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

关于bert用于三元组的疑问 #10

Open
lushishuai opened this issue Dec 3, 2019 · 1 comment
Open

关于bert用于三元组的疑问 #10

lushishuai opened this issue Dec 3, 2019 · 1 comment

Comments

@lushishuai
Copy link

作者你好,我有两个疑问想要询问一下。第一个疑问,我之前并没有接触过bert处理三个句子(或者实体),对于您代码中写的for sequence triples:
# tokens: [CLS] Steve Jobs [SEP] founded [SEP] Apple Inc .[SEP]
# type_ids: 0 0 0 0 1 1 0 0 0 0,我想问一下这个是bert模型里边带有的功能吗?。第二个问题,bert预训练的时候其中一个方案是判断句子一和句子二是否衔接。而三元组显然不符合这个逻辑,用这个方法来微调bert是否有些牵强?而且实体词往往比较短,在短实体词上做mask感觉不是很好。期待您的解答,谢谢!

@yao8839836
Copy link
Owner

@lushishuai

你好,三个句子type_ids: 0 0 0 0 1 1 0 0 0 0 不是BERT自带的,是我根据segment id的定义,以及预训练BERT只有两种segment id的现实设计的。

虽然用于三元组与BERT预训练的上下句有不一致之处,但输入很相似,BERT预训练仍然有助于三个句子间关系的推断,且预训练BERT已被成功应用于文本摘要等多句子任务。例如:

Liu, Y. and Lapata, M., 2019, November. Text Summarization with Pretrained Encoders. In Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing and the 9th International Joint Conference on Natural Language Processing (EMNLP-IJCNLP) (pp. 3721-3731).

由于是微调预训练BERT,实体词只参与微调,没有被mask。

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

2 participants