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

关于relation_extraction例子中的反例样本 #23

Open
lan2720 opened this issue Nov 4, 2019 · 2 comments
Open

关于relation_extraction例子中的反例样本 #23

lan2720 opened this issue Nov 4, 2019 · 2 comments

Comments

@lan2720
Copy link

lan2720 commented Nov 4, 2019

苏神你好,在relation_extraction那个例子中有一行是random.choice选择主语: https://github.com/bojone/bert_in_keras/blob/master/relation_extract.py#L171
这里k1随机出来之后,其实对应k1的正确k2就有了,但是k2你也是随机选出来的,这使得k2有可能选对,也有可能选错,选错的话就会在下面for j in items.get((k1, k2), []):时为[],o1和o2都是全0的,当前错误的subject没有对应的object和predicate。这里是为了加入反例训练样本吗?这种做法有什么reference也是这样吗?不是很了解这块,希望向您请教下~

@lan2720 lan2720 changed the title 关于relation_extraction例子中的细节 关于relation_extraction例子中的反例样本 Nov 4, 2019
@hqsh
Copy link

hqsh commented Jun 3, 2020

苏神你好,在relation_extraction那个例子中有一行是random.choice选择主语: https://github.com/bojone/bert_in_keras/blob/master/relation_extract.py#L171
这里k1随机出来之后,其实对应k1的正确k2就有了,但是k2你也是随机选出来的,这使得k2有可能选对,也有可能选错,选错的话就会在下面for j in items.get((k1, k2), []):时为[],o1和o2都是全0的,当前错误的subject没有对应的object和predicate。这里是为了加入反例训练样本吗?这种做法有什么reference也是这样吗?不是很了解这块,希望向您请教下~

我这两天也在学习这个代码,也注意到了,但不太理解这么做的原因,不知您现在了解了吗,讨教一下?谢谢!

@bufeibufei
Copy link

我这两天也在学习这个代码,同求这样做的原因,谢谢!

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