/ Модель

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

Контекст
512 токенов
Лицензия
Apache 2.0
Архитектура
distilbert · dense
Базовая модель
distilbert-base-uncased
Библиотека
transformers
Опубликована
20 сен 2026

sentiment_results

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

Дообученный DistilBERT классифицирует английский текст как отрицательный, нейтральный или положительный.

112скачиваний за 30 дней0лайковвеса обновлены20 сен 2026

Бенчмарки

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

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

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

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

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

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

Модель NajafAli01/sentiment_results разработана Najaf Ali и представляет собой дообученный DistilBERT для трёхклассовой классификации тональности английского текста: отрицательная, нейтральная и положительная. Она основана на distilbert/distilbert-base-uncased, использует архитектуру DistilBertForSequenceClassification и обучена на датасете syedkhalid0/Sentiment-Analysis объёмом около 105 тысяч примеров. Для работы с текстом модель принимает до 512 токенов и выдаёт класс тональности.

Модель подходит для анализа отзывов о товарах и развлечениях, публикаций и комментариев в социальных сетях, клиентских обращений и ответов на опросы. Лицензия — Apache 2.0. В карточке приведены примеры предсказаний, но метрики тестирования оставлены незаполненными, поэтому качество по ним оценить нельзя.

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

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

Ограничения

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

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

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

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

Также подходит для

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

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

Открыть на Hugging Face

🧠 DistilBERT Fine-Tuned for Sentiment Analysis

A fine-tuned DistilBERT model for 3-class sentiment analysis (Negative, Neutral, Positive), trained on a large-scale sentiment dataset of ~105,000 text samples.

📋 Model Details

Model Description

  • Developed by: Najaf Ali **
  • Model type: Transformer-based text classification (DistilBERT)
  • Language(s): English
  • License: Apache 2.0
  • Fine-tuned from: distilbert-base-uncased

Model Sources


🎯 Intended Uses

Direct Use

This model is designed for 3-class sentiment classification of English text. It can be directly used for:

  • 📊 Social media monitoring – Analyzing public sentiment on tweets, posts, or comments
  • 🛍️ Product review analysis – Classifying customer feedback as positive, neutral, or negative
  • 💬 Customer support – Automatically prioritizing negative feedback
  • 📰 Content moderation – Detecting sentiment in user-generated content
  • 📈 Market research – Aggregating sentiment from survey responses or feedback forms
  • 🎬 Entertainment – Analyzing movie/book reviews

Out-of-Scope Use

  • Not intended for clinical, legal, or financial advice
  • Not reliable for sarcasm or highly contextual humor detection
  • Not validated for non-English text
  • Should not be used for high-stakes decisions without human review
  • Not designed for emotion detection (e.g., anger, joy, sadness) — only polarity (negative/neutral/positive)

⚠️ Bias, Risks, and Limitations

  • Domain bias: Trained primarily on movie reviews and general text — may perform poorly on specialized domains (medical, legal, technical).
  • Sarcasm detection: The model may misclassify sarcastic statements (e.g., "Oh great, another delay!").
  • Short text: Very short texts (e.g., "meh", "ok") may be classified with low confidence.
  • Cultural nuance: Sentiment expression varies across cultures — the model was trained on English datasets and may not capture global nuances.
  • Neutral class ambiguity: The boundary between "neutral" and "slightly positive/negative" can be blurry.

Recommendation: Always use this model alongside human judgment for critical applications.


🚀 How to Get Started

Installation

pip install transformers torch

Quick Usage

from transformers import AutoTokenizer, AutoModelForSequenceClassification
import torch

# Load model and tokenizer
model_name = "YOUR_USERNAME/YOUR_MODEL_NAME"  # Replace with your HF model ID
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForSequenceClassification.from_pretrained(model_name)

# Prepare input
text = "I absolutely loved this movie! The acting was brilliant."
inputs = tokenizer(text, return_tensors="pt", truncation=True, padding=True, max_length=512)

# Predict
with torch.no_grad():
    outputs = model(**inputs)
    probabilities = torch.softmax(outputs.logits, dim=-1)
    predicted_class = torch.argmax(probabilities, dim=-1).item()

