Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Training own model in opennlp

Tags:

I am finding it difficult to create my own model openNLP. Can any one tell me, how to own model. How the training shouls be done.

What should be the input and where the output model file will get stored.

like image 998
user1482228 Avatar asked Jun 26 '12 09:06

user1482228


People also ask

How do I use Apache OpenNLP?

Apache OpenNLP is an open source Java library which is used process Natural Language text. OpenNLP provides services such as tokenization, sentence segmentation, part-of-speech tagging, named entity extraction, chunking, parsing, and co-reference resolution, etc.


1 Answers

https://opennlp.apache.org/docs/1.5.3/manual/opennlp.html

This website is very useful, shows both in code, and using the OpenNLP application to train models for all different types, like entity extraction and part of speech etc.

I could give you some code examples in here, but the page is very clear to use.

Theory-wise:

Essentially you create a file which lists the stuff you want to train

eg.

Sport [whitespace] this is a page about football, rugby and stuff

Politics [whitespace] this is a page about tony blair being prime minister.

The format is described on the page above (each model expects a different format). once you have created this file, you run it through either the API or the opennlp application (via command line), and it generates a .bin file. Once you have this .bin file, you can load it into a model, and start using it (as per the api in the above website).

like image 147
andrew.butkus Avatar answered Oct 20 '22 02:10

andrew.butkus