Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def tfidf_fit(docs):
- docs = [text_prepare(text) for text in docs]
- tfidf_vectorizer = TfidfVectorizer()
- tfidf_fit = tfidf_vectorizer.fit(docs)
- tfidf_matrix = tfidf_fit.transform(docs)
- return tfidf_fit, tfidf_matrix
Add Comment
Please, Sign In to add comment