3 回答

TA貢獻(xiàn)2003條經(jīng)驗(yàn) 獲得超2個(gè)贊
我使用斯坦福大學(xué)nlp進(jìn)行詞條還原。最近幾天,我一直在遇到類似的問題。感謝stackoverflow幫助我解決問題。
import java.util.*;
import edu.stanford.nlp.pipeline.*;
import edu.stanford.nlp.ling.*;
import edu.stanford.nlp.ling.CoreAnnotations.*;
public class example
{
public static void main(String[] args)
{
Properties props = new Properties();
props.put("annotators", "tokenize, ssplit, pos, lemma");
pipeline = new StanfordCoreNLP(props, false);
String text = /* the string you want */;
Annotation document = pipeline.process(text);
for(CoreMap sentence: document.get(SentencesAnnotation.class))
{
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);
}
}
}
}
如果停用詞稍后在分類器中使用,則最好使用停用詞來最小化輸出引理。請(qǐng)看一下John Conwell編寫的coreNlp擴(kuò)展。

TA貢獻(xiàn)1852條經(jīng)驗(yàn) 獲得超7個(gè)贊
我在這個(gè)雪球演示網(wǎng)站上嘗試了您的術(shù)語列表,結(jié)果看起來還不錯(cuò)。...
貓->貓
運(yùn)行->運(yùn)行
跑->跑
仙人掌->仙人掌
仙人掌->仙人掌
社區(qū)->社區(qū)
社區(qū)->社區(qū)
詞干被認(rèn)為可以將詞的變形形式轉(zhuǎn)化為某些共同的詞根。使該詞根成為“適當(dāng)?shù)摹弊值湓~并不是真正的工作。為此,您需要查看形態(tài)/正交分析儀。
我認(rèn)為這個(gè)問題或多或少是同一件事,而Kaarel對(duì)這個(gè)問題的回答是我從第二個(gè)鏈接中獲得的。
- 3 回答
- 0 關(guān)注
- 521 瀏覽
添加回答
舉報(bào)