File size: 900 Bytes
24ba471
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# create_dummy_model.py
import os
import joblib
from sklearn.pipeline import Pipeline
from sklearn.feature_extraction.text import CountVectorizer
from sklearn.linear_model import LogisticRegression

# Create artifacts directory if it doesn't exist
os.makedirs("artifacts", exist_ok=True)

# Simple pipeline for demo purposes
pipeline = Pipeline([
    ("vectorizer", CountVectorizer()),
    ("classifier", LogisticRegression())
])

# Train the dummy model on small sample data
texts = [
    "I love this product",
    "This is great",
    "Amazing experience",
    "I hate this",
    "This is bad",
    "Terrible quality",
]
labels = ["positive", "positive", "positive", "negative", "negative", "negative"]
pipeline.fit(texts, labels)

# Save model artifact
joblib.dump(pipeline, "artifacts/sentiment_pipeline.joblib")
print("✅ Dummy sentiment model created at artifacts/sentiment_pipeline.joblib")