Search code examples
stanford-nlp

Can Stanford CoreNLP lemmatise a word given a custom POS?


I would like to lemmatise a given word multiple times, with different POS supplied.

For example, the lemma of "met" is "meet" (POS: verb), while the lemma of "meeting" is "meeting" (POS: noun).

But if "meeting" is a verb, the lemma is "meet". I would like then to lemmatise "meeting" with a given verb POS, in an effort to find such similarities.

Is this possible?

Using latest Java CoreNLP 3.9.2


Solution

  • Try the method String lemma(String word, String tag) in edu.stanford.nlp.process.Morphology.

    Morphology morphology = new Morphology();
    
    String word = "meeting";
    String tag = "VB";
    String lemma = morphology.lemma(word, tag);
    System.out.println(String.format("%s_%s   %s", word, tag, lemma));