Skip to content

Instantly share code, notes, and snippets.


amankharwal/ Secret

Created Nov 18, 2020
What would you like to do?
df_percent.set_index('name', inplace=True)
indices = pd.Series(df_percent.index)
# Creating tf-idf matrix
tfidf = TfidfVectorizer(analyzer='word', ngram_range=(1, 2), min_df=0, stop_words='english')
tfidf_matrix = tfidf.fit_transform(df_percent['reviews_list'])
cosine_similarities = linear_kernel(tfidf_matrix, tfidf_matrix)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment