/ Модель

Характеристики

Контекст
512 токенов
Параметры
138 млн
Лицензия
Apache 2.0
Архитектура
albert · dense
Базовая модель
albert-base-v2-persian-zwnj-naab-mlm
Библиотека
transformers
Опубликована
7 сен 2026

albert-base-v2-persian-sentiment-sentipers-3class

Классификация текстаТекст → label3 профессии

Дообученная ALBERT-модель определяет отрицательную, нейтральную или положительную тональность коротких текстов на персидском языке, особенно отзывов о товарах.

333скачиваний за 30 дней2лайкавеса обновлены23 ноя 2026

Бенчмарки

Как модель справилась с задачами пользователей ailist и что о ней публикуют открытые лидерборды

Публичные оценки

Из открытых лидербордов. Сравнивайте результаты одного теста при одинаковых условиях — отсутствие оценки не значит, что модель хуже.

В подключённых источниках результатов для этой модели пока нет.

Что умеет модель

Описание составлено по карточке модели и метаданным Hugging Face

Модель разработал MahdiAlikhah для классификации персидского текста по тональности на три класса: отрицательная, нейтральная и положительная. Это ALBERT-base с классификационной головой, дообученный на предложениях из персидских отзывов о товарах Digikala в наборе DeepSentiPers. Исходные пять уровней тональности объединены в три класса; при обучении использовались данные с обратным переводом и взвешивание классов. Модель принимает текст и выдаёт метку класса с оценкой вероятности. Контекст модели — 512 токенов; при описанной авторами предобработке вход обрезается до 128 токенов.

Основной сценарий — определение тональности коротких персидских отзывов, близких к обучающим данным. На исходной отложенной выборке авторы сообщают точность 0,830 и macro-F1 0,802. Модель поддерживает персидский язык и выпущена по лицензии Apache-2.0. Обучающие данные взяты с одной торговой площадки и смещены в сторону положительных оценок, поэтому качество может снизиться на новостях, соцсетях, формальном тексте, диалектах, смешанных языках и других областях; объединение пяти уровней в три также теряет различия в интенсивности тональности.

Сценарии применения

  • Определение тональности персидских отзывов о товарах
  • Разделение отзывов на отрицательные, нейтральные и положительные
  • Подсчёт тональности отзывов о продукции на Digikala
  • Автоматическая сортировка персидских отзывов по оценочной окраске

Ограничения

Обучение проводилось на отзывах одной торговой площадки, с преобладанием положительных примеров; перенос на другие жанры, диалекты и смешанный текст не оценён. Трёхклассовая схема теряет различия в интенсивности тональности, а для важных решений необходима проверка человеком.

Для каких профессий подходит3

Разделы каталога профессий, в задачах которых используется эта модель

Все профессии

Карточка модели

README от автора на Hugging Face, как он его опубликовал

Открыть на Hugging Face

Model Card for albert-fa-sentipers-3class

A 3-class Persian sentiment classifier (negative / neutral / positive), fine-tuned from shekar-ai/albert-base-v2-persian-zwnj-naab-mlm on the DeepSentiPers dataset of Persian product review sentences.

Model Details

Model Description

This model classifies Persian-language text into three sentiment classes: negative, neutral, and positive. It was built by attaching a sequence classification head to a pretrained ALBERT-base Persian MLM checkpoint and fine-tuning it on the DeepSentiPers dataset (Persian customer review sentences from Digikala). The dataset's original 5-point polarity scale (-2 to +2) was collapsed to 3 classes: -2/-1 -> negative, 0 -> neutral, +1/+2 -> positive Training used the back-translation-augmented split (translation.csv) and was evaluated on the dataset's original held-out test.csv split.

  • Developed by: MahdiAlikhah
  • Model type: ALBERT-base for sequence classification, 3-class Persian sentiment analysis
  • Language(s) (NLP): Persian (fa)
  • License: apache-2.0. The base model is MIT-licensed; MIT permits sublicensing, so this fine-tune is released under Apache-2.0.
  • Finetuned from model: shekar-ai/albert-base-v2-persian-zwnj-naab-mlm

Model Sources

Uses

Direct Use

Sentence- or short-passage-level sentiment classification of Persian text into negative, neutral, or positive, particularly for text similar to its training domain (product reviews).

Out-of-Scope Use

Not evaluated on domains far from product reviews (e.g. social media, news, formal writing); not designed for languages other than Persian or mixed-language text; not suitable as a sole signal for high-stakes decisions without human review.

Bias, Risks, and Limitations

Training data skews positive after the 3-class collapse (positive labels outnumber negative by roughly 3-4x), partially addressed with class-weighted loss during training. The dataset is sourced from a single e-commerce platform's product reviews, so sentiment expressed in other registers or dialects may not transfer well. Collapsing the original 5-point scale to 3 classes also removes some intensity distinctions near class boundaries.

Recommendations

Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model. Validate performance on your own domain/data before deploying outside product-review-style Persian text.

How to Get Started with the Model

Use the code below to get started with the model.

from transformers import AutoTokenizer, AutoModelForSequenceClassification
import torch

model_id = "MahdiAlikhah/albert-base-v2-persian-sentiment-sentipers-3class"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForSequenceClassification.from_pretrained(model_id)

text = "این محصول عالی بود"
inputs = tokenizer(text, return_tensors="pt")
with torch.no_grad():
    logits = model(**inputs).logits
pred = logits.argmax(-1).item()
print(model.config.id2label[pred])

Training Details

Training Data

DeepSentiPers (https://github.com/JoyeBright/DeepSentiPers) — Persian sentiment corpus of Digikala product review sentences. Training file: translation.csv (back-translation-augmented, approximately 14,046 rows before splitting). Test file: test.csv (1,854 rows, original held-out split, not augmented or seen during training). Original 5-point polarity labels (-2 to +2) collapsed to 3 classes (negative/neutral/positive).

Training Procedure

Preprocessing

Text normalized with hazm's Normalizer (Persian half-space/ZWNJ normalization), then tokenized with the base model's tokenizer (max_length=128, truncation and padding to max length).

Training Hyperparameters

  • Training regime: fp32
  • Epochs: 5 (best checkpoint selected by validation macro-F1; epoch 4 was selected, as validation F1 peaked there before declining in epoch 5)
  • Batch size: 16 (train), 32 (eval)
  • Learning rate: 2e-5
  • Weight decay: 0.01
  • Loss: class-weighted cross-entropy (balanced class weights) to counteract training-set class imbalance

Speeds, Sizes, Times

Train runtime: approximately 26 minutes (1,574s) for 5 epochs, 3,955 steps total, on a single T4 GPU (Google Colab).

Evaluation

Testing Data, Factors & Metrics

Testing Data

DeepSentiPers test.csv (1,854 rows), 3-class-collapsed, normalized identically to training data. Never included in training or in the back-translation augmentation.

Metrics

Accuracy, and macro F1 (chosen as the primary metric because of class imbalance, so the minority negative class isn't washed out by the larger neutral/positive classes).

Results

Accuracy: 0.830. F1 (macro): 0.802. Eval loss: 0.714.

Summary

Roughly 83% accuracy and 0.80 macro-F1 on the held-out test set. For context, prior work on the full, uncollapsed 5-class DeepSentiPers task reported substantially lower macro-F1 (about 0.71 for a BERT-based model), consistent with 3-class sentiment being an easier task than 5-class.

Environmental Impact

Carbon emissions can be estimated using the Machine Learning Impact calculator presented in Lacoste et al. (2019).

  • Hardware Type: NVIDIA T4 GPU
  • Cloud Provider: Google Colab

Technical Specifications

Model Architecture and Objective

ALBERT-base architecture with a sequence classification head (linear layer over the pooled [CLS] output), 3-way softmax output, fine-tuned with cross-entropy loss.

Hardware

Single NVIDIA T4 GPU (Google Colab)

Software

transformers 4.57.3, tokenizers 0.22.2, PyTorch, datasets, hazm, accelerate, evaluate, scikit-learn.

Как запустить

На своей GPU в ailist. Цена — по текущим предложениям провайдеров

GPU в ailist

Универсальный рантайм · transformers · text-classification

Можно запустить

Подбираем GPU…

Класс архитектуры
AlbertForSequenceClassification
Ревизия весов
74af7ee

0 моделей