/ Модель

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

Контекст
512 токенов
Параметры
77,5 млн
Лицензия
Apache 2.0
Архитектура
deberta-v2 · dense
Базовая модель
deberta-v3-xsmall
Опубликована
4 окт 2024

deberta-v3-xsmall-tweet-sentiment

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

Компактная англоязычная DeBERTa-v3-модель оценивает тональность твитов непрерывной шкалой от негативной до позитивной.

112скачиваний за 30 дней0лайковвеса обновлены4 окт 2024

Бенчмарки

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

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

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

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

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

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

agentlans/deberta-v3-xsmall-tweet-sentiment — англоязычная модель анализа тональности коротких сообщений, разработанная на основе DeBERTa-v3 xsmall и дообученная для регрессии тональности твитов. Она принимает текст и выдаёт непрерывную оценку: отрицательное значение соответствует негативной тональности, ноль — нейтральной, положительное значение — позитивной; абсолютная величина оценки отражает её выраженность. Модель содержит 77,5 млн параметров, использует архитектуру DeBERTa-v2 для классификации последовательностей и рассчитана на контекст до 512 токенов.

Модель предназначена для оценки тональности англоязычных твитов и коротких сообщений. Она обучена на твитах, опубликованных с сентября 2009 по январь 2010 года; оценки для обучающих данных получены из метаанализа десяти классификаторов тональности с использованием метода главных компонент. На тестировании для варианта xsmall указана RMSE 0,2560.

Модель может хуже работать с сарказмом, тонкими нюансами и текстами за пределами жанра твитов; она не учитывает контекст за пределами отдельного сообщения. Данные обучения отражают демографию пользователей Twitter и условия указанного периода. Лицензия — Apache 2.0.

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

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

Ограничения

Обучена на англоязычных твитах 2009–2010 годов и может хуже обобщать на другие жанры; сарказм и тонкие нюансы тональности могут распознаваться ненадёжно. Модель анализирует отдельное сообщение без более широкого контекста.

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

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

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

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

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

Открыть на Hugging Face

DeBERTa-v3 Twitter Sentiment Models

This page contains one of two DeBERTa-v3 models (xsmall and base) fine-tuned for Twitter sentiment regression.

Model Details

  • Model Architecture: DeBERTa-v3
  • Variants:
    • xsmall
    • base
  • Task: Sentiment regression
  • Language: English
  • License: Apache 2.0

Intended Use

These models are designed for fine-grained sentiment analysis of English tweets. They output a continuous sentiment score rather than discrete categories.

  • negative score means negative sentiment
  • zero score means neutral sentiment
  • positive score means positive sentiment
  • the absolute value of the score represents how strong that sentiment is

Training Data

The models were fine-tuned on a dataset of English tweets collected between September 2009 and January 2010. The sentiment scores were derived from a meta-analysis of 10 different sentiment classifiers using principal component analysis. Find the dataset at agentlans/twitter-sentiment-meta-analysis.

How to use

from transformers import AutoTokenizer, AutoModelForSequenceClassification
import torch

model_name="agentlans/deberta-v3-xsmall-tweet-sentiment"

# Put model on GPU or else CPU
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForSequenceClassification.from_pretrained(model_name)
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
model = model.to(device)

def sentiment(text):
    """Processes the text using the model and returns its logits.
    In this case, it's interpreted as the sentiment score for that text."""
    inputs = tokenizer(text, return_tensors="pt", truncation=True, padding=True).to(device)
    with torch.no_grad():
        logits = model(**inputs).logits.squeeze().cpu()
    return logits.tolist()

# Example usage
text = [x.strip() for x in """
    I absolutely despise this product and regret ever purchasing it.
    The service at that restaurant was terrible and ruined our entire evening.
    I'm feeling a bit under the weather today, but it's not too bad.
    The weather is quite average today, neither good nor bad.
    The movie was okay, I didn't love it but I didn't hate it either.
    I'm looking forward to the weekend, it should be nice to relax.
    This new coffee shop has a really pleasant atmosphere and friendly staff.
    I'm thrilled with my new job and the opportunities it presents!
    The concert last night was absolutely incredible, easily the best I've ever seen.
    I'm overjoyed and grateful for all the love and support from my friends and family.
""".strip().split("\n")]

for x, s in zip(text, sentiment(text)):
    print(f"Text: {x}\nSentiment: {round(s, 2)}\n")

Output:

Text: I absolutely despise this product and regret ever purchasing it.
Sentiment: -2.28

Text: The service at that restaurant was terrible and ruined our entire evening.
Sentiment: -2.38

Text: I'm feeling a bit under the weather today, but it's not too bad.
Sentiment: 0.25

Text: The weather is quite average today, neither good nor bad.
Sentiment: -0.14

Text: The movie was okay, I didn't love it but I didn't hate it either.
Sentiment: 0.06

Text: I'm looking forward to the weekend, it should be nice to relax.
Sentiment: 2.06

Text: This new coffee shop has a really pleasant atmosphere and friendly staff.
Sentiment: 2.48

Text: I'm thrilled with my new job and the opportunities it presents!
Sentiment: 2.66

Text: The concert last night was absolutely incredible, easily the best I've ever seen.
Sentiment: 2.68

Text: I'm overjoyed and grateful for all the love and support from my friends and family.
Sentiment: 2.65

Performance

Evaluation set RMSE:

  • xsmall: 0.2560
  • base: 0.1938

Limitations

  • English language only
  • Trained specifically on tweets, may or may not generalize well to other text types
  • Lack of broader context beyond individual tweets
  • May struggle with detecting sarcasm or nuanced sentiment

Ethical Considerations

  • Potential biases in the training data related to the time period and Twitter user demographics
  • Risk of misuse for large-scale sentiment monitoring without consent

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

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

GPU в ailist

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

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

Подбираем GPU…

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

0 моделей