我尝试解析一个文本,通过StanfordParser并使用oghers的笔记我已经成功完成了。然而,对于像这样的文字“快速的棕色狐狸跳过懒狗”我运行命令
java -mx6g edu.stanford.nlp.pipeline.StanfordCoreNLP -outputFormat xml -file input.txt
并且需要130秒才能完成。有没有办法加速这个过程?我只对基本依赖xml输出感兴趣。像这样:
<dependencies type="basic-dependencies">
<dep type="root">
<governor idx="0">ROOT</governor>
<dependent idx="5">jumped</dependent>
</dep>
<dep type="det">
<governor idx="4">fox</governor>
<dependent idx="1">the</dependent>
</dep>
<dep type="amod">
<governor idx="4">fox</governor>
<dependent idx="2">quick</dependent>
</dep>
<dep type="amod">
<governor idx="4">fox</governor>
<dependent idx="3">brown</dependent>
</dep>
<dep type="nsubj">
<governor idx="5">jumped</governor>
<dependent idx="4">fox</dependent>
</dep>
<dep type="case">
<governor idx="9">dog</governor>
<dependent idx="6">over</dependent>
</dep>
<dep type="det">
<governor idx="9">dog</governor>
<dependent idx="7">the</dependent>
</dep>
<dep type="amod">
<governor idx="9">dog</governor>
<dependent idx="8">lazy</dependent>
</dep>
<dep type="nmod">
<governor idx="5">jumped</governor>
<dependent idx="9">dog</dependent>
</dep>
</dependencies>