本文介绍了StanfordCoreNLP与StanfordCoreNLPServer不同的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果您运行:java -mx3g -cp"*" edu.stanford.nlp.pipeline.StanfordCoreNLPServer -props StanfordCoreNLP-spanish.properties

if you run:java -mx3g -cp "*" edu.stanford.nlp.pipeline.StanfordCoreNLPServer -props StanfordCoreNLP-spanish.properties

java -mx3g -cp"*" edu.stanford.nlp.pipeline.StanfordCoreNLP -props StanfordCoreNLP-spanish.properties

java -mx3g -cp "*" edu.stanford.nlp.pipeline.StanfordCoreNLP -props StanfordCoreNLP-spanish.properties

第二个命令打开一个终端,西班牙语解析器工作正常,但是从Server版本开始,它使用英语解析器而不是西班牙语.

The second command open a terminal and Spanish parser works fine, but from the Server version it use the English parser and not the Spanish.

~/CoreNLP/stanford-corenlp-full-2015-12-09# java -mx3g -cp "*" edu.stanford.nlp.pipeline.StanfordCoreNLPServer  -props StanfordCoreNLP-spanish.properties
-- listing properties --
pos.model=edu/stanford/nlp/models/pos-tagger/sp...
ner.model=edu/stanford/nlp/models/ner/spanish.a...
ner.useSUTime=false
parse.model=edu/stanford/nlp/models/lexparser/spa...
tokenize.language=es
annotators=tokenize, ssplit, pos, ner, parse
ner.applyNumericClassifiers=false
Starting server on port 9000 with timeout of 5000 milliseconds.
StanfordCoreNLPServer listening at /0:0:0:0:0:0:0:0:9000
[/0:0:0:0:0:0:0:1:49579] API call w/annotators tokenize,ssplit,parse
El presidente Julio Sanches formo ungrupo de ministros a quienes llamo los cinco economistas magnificos.
[pool-1-thread-1] INFO edu.stanford.nlp.pipeline.StanfordCoreNLP - Adding annotator tokenize
[pool-1-thread-1] INFO edu.stanford.nlp.pipeline.StanfordCoreNLP - Adding annotator ssplit
[pool-1-thread-1] INFO edu.stanford.nlp.pipeline.StanfordCoreNLP - Adding annotator parse
[pool-1-thread-1] INFO edu.stanford.nlp.parser.common.ParserGrammar - Loading parser from serialized file edu/stanford/nlp/models/lexparser/englishPCFG.ser.gz ...
done [0.4 sec].

对于我使用的客户端:wget --post-data总统朱利奥·桑奇斯(Julio Sanches)提出了一个奇妙的策略,以实现经济增长." 'localhost:9000/?properties = {"tokenize.whitespace":"true","annotators":"parse","outputFormat":"text"}'-O-

for the client I have use:wget --post-data 'El presidente Julio Sanches formo ungrupo de ministros a quienes llamo los cinco economistas magnificos.' 'localhost:9000/?properties={"tokenize.whitespace":"true","annotators":"parse","outputFormat":"text"}' -O -

我需要使用西班牙模型文件运行StanfordCoreNLPServer,我需要一个特殊的参数吗?

I need to run StanfordCoreNLPServer with the Spanish model file, do I need a special parameter?

推荐答案

好的解决方案在

但我只是按照以下方式运行:

but I just run as follow:

服务器java -mx4g -cp"*" edu.stanford.nlp.pipeline.StanfordCoreNLPServer客户端

The server java -mx4g -cp "*" edu.stanford.nlp.pipeline.StanfordCoreNLPServerThe client

wget --post-data'el perro corre detras del carro'. --header ="Content-Type:text/plain; charset = UTF-8"'localhost:9000/?properties = {"annotators":"tokenize,ssplit,pos,parse","parse.model":"edu/stanford/nlp/models/lexparser/spanishPCFG.ser.gz","pos.model":"edu/stanford/nlp/models/pos-tagger/spanish/spanish.tagger","tokenize.language":"fr ," outputFormat:"文本}'-O-

wget --post-data 'el perro corre detras del carro.' --header="Content-Type: text/plain; charset=UTF-8" 'localhost:9000/?properties={"annotators": "tokenize,ssplit,pos,parse", "parse.model":"edu/stanford/nlp/models/lexparser/spanishPCFG.ser.gz","pos.model":"edu/stanford/nlp/models/pos-tagger/spanish/spanish.tagger","tokenize.language":"fr","outputFormat": "text"}' -O -

及其作品

这篇关于StanfordCoreNLP与StanfordCoreNLPServer不同的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-09 23:28