NLP, Python, Scikit Learn.
computed on this data. Here is the relevant code: from sklearn.feature_extraction.text import TfidfVectorizer x_train = X['preprocessed'].tolist() vectorizer = TfidfVectorizer() x_train = vectorizer.fit_transform(x_train) print(x_train.shape) # (272, 40337) print(x_train) # (0, 1002)