/ Модель

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

Контекст
514 токенов
Параметры
454 млн
Лицензия
MIT
Архитектура
roberta · dense
Базовая модель
FinTwitRoBERTa-large
Библиотека
transformers
Опубликована
24 окт 2026

FinTwitRoBERTa-sentiment

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

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

879скачиваний за 30 дней2лайкавеса обновлены30 окт 2026

Бенчмарки

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

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

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

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

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

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

FinTwitRoBERTa-sentiment — англоязычная модель Stephan Akkerman для классификации тональности финансовых сообщений в Twitter и других социальных сетях. Это RoBERTa-large с 454,1 млн параметров, дообученная на FinTwitRoBERTa-large; она присваивает тексту одну из меток: NEUTRAL, BULLISH или BEARISH. Контекст модели — 514 токенов, для обучения использовалась максимальная длина 128 токенов.

Модель предназначена для анализа лент о фондовом рынке и криптовалютах, включая разговорные финансовые тексты. Она учитывает, что фактические новости, вопросы и оповещения о ценах часто нейтральны; для цитируемых сообщений следует классифицировать собственный текст автора. На отложенном тесте из 1 237 сообщений указаны macro F1 0,891 и accuracy 0,906. Пороговые значения для bullish и bearish можно применять, если важнее точность этих классов, хотя это снижает полноту.

Доступны веса Safetensors и вариант ONNX с динамической квантованием int8 для ускорения CPU-инференса; последний занимает меньше места, но немного уступает исходной версии на приведённых dev- и test-оценках. Модель распространяется по лицензии MIT. Результаты оценки относятся к финансовым сообщениям из описанных в карточке наборов данных и не гарантируют такого же качества для других источников или типов текстов.

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

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

Ограничения

Модель рассчитана на англоязычные финансовые сообщения в социальных сетях, а приведённая оценка относится к конкретным наборам твитов и может не переноситься на другие источники. Пороговые значения повышают точность определения bullish и bearish ценой снижения полноты; квантованная int8-версия немного уступает исходной по приведённым оценкам.

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

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

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

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

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

Открыть на Hugging Face

FinTwitRoBERTa-sentiment

FinTwitRoBERTa-sentiment is a fine-tuned model for classifying the sentiment of financial tweets as bullish, bearish or neutral. It uses FinTwitRoBERTa-large as a base model, a RoBERTa-large model (355M parameters) pre-trained on millions of financial tweets. This approach ensures that FinTwitRoBERTa-sentiment has seen enough financial tweets, which have an informal nature, compared to other financial texts, such as news headlines. Therefore this model performs great on informal financial texts, seen on social media. It is the successor of FinTwitBERT-sentiment.

Intended Uses

FinTwitRoBERTa-sentiment is intended for classifying financial tweets or other financial social media texts, such as a feed of tweets about stocks and crypto. A tweet is bullish or bearish only when its author expresses an expectation or position; facts, news, questions and price alerts are neutral, which is most of a typical feed. The sentiment is that of the tweet's own text: for a quote tweet, classify the new text without the quoted tweet.

Dataset

FinTwitRoBERTa-sentiment has been trained on human-labeled financial tweets from two datasets:

  • TimKoornstra/financial-tweets-sentiment: 24,373 human-labeled tweets after cleaning. The sources without a neutral class or with inconsistent labels were left out, and the bullish and bearish tweets of the other sources were relabeled by hand with one labeling guideline (most became neutral, since they state facts or news rather than an opinion).
  • 1,500 tweets from StephanAkkerman/financial-tweets, posted from 2024 onwards, picked where an earlier model was least sure and labeled with the same guideline (data/train/feed_v1.csv)

In total 23,435 tweets for training and 2,438 for validation. The tweets of our dev and test sets were removed from the training data.

Model Details

  • Base model: FinTwitRoBERTa-large, a RoBERTa-large model (355M parameters) pre-trained on millions of financial tweets.
  • Labels: NEUTRAL, BULLISH, BEARISH.
  • Training: 2 epochs, learning rate 2e-05 with 10% warmup and layer-wise learning-rate decay of 0.9, weight decay 0.01, batch size 32, maximum length 128 tokens, seed 42. The checkpoint with the best validation F1 (2,438 tweets held out from the training sources) is kept. The recipe (llrd-0.9-feed in experiments.json) was chosen out of a grid of learning rates, epochs, class weights, label smoothing and layer-wise decay by its macro F1 on the dev set.
  • Calibration: config.calibration_temperature = 1.046, fitted on the dev set. Divide the logits by it before the softmax to get confidence scores that match how often the model is right.

Evaluation

The test set has 1,237 tweets from a real financial Twitter feed (first seen from August 2023 onwards) and the dev set 749 tweets from the same feed (2024 onwards), labeled with the same guideline. Neither was used for training; the dev set was used to choose the recipe and fit the temperature. The 95% bootstrap interval of the test macro F1 is 0.871–0.910. For comparison, FinTwitBERT-sentiment scores a macro F1 of 0.565 on the same test set.

MetricTest (1,237 tweets)Dev (749 tweets)
Macro F10.8910.826
Accuracy0.9060.887
Bullish precision0.8840.789
Bullish recall0.9030.783
Bearish precision0.9380.836
Bearish recall0.7870.708
Neutral recall0.9340.935
Calibration error (ECE)0.0170.033

More Information

For a comprehensive overview, including the training setup and analysis of the model, visit the ModernFinTwitBERT GitHub repository.

Usage

