yiyanghkust/finbert-tone

text classificationtransformersentransformerspytorchtftext-classificationfinancial-sentiment-analysissentiment-analysis
944.0K

How to use

You can use this model with Transformers pipeline for sentiment analysis.

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

DEPLOY IN 60 SECONDS

Run finbert-tone on Runcrate

Deploy on H100, A100, or RTX GPUs. Pay only for what you use. No setup required.