From cb065571d66cb2d937ac4dedb26178c8b47b6df0 Mon Sep 17 00:00:00 2001 From: computermacgyver Date: Wed, 25 Sep 2024 18:45:19 +0100 Subject: [PATCH] Remove commented lines, fix typo --- app/main/lib/elasticsearch.py | 2 -- app/main/lib/langid.py | 2 +- app/main/lib/text_similarity.py | 2 -- 3 files changed, 1 insertion(+), 5 deletions(-) diff --git a/app/main/lib/elasticsearch.py b/app/main/lib/elasticsearch.py index 5e5ad7c2..ac4818fd 100644 --- a/app/main/lib/elasticsearch.py +++ b/app/main/lib/elasticsearch.py @@ -8,8 +8,6 @@ from app.main.lib.language_analyzers import SUPPORTED_LANGUAGES from app.main.lib.error_log import ErrorLog -#from app.main.lib.langid import Cld3LangidProvider as LangidProvider -#from app.main.lib.langid import GoogleLangidProvider as LangidProvider from app.main.lib.langid import FastTextLangidProvider as LangidProvider def get_all_documents_matching_context(context): diff --git a/app/main/lib/langid.py b/app/main/lib/langid.py index e164fa89..12f3d385 100644 --- a/app/main/lib/langid.py +++ b/app/main/lib/langid.py @@ -83,7 +83,7 @@ class FastTextLangidProvider: @staticmethod def langid(text): prediction = FastTextLangidProvider.fasttext_model.predict(text) - # prediction is a list of tupples, e.g., (('__label__en',), array([0.22517213])) + # prediction is a list of tuples, e.g., (('__label__en',), array([0.22517213])) return { 'result': { 'language': prediction[0][0].split("__")[-1], diff --git a/app/main/lib/text_similarity.py b/app/main/lib/text_similarity.py index d5dd6d6e..bb34f6fa 100644 --- a/app/main/lib/text_similarity.py +++ b/app/main/lib/text_similarity.py @@ -6,8 +6,6 @@ from app.main.lib import elastic_crud from app.main.lib.shared_models.shared_model import SharedModel from app.main.lib.language_analyzers import SUPPORTED_LANGUAGES -#from app.main.lib.langid import Cld3LangidProvider as LangidProvider -#from app.main.lib.langid import GoogleLangidProvider as LangidProvider from app.main.lib.langid import FastTextLangidProvider as LangidProvider from app.main.lib.openai import retrieve_openai_embeddings, PREFIX_OPENAI ELASTICSEARCH_DEFAULT_LIMIT = 10000