我正在试着用斯坦福大学的柠檬化来跟进这的问题。我的环境是:-
我的代码片段是:-
//...........lemmatization starts........................
Properties props = new Properties();
props.put("annotators", "tokenize, ssplit, pos, lemma");
StanfordCoreNLP pipeline = new StanfordCoreNLP(props, false);
String text = "painting";
Annotation document = pipeline.process(text);
List<edu.stanford.nlp.util.CoreMap> sentences = document.get(SentencesAnnotation.class);
for(edu.stanford.nlp.util.CoreMap sentence: sentences)
{
for(CoreLabel token: sentence.get(TokensAnnotation.class))
{
String word = token.get(TextAnnotation.class);
String lemma = token.get(LemmaAnnotation.class);
System.out.println("lemmatized version :" + lemma);
}
}
//...........lemmatization ends.........................我得到的输出是:-
lemmatized version :painting我期待的地方
lemmatized version :paint请指点我。
发布于 2015-02-23 18:58:30
这个例子中的问题是,“绘画”这个词可以是“要画”或“名词”的现在分词,而狐猴的输出取决于分配给原始单词的词性部分标记。
如果只在片段绘制上运行标签,那么就没有上下文可以帮助标记者(或人类)决定如何标记单词。在这种情况下,它选择了标签NN和引理的名词绘画实际上是绘画。
如果你用“我在画一朵花”这句话来运行相同的代码。标记者应该正确地将绘画标记为VBG,而狐猴应该返回油漆。
https://stackoverflow.com/questions/28678811
复制相似问题