Commit 543f5ef8 authored by vpodpecan's avatar vpodpecan
Browse files

updated and new MUSE components

parent 92883dfa
......@@ -11,6 +11,81 @@
"name": "MUSE"
}
},
{
"pk": 48,
"model": "workflows.category",
"fields": {
"uid": "e8574599-994c-4cff-a94d-453d6c5e2dfd",
"parent": 45,
"workflow": null,
"user": null,
"order": 1,
"name": "3D virtual environment"
}
},
{
"pk": 261,
"model": "workflows.abstractwidget",
"fields": {
"category": 48,
"treeview_image": "",
"windows_queue": false,
"name": "Virtual environment visualization",
"is_streaming": false,
"uid": "05317f75-cc6b-4257-bc71-21f080776bfc",
"interaction_view": "",
"image": "",
"package": "MUSE",
"static_image": "",
"post_interact_action": "",
"user": null,
"visualization_view": "MUSE_virtual_environment_visualization",
"streaming_visualization_view": "",
"action": "MUSE_virtual_environment_visualization",
"wsdl_method": "",
"wsdl": "",
"interactive": false,
"has_progress_bar": false,
"order": 1,
"description": ""
}
},
{
"pk": 556,
"model": "workflows.abstractinput",
"fields": {
"widget": 261,
"name": "NLP data",
"short_name": "nlp",
"uid": "6e5ebc4b-cdbe-4ca6-8f5d-bcde21f5319a",
"default": "",
"required": false,
"multi": false,
"parameter_type": null,
"variable": "NLP_data",
"parameter": false,
"order": 1,
"description": "Results of NLP processing"
}
},
{
"pk": 557,
"model": "workflows.abstractinput",
"fields": {
"widget": 261,
"name": "Server link",
"short_name": "url",
"uid": "585e80d1-e5fb-49c9-92a7-7af16d4070f6",
"default": "",
"required": true,
"multi": false,
"parameter_type": null,
"variable": "unitylink",
"parameter": false,
"order": 2,
"description": "Link to the Unity3D server"
}
},
{
"pk": 46,
"model": "workflows.category",
......@@ -81,6 +156,247 @@
"description": "XML document with all annotations"
}
},
{
"pk": 257,
"model": "workflows.abstractwidget",
"fields": {
"category": 46,
"treeview_image": "",
"windows_queue": false,
"name": "Mapping to Knowledge representation",
"is_streaming": false,
"uid": "57f7621d-0045-45ed-80b7-28700108e610",
"interaction_view": "",
"image": "",
"package": "MUSE",
"static_image": "",
"post_interact_action": "",
"user": null,
"visualization_view": "",
"streaming_visualization_view": "",
"action": "MUSE_mapping_to_KR",
"wsdl_method": "",
"wsdl": "",
"interactive": false,
"has_progress_bar": false,
"order": 1,
"description": "Calls the mapping to knowledge representation service"
}
},
{
"pk": 549,
"model": "workflows.abstractinput",
"fields": {
"widget": 257,
"name": "Input data",
"short_name": "str",
"uid": "3c0b4bbe-9ff2-428c-992e-dd9d93f6d564",
"default": "",
"required": true,
"multi": false,
"parameter_type": null,
"variable": "input_data",
"parameter": false,
"order": 1,
"description": "Plain text file with special annotations"
}
},
{
"pk": 550,
"model": "workflows.abstractinput",
"fields": {
"widget": 257,
"name": "Service url",
"short_name": "url",
"uid": "cbc553ec-1650-459d-bcdd-cf41636b6a56",
"default": "http://vihar.ijs.si:8001/MUSE_services/jsonwsp/description",
"required": true,
"multi": false,
"parameter_type": "text",
"variable": "url",
"parameter": true,
"order": 2,
"description": "URL of the MUSE service"
}
},
{
"pk": 267,
"model": "workflows.abstractoutput",
"fields": {
"widget": 257,
"name": "Instantiated event templates",
"short_name": "tpl",
"variable": "mapping",
"uid": "664a8451-01d5-4570-976d-cc7437221a1d",
"order": 1,
"description": "Instantiated event-templates with argument roles as defined in the domain.\r\n"
}
},
{
"pk": 258,
"model": "workflows.abstractwidget",
"fields": {
"category": 46,
"treeview_image": "",
"windows_queue": false,
"name": "Mapping to Knowledge representation (Tuk, precomputed)",
"is_streaming": false,
"uid": "f4345a84-11ff-4976-aeb0-519e48b385a8",
"interaction_view": "",
"image": "",
"package": "MUSE",
"static_image": "",
"post_interact_action": "",
"user": null,
"visualization_view": "",
"streaming_visualization_view": "",
"action": "MUSE_mapping_to_KR_precomputed",
"wsdl_method": "",
"wsdl": "",
"interactive": false,
"has_progress_bar": false,
"order": 1,
"description": "Returns the precomputed mapping to knowledge representation for Tuk story"
}
},
{
"pk": 551,
"model": "workflows.abstractinput",
"fields": {
"widget": 258,
"name": "Input data",
"short_name": "str",
"uid": "544e5ae0-e3a7-489d-b593-bb811ca148d7",
"default": "",
"required": true,
"multi": false,
"parameter_type": null,
"variable": "input_data",
"parameter": false,
"order": 1,
"description": "Plain text file with special annotations"
}
},
{
"pk": 552,
"model": "workflows.abstractinput",
"fields": {
"widget": 258,
"name": "Service url",
"short_name": "url",
"uid": "63156d94-df63-495e-96dd-17bb7cf78b35",
"default": "http://vihar.ijs.si:8001/MUSE_services/jsonwsp/description",
"required": true,
"multi": false,
"parameter_type": "text",
"variable": "url",
"parameter": true,
"order": 2,
"description": "URL of the MUSE service"
}
},
{
"pk": 268,
"model": "workflows.abstractoutput",
"fields": {
"widget": 258,
"name": "Instantiated event templates",
"short_name": "tpl",
"variable": "mapping",
"uid": "d17bb657-2ff8-48e0-a6ae-f88143d8c6a0",
"order": 1,
"description": "Instantiated event-templates with argument roles as defined in the domain.\r\n"
}
},
{
"pk": 259,
"model": "workflows.abstractwidget",
"fields": {
"category": 46,
"treeview_image": "",
"windows_queue": false,
"name": "Semantic role labeling",
"is_streaming": false,
"uid": "3fa29425-16dc-4c11-a51c-323da6dd30c6",
"interaction_view": "",
"image": "",
"package": "MUSE",
"static_image": "",
"post_interact_action": "",
"user": null,
"visualization_view": "",
"streaming_visualization_view": "",
"action": "MUSE_semantic_role_labeling",
"wsdl_method": "",
"wsdl": "",
"interactive": false,
"has_progress_bar": false,
"order": 1,
"description": "Calls the semantic role labeling service"
}
},
{
"pk": 553,
"model": "workflows.abstractinput",
"fields": {
"widget": 259,
"name": "Input XML",
"short_name": "xml",
"uid": "dab8f94f-b362-41fd-ba71-93c24d740409",
"default": "",
"required": true,
"multi": false,
"parameter_type": null,
"variable": "xml",
"parameter": false,
"order": 1,
"description": "MUSE XML file"
}
},
{
"pk": 554,
"model": "workflows.abstractinput",
"fields": {
"widget": 259,
"name": "Service url",
"short_name": "url",
"uid": "814c5076-50b6-40de-a0d8-1b81aceb4f9f",
"default": "http://vihar.ijs.si:8001/MUSE_services/jsonwsp/description",
"required": true,
"multi": false,
"parameter_type": "text",
"variable": "url",
"parameter": true,
"order": 2,
"description": "URL of the MUSE service"
}
},
{
"pk": 269,
"model": "workflows.abstractoutput",
"fields": {
"widget": 259,
"name": "Output XML",
"short_name": "xml",
"variable": "xml",
"uid": "bfc299c1-d31f-4843-adf7-37066972e91c",
"order": 1,
"description": "XML with semantic roles added"
}
},
{
"pk": 270,
"model": "workflows.abstractoutput",
"fields": {
"widget": 259,
"name": "Input for KR",
"short_name": "str",
"variable": "txt",
"uid": "f390bfa5-36f2-4cf4-92b5-804ac301da4f",
"order": 2,
"description": "Input text file for mapping to knowledge representation"
}
},
{
"pk": 260,
"model": "workflows.abstractwidget",
......
......@@ -50,3 +50,10 @@ def MUSE_semantic_role_labeling(input_dict):
srl, txt = result.response_dict['result']
return {'xml': srl, 'txt': txt}
def MUSE_virtual_environment_visualization(input_dict):
NLP_data = input_dict.get('NLP_data', None)
unitylink = input_dict.get('unitylink', 'https://ive.scm.tees.ac.uk/muse/tukdemo/')
return {'NLP_data' : NLP_data,
'unitylink': unitylink}
\ No newline at end of file
<div id="widgetvisualization-{{widget.pk}}"
rel="{{widget.pk}}"
class="widgetvisualizationdialog"
title="{{widget.name}}"
width=900 height=800>
<iframe src="{{ unitylink }}" width="100%" height="98%" scrolling="no">
<p>Your browser does not support iframes.</p>
</iframe>
</div>
\ No newline at end of file
......@@ -28,3 +28,20 @@ def MUSE_view_xml(request, input_dict, output_dict, widget):
return render(request, 'visualizations/MUSE_view_xml.html',
{'widget': widget, 'filename': filename})
def MUSE_virtual_environment_visualization(request, input_dict, output_dict, widget):
from mothra.settings import MEDIA_ROOT
from workflows.helpers import ensure_dir
filename = os.path.join(str(request.user.id), str(widget.id) + '.txt')
destination = os.path.join(MEDIA_ROOT, filename)
ensure_dir(destination)
f = open(destination, 'w')
f.write(str(input_dict['NLP_data']))
f.close()
return render(request,
'visualizations/MUSE_view_3D_environment.html',
{'widget': widget,
'filename': filename,
'unitylink': input_dict['unitylink']
})
Supports Markdown
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