How many lines and documents should be in the training data of the opennlp classifier

I follow the documentation forApache open-nlp . I was able to understand the definition of a sentence, tokenizer, name-finder. But I'm stuck in Categorizer. The reason, I can’t understand how to create a model for categorization.

I understand that I need to create a file. The format is very clear, it should be a category space and a document in one line. Save the file with the extension .train.

So, I created the following file:

Refund What is the refund status for my order #342 ?
NewOffers Are there any new offers for your products ?

I gave this command -

opennlp DoccatTrainer -model en-doccat.bin -lang en -data en-doccat.train -encoding UTF-8

He begins to do something, and then returns with an error. This content is on the command line:

Indexing events using cutoff of 5

    Computing event counts...  done. 2 events
    Indexing...  Dropped event Refund:[bow=What, bow=is, bow=the, bow=refund, bow=status, bow=for, bow=my, bow=order, bow=#342, bow=?]
Dropped event NewOffers:[bow=Are, bow=there, bow=any, bow=new, bow=offers, bow=for, bow=your, bow=products, bow=?]
done.
Sorting and merging events... Done indexing.
Incorporating indexed data for training...  
Exception in thread "main" java.lang.NullPointerException
    at opennlp.maxent.GISTrainer.trainModel(GISTrainer.java:263)
    at opennlp.maxent.GIS.trainModel(GIS.java:256)
    at opennlp.model.TrainUtil.train(TrainUtil.java:184)
    at opennlp.tools.doccat.DocumentCategorizerME.train(DocumentCategorizerME.java:162)
    at opennlp.tools.cmdline.doccat.DoccatTrainerTool.run(DoccatTrainerTool.java:61)
    at opennlp.tools.cmdline.CLI.main(CLI.java:222)

I just can't understand why this gives a null pointer exception here? I also tried to increase two more lines, but there is no result.

Refund What is the refund status for my order #342 ?
NewOffers Are there any new offers for your products ?
Refund Can I place a refund request for electronics ?
NewOffers Is there any new offer on buying worth 5000 ?  

, . , . ? .

opennlp DoccatTrainer, , . .

EDIT:

Refund What is the refund status for my order #342 ? Can I place a refund request for clothes ?
NewOffers Are there any new offers for your products ? what are the offers on new products or new offers on old products?
Refund Can I place a refund request for electronics ?
NewOffers Is there any new offer on buying worth 5000 ? 

, , - (, ) .

Refund What is the refund status for my order #342 ? Can I place a refund request for clothes ?
NewOffers Are there any new offers for your products ? what are the offers on new products or new offers on old products? 

, , // ?

+1
2

-cutoff DoccatTrainer, . -cutoff 1, 1.

0

All Articles