title: python - Picking most relevant words for a tag cloud from text using nltk and scikit-learn
body: <p>I want to get most relevant words from a text in order to prepare a tag cloud.</p>
  
  <p>I used CountVectoriser from scikit-learn package:</p>
  
  <pre><code>cv = CountVectorizer(min_df=1, charset_error="ignore",
      stop_words="english", max_features=200)
  </code></pre>
  
  <p>This is nice, because it gives me words and frequences:</p>
  
  <pre><code>counts = cv.fit_transform([text]).toarray().ravel()
  words = np.array(cv.get_feature_names())
  </code></pre>
  
  <p>I can filter non frequent words out:</p>
  
  <pre><code>words = words[counts &gt; 1]
  counts = counts[counts &gt; 1]
  </code></pre>
  
  <p>as well as words, that are numbers:</p>
  
  <pre><code>words = words[np.array(map(lambda x: x.isalpha(), words))]
  counts = counts[np.array(map(lambda x: x.isalpha(), words))]
  </code></pre>
  
  <p>But it's still not perfect...</p>
  
  <p><strong>My questions are:</strong></p>
  
  <ol>
  <li>How to filter out verbs?</li>
  <li>How to perfeorm stemming to get rid of different forms of the same word?</li>
  <li>How to call CountVectoriser to filter out two letter words?</li>
  </ol>
  
  <p><strong>Please also note:</strong></p>
  
  <ol>
  <li>I'm fine with nltk but answer like "you should try nltk" is not an answer, give me a code, please.</li>
  <li>I don't want to use Bayesian classifier and other techniques, that require training a model. I don't have time for that and I don't have examples to train the classifier.</li>
  <li>Language is English</li>
  </ol>