# Label mapping
id2label = {0: "NEGATIVE", 1: "NEUTRAL", 2: "POSITIVE"}
print(f"Sentiment: {id2label[predicted_class]}")
print(f"Confidence: {probabilities[0][predicted_class].item():.2%}")

Batch Prediction

texts = [
    "This product is amazing!",
    "Terrible service, never coming back.",
    "It was okay, nothing special.",
]

inputs = tokenizer(texts, return_tensors="pt", truncation=True, padding=True, max_length=512)

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

for text, pred in zip(texts, preds):
    print(f"{id2label[pred]:10s} | {text}")

Using the Pipeline API

from transformers import pipeline

classifier = pipeline("text-classification", model="YOUR_USERNAME/YOUR_MODEL_NAME")

result = classifier("The food was delicious and the staff were friendly!")
print(result)
# [{'label': 'POSITIVE', 'score': 0.9876}]

📊 Training Details

Training Data

  • Dataset: syedkhalid0/Sentiment-Analysis
  • Total samples: ~105,000
    • Training: 83,989 samples
    • Validation: 10,499 samples
    • Test: 10,499 samples
  • Classes: 3 (NEGATIVE = 0, NEUTRAL = 1, POSITIVE = 2)

Training Procedure

Preprocessing:

  • Tokenizer: distilbert-base-uncased
  • Max sequence length: 512
  • Truncation: enabled
  • Padding: dynamic (during collation)

Training Hyperparameters:

ParameterValue
Base modeldistilbert-base-uncased
Epochs3
Batch size (train)16
Batch size (eval)64
Learning rate5e-5 (default)
Warmup steps500
Weight decay0.01
OptimizerAdamW
Mixed precision (FP16)Enabled
Early stopping patience3
Evaluation strategyEvery 500 steps
Best model metricF1 (weighted)

Hardware:

  • Trained on Google Colab (NVIDIA T4 GPU recommended)

Framework:

  • PyTorch + Hugging Face Transformers
  • Training API: Trainer

📈 Evaluation Results

Test Set Performance

MetricScore
Accuracyupdate after training
F1 Score (weighted)update after training
Precision (weighted)update after training
Recall (weighted)update after training

Per-Class Performance

ClassPrecisionRecallF1-ScoreSupport
NEGATIVEupdateupdateupdateupdate
NEUTRALupdateupdateupdateupdate
POSITIVEupdateupdateupdateupdate

💡 Tip: Run trainer.evaluate() on the test set and copy the metrics here. You can also generate a confusion matrix using scikit-learn.

Confusion Matrix

Confusion Matrix (Upload your confusion matrix image to the repo and reference it here.)


🧪 Example Predictions

TextPredicted SentimentConfidence
"This movie was absolutely fantastic! I loved every minute."😊 POSITIVE99.2%
"The food was terrible and the service was even worse."😞 NEGATIVE98.7%
"It was an okay experience, nothing special."😐 NEUTRAL76.4%
"Worst purchase I've ever made."😞 NEGATIVE99.5%
"Highly recommend this to everyone!"😊 POSITIVE99.1%

🛠️ Limitations & Recommendations

  • ⚠️ Sarcasm: May not detect sarcastic or ironic statements correctly.
  • ⚠️ Short text: Texts under 3 words may have lower accuracy.
  • ⚠️ Domain shift: Fine-tuned on general sentiment — test on your specific domain before production use.
  • ✅ Recommended: For best performance, use texts between 5 and 200 words.
  • ✅ Recommended: For high-stakes applications, ensemble with human review.

📚 Citation

If you use this model in your research or project, please cite:

@misc{distilbert-sentiment-analysis,
  author = {Najaf Ali},
  title = {DistilBERT Fine-Tuned for 3-Class Sentiment Analysis},
  year = {2025},
  publisher = {Hugging Face},
  howpublished = {\url{https://huggingface.co/YOUR_USERNAME/YOUR_MODEL_NAME}},
  note = {Fine-tuned from distilbert-base-uncased}
}

📞 Contact


🙏 Acknowledgements


📜 License

This model is released under the Apache 2.0 License. See the LICENSE file for details.


Last updated: 2025

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

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

GPU в ailist

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

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

Подбираем GPU…

Класс архитектуры
DistilBertForSequenceClassification
Ревизия весов
e8efd11

0 моделей