fix youtibe download bug

This commit is contained in:
Gokul Mohanarangan
2023-07-07 14:28:43 +05:30
parent 42329211c7
commit 4636dc030b
5 changed files with 32 additions and 17 deletions

View File

@@ -20,7 +20,6 @@ def preprocess_sentence(sentence):
def compute_similarity(sent1, sent2):
tfidf_vectorizer = TfidfVectorizer()
print("semt1", sent1, sent2)
if sent1 is not None and sent2 is not None:
tfidf_matrix = tfidf_vectorizer.fit_transform([sent1, sent2])
return cosine_similarity(tfidf_matrix[0], tfidf_matrix[1])[0][0]