What does 'Attribute error: List object has no attribute lower' mean? Sklearn toolkit (Countvectorizer)

110 Views Asked by At

I have followed various tutorials using the sklearn toolkit to transform text into a vector for a machine learning model I am building. I keep getting this error with my code:

Error message

This is my code:

from sklearn.feature_extraction.text import CountVectorizer

vectorizer = CountVectorizer()
X = vectorizer.fit_transform(anon_words)

print(vectorizer.get_feature_names())

print(X.toarray)

I think it is because my data is in a list because I've done lots of pre-processing on it?

Here is an image of the output of my text from the previous step: Text following pre-processing

0

There are 0 best solutions below