Is there a way to get the subject of a sentence using OpenNLP?

前端 未结 2 1100
一整个雨季
一整个雨季 2020-12-24 15:55

Is there a way to get the subject of a sentence using OpenNLP? I\'m trying to identify the most important part of a users sentence. Generally, users will be submitting sen

2条回答
  •  既然无缘
    2020-12-24 16:02

    Dependency Parser

    If you're interested in extracting grammatical relations such as what word or phrase is the subject of a sentence, you should really use a dependency parser. While OpenNLP does support phrase structure parsing, I don't think it does dependency parsing yet.

    Opensource Software

    Packages written in Java that support dependency parsing include:

    • MaltParser
    • MSTParser
    • Stanford Parser (demo, see typed dependencies section)
    • RelEx

    Of these, the Stanford Parser is the most accurate. However, some configurations of the MaltParser can be insanely fast (Cer et al. 2010).

提交回复
热议问题