Update README.md
This commit is contained in:
parent
ea0b7e7feb
commit
07a4cbb4aa
22
README.md
22
README.md
|
@ -5,4 +5,24 @@
|
|||
|
||||
More details on `FinBERT`: [Click Link](https://github.com/yya518/FinBERT)
|
||||
|
||||
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.
|
||||
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.
|
||||
|
||||
# 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)
|
||||
|
||||
```
|
Loading…
Reference in New Issue