Skip to content
Snippets Groups Projects
Commit 1b870251 authored by Mateusz Gniewkowski's avatar Mateusz Gniewkowski
Browse files

Merge branch 'developer' into 'master'

Add en, ru, uk language.

See merge request !1
parents 1a1bbf58 15cca73b
No related branches found
No related tags found
1 merge request!1Add en, ru, uk language.
Pipeline #3005 passed
...@@ -14,14 +14,17 @@ class Speller2Worker(nlp_ws.NLPWorker): ...@@ -14,14 +14,17 @@ class Speller2Worker(nlp_ws.NLPWorker):
def static_init(cls, config): def static_init(cls, config):
"""One time static initialisation.""" """One time static initialisation."""
_log.log(logging.INFO, "Worker started loading static models ") _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 ") _log.log(logging.INFO, "Worker finished loading static models ")
def process(self, input_file, task_options, output_file): def process(self, input_file, task_options, output_file):
"""Starting nlp process.""" """Starting nlp process."""
_log.info("Processing") _log.info("Processing")
language = task_options.get('lang', 'pl')
model = self._model model = self._model.get(language)
data = self._read_file(input_file) data = self._read_file(input_file)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment