sentipers / README.md
kforghani's picture
Update README.md
c644e82 verified
metadata
license: mit
dataset_info:
  features:
    - name: text
      dtype: string
    - name: label
      dtype:
        class_label:
          names:
            '0': very_negative
            '1': negative
            '2': neutral
            '3': positive
            '4': very_positive
  splits:
    - name: train
      num_examples: 10820
    - name: validation
      num_examples: 1352
    - name: test
      num_examples: 1353
  dataset_size: 13525
configs:
  - config_name: default
    data_files:
      - split: train
        path: data/train.csv
      - split: validation
        path: data/val.csv
      - split: test
        path: data/test.csv
task_categories:
  - text-classification
language:
  - fa
tags:
  - sentiment
  - review
pretty_name: SentiPers
size_categories:
  - 1K<n<10K

SentiPers Dataset

Dataset Description

SentiPers is a Persian sentiment analysis dataset containing text samples labeled with sentiment polarity scores ranging from -2 (very negative) to 2 (very positive).

Original Repository: https://github.com/phosseini/SentiPers

Fork: https://github.com/k-forghani/SentiPers

Dataset Structure

Data Splits

The dataset is split into three subsets with fixed random seed (42) for reproducibility:

Split Size Percentage
Train 10,820 80%
Validation 1,352 10%
Test 1,353 10%

Data Fields

  • text: The input text in Persian
  • label: Sentiment polarity label (integer from 0 to 4)

Label Mapping

The original polarity scores are mapped to integer labels as follows:

Original Polarity Label ID Sentiment
-2 0 Very Negative
-1 1 Negative
0 2 Neutral
1 3 Positive
2 4 Very Positive

Dataset Creation

The dataset is preprocessed from sentipers.xlsx with the following steps:

  1. Extract text and polarity columns
  2. Remove duplicate texts (keeping first occurrence)
  3. Map polarity scores to integer labels
  4. Perform stratified splitting to maintain label distribution across splits

Loading the Dataset

import pandas as pd

train_df = pd.read_csv('data/train.csv')
val_df = pd.read_csv('data/val.csv')
test_df = pd.read_csv('data/test.csv')

Preprocessing Script

Run preprocess_data.py to regenerate the splits from the source file:

python preprocess_data.py

Citation

If you use this dataset, please cite the original SentiPers repository:

Original: https://github.com/phosseini/SentiPers

Fork: https://github.com/k-forghani/SentiPers