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

Popular posts from this blog

javascript - RequestAnimationFrame not working when exiting fullscreen switching space on Safari -

c# - How do I get the Nth largest element from a list with duplicates, using LINQ? -

jsp - "Sending a redirect is forbidden after the response has been committed" in sendRedirect -