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

added the widget for "definition extraction by terms"

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