我对 NLP 很陌生,并且正在使用 GATE。如果我为大型数据集(包含 7K+ 记录)运行我的代码,我会收到 OOM 异常。下面是发生异常的代码。
/**
* Run ANNIE
*
* @param controller
* @throws GateException
*/
public void execute(SerialAnalyserController controller)
throws GateException {
TestLogger.info("Running ANNIE...");
controller.execute(); /**** GateProcessor.java:217 ***/
// controller.cleanup();
TestLogger.info("...ANNIE complete");
}
这是日志:
Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
at java.util.HashMap.addEntry(Unknown Source)
at java.util.HashMap.put(Unknown Source)
at java.util.HashMap.putAll(Unknown Source)
at gate.annotation.AnnotationSetImpl.<init>(AnnotationSetImpl.java:111)
at gate.jape.SinglePhaseTransducer.attemptAdvance(SinglePhaseTransducer.java:448)
at gate.jape.SinglePhaseTransducer.transduce(SinglePhaseTransducer.java:287)
at gate.jape.MultiPhaseTransducer.transduce(MultiPhaseTransducer.java:168)
at gate.jape.Batch.transduce(Batch.java:352)
at gate.creole.Transducer.execute(Transducer.java:116)
at gate.creole.SerialController.runComponent(SerialController.java:177)
at gate.creole.SerialController.executeImpl(SerialController.java:136)
at gate.creole.SerialAnalyserController.executeImpl(SerialAnalyserController.java:67)
at gate.creole.AbstractController.execute(AbstractController.java:42)
at in.co.test.GateProcessor.execute(GateProcessor.java:217)
我想知道执行功能到底发生了什么以及如何解决它。谢谢。