Views
No views yet
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.FinBERT: Click Linkfinbert-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.1from transformers import BertTokenizer, BertForSequenceClassification
2from transformers import pipeline
3
4finbert = BertForSequenceClassification.from_pretrained('yiyanghkust/finbert-tone',num_labels=3)
5tokenizer = BertTokenizer.from_pretrained('yiyanghkust/finbert-tone')
6
7nlp = pipeline("sentiment-analysis", model=finbert, tokenizer=tokenizer)
8
9sentences = ["there is a shortage of capital, and we need extra financing",
10 "growth is strong and we have plenty of liquidity",
11 "there are doubts about our finances",
12 "profits are flat"]
13results = nlp(sentences)
14print(results) #LABEL_0: neutral; LABEL_1: positive; LABEL_2: negative
15