Guest User

Untitled

a guest
Dec 7th, 2018
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.24 KB | None | 0 0
  1. def tfidf_fit(docs):
  2.  
  3. docs = [text_prepare(text) for text in docs]
  4. tfidf_vectorizer = TfidfVectorizer()
  5. tfidf_fit = tfidf_vectorizer.fit(docs)
  6. tfidf_matrix = tfidf_fit.transform(docs)
  7.  
  8. return tfidf_fit, tfidf_matrix
Add Comment
Please, Sign In to add comment