Stanford nlp 斯坦福NLP中的货币正常化未按预期运行

Stanford nlp 斯坦福NLP中的货币正常化未按预期运行,stanford-nlp,Stanford Nlp,我正在使用斯坦福CoreNLP进行提取。下面是我试图从中提取货币和货币符号的句子 2015年3月5日5亿欧元的克林发行0.875% 我需要提取的数据为5000000000.875欧元 NLP默认将其给出的句子作为 2015年3月5日发行**$**500000000 0.875% 所以我写了 public static readonly TokenizerFactory TokenizerFactory = PTBTokenizer.factory(new CoreLabelTokenFactor

我正在使用斯坦福CoreNLP进行提取。下面是我试图从中提取货币和货币符号的句子

2015年3月5日5亿欧元的克林发行0.875%

我需要提取的数据为5000000000.875欧元

NLP默认将其给出的句子作为

2015年3月5日发行**$**500000000 0.875%

所以我写了

public static readonly TokenizerFactory TokenizerFactory = PTBTokenizer.factory(new CoreLabelTokenFactory(),
            "normalizeCurrency=false");
DocumentPreprocessor docPre = new DocumentPreprocessor(new java.io.StringReader(textChunk));
docPre.setTokenizerFactory(TokenizerFactory);
现在这个判决恰如其分

2015年3月5日,发行500000000欧元,0.875%

但当我这么做的时候

props.put("annotators", "tokenize, cleanxml, ssplit, pos, lemma, ner, regexner");
props.setProperty("ner.useSUTime", "0");
_pipeline = new StanfordCoreNLP(props);
Annotation document = new Annotation(text);
_pipeline.annotate(document);
其中text=2015年3月5日,发行500000000欧元,0.875%

我得到的输出是

<token id="9">
   <word>$</word>
   <lemma></lemma>
   <CharacterOffsetBegin>48</CharacterOffsetBegin>
   <CharacterOffsetEnd>49</CharacterOffsetEnd>
   <POS>CD</POS>
   <NER>MONEY</NER>
   <NormalizedNER>$5.000000000875E9</NormalizedNER>
</token>

$
48
49
光盘
钱
$5.000000000875E9
所以我添加了行
props.put(“tokenize.options”,“normalizeCurrency=false”)
但产量仍然与5.000000000美元875E9相同


谁能帮帮我吗。谢谢

当我运行此代码时,它没有将货币符号更改为“$”:


谢谢你的帮助。我添加了props.setProperty(“tokenize.options”,“normalizeCurrency=false”);然而,之前的输出没有任何货币符号,如48 49 CD MONEY 5.000000000875E9。您能告诉我如何在C#中写入(CoreLabel标记:document.get(CoreAnnotations.TokensAnotation.class))。因为我对java知之甚少。我用c#来提取。
package edu.stanford.nlp.examples;

import edu.stanford.nlp.ling.*;
import edu.stanford.nlp.pipeline.*;

import java.util.*;

public class TokenizeOptionsExample {

  public static void main(String[] args) {
    Annotation document = new Annotation("5 March 2015 Kering Issue of €500,000,000 0.875 per cent");
    Properties props = new Properties();
    props.setProperty("annotators", "tokenize,ssplit");
    props.setProperty("tokenize.options", "normalizeCurrency=false");
    StanfordCoreNLP pipeline = new StanfordCoreNLP(props);
    pipeline.annotate(document);
    for (CoreLabel token : document.get(CoreAnnotations.TokensAnnotation.class)) {
      System.out.println(token);
    }
  }
}