crop-guard-backend / app /scripts /dummy_model.py
SaiStack's picture
Added entire project to hf
fc10439
raw
history blame contribute delete
472 Bytes
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.")