Skip to content

Instantly share code, notes, and snippets.

@andrea-dagostino
Created November 22, 2021 14:29
Show Gist options
  • Save andrea-dagostino/b7e9674398648e27e404f190b6d97094 to your computer and use it in GitHub Desktop.
Save andrea-dagostino/b7e9674398648e27e404f190b6d97094 to your computer and use it in GitHub Desktop.
posts/raggruppamento-testuale-con-tf-idf
# 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