From 67ed8b4e520df4c0eb9ccef46c1b8c7feb313a32 Mon Sep 17 00:00:00 2001 From: TharinduDR Date: Fri, 16 Apr 2021 09:43:52 +0100 Subject: [PATCH] 003: Adding spacey lib --- mudes/app/mudes_app.py | 11 ----------- setup.py | 2 +- 2 files changed, 1 insertion(+), 12 deletions(-) diff --git a/mudes/app/mudes_app.py b/mudes/app/mudes_app.py index 5eb2f0d..7615393 100644 --- a/mudes/app/mudes_app.py +++ b/mudes/app/mudes_app.py @@ -1,12 +1,7 @@ -import os - from spacy.lang.en import English from spacy.lang.xx import MultiLanguage from mudes.algo.mudes_model import MUDESModel -import logging -from google_drive_downloader import GoogleDriveDownloader as gdd - from mudes.algo.predict import predict_spans from mudes.algo.preprocess import contiguous_ranges @@ -42,12 +37,6 @@ def __init__(self, model_name_or_path, model_type=None, use_cuda=True, cuda_de self.model = MUDESModel(model_type, self.model_name_or_path, labels=["NOT_TOXIC", "TOXIC"], use_cuda=self.use_cuda, cuda_device=self.cuda_device) - @staticmethod - def _download(drive_id, model_name): - gdd.download_file_from_google_drive(file_id=drive_id, - dest_path= os.path.join(".mudes", model_name, "model.zip"), - unzip=True) - def predict_toxic_spans(self, text: str, spans: bool = False, language: str = "en"): toxic_spans = predict_spans(self.model, text, language) if spans: diff --git a/setup.py b/setup.py index 956c3b5..feb59ee 100755 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ setup( name="mudes", - version="0.2.1", + version="0.2.2", author="Tharindu Ranasinghe", author_email="rhtdranasinghe@gmail.com", description="Toxic Spans Prediction",