ahmedrachid commited on
Commit
84248c3
1 Parent(s): 131a54d

Create README.md

Browse files
Files changed (1) hide show
  1. README.md +29 -0
README.md ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language: en
3
+ widget:
4
+ - text: Operating profit rose to EUR 13.1 mn from EUR 8.7 mn in the corresponding period in 2007 representing 7.7 % of net sales.
5
+ - text: Bids or offers include at least 1,000 shares and the value of the shares must correspond to at least EUR 4,000.
6
+ - text: Raute reported a loss per share of EUR 0.86 for the first half of 2009 , against EPS of EUR 0.74 in the corresponding period of 2008.
7
+ ---
8
+ **FinancialBERT** is a BERT model pre-trained on a large corpora of financial texts. The purpose is to enhance financial NLP research and practice in financial domain, we hope financial practitioners and researchers can benefit from our model without the necessity of the significant computational resources required to train the model.
9
+
10
+ We fine-tuned our model on Sentiment Analysis task using FinancialPhraseBank dataset, experiments show that FinancialBERT outperforms the general BERT and other financial domain-specific models.
11
+
12
+ # How to use
13
+ Our model can be used thanks to Transformers pipeline for sentiment analysis.
14
+ ```python
15
+ from transformers import BertTokenizer, BertForSequenceClassification
16
+ from transformers import pipeline
17
+
18
+ finbert = BertForSequenceClassification.from_pretrained("ahmedrachid/FinancialBERT-Sentiment-Analysis",num_labels=3)
19
+ tokenizer = BertTokenizer.from_pretrained("ahmedrachid/FinancialBERT-Sentiment-Analysis")
20
+
21
+ nlp = pipeline("sentiment-analysis", model=finbert, tokenizer=tokenizer)
22
+
23
+ sentences = ["Operating profit rose to EUR 13.1 mn from EUR 8.7 mn in the corresponding period in 2007 representing 7.7 % of net sales.",
24
+ "Bids or offers include at least 1,000 shares and the value of the shares must correspond to at least EUR 4,000.",
25
+ "Raute reported a loss per share of EUR 0.86 for the first half of 2009 , against EPS of EUR 0.74 in the corresponding period of 2008.",
26
+ ]
27
+ results = nlp(sentences)
28
+ print(results)
29
+ ```