NLP CounterVectorizer (sklearn), not able to get it to fit my code I was starting an NLP project and simply get a &quot;CountVectorizer()&quot; output anytime I try to run CountVectorizer.fit on the list.  I've had the same issue across multiple IDE's, and different code.  I've looked online, and even copy and pasted other codes with their lists and I receive the same CountVectorizer() output.
My code is as follows:
cv = CountVectorizer()

messages = ['This is a good product', 'It was a bit pricey for what it does', 'I found good value here']

cv.fit(messages)

**output -----&gt;  CountVectorizer()**

I'm really stumped on this issue.  Any advice would be greatly appreciated.  Thanks.
Update:  This seems to be a local issue as I am able to get it to fit on Colab.  If anyone can suggest what might be going on I'd be estatic.
This is normal, the fit method of scikit-learn'sCountverctorizer object changes the object inplace, and returns the object itself as explained in the documentation. This holds true for any sklearn object implementing a fit method, by the way.
When you run:
cv.fit(messages)

The cv object learns the transformation (here it is simply about counting words) and stores all the necessary parameters in order to be able to later apply the transformation to any new data point.
If you want to transform the data, you need to use first the fit method (to learn the transformation as said before) and then the transform method.
In your case if you want to transform your list of sentences you should do as follows:
cv = CountVectorizer()

messages = ['This is a good product', 'It was a bit pricey for what it does', 'I found good value here']

cv.fit(messages)
vectorized_messages = cv.transform(messages)

vectorized_messages

This will output:
&lt;3x14 sparse matrix of type '&lt;class 'numpy.int64'&gt;'
    with 15 stored elements in Compressed Sparse Row format&gt;

So you will have successfully transformed your list of strings to a a matrix of token counts.
Note that sklearn often also implement a fit_transform method that does bothe at the same time:
cv = CountVectorizer()
cv.fit(messages)
vectorized_messages = cv.transform(messages)

#is the same as:
cv = CountVectorizer()
vectorized_messages = cv.transform(messages)