CRF stands for conditional random field. This is the name a statistical model that is used for many purposes, including the of text. In this recipe, we will illustrate how to use this CRF model to identify entities within a document. Specifically, we will use the Stanford NLP CRFClassifier class and a trained model.
Using a CRF model to find entities in a document
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>edu.stanford.nlp</groupId>
<artifactId>stanford-corenlp</artifactId>
<version>3.9.2</version>
</dependency>
- Download the english.conll.4class.distsim.crf.ser...