We will use the OpenNLP API to demonstrate how to train a specialized POS model. Training your own model is important when the pre-trained models do not work satisfactorily for the problem at hand and there are no other specialized models available for the language or problem domain.
We will use the POSTaggerME class to train our model. We will need to create a file that contains POS markups. Once trained, we will test the model using the technique demonstrated in the Finding POS using tagging recipe.