Commit a5742ec1 authored by Janez's avatar Janez

Merge branch 'totrtale_multiproc' of /home/git/repositories/kt/mothra

parents 52825a35 8e997e6f
...@@ -9,7 +9,8 @@ import re ...@@ -9,7 +9,8 @@ import re
import itertools import itertools
import subprocess import subprocess
webservices_totrtale_url = "http://vihar.ijs.si:8104" webservices_totrtale_url = "http://172.20.0.154/totrtale"
webservice_def_ex_url = "http://172.20.0.154/definition"
def merge_sentences(input_dict): def merge_sentences(input_dict):
""" """
...@@ -441,7 +442,7 @@ def nlp_term_extraction2(input_dict): ...@@ -441,7 +442,7 @@ def nlp_term_extraction2(input_dict):
''' '''
Term extraction from totrtale annotations. Term extraction from totrtale annotations.
''' '''
ws_url = "http://vihar.ijs.si:8081/call" ws_url = webservice_def_ex_url + "/call"
annotations = input_dict['annotations'] annotations = input_dict['annotations']
lang = input_dict['lang'] lang = input_dict['lang']
stop_list_checkbox = input_dict["stop_list"] == "true" stop_list_checkbox = input_dict["stop_list"] == "true"
...@@ -518,10 +519,14 @@ def nlp_def_extraction_patterns2(input_dict): ...@@ -518,10 +519,14 @@ def nlp_def_extraction_patterns2(input_dict):
lang = input_dict['lang'] lang = input_dict['lang']
pattern = input_dict['pattern'] pattern = input_dict['pattern']
if lang == "sl" and pattern == "begin_allvar":
raise Exception("Pattern begin_allvar is not supported for slovene language.")
if '<TEI xmlns="http://www.tei-c.org/ns/1.0">' in annotations: if '<TEI xmlns="http://www.tei-c.org/ns/1.0">' in annotations:
annotations = TEItoTab(annotations) annotations = TEItoTab(annotations)
ws_url = "http://vihar.ijs.si:8081/patDefSent" ws_url = webservice_def_ex_url + "/patDefSent"
params = {"corpus":annotations, params = {"corpus":annotations,
"pattern":pattern, "pattern":pattern,
"lang":lang} "lang":lang}
...@@ -576,7 +581,7 @@ def nlp_def_extraction_terms2(input_dict): ...@@ -576,7 +581,7 @@ def nlp_def_extraction_terms2(input_dict):
if '<TEI xmlns="http://www.tei-c.org/ns/1.0">' in annotations: if '<TEI xmlns="http://www.tei-c.org/ns/1.0">' in annotations:
annotations = TEItoTab(annotations) annotations = TEItoTab(annotations)
ws_url = "http://vihar.ijs.si:8081/termDefSent" ws_url = webservice_def_ex_url + "/termDefSent"
params = {"corpus":annotations, params = {"corpus":annotations,
"candidates":term_candidates, "candidates":term_candidates,
"lang":lang, "lang":lang,
...@@ -618,7 +623,7 @@ def nlp_def_extraction_wnet2(input_dict): ...@@ -618,7 +623,7 @@ def nlp_def_extraction_wnet2(input_dict):
if '<TEI xmlns="http://www.tei-c.org/ns/1.0">' in annotations: if '<TEI xmlns="http://www.tei-c.org/ns/1.0">' in annotations:
annotations = TEItoTab(annotations) annotations = TEItoTab(annotations)
ws_url = "http://vihar.ijs.si:8081/wnetDefSent" ws_url = webservice_def_ex_url + "/wnetDefSent"
params = {"corpus":annotations, params = {"corpus":annotations,
"lang":lang} "lang":lang}
response = post(ws_url, params=params) response = post(ws_url, params=params)
......
...@@ -147,7 +147,7 @@ ...@@ -147,7 +147,7 @@
"model": "workflows.abstractinput", "model": "workflows.abstractinput",
"fields": { "fields": {
"widget": "09d72ebd-2eaf-47f6-95e0-2f2ed0c51ea2", "widget": "09d72ebd-2eaf-47f6-95e0-2f2ed0c51ea2",
"name": "Nominatives", "name": "Nominatives (only for Slovene)",
"short_name": "nom", "short_name": "nom",
"default": "0", "default": "0",
"description": "", "description": "",
......
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
"model": "workflows.abstractinput", "model": "workflows.abstractinput",
"fields": { "fields": {
"widget": "f3e3b0c7-39e1-4e7e-ba94-514d13864823", "widget": "f3e3b0c7-39e1-4e7e-ba94-514d13864823",
"name": "Pre-defined patterns", "name": "Predefined patterns",
"short_name": "pat", "short_name": "pat",
"default": "begin_novar", "default": "begin_novar",
"description": "Pre-defined patterns", "description": "Pre-defined patterns",
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
"parameter_type": "select", "parameter_type": "select",
"variable": "pattern", "variable": "pattern",
"parameter": true, "parameter": true,
"order": 1, "order": 3,
"uid": "687262b9-e21f-4279-8a72-e017b5ed9e72" "uid": "687262b9-e21f-4279-8a72-e017b5ed9e72"
} }
}, },
...@@ -71,7 +71,7 @@ ...@@ -71,7 +71,7 @@
"parameter_type": "select", "parameter_type": "select",
"variable": "lang", "variable": "lang",
"parameter": true, "parameter": true,
"order": 1, "order": 2,
"uid": "dcfab65d-8fe9-4b8f-b2c5-fe3a93274453" "uid": "dcfab65d-8fe9-4b8f-b2c5-fe3a93274453"
} }
}, },
...@@ -108,7 +108,7 @@ ...@@ -108,7 +108,7 @@
{ {
"model": "workflows.abstractoption", "model": "workflows.abstractoption",
"fields": { "fields": {
"name": "Begin allvar", "name": "Begin allvar (only for English)",
"uid": "5c6c3598-8a05-4918-9c38-992202d16fc9", "uid": "5c6c3598-8a05-4918-9c38-992202d16fc9",
"value": "begin_allvar", "value": "begin_allvar",
"abstract_input": "687262b9-e21f-4279-8a72-e017b5ed9e72" "abstract_input": "687262b9-e21f-4279-8a72-e017b5ed9e72"
......
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