diff --git a/workflows/MUSE_v3/library.py b/workflows/MUSE_v3/library.py index 41b1aed05fbb71aa9b8ebd29a15426e48c8be6d3..8a7f0ecb7d164ac30037711b4e35b83caea4f169 100644 --- a/workflows/MUSE_v3/library.py +++ b/workflows/MUSE_v3/library.py @@ -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 + + + + + + + + + + + + + + + + diff --git a/workflows/MUSE_v3/package_data/widgets/4f54f09a-e9c7-4849-9316-87d10b3e1c5e.json b/workflows/MUSE_v3/package_data/widgets/4f54f09a-e9c7-4849-9316-87d10b3e1c5e.json new file mode 100644 index 0000000000000000000000000000000000000000..c9cd6d53852085208a10210544cadea18557752d --- /dev/null +++ b/workflows/MUSE_v3/package_data/widgets/4f54f09a-e9c7-4849-9316-87d10b3e1c5e.json @@ -0,0 +1,73 @@ +[ + { + "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 diff --git a/workflows/MUSE_v3/package_data/widgets/65b7fbf9-3459-433c-bb41-635c08e2a19e.json b/workflows/MUSE_v3/package_data/widgets/65b7fbf9-3459-433c-bb41-635c08e2a19e.json new file mode 100644 index 0000000000000000000000000000000000000000..b922798b183afdf39c27218c097c5314365e94f4 --- /dev/null +++ b/workflows/MUSE_v3/package_data/widgets/65b7fbf9-3459-433c-bb41-635c08e2a19e.json @@ -0,0 +1,107 @@ +[ + { + "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 diff --git a/workflows/templates/visualizations/display_string.html b/workflows/templates/visualizations/display_string.html index 23e7d858399a85756a520ddaa1c0932d92ccedd0..98ec1db5a9593ba6bc593b8332631b5a3b48200d 100755 --- a/workflows/templates/visualizations/display_string.html +++ b/workflows/templates/visualizations/display_string.html @@ -1,6 +1,6 @@