gpt4 book ai didi

java - CoreNLP : Parsing of sentence failed, 可能是因为内存不足

转载 作者:搜寻专家 更新时间:2023-11-01 03:33:10 25 4
gpt4 key购买 nike

在运行 Stanford 的 CoreNLP 3.7.0 时,我偶尔会看到:

WARNING: Parsing of sentence failed, possibly because of out of memory.
Will ignore and continue: Just a year ago , the public outrage was over
Sovaldi , a new hepatitis C drug being sold by Gilead Sciences for
$ 1,000 a pill , or $ 84,000 for a course of treatment .

我以前见过这个,但那是在句子分割困惑的时候,给出了一个很长的句子。我现在看到的案例,如上面的案例,具有合理大小、正确拆分的句子。

为什么会发生这种情况,我应该如何解决?

最佳答案

虽然这并不是为什么会发生这种情况的确切答案,但我通过使用 64 位 JRE 和增加可用堆来解决这个问题。我不确定您使用的是什么环境和 IDE,但要在 Windows 上的 Eclipse 中执行此操作,您必须做三件事:

  • Download the 64-bit JRE (选择 Windows 离线版/64 位)
  • 在 Eclipse 中,单击 Window..Preferences..Java..Installed JREs 然后确保选择了新安装的 JRE(您可能必须单击搜索 才能先找到它)
  • 右键单击您的 Java 项目,单击Properties..Run/Debug Settings,选择您感兴趣的启动配置,然后单击Edit。在Arguments 选项卡上,在VM arguments 下输入-Xmx30G

这会将最大堆设置为 30Gb(我不确定它是否受到物理内存的限制,因为我没有那么多)并且您的项目应该会再次运行。请注意,它之前摔倒的那些东西可能会处理得相当慢。

关于java - CoreNLP : Parsing of sentence failed, 可能是因为内存不足,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41906774/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com