Hi,

The CrossValidator is hitting a NPE in a pretty standard use case.  I
traced it through, and, when cross-validating, DataIndexer.getContexts is
returning null (and thus, the call to contexts.length is throwing the
exception.)  What can I do here?

Thanks,

Walrus theCat

Exception in thread "main" java.lang.NullPointerException
    at opennlp.tools.ml.maxent.GISTrainer.trainModel(GISTrainer.java:264)
    at opennlp.tools.ml.maxent.GIS.trainModel(GIS.java:298)
    at opennlp.tools.ml.maxent.GIS.doTrain(GIS.java:83)
    at opennlp.tools.ml.maxent.GIS.doTrain(GIS.java:36)
    at
opennlp.tools.ml.AbstractEventTrainer.train(AbstractEventTrainer.java:93)
    at opennlp.tools.namefind.NameFinderME.train(NameFinderME.java:410)
    at opennlp.tools.namefind.NameFinderME.train(NameFinderME.java:472)
    at
opennlp.tools.namefind.TokenNameFinderCrossValidator.evaluate(TokenNameFinderCrossValidator.java:225)
    at precyse.ml.ner.TrainNERModels$.getResults(TrainNERModels.scala:153)
    at
precyse.ml.ner.TrainNERModels$$anonfun$main$3.apply(TrainNERModels.scala:58)
    at
precyse.ml.ner.TrainNERModels$$anonfun$main$3.apply(TrainNERModels.scala:53)
    at
scala.collection.mutable.ResizableArray$class.foreach(ResizableArray.scala:60)
    at scala.collection.mutable.ArrayBuffer.foreach(ArrayBuffer.scala:47)
    at initech.ml.ner.TrainNERModels$.main(TrainNERModels.scala:53)
    at initech.ml.ner.TrainNERModels.main(TrainNERModels.scala)

Reply via email to