Downloads · 30 days
40
0% of all-time downloads
abhilash1910/financial_roberta
financial_roberta is a fill-mask model from abhilash1910. Use it when you need the model to fill a missing word. It is set up for transformers.
This is a Masked Language Model trained with Roberta on a Financial Phrasebank Corpus. The model is built using Huggingface transformers. The model can be found at :FinancialRoberta
Downloads · 30 days
40
0% of all-time downloads
All-time downloads
10.9K
Public
Parameters
86.6M
3.3 GB on disk
Likes
5
Public
Click a slice to open those files.
.h5522 MB · 33%
How the weights are stored.
F3286.6M · 100%
From the Hugging Face model README
This is a Masked Language Model trained with Roberta on a Financial Phrasebank Corpus. The model is built using Huggingface transformers. The model can be found at :Financial_Roberta
The corpus for training is taken from the Financial Phrasebank (Malo et al)[https://www.researchgate.net/publication/251231107_Good_Debt_or_Bad_Debt_Detecting_Semantic_Orientations_in_Economic_Texts].
The model chosen for training is Roberta with the following specifications:
This is trained by using RobertaConfig from transformers package. The model is trained for 10 epochs with a gpu batch size of 64 units.
For using this model, we have to first import AutoTokenizer and AutoModelWithLMHead Modules from transformers After that we have to specify, the pre-trained model,which in this case is 'abhilash1910/financial_roberta' for the tokenizers and the model.
from transformers import AutoTokenizer, AutoModelWithLMHead
tokenizer = AutoTokenizer.from_pretrained("abhilash1910/financial_roberta")
model = AutoModelWithLMHead.from_pretrained("abhilash1910/financial_roberta")
After this the model will be downloaded, it will take some time to download all the model files. For testing the model, we have to import pipeline module from transformers and create a masked output model for inference as follows:
from transformers import pipeline
model_mask = pipeline('fill-mask', model='abhilash1910/inancial_roberta')
model_mask("The company had a <mask> of 20% in 2020.")
Some of the examples are also provided with generic financial statements:
Example 1:
model_mask("The company had a <mask> of 20% in 2020.")
Output:
[{'sequence': '<s>The company had a profit of 20% in 2020.</s>',
'score': 0.023112965747714043,
'token': 421,
'token_str': 'Ġprofit'},
{'sequence': '<s>The company had a loss of 20% in 2020.</s>',
'score': 0.021379893645644188,
'token': 616,
'token_str': 'Ġloss'},
{'sequence': '<s>The company had a year of 20% in 2020.</s>',
'score': 0.0185744296759367,
'token': 443,
'token_str': 'Ġyear'},
{'sequence': '<s>The company had a sales of 20% in 2020.</s>',
'score': 0.018143286928534508,
'token': 428,
'token_str': 'Ġsales'},
{'sequence': '<s>The company had a value of 20% in 2020.</s>',
'score': 0.015319528989493847,
'token': 776,
'token_str': 'Ġvalue'}]
Example 2:
model_mask("The <mask> is listed under NYSE")
Output:
[{'sequence': '<s>The company is listed under NYSE</s>',
'score': 0.1566661298274994,
'token': 359,
'token_str': 'Ġcompany'},
{'sequence': '<s>The total is listed under NYSE</s>',
'score': 0.05542507395148277,
'token': 522,
'token_str': 'Ġtotal'},
{'sequence': '<s>The value is listed under NYSE</s>',
'score': 0.04729423299431801,
'token': 776,
'token_str': 'Ġvalue'},
{'sequence': '<s>The order is listed under NYSE</s>',
'score': 0.02533523552119732,
'token': 798,
'token_str': 'Ġorder'},
{'sequence': '<s>The contract is listed under NYSE</s>',
'score': 0.02087237872183323,
'token': 635,
'token_str': 'Ġcontract'}]
For all resources , please look into the HuggingFace Site and the Repositories.