-
Notifications
You must be signed in to change notification settings - Fork 55
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
Allennlp预测SRL结果不一致 #12
Comments
这个预测结果似乎模型没有有效执行,印象中没有正确识别动词的话会出现全空的情况。 |
两个版本均是一样的结果,这只是其中的一个样本,无法正确的预测类似do、is、was、were等类型的系动词或者辅助动词,但是对于其他的动词,结果感觉还是挺好的,稍后我会将具体的流程提供以便复现 |
AllenNLP的动词是通过spacy识别的。确认下你现在用的是之前的ELMo模型还是BERT? allennlp基于BERT的demo的确也识别不了类似动词(https://demo.allennlp.org/semantic-role-labeling)。 Related Issue: allenai/allennlp#4146 |
pytorch版本为1.5.0 |
复现: 或者 sentence = "yeah i know and i did that all through college and it worked too" 样本结果: |
我试了下不同spacy的版本在给出verb标签的时候有些区别,可能导致了SRL模型对谓词的识别问题。可以换成早期的spacy的版本(如2.0.18,并重新安装python -m spacy download en_core_web_sm) 测试样例:
以下是具体的输出对比: spacy 2.0.18 ['The', 'new', 'rights', 'are', 'nice', 'enough'] spacy 2.2.4 ['yeah', 'i', 'know', 'and', 'i', 'did', 'that', 'all', 'through', 'college', 'and', 'it', 'worked', 'too'] |
非常感谢您的帮助,此问题已解决,谢谢 |
您好,当我直接使用原始数据进行SRL预测时,所得到的结果与您提供的测试样本不一致
如 The new rights are nice enough
样本测试所给的结果是 {"verbs": [{"verb": "are", "description": "[ARG1: The new rights] [V: are] [ARG2: nice enough]", "tags": ["B-ARG1", "I-ARG1", "I-ARG1", "B-V", "B-ARG2", "I-ARG2"]}], "words": ["The", "new", "rights", "are", "nice", "enough"]}
而allennlp预测出来的结果是 [{'verbs': [], 'words': ['The', 'new', 'rights', 'are', 'nice', 'enough']}]
allennlp 0.8.1 allennlp-models=1.0.0
也测试过 allennlp 1.0.0 allennlp-models=1.0.0
The text was updated successfully, but these errors were encountered: