From e76bd0588d13aa39e40c59eb0550ff1e33787cc2 Mon Sep 17 00:00:00 2001 From: Dmitry Ivanov Date: Mon, 29 Apr 2024 17:49:27 +0300 Subject: [PATCH] update check_similarity for using recognized_conclusions --- app/nlp/similarity_of_texts.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/nlp/similarity_of_texts.py b/app/nlp/similarity_of_texts.py index 99d6990a..7621ff5b 100644 --- a/app/nlp/similarity_of_texts.py +++ b/app/nlp/similarity_of_texts.py @@ -10,7 +10,7 @@ def check_similarity(string1, string2): base_conclusions = stemming.get_sentences(string2, False) ignore = re.compile('[0-9]+[.]?|Заключение|‹#›') clear_conclusions = [ch for ch in base_conclusions if not re.fullmatch(ignore, ch)] - recognized_conclusions = [s for s in clear_conclusions if s != further_dev.get('dev_sentence')] + recognized_conclusions = "".join(s for s in clear_conclusions if s != further_dev.get('dev_sentence')) percentage_of_similarity = int(compare_sentences(string1, recognized_conclusions) * 100)