0

単語の種類を正確に知っているリソースがあります。それらを見出し語にする必要がありますが、正しい結果を得るには、手動でタグ付けする必要があります。単語を手動でタグ付けするためのコードが見つかりませんでした。次のコードを使用していますが、間違った結果を返します。つまり、「ペイント」を期待する「ペイント」の「ペイント」です。

*//...........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.........................*

pos のタグ付けが自動的に行われる文ではなく、単語に対して lemmatizer を実行する必要があります。そのため、最初に単語に手動でタグを付けてから、それらの補題を見つけます。いくつかのサンプルコードやいくつかのサイトへの参照を手伝ってください.

4

1 に答える 1