Commit 9418e822 authored by vpodpecan's avatar vpodpecan

new MUSE widgets + fix for Display string (no auto wrapping)

parent bb86f0c3
......@@ -34,3 +34,49 @@ def MUSE_coreference(input_dict):
corefs = result.response_dict['result']
return {'coreferences': corefs}
#end
def MUSE_SRL(input_dict):
url = input_dict['url']
tokens = input_dict['tokens']
import socket
socket.setdefaulttimeout(None)
cli = JSONWSPClient(url)
result = cli.SRL(tokens=tokens)
srl = result.response_dict['result']
return {'srl': srl}
#end
def MUSE_directspeech(input_dict):
url = input_dict['url']
srl = input_dict['srl']
coref = input_dict['coref']
entities = input_dict['entities']
import socket
socket.setdefaulttimeout(None)
cli = JSONWSPClient(url)
result = cli.direct_speech(srl=srl, coref=coref, entities=entities)
dspeech = result.response_dict['result']
return {'directspeech': dspeech}
#end
[
{
"model": "workflows.abstractwidget",
"fields": {
"category": "c0ecc61e-3fe1-4681-8ed7-8d45e796d9d0",
"treeview_image": "",
"uid": "4f54f09a-e9c7-4849-9316-87d10b3e1c5e",
"windows_queue": false,
"package": "MUSE_v3",
"interaction_view": "",
"has_progress_bar": false,
"image": "",
"description": "This function performs semantic role labelling on tokenised text.",
"static_image": "",
"action": "MUSE_SRL",
"visualization_view": "",
"streaming_visualization_view": "",
"post_interact_action": "",
"wsdl_method": "",
"wsdl": "",
"interactive": false,
"is_streaming": false,
"order": 1,
"name": "Semantic role labelling"
}
},
{
"model": "workflows.abstractinput",
"fields": {
"widget": "4f54f09a-e9c7-4849-9316-87d10b3e1c5e",
"name": "Service url",
"short_name": "url",
"default": "http://grom.ijs.si:8001/MUSE_services_V3/jsonwsp/description",
"description": "URL of the MUSE service",
"required": true,
"multi": false,
"parameter_type": "text",
"variable": "url",
"parameter": true,
"order": 1,
"uid": "4acb5124-4e76-49ad-b5cd-e86aea55cf70"
}
},
{
"model": "workflows.abstractinput",
"fields": {
"widget": "4f54f09a-e9c7-4849-9316-87d10b3e1c5e",
"name": "Tokens",
"short_name": "tok",
"default": "",
"description": "Tokenised text",
"required": true,
"multi": false,
"parameter_type": null,
"variable": "tokens",
"parameter": false,
"order": 1,
"uid": "f5d71cb7-1965-44c7-91d5-4cfd6cd27af7"
}
},
{
"model": "workflows.abstractoutput",
"fields": {
"widget": "4f54f09a-e9c7-4849-9316-87d10b3e1c5e",
"name": "Semantic role labels",
"short_name": "srl",
"description": "Tokenised sentences with semantic roles and other information",
"variable": "srl",
"order": 1,
"uid": "fad56b23-dd4b-41f7-91e3-460f9cee5883"
}
}
]
\ No newline at end of file
[
{
"model": "workflows.abstractwidget",
"fields": {
"category": "c0ecc61e-3fe1-4681-8ed7-8d45e796d9d0",
"treeview_image": "",
"uid": "65b7fbf9-3459-433c-bb41-635c08e2a19e",
"windows_queue": false,
"package": "MUSE_v3",
"interaction_view": "",
"has_progress_bar": false,
"image": "",
"description": "Detection of direct speech.",
"static_image": "",
"action": "MUSE_directspeech",
"visualization_view": "",
"streaming_visualization_view": "",
"post_interact_action": "",
"wsdl_method": "",
"wsdl": "",
"interactive": false,
"is_streaming": false,
"order": 1,
"name": "Direct speech"
}
},
{
"model": "workflows.abstractinput",
"fields": {
"widget": "65b7fbf9-3459-433c-bb41-635c08e2a19e",
"name": "Entities",
"short_name": "ent",
"default": "",
"description": "Entities for direct speech detection",
"required": true,
"multi": false,
"parameter_type": null,
"variable": "entities",
"parameter": false,
"order": 3,
"uid": "521e857d-d0aa-4a82-8f72-07b713f65ab4"
}
},
{
"model": "workflows.abstractinput",
"fields": {
"widget": "65b7fbf9-3459-433c-bb41-635c08e2a19e",
"name": "Coreferences",
"short_name": "cor",
"default": "",
"description": "Coreferences as produced by the coreference function",
"required": true,
"multi": false,
"parameter_type": null,
"variable": "coref",
"parameter": false,
"order": 2,
"uid": "84adf867-26cd-4e74-884e-1c7f351c7238"
}
},
{
"model": "workflows.abstractinput",
"fields": {
"widget": "65b7fbf9-3459-433c-bb41-635c08e2a19e",
"name": "Service url",
"short_name": "url",
"default": "http://grom.ijs.si:8001/MUSE_services_V3/jsonwsp/description",
"description": "URL of the MUSE service",
"required": true,
"multi": false,
"parameter_type": "text",
"variable": "url",
"parameter": true,
"order": 4,
"uid": "916b1832-7e59-4988-9bcc-3e64c6af4978"
}
},
{
"model": "workflows.abstractinput",
"fields": {
"widget": "65b7fbf9-3459-433c-bb41-635c08e2a19e",
"name": "Semantic role labels",
"short_name": "srl",
"default": "",
"description": "Tokenised sentences with semantic roles",
"required": true,
"multi": false,
"parameter_type": null,
"variable": "srl",
"parameter": false,
"order": 1,
"uid": "d7e6c005-383a-4df6-82c7-6b4bbe8ae37e"
}
},
{
"model": "workflows.abstractoutput",
"fields": {
"widget": "65b7fbf9-3459-433c-bb41-635c08e2a19e",
"name": "Direct speech",
"short_name": "dsp",
"description": "Detected direct speech",
"variable": "directspeech",
"order": 1,
"uid": "0eb0be93-773c-438a-9a1b-b099d04b9d6f"
}
}
]
\ No newline at end of file
<div id="widgetvisualization-{{widget.pk}}" rel="{{widget.pk}}" class="widgetvisualizationdialog" title="{{widget.name}} visualization">
<div style="width:400px;white-space:pre-wrap;font-family:monospace;">
<pre style="width:400px !important;white-space:pre-wrap">
<pre style="width:400px !important;white-space:pre">
{{input_dict.string}}
</pre>
</div>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment