Team Ai
Datasetpublic

syedkhalid0/Sentiment-Analysis-Over-sampled

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… See the full description on the dataset page: https://huggingface.co/datasets/syedkhalid0/Sentiment-Analysis-Over-sampled.

sourceHugging Faceupdated 2y agoView on Hugging Face
0likes24downloads
Dataset Card

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**
Train121,374Balanced (Oversampled)
Validation10,499Original
Test10,499Original

File Format

  • —Type: CSV
  • —Columns:
  • —text: The input text.
  • —label: The sentiment label (0, 1, 2).

Labels

**Label****Sentiment**
0Negative
1Neutral
2Positive

Preprocessing

The dataset has been thoroughly cleaned and pre-processed, ensuring consistency and readiness for use in machine learning tasks. Preprocessing steps include:

  1. 1.Removal of dubplicates.
  2. 2.Removal of Null rows.
  3. 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**
TrainFor model training (oversampled).
ValidationFor hyperparameter tuning.
TestFor 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