harbor run -t LiteCoder/sentiment-random-forest-pipelineharbor download LiteCoder/sentiment-random-forest-pipelineBuild a sentiment analysis pipeline that classifies IMDB movie reviews as positive or negative using Random Forest classifiers, comparing TF-IDF and Word2Vec feature extraction approaches.
/app/solution.py — running python solution.py must produce all output filesUse the IMDB movie reviews dataset (50,000 reviews). Download it programmatically (e.g., via datasets library, direct URL, or any reliable source). If download fails, the script should exit with a non-zero exit code and print an error message to stderr.
Apply a text preprocessing pipeline to all reviews using NLTK:
random_state=42.RandomForestClassifier (with n_estimators=100, random_state=42) for each feature type./app/results.jsonA JSON file with the following exact structure:
{
"tfidf": {
"accuracy": <float>,
"precision": <float>,
"recall": <float>,
"f1_score": <float>
},
"word2vec": {
"accuracy": <float>,
"precision": <float>,
"recall": <float>,
"f1_score": <float>
},
"best_method": "<string: 'tfidf' or 'word2vec'>"
}
best_method is determined by the higher F1 score./app/comparison_plot.pngA grouped bar chart comparing accuracy, precision, recall, and F1 score for both methods. The chart must have: