Skip to content

Instantly share code, notes, and snippets.

@cydal
Last active March 18, 2021 10:21
Show Gist options
  • Save cydal/bd3cf0b3f23457ad969fe0ba7c1fb32f to your computer and use it in GitHub Desktop.
Save cydal/bd3cf0b3f23457ad969fe0ba7c1fb32f to your computer and use it in GitHub Desktop.
import pandas as pd
import numpy as np
from sklearn.feature_extraction.text import TfidfVectorizer
tfidf_vectorizer = TfidfVectorizer(max_features=10000, ngram_range=(1,2))
x_transformed = tfidf_vectorizer.fit_transform(core_df["cleaned_text"])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment