Stanford nlp 忽略lemmatizer的单词

Stanford nlp 忽略lemmatizer的单词,stanford-nlp,Stanford Nlp,我想用StanfordCorenlp进行柠檬化,但我有一些词没有被柠檬化。是否有办法向工具提供此忽略列表?当程序调用this.pipeline.annotate(document)时,我正在跟踪它那么,就这样;这将是很难取代的事件。一种解决方案是创建一个映射列表,其中每个要忽略的单词都与lemmatize(单词)(即,d={(w1,lemmatize(w1)),(w2,lemmatize(w2),…})配对,并使用该映射列表进行后处理。但我想这应该比这更容易 谢谢你的帮助。我想我在朋友的帮助下找

我想用StanfordCorenlp进行柠檬化,但我有一些词没有被柠檬化。是否有办法向工具提供此忽略列表?当程序调用
this.pipeline.annotate(document)时,我正在跟踪它那么,就这样;这将是很难取代的事件。一种解决方案是创建一个映射列表,其中每个要忽略的单词都与lemmatize(单词)(即,d={(w1,lemmatize(w1)),(w2,lemmatize(w2),…})配对,并使用该映射列表进行后处理。但我想这应该比这更容易


谢谢你的帮助。

我想我在朋友的帮助下找到了解决办法

  for(CoreMap sentence: sentences) {
        // Iterate over all tokens in a sentence
        for (CoreLabel token: sentence.get(TokensAnnotation.class)) {
            System.out.print(token.get(OriginalTextAnnotation.class) + "\t");
            System.out.println(token.get(LemmaAnnotation.class));

        }
    }
您可以通过调用
token.get(OriginalTextAnnotation.class)
来获取单词的原始形式