finbert tone

Provideryiyanghkust
Categorytext-classification
LicenseApache-2.0
Downloads667.8K
Stars0

Overview

FinBERT-Tone is a specialized text-classification model fine-tuned specifically for sentiment analysis within the financial domain. Unlike general-purpose NLP models that often struggle with the nuanced language of markets—where words like 'volatile' or 'bearish' carry specific weights—this model is optimized to categorize financial text into positive, negative, or neutral tones. For developers building algorithmic trading bots, portfolio monitors, or market sentiment dashboards, it provides a reliable way to quantify qualitative data from earnings reports, news feeds, and analyst notes. It integrates easily into standard PyTorch or Hugging Face pipelines, offering a lightweight alternative to LLMs for high-throughput sentiment labeling tasks.

Highlights

  • Domain-specific sentiment analysis for financial texts
  • Optimized for market-specific terminology and nuance
  • Compatible with Hugging Face transformers pipeline
  • Apache-2.0 license for flexible commercial integration
  • Efficient classification of news and earnings reports

Usage

Install
# Install Hugging Face transformers
pip install transformers torch
SDK Usage
# Load model with transformers
from transformers import AutoModel, AutoTokenizer

model = AutoModel.from_pretrained("yiyanghkust/finbert-tone")
tokenizer = AutoTokenizer.from_pretrained("yiyanghkust/finbert-tone")

Hugging Face Download

We recommend downloading the model via the Hugging Face CLI or Hub SDK.

Guidance:Before downloading, install huggingface_hub with:

Guidance
pip install -U huggingface_hub

CLI Download

Download the full repository

Download the full repository
huggingface-cli download yiyanghkust/finbert-tone

Download a single file to a local folder (e.g. config.json into ./dir)

Download a single file to a local folder (e.g. config.json into ./dir)
huggingface-cli download yiyanghkust/finbert-tone config.json --local-dir ./dir

See the official docs for more CLI options

SDK Download

SDK Download
# 模型下载
from huggingface_hub import snapshot_download
model_dir = snapshot_download('yiyanghkust/finbert-tone')

Git Download

Make sure git-lfs is installed first

Git Download
git lfs install
git clone https://huggingface.co/yiyanghkust/finbert-tone

To skip LFS large-file downloads, use:

Skip LFS
GIT_LFS_SKIP_SMUDGE=1 git clone https://huggingface.co/yiyanghkust/finbert-tone

Model files are hosted on the Hugging Face Hub — download directly via HF CLI / SDK / Git, not through this site.

PyTorch / Transformers Usage

Install Transformers

Install Transformers
pip install -U transformers torch

Load the model and run inference

Load the model and run inference
from transformers import AutoModelForCausalLM, AutoTokenizer

model = AutoModelForCausalLM.from_pretrained('yiyanghkust/finbert-tone')
tokenizer = AutoTokenizer.from_pretrained('yiyanghkust/finbert-tone')

Full Documentation

来源: HuggingFace

---
language: "en"
tags:

  • financial-sentiment-analysis

  • sentiment-analysis

widget:
  • text: "growth is strong and we have plenty of liquidity"

---

FinBERT is a BERT model pre-trained on financial communication text. The purpose is to enhance financial NLP research and practice. It is trained on the following three financial communication corpus. The total corpora size is 4.9B tokens.

  • Corporate Reports 10-K & 10-Q: 2.5B tokens

  • Earnings Call Transcripts: 1.3B tokens

  • Analyst Reports: 1.1B tokens

More technical details on FinBERT: Click Link

This released finbert-tone model is the FinBERT model fine-tuned on 10,000 manually annotated (positive, negative, neutral) sentences from analyst reports. This model achieves superior performance on financial tone analysis task. If you are simply interested in using FinBERT for financial tone analysis, give it a try.

If you use the model in your academic work, please cite the following paper:

Huang, Allen H., Hui Wang, and Yi Yang. "FinBERT: A Large Language Model for Extracting Information from Financial Text." *Contemporary Accounting Research* (2022).

How to use

You can use this model with Transformers pipeline for sentiment analysis.
python
from transformers import BertTokenizer, BertForSequenceClassification
from transformers import pipeline

finbert = BertForSequenceClassification.from_pretrained('yiyanghkust/finbert-tone',num_labels=3)
tokenizer = BertTokenizer.from_pretrained('yiyanghkust/finbert-tone')

nlp = pipeline("sentiment-analysis", model=finbert, tokenizer=tokenizer)

sentences = ["there is a shortage of capital, and we need extra financing",
"growth is strong and we have plenty of liquidity",
"there are doubts about our finances",
"profits are flat"]
results = nlp(sentences)
print(results) #LABEL_0: neutral; LABEL_1: positive; LABEL_2: negative

Join our Telegram