Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Follow-up question #2

Open
wanghuijia326 opened this issue Jan 2, 2020 · 7 comments
Open

Follow-up question #2

wanghuijia326 opened this issue Jan 2, 2020 · 7 comments

Comments

@wanghuijia326
Copy link

Thank you for your help, I successfully ran the program with my own data.
I would like to ask, is your bert original or is it pre-trained with tweet data in the target domain?
If it was pre-trained with tweet data in the later stage, can you probably tell me how to train?

@JRC1995
Copy link
Owner

JRC1995 commented Jan 2, 2020

It's the original pre-trained bert (the multilinguial one) pre-trained by Google on wikipedia and stuff. I didn't pre-train it further with Tweet Data though someday I might.

I have a demo code here: https://github.com/JRC1995/BERT-Disaster-Classification-Capsule-Routing/tree/master/MLM for pre-training with the main Masked LM objective. It's a just a toy code that kind of implements the essence of MLM training with HuggingFace's library - so you have to extend that for full blown pre-training. The demo code is mostly based on Huggingface's documentations.
There may be better resources and examples for MLM-pre-training (there are also other multi-task objectives that can it can be trained on).

@wanghuijia326
Copy link
Author

For the same corpus, training and testing with the BERT_capsule model are normal, but replaced with the BERT_capsule_BiLSTM_attn model,the F1,P,R of training/test is zero.
I don’t know what the reason is, can you provide me with a solution?

@JRC1995
Copy link
Owner

JRC1995 commented Jan 6, 2020

That's strange. I don't know why. Is the only thing you changed is the model? What is the binary/multi accuracy? And what about the cross entropy loss during training? Are they normal or something strange in it? You can try to debug by print out inside the respective functions to see what is happening. It may be possible that all your samples are being ignored for some reason. Are both binary and multi-F1 zero? I suspect multi-F1. If you are doing binary classification only, you should ignore multi-precision, multi-recall, multi-F1.

@zhangshuai19971210
Copy link

The operation was unsuccessful and could not be downloaded from the Pre_trained_BERT file. There is no JSON file in the Pre_trained_BERT file. Has the file been modified?

@JRC1995
Copy link
Owner

JRC1995 commented Jun 24, 2022

Did you locally saved BERT beforehand?:
https://github.com/JRC1995/BERT-Disaster-Classification-Capsule-Routing#saving-multilingual-bert
https://github.com/JRC1995/BERT-Disaster-Classification-Capsule-Routing/blob/master/Classification/Save_pre_trained_locally.py

If so, could be due to version mismatch issues. You can also try running it in an environment with a older huggingface code (the one in the readme, for example).

@zhangshuai19971210
Copy link

We couldn't connect to 'https://huggingface.co' to load this model, couldn't find it in the cached files and it looks like ../Pre_trained_BERT/ is not the path to a directory containing a {configuration_file} file.
Checkout your internet connection or see how to run the library in offline mode at 'https://huggingface.co/docs/transformers/installation#offline-mode'.
I ran on my data and this error occurred. The model has been downloaded locally.

@JRC1995
Copy link
Owner

JRC1995 commented Jun 27, 2022 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants