简体   繁体   English

如何在另一个数据集上微调我训练的 model (bert)

[英]How Fine-tuned my trained model (bert) on another dataset

*** I used a pretrained BertModel to fine-tune model on squadv1 then fine-tune result model to final model. *** 我使用预训练的 BertModel 对小队 v1 上的 model 进行微调,然后将结果 model 微调为最终的 model。

This how I can load my trined model on squadv1这就是我如何在squadv1上加载我的经过优化的model

output_dir="mybert_squadv1/checkpoint-60000/"
model = AutoModelForQuestionAnswering.from_pretrained(output_dir)
tokenizer = AutoTokenizer.from_pretrained(output_dir, do_lower_case=do_lower_case)

after I loaded my model on a dataset, I want to fine-tune this model on another dataset.在一个数据集上加载我的 model 后,我想在另一个数据集上微调这个 model。 Let say squadv3 Can I do that or not?比方说squadv3 我可以这样做吗? if so, how i can do it?如果是这样,我该怎么做?

you just get the tokenizer.您只需获得标记器。 After that,you should add your own Neural Networks after that and loss function.之后,您应该添加自己的神经网络并丢失 function。 you can see how to train a normal network.你可以看到如何训练一个正常的网络。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何使用微调的 BERT model 进行句子编码? - How to use fine-tuned BERT model for sentence encoding? 保存“微调”的 bert 模型 - Saving a 'fine-tuned' bert model 在预训练的 BERT 上进行微调后如何导出/保存文本分类器 - How to export/save a text classifier after fine-tuned on a pre-trained BERT 将 LIME 解释应用到我为序列分类模型微调的 BERT 上? - Applying LIME interpretation on my fine-tuned BERT for sequence classification model? 如何使用预训练模型进行文本分类?比较经过微调的 model 与未经微调的预训练 model - How to use pre-trained models for text classification?Comparing a fine-tuned model with a pre-trained model without fine-tuning 我们如何将字符串列表传递给经过微调的 bert model? - How can we pass a list of strings to a fine tuned bert model? 如何在重新加载后在拥抱脸中使用微调的 model 进行实际预测? - How to use fine-tuned model in huggingface for actual prediction after re-loading? 在 Docker 容器中加载微调的 simpletransformer model 时出错 - Error while loading fine-tuned simpletransformer model in Docker Container 如何获得微调的 TFBertModel 的隐藏状态? - How to get the hidden states of a fine-tuned TFBertModel? 如何从检查点文件加载经过微调的 pytorch huggingface bert model? - How to load a fine tuned pytorch huggingface bert model from a checkpoint file?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM