minor refactor

This commit is contained in:
Gokul Mohanarangan
2023-07-10 22:40:58 +05:30
parent acf0d9e9e2
commit 73c4270764
6 changed files with 29 additions and 14 deletions

View File

@@ -19,6 +19,9 @@ def preprocess_sentence(sentence):
return ' '.join(tokens)
def compute_similarity(sent1, sent2):
"""
Compute the similarity
"""
tfidf_vectorizer = TfidfVectorizer()
if sent1 is not None and sent2 is not None:
tfidf_matrix = tfidf_vectorizer.fit_transform([sent1, sent2])