小编Div*_*ala的帖子

在android中存储静态数据的最快/首选方法是什么?

我想存储大约一千个字符串(如一些引号)并填充ListViewListFragment使用它们.这些字符串是静态的,一旦加载就不会改变.

它是一个只读数据,不应允许用户操纵它.

我应该使用XML文件或文本文件存储它们,还是最好的方法?

android

7
推荐指数
1
解决办法
2692
查看次数

在大型数据集上使用GATE时获取OOM

我对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");
}
Run Code Online (Sandbox Code Playgroud)

这是日志:

    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)
Run Code Online (Sandbox Code Playgroud)

我想知道执行函数究竟发生了什么以及如何解决它.谢谢.

java nlp gate

0
推荐指数
1
解决办法
989
查看次数

标签 统计

android ×1

gate ×1

java ×1

nlp ×1