Skip to content

Commit

Permalink
update check_similarity for using recognized_conclusions
Browse files Browse the repository at this point in the history
  • Loading branch information
HadronCollider committed Apr 29, 2024
1 parent 4fa7e9e commit e76bd05
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/nlp/similarity_of_texts.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit e76bd05

Please sign in to comment.