-
Notifications
You must be signed in to change notification settings - Fork 125
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
When I use the new version, there's some problems. #68
Comments
This is a known issue with huggingface AutoTokenizer. You have to specify a specific tokenizer loading module: from bert_multitask_learning import DynamicBatchSizeParams
params = DynamicBatchSizeParams()
params.transformer_tokenizer_loading = 'BertTokenizer'
# then pass the param to train_bert_multitask This is not a very good solution but does the job for now. |
Thank you. But when I made the prediction, there was another problem. |
Oh, this is a bug that will be triggered when the length of prediction input list is 1. Please try repeating the input list like |
Thank you for the help. I will try again. |
Another question: It is a Joint model of NER and sentence-pair classification. But when I was training the model, it wasn't show NER's accuracy, and from some examples, it didn't do very well. |
Currently, only cls problem supports calculating accuracy. But implementing accuracy for seq_tag shouldn't be too difficult. Contribution is welcomed. You can start here. As for the performance issue, I'll take some time to investigate. I wonder if it is related to huggingface transformers since the top layer is relatively simple. |
Ok, thank U. |
I removed a padding logic which could potentially cause a performance drop for sequence labeling, please install the latest code and give another shot. |
I have added the acc metric to seq_tag problem. BTW, I trained this ner problem for 3 epochs and judging from the results, the model is learning. |
Bravo, the problem has been solved. Thank U. |
Excuse me, I have a problem of sentence-pair classification. When I trained it as a single task, it had a high accuracy rate, but when I trained it as one of multi-task, it had a low accuracy rate, and the accuracy was always 0.8332. I'm puzzled by the result. Do you know the reason? Expect a response, thank you. ---- Multi-task ---- |
'''
WARNING:root:bert_config not exists. will load model from huggingface checkpoint.
Traceback (most recent call last):
File "run_weibo_ner_cws.py", line 31, in
train_bert_multitask(problem='weibo_ner&weibo_cws', params=params, problem_type_dict=problem_type_dict,
File "/data/home/likai/.conda/envs/lkai_tf2/lib/python3.8/site-packages/bert_multitask_learning/run_bert_multitask.py", line 113, in train_bert_multitask
params.assign_problem(problem, gpu=int(num_gpus),
File "/data/home/likai/.conda/envs/lkai_tf2/lib/python3.8/site-packages/bert_multitask_learning/params.py", line 221, in assign_problem
self.prepare_dir(base_dir, dir_name, self.problem_list)
File "/data/home/likai/.conda/envs/lkai_tf2/lib/python3.8/site-packages/bert_multitask_learning/params.py", line 491, in prepare_dir
tokenizer = load_transformer_tokenizer(
File "/data/home/likai/.conda/envs/lkai_tf2/lib/python3.8/site-packages/bert_multitask_learning/utils.py", line 278, in load_transformer_tokenizer
tok = getattr(transformers, load_module_name).from_pretrained(
File "/data/home/likai/.conda/envs/lkai_tf2/lib/python3.8/site-packages/transformers/tokenization_auto.py", line 188, in from_pretrained
config = AutoConfig.from_pretrained(pretrained_model_name_or_path, **kwargs)
File "/data/home/likai/.conda/envs/lkai_tf2/lib/python3.8/site-packages/transformers/configuration_auto.py", line 289, in from_pretrained
raise ValueError(
ValueError: Unrecognized model in models/weibo_cws_weibo_ner_ckpt/tokenizer. Should have a
model_type
key in its config.json, or contain one of the following strings in its name: retribert, t5, mobilebert, distilbert, albert, bert-generation, camembert, xlm-roberta, pegasus, marian, mbart, bart, reformer, longformer, roberta, flaubert, bert, openai-gpt, gpt2, transfo-xl, xlnet, xlm, ctrl, electra, encoder-decoder, funnel, lxmert'''
The file-'config.json' under this path -'models/weibo_cws_weibo_ner_ckpt/tokenizer' is updated each time I run the program, and there is no
model_type
. Do you know what the problem is?Expect a response, thank you.The text was updated successfully, but these errors were encountered: