Created
November 22, 2021 14:29
-
-
Save andrea-dagostino/b7e9674398648e27e404f190b6d97094 to your computer and use it in GitHub Desktop.
posts/raggruppamento-testuale-con-tf-idf
This file contains 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
# inizializziamo il vettorizzatore | |
vectorizer = TfidfVectorizer(sublinear_tf=True, min_df=5, max_df=0.95) | |
# fit_transform applica il TF-IDF ai testi puliti - salviamo la matrice di vettori in X | |
X = vectorizer.fit_transform(df['cleaned']) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment