简体   繁体   English

如何为特定领域的代表性学习任务训练一个 bert model?

[英]How can I train a bert model for representational learning task that is domain specific?

I am trying to generate good sentence embeddings for some specific type od texts, using sentence transformer models while testing the the similarity and clustering using kmeans doesnt give good results.我正在尝试为某些特定类型的 od 文本生成良好的句子嵌入,使用句子转换器模型,同时使用 kmeans 测试相似性和聚类并没有给出好的结果。 Any ideas to improve?有什么改进的想法吗? I was thinking of training any of the sentence transformer model on my dataset(which are just sentences but do not have any labels).我正在考虑在我的数据集上训练任何句子转换器 model(它们只是句子但没有任何标签)。 How can i retrain the existing models specifically on ny data to generate better embeddings.如何专门针对 ny 数据重新训练现有模型以生成更好的嵌入。 Thanks.谢谢。

The sentence embeddings produced by pre-trained BERT model are generic and need not be appropriate for all the tasks.由预训练的 BERT model 生成的句子嵌入是通用的,不需要适用于所有任务。

To solve this problem:要解决这个问题:

  1. Fine-tune the model with the task specific corpus on the given task (If the end goal is classification, fine-tune the model for classification task, later you can use the embeddings from the BERT model) (This is the method suggested for the USE embeddings, especially when the model remains a black-box)使用给定任务上的任务特定语料库微调 model(如果最终目标是分类,微调 model 用于分类任务,稍后您可以使用来自 BERT 模型的嵌入)(这是建议的方法使用嵌入,尤其是当 model 仍然是黑盒时)

  2. Fine-tune the model in unsupervised manner using masked language model.使用掩码语言 model 以无监督方式微调 model。 This doesn't require you to know the task before hand, but you can just use the actual BERT training strategy to adapt to your corpus.这不需要你事先知道任务,但你可以使用实际的 BERT 训练策略来适应你的语料库。

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

相关问题 如何使用 Huggingface 使用自定义(原始文本)特定领域数据集训练 BERT? - How to train BERT with custom (raw text) domain-specific dataset using Huggingface? BERT 到 XLNET 火车 model - BERT to XLNET train model 如何将一系列 numpy ndarrays 作为输入数据来训练 tensorflow 机器学习模型? - How can I have a series of numpy ndarrays as the input data to train a tensorflow machine learning model? 我们如何训练深度学习模型以输入任意长度? - How can we train a deep learning model for input of any length? 或者在 pytorch 中训练多任务学习模型 - 权重更新 - Alternatively train multi task learning model in pytorch - weight updating 如何用FastText训练机器学习 model output - How to train machine learning model with FastText output 如何训练 tensorflow deeplab 模型? - How can I train tensorflow deeplab model? 如何提高我的迁移学习 BERT 的 model 的验证和测试的准确性 - How to improve an accuracy of validation and test of my model of Transfer Learning BERT 如何稳定机器学习 model? - How can I stabilize a machine learning model? 如何让 Keras 在特定 GPU 上训练模型? - How do I get Keras to train a model on a specific GPU?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM