Exception in GISTrainer.trainModel

13 views
Skip to first unread message

Karni Gilon

unread,
Oct 19, 2016, 2:49:23 AM10/19/16
to eop-users
I get an exceptions in GISTrainer.trainModel when running the tutorial Hello World application l.
Following are the last lines on the console:

=========================

6/10/19 09:45:55 INFO implbase.LAP_ImplBase: Pair 800 written as /cs/guest/karnigilon/tmp/EN/dev/800.xmi
Oct 19, 2016 9:45:55 AM eu.excitementproject.eop.core.MaxEntClassificationEDA initializeModel
INFO: The trained model will be stored in /cs/guest/karnigilon/workspace/analogies1/eop-resources-1.2.3/model/MaxEntClassificationEDAModel_Base+OpenNLP_EN
Indexing events using cutoff of 1

Computing event counts...  done. 0 events
Indexing...  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.maxent.GIS.trainModel(GIS.java:223)
at opennlp.maxent.GIS.trainModel(GIS.java:166)
at eu.excitementproject.eop.core.MaxEntClassificationEDA.startTraining(MaxEntClassificationEDA.java:513)
at hello2.pkg.HelloWorld2.creatingNewModels(HelloWorld2.java:83)
at hello2.pkg.HelloWorld2.main(HelloWorld2.java:234)
===============================

Roberto Ferrari

unread,
Oct 19, 2016, 6:06:14 AM10/19/16
to eop-...@googlegroups.com
Could you send us the content of the EDA's configuration file you use?
Thanks
Roberto

--
You received this message because you are subscribed to the Google Groups "eop-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to eop-users+unsubscribe@googlegroups.com.
To post to this group, send email to eop-...@googlegroups.com.
Visit this group at https://groups.google.com/group/eop-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/eop-users/099ab2ef-6194-465c-998d-019cf3e6038d%40googlegroups.com.

Karni Gilon

unread,
Oct 19, 2016, 10:57:02 AM10/19/16
to eop-users
Yes, ofcourse. The file is axEntClassificationEDA_Base+OpenNLP_EN.xml and following is the content:

<?xml version="1.0" encoding="utf-8"?>

<!DOCTYPE configuration [
<!ENTITY myVar "Some common #PCDATA that can be reused... ">
]>
<!--
 Description: Given a certain configuration, the EDA - named MaxEntClassificationEDA -
 can be trained over a specific data set in order to optimize its performance based on Maximum Entropy Modeling.
 MaxEntClassificationEDA learns a binary classifier for deciding the entailment problem. The supervised learner
 receives a number of features which are provided through the interplay of different processing components and
 knowledge sources. A configuration file, like this, specifies these components and knowledge sources together
 with settings of the learner.

 The common structure of a configuration file for MaxEntClassificationEDA is as follows (for further detail

 - It begins with a specification of platform specific settings in the section "PlatformConfiguration" for
 selecting the EDA, the language and eventually the LPA (Linguistic Pipeline Analysis).
 - It follows the names of the processing components to use, where for each component a separate section is
 defined.
 - As minimal configuration the base processing components named "BagOfWordsScoring" and "BagOfLemmasScoring"
 have to be specified, which provide bag of words and bag of lemmas features.
 - If a processing component also makes use of a knowledge base, then this knowledge base has to be introduced
 via its own section and referenced via the "name" parameter in the corresponding processing component
 that uses this knowledge base.
 - Finally, the parameters for the learning and application phases of the activated EDA have to be specified viz.
 the model file, locations of training and test data, control parameters for the classifier,
 and the list of components to run.
 Note, that the name of the EDA in the "activatedEDA" property of the "PlatformConfiguration" and the name
 of this last section must be equal.
 -->

<configuration>

        <section name="PlatformConfiguration">
                <property name="activatedEDA">eu.excitementproject.eop.core.MaxEntClassificationEDA</property>
                <property name="language">EN</property>
                <property name="activatedLAP">eu.excitementproject.eop.lap.dkpro.OpenNLPTaggerEN</property>
        </section>

        <section name="BagOfWordsScoring">
        </section>

        <section name="eu.excitementproject.eop.core.MaxEntClassificationEDA">
                <property name="modelFile">eop-resources-1.2.3/model/MaxEntClassificationEDAModel_Base+OpenNLP_EN</property>
                <property name="trainDir">/tmp/EN/dev1/</property>
                <property name="testDir">/tmp/EN/test1/</property>
                <property name="classifier">10000,1</property>
                <property name="Components">BagOfWordsScoring</property>
        </section>

</configuration>
Roberto

To unsubscribe from this group and stop receiving emails from it, send an email to eop-users+...@googlegroups.com.

Roberto Ferrari

unread,
Oct 20, 2016, 2:52:51 AM10/20/16
to eop-...@googlegroups.com
Be sure that the directories in the configuration file (trainDir, testDir) and the model file name (modelFile) correspond
to the ones that you have in the main method of the HelloWorld class. 

I'm saying that because you are saving the preprocessed files into
/cs/guest/karnigilon/tmp/EN/dev/

but in the config file it seems that the directory is set to  /tmp/EN/dev1/


To unsubscribe from this group and stop receiving emails from it, send an email to eop-users+unsubscribe@googlegroups.com.

To post to this group, send email to eop-...@googlegroups.com.
Visit this group at https://groups.google.com/group/eop-users.

Karni Gilon

unread,
Oct 20, 2016, 2:58:05 AM10/20/16
to eop-users
Thanks. I noticed it last night and changed it back to /tmp (i.e.,tmp is back in the general directory rather than local).
However, the exception remains

Karni Gilon

unread,
Oct 20, 2016, 4:09:31 AM10/20/16
to eop-users
Here is the exception again (BTW, I assume that the place where the trained model is OK, and should not  also be /tmp/EN. Can you confirm?)

16/10/20 11:04:16 INFO implbase.LAP_ImplBase: Pair 800 written as /tmp/EN/dev/800.xmi
Oct 20, 2016 11:04:16 AM eu.excitementproject.eop.core.MaxEntClassificationEDA initializeModel
INFO: The trained model will be stored in /cs/guest/karnigilon/workspace/analogies1/eop-resources-1.2.3/model/MaxEntClassificationEDAModel_Base+OpenNLP_EN
Indexing events using cutoff of 1

Computing event counts...  done. 0 events
Indexing...  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.maxent.GIS.trainModel(GIS.java:223)
at opennlp.maxent.GIS.trainModel(GIS.java:166)
at eu.excitementproject.eop.core.MaxEntClassificationEDA.startTraining(MaxEntClassificationEDA.java:513)
at hello2.pkg.HelloWorld2.creatingNewModels(HelloWorld2.java:83)
at hello2.pkg.HelloWorld2.main(HelloWorld2.java:234)


Karni Gilon

unread,
Oct 20, 2016, 4:16:15 AM10/20/16
to eop-users
OK. Just noticed there was still an issue with the directory name. Will fix. Thanks for your help
Reply all
Reply to author
Forward
0 new messages