为什么我没有完全依赖(Why I was not getting the complete dependency)
我尝试了依赖解析器的在线演示和下载版本。 在线演示的增强依赖关系能够获得准确的结果。 例如,“你能推荐我一部由詹姆斯卡梅隆和莱昂纳多迪卡普里奥执导的电影吗?” 生成以下结果:
root(ROOT-0,推荐-3)aux(推荐-3,Can-1)nsubj(推荐-3,你-2)nsubj(movie-6,me-4)det(movie-6,a-5) xcomp(recommended-3,movie-6)nsubjpass(directed-9,which-7)nsubjpass(acted-14,which-7)(extra)auxpass(directed-9,was-8)acl:relcl(movie-6 ,指导-9)病例(Cameron-12,by-10)化合物(Cameron-12,James-11)nmod:药剂(定向-9,Cameron-12)cc(定向-9和-13)acl:relcl (电影-6,行动-14)(额外)conj:和(定向9,行动-14)案件(DiCaprio-17,by-15)化合物(DiCaprio-17,Leonardo-16)nmod:by(actted- 14,迪卡普里奥-17)
虽然两个动词“指示”和“行动”被几个单词分开,但在线演示能够识别出它们都是指名词“电影”(acl:relcl(movie-6,directed-9), acl:relcl(movie-6,act-14)(额外))。
但是,下面是我从斯坦福大学网站下载的jar文件的结果。 CoreNLP版本是3.6.0:
root(ROOT-0,推荐-3)aux(推荐-3,Can-1)nsubj(推荐-3,你-2)nsubj(movie-7,me-4)det(movie-7,a-5) amod(movie-7,romantic-6)dobj(推荐-3,电影-7)nsubjpass(direct-10,movie-7)ref(movie-7,which-8)auxpass(direct-10,was-9) acl:relcl(movie-7,directed-10)case(Cameron-13,by-11)化合物(Cameron-13,James-12)nmod:agent(direct-10,Cameron-13)cc(Cameron-13,和-14)nmod:agent(定向-10,行为-15)conj:和(Cameron-13,act-15)案例(DiCaprio-18,by-16)化合物(DiCaprio-18,Leonardo-17)nmod: by(acted-15,DiCaprio-18)punct(推荐-3,?-19)
在这种情况下,解析器无法获得依赖项acl:relcl(movie-6,act-14)(额外)。
这是我的构造函数代码:
public CoreNlpParser() { props = new Properties(); props.put("annotators", "tokenize, ssplit, pos, parse, lemma, depparse, ner"); props.setProperty("depparse.extradependencies", "MAXIMAL"); pipeline = new StanfordCoreNLP(props); }
我认为通过将“depparse.extradependencies”设置为“MAXIMAL”,我应该能够获得与在线演示相同的结果。 我缺少什么,我应该如何正确配置注释器? 非常感谢
I tried both the online demo and download version of the dependency parser. The online demo's Enhanced Dependencies was able to get accurate results. For example, "Can you recommend me a movie which was directed by James Cameron and Leonardo DiCaprio?" generated below results:
root ( ROOT-0 , recommend-3 ) aux ( recommend-3 , Can-1 ) nsubj ( recommend-3 , you-2 ) nsubj ( movie-6 , me-4 ) det ( movie-6 , a-5 ) xcomp ( recommend-3 , movie-6 ) nsubjpass ( directed-9 , which-7 ) nsubjpass ( acted-14 , which-7 ) (extra) auxpass ( directed-9 , was-8 ) acl:relcl ( movie-6 , directed-9 ) case ( Cameron-12 , by-10 ) compound ( Cameron-12 , James-11 ) nmod:agent ( directed-9 , Cameron-12 ) cc ( directed-9 , and-13 ) acl:relcl ( movie-6 , acted-14 ) (extra) conj:and ( directed-9 , acted-14 ) case ( DiCaprio-17 , by-15 ) compound ( DiCaprio-17 , Leonardo-16 ) nmod:by ( acted-14 , DiCaprio-17 )
Although the two verb "directed" and "acted" were separated by a few words, the online demo was able to recognize that they were both referring to the noun "movie" (acl:relcl ( movie-6 , directed-9 ), acl:relcl ( movie-6 , acted-14 ) (extra)).
However, below is the result I got with the jar files downloaded from Stanford's website. The CoreNLP version is 3.6.0:
root(ROOT-0, recommend-3) aux(recommend-3, Can-1) nsubj(recommend-3, you-2) nsubj(movie-7, me-4) det(movie-7, a-5) amod(movie-7, romantic-6) dobj(recommend-3, movie-7) nsubjpass(directed-10, movie-7) ref(movie-7, which-8) auxpass(directed-10, was-9) acl:relcl(movie-7, directed-10) case(Cameron-13, by-11) compound(Cameron-13, James-12) nmod:agent(directed-10, Cameron-13) cc(Cameron-13, and-14) nmod:agent(directed-10, acted-15) conj:and(Cameron-13, acted-15) case(DiCaprio-18, by-16) compound(DiCaprio-18, Leonardo-17) nmod:by(acted-15, DiCaprio-18) punct(recommend-3, ?-19)
And in this case, the parser failed to get the dependency acl:relcl ( movie-6 , acted-14 ) (extra).
This is my constructor code:
public CoreNlpParser() { props = new Properties(); props.put("annotators", "tokenize, ssplit, pos, parse, lemma, depparse, ner"); props.setProperty("depparse.extradependencies", "MAXIMAL"); pipeline = new StanfordCoreNLP(props); }
I thought that by setting "depparse.extradependencies" to "MAXIMAL" I should be able to get the same results as the online demo's. What I was missing and how should I properly configure the annotators? Thanks very much
原文:https://stackoverflow.com/questions/36243749
满意答案
相关问答
更多如何用$ form-> populate()和$ form-> isValid()填充自定义的zend_form_element(How to populate a custom zend_form_element with $form->populate() and $form->isValid())
如何清除/删除JavaScript事件处理程序?(How to Clear/Remove JavaScript Event Handler?)
如何使用Javascript动态地将事件处理程序附加到文档元素?(How to attach event handlers to document elements on the fly using Javascript?)
为什么javascript发送元素到我的事件处理程序,当该元素没有事件?(Why is javascript sending an element to my event handler, when that element has no event?)
Javascript事件处理程序还是?(Javascript event handler or?)
Zend Framework,Zend_Form_Element如何设置自定义名称?(Zend Framework, Zend_Form_Element how to set custom name?)
Zend_Form_Element本身的setLabel(setLabel in the Zend_Form_Element itself)
将JavaScript事件处理程序附加到Zend_Form_Element(Attach JavaScript event handler to Zend_Form_Element)
的JavaScript。(Javascript. Is there a way to check inside an event handler which element sent the event? [duplicate])
如何附加事件“ondblclick”,其直接赋值处理程序将“this”作为参数(how to attach event “ondblclick”, whose handler in direct assign take “this” as parameter)
相关文章
更多解决Hadoop mapreduce 包依赖问题
multi-core solr deploy process(not complete)
sbt添加依赖库
[转]Top 20 Programming Lessons I've Learned in 20 Years
Gradle依赖管理详解
multi-core solr deploy process(not complete)
I18n的一个问题
Hadoop的I/O
Hadoop依赖包处理方式
最新问答
更多sp_updatestats是否导致SQL Server 2005中无法访问表?(Does sp_updatestats cause tables to be inaccessible in SQL Server 2005?)
如何创建一个可以与持续运行的服务交互的CLI,类似于MySQL的shell?(How to create a CLI that can interact with a continuously running service, similar to MySQL's shell?)
AESGCM解密失败的MAC(AESGCM decryption failing with MAC)
Zurb Foundation 4 - 嵌套网格对齐问题(Zurb Foundation 4 - Nested grid alignment issues)
湖北京山哪里有修平板计算机的
SimplePie问题(SimplePie Problem)
在不同的任务中,我们可以同时使用多少“上下文”?(How many 'context' we can use at a time simultaneously in different tasks?)
HTML / Javascript:从子目录启用文件夹访问(HTML/Javascript: Enabling folder access from a subdirectory)
为什么我会收到链接错误?(Why do I get a linker error?)
如何正确定义析构函数(How to properly define destructor)
Copyright ©2023 peixunduo.com All Rights Reserved.粤ICP备14003112号
本站部分内容来源于互联网,仅供学习和参考使用,请莫用于商业用途。如有侵犯你的版权,请联系我们(neng862121861#163.com),本站将尽快处理。谢谢合作!