CoreNLP Server为所有依赖项分配'dep'

时间:2016-03-25 19:56:31

标签: nlp stanford-nlp

以下请求'http://corenlp.run'将标签'dep'分配给所有依赖项。有人可以解释这种行为吗?看起来对我来说是一个问题,或者这可能是公共端点的一些限制(速率限制)?但是,web-interface会返回正确的响应。

wget --post-data "Having earned a doctorate as a physical chemist, Merkel entered politics in the wake of the Revolutions of 1989, briefly serving as a deputy spokesperson for the first democratically-elected East German Government in 1990. Following German reunification in 1990, Merkel was elected to the Bundestag for Stralsund-Nordvorpommern-Rügen in the state of Mecklenburg-Vorpommern, a seat she has held ever since. Merkel was later appointed as the Minister for Women and Youth in 1991 under Chancellor Helmut Kohl, later becoming the Minister for the Environment in 1994. After Kohl was defeated in 1998, Merkel was elected Secretary-General of the CDU before becoming the party's first woman leader two years later in the aftermath of a donations scandal that toppled Wolfgang Schäuble." 'http://corenlp.run/?properties={"tokenize.whitespace": "true", "annotators": "tokenize,ssplit,pos,lemma,ner,parse, depparse,mention,coref", "outputFormat": "json",'timeout': 30000}' -O -

对于其他输入,parse属性响应看起来很奇怪。 Web界面的答案再次正确。错误的解析响应示例:

"parse":"(X ... (X their) (X stomachs) (X while) (X simultaneously) (X appealing) (X to) (X their) (X vanity.) (X The) ...)" 

我尝试了公共端点,因为最新的编译版本受到这个issue的影响,并且Github代码库构建指令似乎已经过时了。我完全错过了一个指南,该指南描述了如何从Github仓库中构建命运包here中提供的* .jars。

更新:

刚刚尝试了与本地实例和最新CoreNLP服务器相同的请求。同样的问题。只有Web界面才会返回正确的响应。如果我删除解析注释器,它的工作原理。但是,我需要两个注释。

1 个答案:

答案 0 :(得分:0)

您可能会遇到服务器的默认request.environ['HTTP_X_REQUESTED_WITH'] = 'XMLHttpRequest'限制为60.您可以通过在传递给服务器的属性中显式设置属性request.environ['HTTP_UPGRADE_INSECURE_REQUESTS'] is absent from the first request, and equals来覆盖它。但是,要注意:比这更长的句子可能需要很长时间才能解析。

如果您只需要依赖项,我建议您使用parse.maxlen注释器。这就是corenlp.run的演示使用的原因,以及为什么它适用于较长的句子。

相关问题