File size: 3,611 Bytes
7cf2dd0
 
66d9d36
7cf2dd0
 
 
 
 
 
 
 
 
 
 
 
66d9d36
7cf2dd0
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
d113ece
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
---
datasets:
  - sentiment-analysis-dataset-oversampled
language:
  - en
task_categories:
  - text-classification
task_ids:
  - sentiment-classification
tags:
  - sentiment-analysis
  - text-classification
  - balanced-dataset
  - oversampling
  - csv
pretty_name: Sentiment Analysis Dataset OverSampled
dataset_info:
  features:
    - name: text
      dtype: string
    - name: label
      dtype: int64
  splits:
    - name: train
      num_examples: 121374
    - name: validation
      num_examples: 10499
    - name: test
      num_examples: 10499
  format: csv
---


# Sentiment Analysis Dataset  

## Overview  

This dataset is designed for sentiment analysis tasks, offering a balanced and pre-processed collection of labeled text data. The dataset includes three sentiment labels:  
- **0**: Negative  
- **1**: Neutral  
- **2**: Positive  

The training dataset has been oversampled to ensure balanced label distribution, making it suitable for training robust sentiment analysis models. The validation and test datasets remain unaltered to preserve the original label distribution for unbiased evaluation.  

---

## Dataset Details  

### Structure  

| **Split**      | **Rows** | **Label Distribution** |
|-----------------|----------|------------------------|
| **Train**      | 121,374  | Balanced (Oversampled) |
| **Validation** | 10,499   | Original              |
| **Test**       | 10,499   | Original              |

### File Format  

- **Type**: CSV  
- **Columns**:  
  - `text`: The input text.  
  - `label`: The sentiment label (`0`, `1`, `2`).  

### Labels  

| **Label** | **Sentiment** |
|-----------|---------------|
| `0`       | Negative      |
| `1`       | Neutral       |
| `2`       | Positive      |

---

## Preprocessing  

The dataset has been thoroughly cleaned and pre-processed, ensuring consistency and readiness for use in machine learning tasks. Preprocessing steps include:  
1. Removal of dubplicates.  
2. Removal of Null rows.
3. Filtering out extremely short or long entries.

---

## Usage  

### Loading the Dataset  

The dataset can be loaded and processed using common Python libraries like `pandas`:  

```python
import pandas as pd

# Load the train dataset
train_data = pd.read_csv("path/to/train.csv")
val_data = pd.read_csv("path/to/validation.csv")
test_data = pd.read_csv("path/to/test.csv")

# Display sample data
print(train_data.head())
```

### Example  

```python
# Example usage: Distribution of labels in the train dataset
print(train_data['label'].value_counts())

# Example data preprocessing for modeling
from sklearn.model_selection import train_test_split
X_train, y_train = train_data['text'], train_data['label']
X_val, y_val = val_data['text'], val_data['label']
X_test, y_test = test_data['text'], test_data['label']
```

---

## Applications  

This dataset can be used for various sentiment analysis tasks, including:  
- Building sentiment classifiers for social media analysis.  
- Evaluating product or service feedback.  
- Developing opinion mining systems.  

---

## Dataset Split  

| **Split**      | **Purpose**                        |
|-----------------|------------------------------------|
| **Train**      | For model training (oversampled).  |
| **Validation** | For hyperparameter tuning.         |
| **Test**       | For final model evaluation.        |

---

## Citation  

If you use this dataset in your research or projects, please provide proper attribution:  

```plaintext  
Sentiment Analysis Dataset (OverSampled) 
Contributed by: Syed Khalid Hussain  
```

---


**Author**: Syed Khalid Hussain