title: How do I get word frequency in a corpus using Scikit Learn CountVectorizer?
body: <p>I'm trying to compute a simple word frequency using scikit-learn's <code>CountVectorizer</code>.</p>
  
  <pre><code>import pandas as pd
  import numpy as np
  from sklearn.feature_extraction.text import CountVectorizer
  
  texts=["dog cat fish","dog cat cat","fish bird","bird"]
  cv = CountVectorizer()
  cv_fit=cv.fit_transform(texts)
  
  print cv.vocabulary_
  {u'bird': 0, u'cat': 1, u'dog': 2, u'fish': 3}
  </code></pre>
  
  <p>I was expecting it to return <code>{u'bird': 2, u'cat': 3, u'dog': 2, u'fish': 2}</code>.</p>