标签: stanford-nlp-server

运行斯坦福corenlp服务器与法国模型

我试图用Stanford CoreNLP工具分析一些法语文本(这是我第一次尝试使用任何StanfordNLP软件)

为此,我已经下载了v3.6.0 jar和相应的法语模型.

然后我运行服务器:

java -mx4g -cp "*" edu.stanford.nlp.pipeline.StanfordCoreNLPServer
Run Code Online (Sandbox Code Playgroud)

如本回答所述,我将API称为:

wget --post-data 'Bonjour le monde.' 'localhost:9000/?properties={"parse.model":"edu/stanford/nlp/models/parser/nndep/UD_French.gz", "annotators": "parse", "outputFormat": "json"}' -O -
Run Code Online (Sandbox Code Playgroud)

但我得到以下日志+错误:

 [pool-1-thread-1] INFO edu.stanford.nlp.pipeline.StanfordCoreNLP  
 Adding annotator tokenize
 [pool-1-thread-1] INFO edu.stanford.nlp.pipeline.TokenizerAnnotator - TokenizerAnnotator: No tokenizer type provided. Defaulting to PTBTokenizer.
 [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/parser/nndep/UD_French.gz ... 

 edu.stanford.nlp.io.RuntimeIOException: java.io.StreamCorruptedException: invalid stream header: 64696374
    at edu.stanford.nlp.parser.common.ParserGrammar.loadModel(ParserGrammar.java:188)
    at …
Run Code Online (Sandbox Code Playgroud)

stanford-nlp stanford-nlp-server

5
推荐指数
1
解决办法
1643
查看次数

在StanfordCoreNLPServer输出中同时使用NER和RegexNER标签?

我正在使用StanfordCoreNLPServer从文本中提取一些信息(例如表面,街道名称)

街道由经过专门训练的NER模型提供,表面由简单的正则表达式通过RegexNER提供.

它们中的每一个都可以单独工作,但是当它们一起使用时,只有NER结果出现在ner标签下的输出中.为什么没有regexner标签?有没有办法获得RegexNER结果?

有关信息:

  • StanfordCoreNLP v3.6.0

  • 使用的URL:

    'http://127.0.0.1:9000/'
    '?properties={"annotators":"tokenize,ssplit,pos,ner,regexner", '
    '"pos.model":"edu/stanford/nlp/models/pos-tagger/french/french.tagger",'
    '"tokenize.language":"fr",'
    '"ner.model":"ner-model.ser.gz", ' # custom NER model with STREET labels
    '"regexner.mapping":"rules.tsv", ' # SURFACE label
    '"outputFormat": "json"}'
    
    Run Code Online (Sandbox Code Playgroud)

    如建议在这里regexner注释是之后ner,但仍...

  • 当前输出(提取):

    {u'index': 4, u'word': u'dans', u'lemma': u'dans', u'pos': u'P', u'characterOffsetEnd': 12, u'characterOffsetBegin': 8, u'originalText': u'dans', u'ner': u'O'}
    {u'index': 5, u'word': u'la', u'lemma': u'la', u'pos': u'DET', u'characterOffsetEnd': 15, u'characterOffsetBegin': 13, u'originalText': u'la', u'ner': u'O'}
    {u'index': 6, u'word': u'rue', u'lemma': u'rue', …
    Run Code Online (Sandbox Code Playgroud)

stanford-nlp stanford-nlp-server

5
推荐指数
1
解决办法
962
查看次数

标签 统计

stanford-nlp ×2

stanford-nlp-server ×2