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
No related branches found
No related tags found
1 merge request!1Add en, ru, uk language.
Pipeline #2999 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