In this recipe, we will use the model created in the previous recipe, Training a model to classify text using LingPipe, to classify sample text. While we could use any of the four classification categories to test the data, we will use a sample text consisting of a religion reference. Specifically, we will use the LMClassifier class to perform the classification.
Using LingPipe to classify text
Getting ready
To prepare, we need to do the following:
- Create a new Maven project
- Add the following dependency to the project's POM file:
<!-- https://mvnrepository.com/artifact/de.julielab/aliasi-lingpipe -->
<dependency>
<groupId>de.julielab</groupId>
<artifactId>aliasi-lingpipe</artifactId...