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 -

jsf - How to ajax update an item in the footer of a PrimeFaces dataTable? -

django - CSRF verification failed. Request aborted. CSRF cookie not set -