Commit c0d7e03f authored by vpodpecan's avatar vpodpecan
Browse files

new MUSE widgets and updates

parent 6b6bbd17
......@@ -23,6 +23,69 @@
"name": "3D virtual environment"
}
},
{
"pk": 421,
"model": "workflows.abstractwidget",
"fields": {
"category": 36,
"treeview_image": "",
"windows_queue": false,
"name": "Tuk the Hunter 3D demonstrator",
"is_streaming": false,
"uid": "ec3279bc-9a20-4e06-84c0-ae0cd1c79a56",
"interaction_view": "",
"image": "",
"package": "MUSE",
"static_image": "",
"post_interact_action": "",
"user": null,
"visualization_view": "MUSE_virtual_environment_demonstrator_tuk",
"streaming_visualization_view": "",
"action": "MUSE_virtual_environment_demonstrator_tuk",
"wsdl_method": "",
"wsdl": "",
"interactive": false,
"has_progress_bar": false,
"order": 1,
"description": "3D demonstrator for the Tuk the Hunter children story"
}
},
{
"pk": 1060,
"model": "workflows.abstractinput",
"fields": {
"widget": 421,
"name": "mapping file URL",
"short_name": "lnk",
"uid": "6f99be99-50d7-4f2b-a1f0-2ab2aa8c69b9",
"default": "",
"required": true,
"multi": false,
"parameter_type": null,
"variable": "mappingLink",
"parameter": false,
"order": 1,
"description": "A link to the XML file contating mapping to knowledge representation"
}
},
{
"pk": 1061,
"model": "workflows.abstractinput",
"fields": {
"widget": 421,
"name": "Unity3D app link",
"short_name": "lnk",
"uid": "adfdaa7d-4e2e-4d98-aaa0-a33df67c381e",
"default": "https://ive.scm.tees.ac.uk/muse/tuk-text/Tuk-Text-Workflow-Web.html",
"required": true,
"multi": false,
"parameter_type": "text",
"variable": "unityLink",
"parameter": true,
"order": 2,
"description": "A link to the Tuk Unity3D web app"
}
},
{
"pk": 166,
"model": "workflows.abstractwidget",
......@@ -156,6 +219,46 @@
"description": "XML document with all annotations"
}
},
{
"pk": 422,
"model": "workflows.abstractwidget",
"fields": {
"category": 37,
"treeview_image": "",
"windows_queue": false,
"name": "Mapping to KR golden standard",
"is_streaming": false,
"uid": "32cab8ef-ef16-41bd-b14e-fff54ad1e411",
"interaction_view": "",
"image": "",
"package": "MUSE",
"static_image": "",
"post_interact_action": "",
"user": null,
"visualization_view": "",
"streaming_visualization_view": "",
"action": "MUSE_mapping_to_KR_golden_standard",
"wsdl_method": "",
"wsdl": "",
"interactive": false,
"has_progress_bar": false,
"order": 1,
"description": "A link to the golden standard XML file for mapping to KR"
}
},
{
"pk": 454,
"model": "workflows.abstractoutput",
"fields": {
"widget": 422,
"name": "Link",
"short_name": "lnk",
"variable": "goldenLink",
"uid": "f130683f-435e-4199-be4d-c420acb29886",
"order": 1,
"description": "Link to the golden standard for mapping to KR"
}
},
{
"pk": 168,
"model": "workflows.abstractwidget",
......
from django.shortcuts import render
def MUSE_filter_integers(request,input_dict,output_dict,widget):
return render(request, 'interactions/MUSE_filter_integers.html',{'widget':widget,'intList':input_dict['intList']})
def MUSE_filter_integers(request, input_dict, output_dict, widget):
return render(request, 'interactions/MUSE_filter_integers.html',
{'widget': widget, 'intList': input_dict['intList']})
def MUSE_string_to_file(request, input_dict, output_dict, widget):
......@@ -14,5 +15,5 @@ def MUSE_string_to_file(request, input_dict, output_dict, widget):
ensure_dir(destination)
with open(destination, 'w') as f:
f.write(str(input_dict['data']))
return render(request, 'visualizations/MUSE_string_to_file.html', {'widget':widget,'fileURL': basename})
return render(request, 'visualizations/MUSE_string_to_file.html', {'widget': widget, 'fileURL': basename})
......@@ -66,6 +66,10 @@ def MUSE_mapping_to_KR_precomputed_latest(input_dict):
return {'mapping': mapping, 'xml': xml}
def MUSE_mapping_to_KR_golden_standard(input_dict):
return {'goldenLink': 'https://ive.scm.tees.ac.uk/muse/tuk-text/gold_standard.xml'}
def MUSE_semantic_role_labeling(input_dict):
url = input_dict['url']
data = input_dict['xml']
......@@ -88,18 +92,28 @@ def MUSE_semantic_role_labeling_tuk(input_dict):
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}
def MUSE_string_to_file(input_dict):
return {}
def MUSE_string_to_file_finished(postdata, input_dict, output_dict):
fileURL = postdata.get('fileURL')[0]
from socket import getfqdn
import sys
DEVSERVER = (sys.argv[1].startswith('runserver'))
fqdn = '127.0.0.1:8000' if DEVSERVER else getfqdn()
fileURL = fqdn + postdata.get('fileURL')[0]
return {'fileURL': fileURL}
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}
def MUSE_virtual_environment_demonstrator_tuk(input_dict):
return {'mappingLink': str(input_dict['mappingLink']), 'unityLink': input_dict['unityLink']}
<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
......@@ -46,3 +46,15 @@ def MUSE_virtual_environment_visualization(request, input_dict, output_dict, wid
'unitylink': input_dict['unitylink']
})
def MUSE_virtual_environment_demonstrator_tuk(request, input_dict, output_dict, widget):
from urllib import urlencode
params = urlencode({'filename': str(input_dict['mappingLink'])})
unityLink = '%s?%s' % (str(input_dict['unityLink']), params)
# print unityLink
return render(request,
'visualizations/MUSE_Tuk_demonstrator.html',
{'widget': widget,
'unityLink': str(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