In this recipe, we will use the OpenNLP API to generate a parse tree. We will use a previously created chunking model. We will demonstrate different parse trees that may be available for the same text and how to determine which of them have a higher probability of being correct.
Using OpenNLP to generate a parse tree
Getting ready
To prepare, we need to do the following:
- Create a new Maven project
- Add the following dependency to the POM file:
<dependency>
<groupId>org.apache.opennlp</groupId>
<artifactId>opennlp-tools</artifactId>
<version>1.9.0</version>
</dependency>
- Download the file, en-parser-chunking.bin, from http://opennlp.sourceforge.net/models-1.5/ and save...