File size: 3,408 Bytes
0385ad0
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
---
title: Sentiment Analysis Tool
emoji: 🧠
colorFrom: blue
colorTo: indigo
sdk: streamlit
sdk_version: "1.24.0"
app_file: app.py
pinned: false
---

# πŸ’¬ Sentiment Analysis Tool

A powerful web application for analyzing sentiment in text data using multiple NLP techniques.

![image](https://github.com/user-attachments/assets/e9fae115-58c0-48d7-992f-fef2c0473443)

---

## πŸ“ Overview

This tool helps you analyze the sentiment (positive, negative, or neutral) of any text content such as tweets, product reviews, customer feedback, etc. It provides both single text analysis and batch processing capabilities with interactive visualizations.

---

## πŸš€ Features

### πŸ” Dual Analysis Methods

- **TextBlob**: Simple and effective general-purpose sentiment analysis  
- **VADER**: Specialized for social media content and colloquial expressions

### ✏️ Single Text Analysis
![image](https://github.com/user-attachments/assets/bb7504da-7a0d-41d2-89f1-6f90bbdf7e95)

- Instant sentiment classification  
- Sentiment scores with detailed breakdown  
- Visual representation of results

### πŸ“ Batch Processing
![image](https://github.com/user-attachments/assets/9ce56588-d4be-4eca-b6ae-b48a83dad0d9)

- Upload CSV or Excel files with multiple text entries  
- Process hundreds of entries at once  
- Download results as a CSV file  
- Visualize sentiment distribution across all entries

### πŸ§‘β€πŸ’» Interactive UI

- User-friendly interface  
- Real-time analysis  
- Interactive charts and visualizations

---

## βš™οΈ Installation

### Clone this repository

```bash
git clone https://github.com/your-username/sentiment-analysis.git
cd Sentiment-Analysis
```
### Install the required dependencies
```bash
pip install -r requirements.txt
```
## ▢️ Usage
### Run the Streamlit app
```bash
streamlit run app.py
```
Then open your web browser and navigate to:
http://localhost:8501

## 🧭 How to Use

### πŸ”Ή For Single Text Analysis
- Enter or paste your text  
- Select your preferred analysis method (**TextBlob** or **VADER**)  
- Click **"Analyze Sentiment"**

### πŸ”Ή For Batch Analysis
- Upload a CSV or Excel file with text data  
- Select the text column to analyze  
- Choose your analysis method  
- Click **"Run Batch Analysis"**

---

## πŸ“Š Understanding the Results

### πŸ“˜ TextBlob Analysis
- **Polarity**: Score from **-1.0** (very negative) to **1.0** (very positive)  
- **Subjectivity**: Score from **0.0** (objective) to **1.0** (subjective)

### 🐦 VADER Analysis
- **Compound Score**: Normalized score between **-1** (very negative) and **1** (very positive)  
- **Positive / Neutral / Negative**: Proportion of text falling into each category

---

## πŸ“¦ Dependencies

- `streamlit >= 1.24.0`  
- `textblob >= 0.17.1`  
- `vaderSentiment >= 3.3.2`  
- `pandas >= 2.0.3`  
- `matplotlib == 3.7.2`  
- `plotly >= 5.15.0`

---

## πŸ’‘ Use Cases

- Monitor brand sentiment on social media  
- Analyze customer reviews and feedback  
- Track public opinion on products or services  
- Research emotional content in texts  
- Evaluate communication effectiveness

---

## ⚠️ Limitations

- Best performance with English text  
- May struggle with sarcasm and complex context  
- Limited understanding of industry-specific terminology  
- Cannot detect subtle emotional nuances


**Created with ❀️ by [Jivan Jamdar](https://github.com/Jivan052)**