Учтите, что мне нужно применить CountVectorizer() к следующим данным:
words = [
'A am is',
'This the a',
'the am is',
'this a am',
]
Я сделал следующее:
from sklearn.feature_extraction.text import CountVectorizer
vectorizer = CountVectorizer()
X = vectorizer.fit_transform(corpus)
print(X.toarray())
Он возвращает следующее:
[[1 1 0 0]
[0 0 1 1]
[1 1 1 0]
[1 0 0 1]]
Для справки print(vectorizer.get_feature_names())
печатает ['am', 'is', 'the', 'this']
Почему 'a' не читается??
Дело в том, что однобуквенные слова не считаются словами в CountVectorizer()?