Created
September 30, 2018 23:55
-
-
Save emmagrimaldi/2c33e6faee9edab0da6fdc5505cc3559 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # instantiating and generating the count matrix | |
| count = CountVectorizer() | |
| count_matrix = count.fit_transform(df['bag_of_words']) | |
| # generating the cosine similarity matrix | |
| cosine_sim = cosine_similarity(count_matrix, count_matrix) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
how did you created the bag of word model ! do we need to create a bag of word for data and add it as a new column