yya518 / finbert Goto Github PK
View Code? Open in Web Editor NEWA Pretrained BERT Model for Financial Communications. https://arxiv.org/abs/2006.08097
License: Apache License 2.0
A Pretrained BERT Model for Financial Communications. https://arxiv.org/abs/2006.08097
License: Apache License 2.0
Do you have a ONNX format available? My environment is ML.Net and DON’T want to go through the full conversion process and setting up the environment..
how can i get the probability scores of all three categories?
Hi,
Can you please explain the steps in pre-processing the data since the company filings have tables, etc.?
Thanks!
first, I really appreciate this model.
In my environment CUDA is available, but if i run the model, the process will die since using only CPU.
Is there a separate setting method for using CUDA?
Thank you again for this model.
when running model.load_state_dict(torch.load(fine_tuned_weight_path, map_location=device))
from FinBert Model Example.ipynb
from my local machine, I ran into this error:
RuntimeError: Error(s) in loading state_dict for BertClassification:
Missing key(s) in state_dict: "bert.embeddings.position_ids".
Thank you for providing us with your trained model! I finally have the fine-tuned model working on my machine. But after struggling for a long time, here are some notes that may help future users who like me have little experience with these types of models.
In working through your example for using the fine-tuned FinBERT, I had issues installing torch==1.2.0 until I first ran pip install pytorch-pretrained-bert
, which did the installation of torch for me and eliminated that issue.
I do not have a CUDA compatible GPU and so had to change device='cuda:1'
to device='cpu'
. I then needed to add map_location=device
or map_location='cpu'
when running model.load_state_dict(torch.load(fine_tuned_weight_path,map_location=device))
.
These are rather simple changes, but they held me up for some time.
I might be missing something, but it seems there is a mis-match between the label ordering when preparing the training data v.s. when doing the inference in the provided jupyter notebook.
In the 'datasets.py' file, in the 'transform_labels' method, the order is: "dict_labels = {'positive': 0, 'neutral':1, 'negative':2}"
But in the notebook: "labels = {0:'neutral', 1:'positive', 2:'negative'}"
In both cases, 'negative'=2, but 'positive' and 'neutral' are switched.
Is there a reason I am missing?
Thank you!
I have created my own sentence "there is a abundance of capital because of good profits" to test the sentiment prediction for the fine-tuned model using the notebook given: "FinBert Model Example.ipynb".
When I ran for the first time I got the result as 'positive': https://prnt.sc/vf3fnb
When I ran for the second time I got the result as 'neutral': https://prnt.sc/vf3fcr
Why is this variation happening? How can we trust the results from this model if it is not stable?
It says positive for: "This is the worst stock market of the world."
I am using your sentiment model to predict sentences from calls. There are two sentences:
I am trying to understand why it gives quite different labels. Initially I thought it was the label confusion, but you have answered the question in Issue #17.
Could you explain more about how you fine-tuning the model for analyst tones and what date you use for the classification model? Thank you!
Are there any plans on migrating the current model to the newer transformers library by hugging face? I want to use it with the sentence-transformer library but it seems like it can only run with the newer transformer model.
HI,
Congrats for the wonderful work.
I would much appreciate if you would construct a prediction script which could work like this:
python bert_prediction.py --input "Sentence for classification" -- weights (path to weights)
Hi!
Thank you for this repository.
Do you know where I can find the Analyst Tone dataset that you mention in the paper?
Thank you,
Maxime.
Greatly appreciated if you can share the file analysttone.csv , used on Finetuning.
Jorge
Interested in whether you would provide the 3 pieces of corpora used for pretraining FinBERT.
Thanks in advance:)
My collaborators and I were experimenting with FinBERT by comparing the results of your code from the Finbert Model Example notebook to the results of using the transformer code in a HuggingFace pipeline. of the 7 we tested it on, all came out with different scores, but 3 came out with different labels altogether. We were wondering if you knew what the reason for that might be? I can upload the code that we used if that would be helpful.
Thank you for the great library.
I went through example and there are only labels, i.e. positive, neutral and negative for the text's sentiment. I'm wondering if there's any score or probability deciding what text is positive, neutral or negative?
I was looking in attributes, i.e. dir(outputs)
or dir(tourch)
but did not find any such value, which would be indeed useful to know.
You forgot to add num2word in the requirements.txt file.
This is a really interesting project.
Can you please provide a version of the analysttone.csv file? The NB will not run without it.
At a minimum provide a specification and a few hundred examples.
Thank you.
Richard
Hello,
Will you be generating a TF version of this model? I will need it to import on SparkNLP.
I'm parsing conference calls and run into this error a couple of times. I used NLTK to parse the text components into sentences and then pass those sentences into the classifier following your example. It largely works, but I ran into this issue. From what I read, it arises because there are too many tokens (words) in the sentence. I manually inspect where I think the issue is occurring to identify a piece that is extra long. It occurs when there is a lot of semi-colons. So I could break up sentences with semi-colons, but that doesn't seem quite right. Using word_tokenize
from nltk
, there are only 488 tokens. How do you tokenize the words? I'm thinking I will truncate the sentence before passing to the model, but to do so accurately, I need to know how many tokens are created by the model.
Is my assessment of why this is happening correct and do you have a better solution than truncating? Thanks.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.