Spaces:
Paused
Paused
File size: 472 Bytes
fc10439 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 | from sklearn.pipeline import make_pipeline
from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn.linear_model import LogisticRegression
import joblib
X = ["i love this", "i hate this", "amazing", "terrible", "good", "bad"]
y = ["positive", "negative", "positive", "negative", "positive", "negative"]
model = make_pipeline(TfidfVectorizer(), LogisticRegression())
model.fit(X, y)
joblib.dump(model, "model/classifier.pkl")
print("Dummy model saved.")
|