CountVectorizer returns 1x1 sparse matrix

17 views Asked by At

My X_train data is as follows:

enter image description here

The code I am using is

count_vect = CountVectorizer(stop_words='english')
X_count = count_vect.fit_transform(X_train)

The shape of X_count is (1 x 1).

I am expecting the returned feature matrix to be of shape (nrows, nfeatures). I am not able to figure out what I am missing. Any help is appreciated.

0

There are 0 answers