title: How to get top n terms with highest tf-idf score - Big sparse matrix
body: <p>There is this code:</p>
  
  <pre><code>feature_array = np.array(tfidf.get_feature_names())
  tfidf_sorting = np.argsort(response.toarray()).flatten()[::-1]
  
  n = 3
  top_n = feature_array[tfidf_sorting][:n]
  </code></pre>
  
  <p>coming from <a href="https://stackoverflow.com/a/34236002/9024698">this</a> answer.</p>
  
  <p>My question is how can I efficiently do this in the case where my sparse matrix is too big to convert at once to a dense matrix (with <code>response.toarray()</code>)?</p>
  
  <p>Apparently, the general answer is by splitting the sparse matrix in chunks, doing the conversion of each chunk in a for loop and then combining the results across all chunks.</p>
  
  <p>But I would like to see specifically the code which does this in total.</p>