harbor run -t LiteCoder/cpu-sentiment-movie-reviewsharbor download LiteCoder/cpu-sentiment-movie-reviewsBuild a sentiment analysis pipeline that classifies IMDb movie reviews as positive or negative using CPU-only processing, and output evaluation results in a structured format.
Download and use the IMDb Large Movie Review Dataset (https://ai.stanford.edu/~abell/data/movie-review-data/aclImdb_v1.tar.gz). The dataset contains 50,000 movie reviews split into positive and negative sentiment classes.
random_state=42.max_iter=1000, random_state=42).All output files must be written under /app/.
/app/metrics.jsonA JSON file containing evaluation metrics with the following structure:
{
"accuracy": 0.xx,
"precision": 0.xx,
"recall": 0.xx,
"f1_score": 0.xx
}
/app/confusion_matrix.pngA saved confusion matrix visualization (PNG format). The image file must be non-empty.
/app/model.pklThe trained Logistic Regression model serialized using pickle or joblib. The file must be loadable and usable for prediction.
/app/predict.pyA standalone prediction script that:
/app/model.pkl and the TF-IDF vectorizer from /app/vectorizer.pkl.{"review": "the input text", "sentiment": "positive", "confidence": 0.xx}
sentiment must be either "positive" or "negative".confidence is the predicted probability of the chosen class, rounded to 4 decimal places.Usage example:
python /app/predict.py "This movie was absolutely wonderful and moving"
/app/vectorizer.pklThe fitted TF-IDF vectorizer serialized using pickle or joblib, used by predict.py.
/app/report.jsonA summary report in JSON format:
{
"dataset_size": 50000,
"train_size": <int>,
"test_size": <int>,
"feature_count": <int>,
"model": "LogisticRegression",
"metrics": {
"accuracy": 0.xx,
"precision": 0.xx,
"recall": 0.xx,
"f1_score": 0.xx
}
}
train_size and test_size must sum to dataset_size.feature_count is the number of TF-IDF features used.metrics must match the values in /app/metrics.json.