Skip to content
Snippets Groups Projects
Commit 15cca73b authored by Bartłomiej Bojanowski's avatar Bartłomiej Bojanowski
Browse files

Add en, ru, uk language.

parent 1a1bbf58
Branches
Tags
1 merge request!1Add en, ru, uk language.
Pipeline #2999 passed with stage
in 29 seconds
......@@ -14,14 +14,17 @@ class Speller2Worker(nlp_ws.NLPWorker):
def static_init(cls, config):
"""One time static initialisation."""
_log.log(logging.INFO, "Worker started loading static models ")
cls._model = Speller('pl')
cls._model = {'pl': Speller('pl'),
'ru': Speller('ru'),
'en': Speller('en'),
'uk': Speller('uk')}
_log.log(logging.INFO, "Worker finished loading static models ")
def process(self, input_file, task_options, output_file):
"""Starting nlp process."""
_log.info("Processing")
model = self._model
language = task_options.get('lang', 'pl')
model = self._model.get(language)
data = self._read_file(input_file)
......
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