r语言 - initCoreNLP中的错误,特别是"annoators"



我已经使用了coreNLP包&斯坦福解析器通过rJAVA,NLP,openNLP,coreNLP包

我的代码

sent_token_annotator <- Maxent_Sent_Token_Annotator()
word_token_annotator <- Maxent_Word_Token_Annotator()
parse_annotator <- Parse_Annotator()
initCoreNLP(mem = "8g", annotators = c("tokenize", "ssplit","pos","lemma"))

在昨天,一切都是工作,

但是今天,它突然不起作用了。显示:

initCoreNLP(mem = "8g", annotators = c("tokenize", "ssplit",)错误:未使用的参数(annotators = c("tokenize", "ssplit", "pos", "lemma"))

在我的代码中,前3行成功运行,但最后一行出错

我试图检查内存(CPU i5: ram: 8gb),重新安装R &R工作室。

同样,同样的代码在其他计算机上,也出现了错误。代码有错误吗?还是NLP服务器出现了一些错误?我解决不了这个问题。我怎么解决它?

面对同样的问题…根据版本(https://cran.r-project.org/web/packages/coreNLP/coreNLP.pdf),不再有参数注释器了。语法是

initCoreNLP(libLoc, type = c("english", "english_all", "english_fast",
"arabic", "chinese", "french", "german", "spanish"), parameterFile = NULL,
mem = "4g")

您必须使用以下命令,它将工作,但初始化所有注释器(包括许多您不会使用的,会消耗大量内存的注释器(如coref))。

initCoreNLP(mem = "8g")

要继续使用旧版本,你必须卸载coreNLP并使用devtools重新安装它,并明确提到安装版本0.4-1(而不是当前版本0.4-2)。之后,您可以使用与之前相同的命令:

library(devtools)
install_version("coreNLP", version = "0.4-1", repos = "http://cran.rproject.org")
initCoreNLP(mem="8g", annotators = c("tokenize", "ssplit","pos","lemma"))

您可以直接在standfordcorenlp中更改注释器。属性文件。

相关内容

最新更新