add ngrams
Browse files
app.py
CHANGED
@@ -120,7 +120,7 @@ def get_recommendations_TFIDF(abstract):
|
|
120 |
corpus = pd.concat([train_corpus, pd.Series(abstract)], ignore_index=True)
|
121 |
|
122 |
# Initialize an instance of tf-idf Vectorizer
|
123 |
-
tfidf_vectorizer = TfidfVectorizer()
|
124 |
# Generate the tf-idf vectors for the corpus
|
125 |
tfidf_matrix = tfidf_vectorizer.fit_transform(corpus)
|
126 |
|
|
|
120 |
corpus = pd.concat([train_corpus, pd.Series(abstract)], ignore_index=True)
|
121 |
|
122 |
# Initialize an instance of tf-idf Vectorizer
|
123 |
+
tfidf_vectorizer = TfidfVectorizer(ngram_range=(1, 2))
|
124 |
# Generate the tf-idf vectors for the corpus
|
125 |
tfidf_matrix = tfidf_vectorizer.fit_transform(corpus)
|
126 |
|