Using HuggingFace's transformers library the model and tokenizers can be converted into a pipeline for text classification.

from transformers import pipeline

# Create a sentiment analysis pipeline
pipe = pipeline(
    "sentiment-analysis",
    model="StephanAkkerman/FinTwitRoBERTa-sentiment",
)

# Get the predicted sentiment
print(pipe("Nice 9% pre market move for $para, pump my calls Uncle Buffett 🤑"))

The model was trained on tweets with links replaced by [URL] and user mentions by @USER, so do the same for the best results. The pipeline's scores are not calibrated; for confidence scores, divide the logits by config.calibration_temperature:

import torch
from transformers import AutoModelForSequenceClassification, AutoTokenizer

tokenizer = AutoTokenizer.from_pretrained("StephanAkkerman/FinTwitRoBERTa-sentiment")
model = AutoModelForSequenceClassification.from_pretrained("StephanAkkerman/FinTwitRoBERTa-sentiment").eval()

inputs = tokenizer(["$NVDA breaking out, loading calls"], return_tensors="pt", truncation=True)
with torch.no_grad():
    logits = model(**inputs).logits
probs = (logits / model.config.calibration_temperature).softmax(-1)
print({model.config.id2label[i]: p for i, p in enumerate(probs[0].tolist())})

Decision thresholds

config.decision_thresholds = {"bullish": 0.8, "bearish": 0.86}, tuned on the dev set for precision >= 0.9. Call a tweet bullish or bearish only when its calibrated probability for that class reaches the threshold, otherwise neutral:

label = model.config.id2label[int(probs[0].argmax())].lower()
if label != "neutral" and probs[0].max() < model.config.decision_thresholds[label]:
    label = "neutral"
splitsettingmacro_f1bullish_callsbullish_precisionbullish_recallbearish_callsbearish_precisionbearish_recall
devargmax0.8261420.7890.783550.8360.708
devthresholds0.7631020.9120.65330.9090.462
testargmax0.8913880.8840.9031300.9380.787
testthresholds0.8513250.9540.816980.990.626

ONNX int8

onnx/model_int8.onnx is this model with int8 weights (dynamic per-channel quantization of all linear layers and the embeddings) for fast CPU inference, for example on a Raspberry Pi. It needs only onnxruntime and tokenizers, no torch:

fp32 (PyTorch)int8 (ONNX)
size1,421 MB358 MB
ms per tweet (batch 1, 8 CPU threads)9719
import json

import numpy as np
import onnxruntime as ort
from huggingface_hub import hf_hub_download
from tokenizers import Tokenizer

repo = "StephanAkkerman/FinTwitRoBERTa-sentiment"
config = json.loads(open(hf_hub_download(repo, "config.json")).read())
session = ort.InferenceSession(hf_hub_download(repo, "onnx/model_int8.onnx"))
tokenizer = Tokenizer.from_file(hf_hub_download(repo, "tokenizer.json"))
tokenizer.enable_truncation(128)
tokenizer.enable_padding(pad_id=1)

encodings = tokenizer.encode_batch(["$NVDA breaking out, loading calls"])
logits = session.run(None, {
    "input_ids": np.array([e.ids for e in encodings], dtype=np.int64),
    "attention_mask": np.array([e.attention_mask for e in encodings], dtype=np.int64),
})[0] / config["calibration_temperature"]
probs = np.exp(logits) / np.exp(logits).sum(-1, keepdims=True)  # NEUTRAL, BULLISH, BEARISH

Apply config.decision_thresholds to probs the same way as for the PyTorch model. ModernFinTwitBERT's onnx_predict.OnnxSentiment does all of this, including the training preprocessing (@USER, [URL]). Scores on the same dev and test sets; same_label_as_fp32 is how often both models give the same argmax label:

splitmodelsettingmacro_f1bullish_callsbullish_precisionbullish_recallbearish_callsbearish_precisionbearish_recallsame_label_as_fp32
devfp32argmax0.8261420.7890.783550.8360.7080.979
devint8argmax0.8181390.7990.776560.8040.6920.979
devfp32thresholds0.7631020.9120.65330.9090.4620.979
devint8thresholds0.76980.9180.629320.9380.4620.979
testfp32argmax0.8913880.8840.9031300.9380.7870.989
testint8argmax0.8923830.8960.9031330.9250.7940.989
testfp32thresholds0.8513250.9540.816980.990.6260.989
testint8thresholds0.8443210.9560.808950.9890.6060.989

Citing & Authors

If you use FinTwitRoBERTa-sentiment or FinTwitRoBERTa-large in your research, please cite me as follows:

@misc{FinTwitRoBERTalarge,
  author = {Stephan Akkerman},
  title = {FinTwitRoBERTa-large},
  year = {2026},
  publisher = {GitHub},
  journal = {GitHub repository},
  howpublished = {\url{https://github.com/StephanAkkerman/ModernFinTwitBERT}}
}

Additionally, if you utilize the sentiment classifier, please cite:

@misc{FinTwitRoBERTasentiment,
  author = {Stephan Akkerman},
  title = {FinTwitRoBERTa-sentiment: A Sentiment Classifier for Financial Tweets},
  year = {2026},
  publisher = {Hugging Face},
  howpublished = {\url{https://huggingface.co/StephanAkkerman/FinTwitRoBERTa-sentiment}}
}

License

This project is licensed under the MIT License. See the LICENSE file for details.

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

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

GPU в ailist

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

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

Подбираем GPU…

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

0 моделей