from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn.naive_bayes import MultinomialNB
from sklearn.pipeline import Pipeline
# Create a pipeline
text_clf = Pipeline([
('tfidf', TfidfVectorizer()),
('clf', MultinomialNB()),
])
# Train the model
text_clf.fit(X_train, y_train)
# Make predictions
predictions = text_clf.predict(X_test)