Training own model in opennlp

后端 未结 4 1565
灰色年华
灰色年华 2020-12-29 06:00

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

4条回答
  •  半阙折子戏
    2020-12-29 06:20

    First you need to train the data with the required Entity.

    Sentences should be separated with new line character (\n). Values should be separated from and tags with a space character.
    Let's say you want to create medicine entity model, so data should be something like this:

     Augmentin-Duo  is a penicillin antibiotic that contains two medicines -  amoxicillin trihydrate  and 
     potassium clavulanate . They work together to kill certain types of bacteria and are used to treat certain types of bacterial infections.
    

    You can refer a sample dataset for example. Training data should have at least 15000 sentences to get the better results.

    Further you can use Opennlp TokenNameFinderTrainer. Output file will be in the .bin format.

    Here is the example: Writing a custom NameFinder model in OpenNLP

    For more details, refer the Opennlp documentation

提交回复
热议问题