Commit 9b1d78aa authored by Anze Vavpetic's avatar Anze Vavpetic

added the widget for "definition extraction by terms"

parent 525c0a6b
......@@ -38,39 +38,39 @@
}
},
{
"pk": 1,
"pk": 413,
"model": "workflows.abstractinput",
"fields": {
"widget": 1,
"name": "File",
"short_name": "fil",
"uid": "096159a3-ddc8-4a57-b769-dddfb2590065",
"default": "",
"name": "Web service address",
"short_name": "ws",
"uid": "907565a7-4336-48c3-8989-9024aae0d7b1",
"default": "http://vihar.ijs.si:8095/totale?wsdl",
"required": true,
"multi": false,
"parameter_type": "file",
"variable": "file",
"parameter_type": "text",
"variable": "wsdl",
"parameter": true,
"order": 1,
"description": "File"
"description": "Web service address"
}
},
{
"pk": 413,
"pk": 1,
"model": "workflows.abstractinput",
"fields": {
"widget": 1,
"name": "Web service address",
"short_name": "ws",
"uid": "907565a7-4336-48c3-8989-9024aae0d7b1",
"default": "http://vihar.ijs.si:8095/totale?wsdl",
"name": "File",
"short_name": "fil",
"uid": "096159a3-ddc8-4a57-b769-dddfb2590065",
"default": "",
"required": true,
"multi": false,
"parameter_type": "text",
"variable": "wsdl",
"parameter_type": "file",
"variable": "file",
"parameter": true,
"order": 1,
"description": "Web service address"
"order": 2,
"description": "File"
}
},
{
......
......@@ -88,7 +88,7 @@ def nlp_def_extraction_patterns(input_dict):
'''
annotations = input_dict['annotations']
lang = input_dict['lang']
wsdl = input_dict.get('wsdl', 'http://vihar.ijs.si:8095/totale?wsdl')
wsdl = input_dict.get('wsdl', 'http://vihar.ijs.si:8094')
ws = WebService(wsdl, 60000)
pattern = input_dict['pattern']
response = ws.client.GlossaryExtractionByWnet(corpus=annotations,
......@@ -100,7 +100,24 @@ def nlp_def_extraction_terms(input_dict):
'''
Definition extraction using terms.
'''
pass
annotations = input_dict['annotations']
term_candidates = input_dict['term_candidates']
lang = input_dict['lang']
wsdl = input_dict.get('wsdl', 'http://vihar.ijs.si:8094')
terms_per_sentence = input_dict['terms_per_sentence']
nominatives = input_dict['nominatives']
threshold = input_dict['threshold']
verb_two_terms = input_dict['verb_two_terms']
multiword_term = input_dict['multiword_term']
num_multiterms = input_dict['num_multiterms']
term_beginning = input_dict['term_beginning']
ws = WebService(wsdl, 60000)
response = ws.client.GlossaryExtractionByTerms(corpus=annotations,
candidates=term_candidates, lang=lang, nominatives=nominatives,
termsPerSent=terms_per_sentence, select=threshold,
verb_two_terms=verb_two_terms, multiword_term=multiword_term,
num_multiterms=num_multiterms, term_beginning=term_beginning)
return {'sentences': response['candidates']}
def nlp_def_extraction_wnet(input_dict):
......@@ -109,7 +126,7 @@ def nlp_def_extraction_wnet(input_dict):
'''
annotations = input_dict['annotations']
lang = input_dict['lang']
wsdl = input_dict.get('wsdl', 'http://vihar.ijs.si:8095/totale?wsdl')
wsdl = input_dict.get('wsdl', 'http://vihar.ijs.si:8094')
ws = WebService(wsdl, 60000)
response = ws.client.GlossaryExtractionByWnet(corpus=annotations, lang=lang)
return {'sentences': response['candidates']}
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