Spaces:
Sleeping
Sleeping
Update README.md
Browse files
README.md
CHANGED
|
@@ -10,10 +10,81 @@ tags:
|
|
| 10 |
pinned: false
|
| 11 |
short_description: Streamlit template space
|
| 12 |
---
|
|
|
|
| 13 |
|
| 14 |
-
|
| 15 |
|
| 16 |
-
|
| 17 |
|
| 18 |
-
|
| 19 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10 |
pinned: false
|
| 11 |
short_description: Streamlit template space
|
| 12 |
---
|
| 13 |
+
# π¬ IMDb Movie Review Sentiment Analysis
|
| 14 |
|
| 15 |
+
This app predicts whether a movie review is **positive** or **negative** using a Machine Learning model trained on the IMDb dataset.
|
| 16 |
|
| 17 |
+
π **Live App:** (add your Hugging Face link here)
|
| 18 |
|
| 19 |
+
---
|
| 20 |
+
|
| 21 |
+
## π Project Overview
|
| 22 |
+
|
| 23 |
+
Sentiment analysis is a Natural Language Processing (NLP) task that determines the emotional tone behind a piece of text.
|
| 24 |
+
|
| 25 |
+
In this project:
|
| 26 |
+
|
| 27 |
+
- User enters a movie review
|
| 28 |
+
- The text is transformed using **Bag-of-Words (CountVectorizer)**
|
| 29 |
+
- A **Logistic Regression** model predicts the sentiment
|
| 30 |
+
|
| 31 |
+
---
|
| 32 |
+
|
| 33 |
+
## π§ Model Details
|
| 34 |
+
|
| 35 |
+
- **Algorithm:** Logistic Regression
|
| 36 |
+
- **Vectorizer:** CountVectorizer (max_features = 5000, English stopwords removed)
|
| 37 |
+
- **Train/Test Split:** 80 / 20
|
| 38 |
+
- **Evaluation Metric:** Accuracy
|
| 39 |
+
|
| 40 |
+
β
**Accuracy:** ~0.87
|
| 41 |
+
|
| 42 |
+
The dataset is balanced between positive and negative reviews, making accuracy a reliable metric.
|
| 43 |
+
|
| 44 |
+
---
|
| 45 |
+
|
| 46 |
+
## π Dataset
|
| 47 |
+
|
| 48 |
+
IMDb Dataset of 50K Movie Reviews
|
| 49 |
+
Each review is labeled as:
|
| 50 |
+
|
| 51 |
+
- `positive`
|
| 52 |
+
- `negative`
|
| 53 |
+
|
| 54 |
+
---
|
| 55 |
+
|
| 56 |
+
## βοΈ How It Works
|
| 57 |
+
|
| 58 |
+
1. User enters a movie review in the app
|
| 59 |
+
2. The review is converted into numerical features using the trained vectorizer
|
| 60 |
+
3. The model predicts the sentiment
|
| 61 |
+
4. The app displays:
|
| 62 |
+
- Predicted class
|
| 63 |
+
- Confidence score
|
| 64 |
+
|
| 65 |
+
---
|
| 66 |
+
|
| 67 |
+
## π₯οΈ App Features
|
| 68 |
+
|
| 69 |
+
β Real-time sentiment prediction
|
| 70 |
+
β Confidence probability
|
| 71 |
+
β Clean and interactive UI
|
| 72 |
+
β Handles raw text input
|
| 73 |
+
|
| 74 |
+
---
|
| 75 |
+
|
| 76 |
+
## π οΈ Tech Stack
|
| 77 |
+
|
| 78 |
+
- Python
|
| 79 |
+
- Scikit-learn
|
| 80 |
+
- Pandas
|
| 81 |
+
- Streamlit
|
| 82 |
+
- Joblib
|
| 83 |
+
|
| 84 |
+
---
|
| 85 |
+
|
| 86 |
+
## π Run Locally
|
| 87 |
+
|
| 88 |
+
```bash
|
| 89 |
+
pip install -r requirements.txt
|
| 90 |
+
streamlit run streamlit_app.py
|