Commit 525c0a6b authored by Anze Vavpetic's avatar Anze Vavpetic

added server code for def.ex. with wnet and patterns

parent 77ba410a
......@@ -77,20 +77,28 @@ def nlp_term_extraction(input_dict):
lang = input_dict['lang']
wsdl = input_dict.get('wsdl', 'http://vihar.ijs.si:8095/totale?wsdl')
ws = WebService(wsdl, 60000)
response = ws.client.TermExtraction(corpus=annotations, lang=lang, threshold=0)
response = ws.client.TermExtraction(corpus=annotations, lang=lang,
threshold=0)
return {'candidates': response['candidates']}
def nlp_def_extraction_terms(input_dict):
def nlp_def_extraction_patterns(input_dict):
'''
Definition extraction using terms.
Definition extraction using pre-defined patterns.
'''
pass
annotations = input_dict['annotations']
lang = input_dict['lang']
wsdl = input_dict.get('wsdl', 'http://vihar.ijs.si:8095/totale?wsdl')
ws = WebService(wsdl, 60000)
pattern = input_dict['pattern']
response = ws.client.GlossaryExtractionByWnet(corpus=annotations,
lang=lang, pattern=pattern)
return {'sentences': response['candidates']}
def nlp_def_extraction_patterns(input_dict):
def nlp_def_extraction_terms(input_dict):
'''
Definition extraction using pre-defined patterns.
Definition extraction using terms.
'''
pass
......@@ -99,4 +107,9 @@ def nlp_def_extraction_wnet(input_dict):
'''
Definition extraction using WordNet.
'''
pass
annotations = input_dict['annotations']
lang = input_dict['lang']
wsdl = input_dict.get('wsdl', 'http://vihar.ijs.si:8095/totale?wsdl')
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