Coreference permission using OpenNLP

I want to do "kernel resolution" using OpenNLP. The documentation from Apache ( Coreference Resolution ) does not cover how to do core resolution. Does anyone have any docs / tutorials on how to do this?

+7
source share
2 answers

OpenNLP currently has little documentation on resolving a code notation, with the exception of a very brief mention of how to run it in readme .

If you are not investing in using OpenNLP, consider the Stanford CoreNLP package , which includes a Java example of how to run it, including how to resolve code space using the package. It also includes a page that summarizes its performance, as well as publications published in the coreference package .

+9
source

I recently ran into the same problem and wrote a few blog notes on using OpenNLP 1.5.x tools. This is a little tight to copy in full, so here is a link with more details .


At a high level, you need to download the appropriate OpenNLP coreference model libraries, as well as the WordNet 3.0 dictionary . Given these dependencies, initializing the linker object is quite simple:

// LinkerMode should be TEST //Note: I tried LinkerMode.EVAL before realizing that this was the problem Linker _linker = new DefaultLinker("lib/opennlp/coref", LinkerMode.TEST); 

The use of the linker, however, is slightly less obvious. You need:

  1. Break content into offers and associated tokens
  2. Create a Parse Object for Each Offer
  3. Wrap each Parse sentence in such a way as to indicate the order of the sentences:

      final DefaultParse parseWrapper = new DefaultParse (parse, idx); 
  4. Iterate over each sentence parsing and use the linker to get the Mention objects from each analysis:

      final Mention [] extents =
        _linker.getMentionFinder (). getMentions (parseWrapper); 
  5. Finally, use the linker to identify the various objects in all Mention objects:

      DiscourseEntity [] entities = _linker.getEntities (arrayOfAllMentions); 
+12
source

All Articles