Skip to content

Instantly share code, notes, and snippets.

@alabrashJr
Created June 8, 2020 14:16
Show Gist options
  • Save alabrashJr/bfff2d59650e78a70758d09449321330 to your computer and use it in GitHub Desktop.
Save alabrashJr/bfff2d59650e78a70758d09449321330 to your computer and use it in GitHub Desktop.
from sklearn.feature_extraction.text import TfidfVectorizer
vectorizer = TfidfVectorizer(strip_accents='unicode', analyzer='word', ngram_range=(1,3), norm='l2', max_features = 10000)
vectorizer.fit(train_text)
vectorizer.fit(test_text)
X_train = vectorizer.transform(train_text)
x_test = vectorizer.transform(test_text)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment