/ Модель

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

Контекст
258 токенов
Параметры
162 млн
Лицензия
MIT
Архитектура
roberta · dense
Базовая модель
phobert-base-v2
Опубликована
29 авг 2026

phobert-emotion-social

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

Модель на базе PhoBERT распознаёт семь классов эмоций во вьетнамских текстах из социальных сетей.

170скачиваний за 30 дней1лайквеса обновлены9 окт 2026

Бенчмарки

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

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

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

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

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

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

huyleit разработал и дообучил PhoBERT-base — модель семейства RoBERTa — для распознавания эмоций во вьетнамских публикациях и комментариях в социальных сетях. Модель относит текст к одному из семи классов эмоций; среди приведённых в карточке — радость или симпатия, грусть и отвращение. Она рассчитана на тексты с Facebook, Threads и VNExpress, включая интернет-сленг и сокращения.

Модель содержит 162,4 млн параметров и имеет контекст до 258 токенов. В репозитории доступны веса safetensors и варианты ONNX, в том числе квантованный INT8 для ускорения вывода на CPU. В README приведены результаты оценки на тестовой выборке из 1482 примеров, но показана лишь часть метрик, поэтому качество по всем классам по карточке оценить нельзя.

Модель принимает текст на вьетнамском языке и выдаёт метки эмоций с оценками. Лицензия — MIT.

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

  • определение эмоций в комментариях Facebook
  • анализ эмоциональной окраски публикаций в Threads
  • классификация эмоций во вьетнамских сообщениях со сленгом
  • разметка комментариев для анализа настроений в соцсетях

Ограничения

Модель специализирована на вьетнамских текстах из социальных сетей и контекст ограничен 258 токенами. Карточка приводит метрики лишь для части семи классов, поэтому полную оценку качества по ней составить нельзя.

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

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

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

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

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

Открыть на Hugging Face

PhoBERT Emotion Recognition v1.1

Model Description

PhoBERT Emotion v1.1 is a fine-tuned sequence classification model based on vinai/phobert-base-v2 for 7-class emotion recognition in Vietnamese social media texts:

  • Enjoyment (Thích thú / Vui vẻ)
  • Sadness (Buồn bã)
  • Disgust (Chán ghét / Khinh bỉ)
  • Anger (Tức giận)
  • Fear (Sợ hãi)
  • Surprise (Ngạc nhiên)
  • Other (Khác / Trung tính)

The model is trained on a curated and balanced Vietnamese social corpus (11,193 samples) with anti-overfitting techniques (Cosine Annealing scheduler, early stopping, and weight decay). In addition to standard PyTorch weights, optimized ONNX FP32 and ONNX Dynamic INT8 formats are provided for high-speed, resource-efficient CPU inference in production environments.


Model Formats & Artifacts

FormatFile PathModel SizeTarget Use-Case
PyTorch FP32model.safetensors~515 MBStandard Hugging Face training & fine-tuning
ONNX FP32onnx/phobert_emotion_fp32.onnx~515 MB100% precision preservation, ~15% faster CPU inference
ONNX INT8onnx/phobert_emotion_int8.onnx~130 MBDynamic quantization, 74.8% memory saving, low-latency CPU serving

Intended Uses & Capabilities

  • Social Listening & Monitoring: Real-time emotion sentiment tracking on comments, posts, and forum threads.
  • Mental Health & Chatbot Companions: Identifying distressed, anxious, or joyful states in conversational agents.
  • Customer Experience Analysis: Detecting frustration, anger, or satisfaction in feedback and review texts.

How to Use

1. Using Hugging Face pipeline

from transformers import pipeline

classifier = pipeline(
    task="text-classification",
    model="huyleit/phobert-vi-emotion-v1.1", # Or local folder path
    tokenizer="huyleit/phobert-vi-emotion-v1.1"
)

text = "Hôm nay nhận được tin vui quá trời luôn!"
prediction = classifier(text)
print(prediction)

2. Using PyTorch (transformers)

import torch
from transformers import AutoTokenizer, AutoModelForSequenceClassification

model_id = "huyleit/phobert-vi-emotion-v1.1"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForSequenceClassification.from_pretrained(model_id)

id2label = {
    0: "Enjoyment",
    1: "Sadness",
    2: "Disgust",
    3: "Anger",
    4: "Fear",
    5: "Surprise",
    6: "Other"
}

text = "Hôm nay nhận được tin trúng tuyển thực sự vui phát khóc luôn á!"
inputs = tokenizer(text, return_tensors="pt", max_length=128, truncation=True)

with torch.no_grad():
    logits = model(**inputs).logits
    probs = torch.softmax(logits, dim=-1)

pred_id = torch.argmax(probs, dim=-1).item()
confidence = probs[0][pred_id].item()

print(f"Predicted: {id2label[pred_id]} (Confidence: {confidence:.4f})")

3. Using ONNX Runtime (Fast CPU Inference)

import numpy as np
import onnxruntime as ort
from transformers import AutoTokenizer

model_id = "huyleit/phobert-vi-emotion-v1.1"
tokenizer = AutoTokenizer.from_pretrained(model_id)

# Load ONNX quantized INT8 model for ultra-fast inference
session = ort.InferenceSession("onnx/phobert_emotion_int8.onnx", providers=["CPUExecutionProvider"])

id2label = {
    0: "Enjoyment",
    1: "Sadness",
    2: "Disgust",
    3: "Anger",
    4: "Fear",
    5: "Surprise",
    6: "Other"
}

text = "Thật sự rất sốc và không thể tin nổi chuyện này lại xảy ra!"
inputs = tokenizer(text, return_tensors="np", max_length=128, truncation=True)

ort_inputs = {
    "input_ids": inputs["input_ids"],
    "attention_mask": inputs["attention_mask"]
}
logits = session.run(["logits"], ort_inputs)[0]
pred_id = int(np.argmax(logits, axis=1)[0])

print(f"Predicted: {id2label[pred_id]}")

Evaluation Results

The model was evaluated on a clean held-out test set of 1,679 samples (evaluation/emotion/data/phobert_test.json).

Classification Report (Held-out Test Set)

Emotion ClassPrecisionRecallF1-ScoreSupport
Enjoyment0.70640.78310.7428295
Sadness0.62170.66140.6409251
Disgust0.57270.49220.5294256
Anger0.60420.58230.5930249
Fear0.62870.70950.6667210
Surprise0.78610.70220.7418225
Other0.56150.54400.5526193
Accuracy——0.64321679
Macro Average0.64020.63920.63821679
Weighted Average0.64250.64320.64131679

Runtime & Quantization Benchmark Comparison

MetricPyTorch FP32ONNX FP32ONNX INT8 (Quantized)Impact / Optimization
Disk Size515.02 MB515.26 MB129.56 MB-74.8% (4x smaller)
Runtime RAM Usage~268 MB~540 MB~160 MBSignificant RAM reduction
Average CPU Latency97.01 ms82.65 ms64.85 ms+33.2% faster
P95 Latency113.63 ms140.68 ms113.83 msPredictable tail latency
Throughput10.3 req/s12.1 req/s15.4 req/s+49.5% request capacity
Accuracy64.32%64.32%62.00%Preserved precision
Macro F163.82%63.82%61.86%Minimal degradation (-1.96%)

Training Details

Training Data

  • Total samples: 11,193 Vietnamese social media text samples (balanced corpus).
  • Split Ratio: 70% Train (7,835 samples) / 15% Validation (1,679 samples) / 15% Held-out Test (1,679 samples).

Training Hyperparameters

  • Base Architecture: vinai/phobert-base-v2 (135M parameters)
  • Max Sequence Length: 128
  • Batch Size: 16
  • Learning Rate: 1.5e-5
  • LR Scheduler: CosineAnnealingLR (Warmup steps: 200)
  • Weight Decay: 0.02 (L2 Regularization)
  • Precision: Mixed Precision FP16
  • Optimization Metric: Validation Macro F1 (eval_f1)
  • Early Stopping: Patience = 2 epochs
  • Hardware: Google Colab NVIDIA Tesla T4 GPU

Label Mapping

{
  "0": "Enjoyment",
  "1": "Sadness",
  "2": "Disgust",
  "3": "Anger",
  "4": "Fear",
  "5": "Surprise",
  "6": "Other"
}

Limitations and Bias

  • Social Media Slang & Teencode: The model performs robustly on standard text and common social media expressions, but extreme teencode or emerging neologisms may reduce classification performance.
  • Sarcasm & Irony: Sarcastic expressions where positive words carry negative emotional meaning remain inherently challenging for subword-level contextual embeddings without broader conversation history.
  • Subjectivity: Boundaries between emotions like Disgust vs Anger or Other vs Sadness can be subjective across different annotators.

Citation & Acknowledgements

If you use this model or its quantized variants, please cite the following foundational works:

@inproceedings{phobert,
  title     = {{PhoBERT: Pre-trained language models for Vietnamese}},
  author    = {Dat Quoc Nguyen and Anh Tuan Nguyen},
  booktitle = {Findings of the Association for Computational Linguistics: EMNLP 2020},
  pages     = {1037--1042},
  year      = {2020}
}

@inproceedings{ho2020vsmec,
  title     = {Emotion Recognition for Vietnamese Social Media Text},
  author    = {Vong Anh Ho and Duong Huynh-Cong Nguyen and Danh Hoang Nguyen and Pham-Nguyen Cuong and Duc-Vu Nguyen and Kiet Van Nguyen and Ngan Luu-Thuy Nguyen},
  booktitle = {2020 17th International Conference on Electrical Engineering/Electronics, Computer, Telecommunications and Information Technology (ECTI-CON)},
  year      = {2020}
}

@inproceedings{demszky2020goemotions,
  title     = {{GoEmotions: A Dataset of Fine-Grained Emotions}},
  author    = {Dorottya Demszky and Dana Movshovitz-Attias and Jeongwoo Ko and Alan Cowen and Gaurav Nemade and Sujith Ravi},
  booktitle = {58th Annual Meeting of the Association for Computational Linguistics (ACL)},
  year      = {2020}
}

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

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

GPU в ailist

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

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

Подбираем GPU…

Класс архитектуры
RobertaForSequenceClassification
Ревизия весов
422ce99

0 моделей