GATE java.lang.NullPointerException?

时间:2016-03-20 12:48:39

标签: machine-learning nlp gate

我是GATE的新手,我正在用它来进行机器学习。批处理学习PR的配置文件如下:

<?xml version="1.0"?>

-<ML-CONFIG>

<VERBOSITY level="1"/>

<SURROUND value="false"/>

<PARAMETER value="0.5" name="thresholdProbabilityClassification"/>

<multiClassification2Binary method="one-vs-others"/>

<EVALUATION method="kfold" ratio="0.66" runs="5"/>

<ENGINE options=" -p 50 -n 5 -optB 0.0 " implementationName="PAUM" nickname="PAUM"/>


-<DATASET>

<INSTANCE-TYPE>attitude</INSTANCE-TYPE>


-<NGRAM>

<NAME>ngram</NAME>

<NUMBER>1</NUMBER>

<CONSNUM>1</CONSNUM>


-<CONS-1>

<TYPE>Token</TYPE>

<FEATURE>root</FEATURE>

</CONS-1>

<!-- <CONS-2> <TYPE>Token</TYPE> <FEATURE>orth</FEATURE> </CONS-2> -->


</NGRAM>


-<ATTRIBUTE>

<NAME>Class</NAME>

<SEMTYPE>NOMINAL</SEMTYPE>

<TYPE>attitude</TYPE>

<FEATURE>feature</FEATURE>

<POSITION>0</POSITION>

<CLASS/>

</ATTRIBUTE>

</DATASET>

</ML-CONFIG>

我希望程序学习的注释称为“态度”,其功能称为“功能”。该功能的价值只是正面和负面。

但是,每次运行Batch Learning PR(训练模式)时,都会出现如下错误:

java.lang.NullPointerException
at gate.learning.NLPFeaturesOfDoc.writeNLPFeaturesToFile(NLPFeaturesOfDoc.java:818)
at gate.learning.LightWeightLearningApi.annotations2NLPFeatures(LightWeightLearningApi.java:198)
at gate.learning.LearningAPIMain.execute(LearningAPIMain.java:594)
at gate.util.Benchmark.executeWithBenchmarking(Benchmark.java:291)
at gate.creole.SerialController.runComponent(SerialController.java:225)
at gate.creole.SerialController.executeImpl(SerialController.java:157)
at gate.creole.SerialAnalyserController.executeImpl(SerialAnalyserController.java:223)
at gate.creole.SerialAnalyserController.execute(SerialAnalyserController.java:126)
at gate.util.Benchmark.executeWithBenchmarking(Benchmark.java:291)
at gate.gui.SerialControllerEditor$RunAction$1.run(SerialControllerEditor.java:1728)
at java.lang.Thread.run(Unknown Source)

由于我无法在GATE中途调试,我不明白代码有什么问题。

有人可以帮忙吗?

谢谢!

1 个答案:

答案 0 :(得分:0)

我建议您查看哪个培训过程失败的文件。可能会发生GATE没有生成任何功能(例如文档内容为空等)。