Newer
Older
"""Implementation of punctuator service"""
import configparser
import nlp_ws
from src.winer_worker import WinerWorker
class Worker(nlp_ws.NLPWorker):
def init(self):
config = configparser.ConfigParser()
config.read("config.ini")
config = config["deployment"]
models_cache_dir = config.get("models_cache_dir", "/home/worker/models")
self.winer = WinerWorker(models_cache_dir)
def process(self, input_path: str, task_options: dict, output_path: str) -> None:
self.winer.process(input_path, task_options, output_path)
if __name__ == "__main__":
nlp_ws.NLPService.main(Worker)