Skip to content

Instantly share code, notes, and snippets.

@jerryan999
Last active March 17, 2020 03:31
Show Gist options
  • Save jerryan999/31199bc4fa6309eac031599ddce4fe5d to your computer and use it in GitHub Desktop.
Save jerryan999/31199bc4fa6309eac031599ddce4fe5d to your computer and use it in GitHub Desktop.
from sklearn.feature_extraction.text import TfidfVectorizer
documents = [
"The quick brown fox jumped over the lazy dog's back",
"Now is the time for all good men to come to the aid of their party"
]
vectorizer = TfidfVectorizer(stop_words=["for","is","of","the","to"])
X = vectorizer.fit_transform(documents)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment