scipy - How to sort python csr_matix by data -
i want keywords of text tfidf method sklenrn
i have got tfidf module, see code below:
from sklearn.feature_extraction import text tfidf_vect = text.tfidfvectorizer() texts = get_text_list() tfidf = tfidf_vect.fit_transform(texts) now , inputting new documents text
res = tfidf_vect.transform(text) the res csr_matrix. res.indices positions of words , res.data tfidf value.
how sort res res.data
reference:http://www.cs.duke.edu/courses/spring14/compsci290/assignments/lab02.html
Comments
Post a Comment