Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/dart/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
NameFinderME类中OpenNLP的Nullpointer异常_Nlp_Opennlp - Fatal编程技术网

NameFinderME类中OpenNLP的Nullpointer异常

NameFinderME类中OpenNLP的Nullpointer异常,nlp,opennlp,Nlp,Opennlp,我正在使用从给定文本中提取命名实体。 在大数据上运行代码时,它给出了以下错误。当我在小数据上运行它时,它工作得很好 java.lang.NullPointerException at opennlp.tools.util.Cache.put(Cache.java:134) at opennlp.tools.util.featuregen.CachedFeatureGenerator.createFeatures(CachedFeatureGenerator.java:71)

我正在使用从给定文本中提取命名实体。 在大数据上运行代码时,它给出了以下错误。当我在小数据上运行它时,它工作得很好

java.lang.NullPointerException
    at opennlp.tools.util.Cache.put(Cache.java:134)
    at opennlp.tools.util.featuregen.CachedFeatureGenerator.createFeatures(CachedFeatureGenerator.java:71)
    at opennlp.tools.namefind.DefaultNameContextGenerator.getContext(DefaultNameContextGenerator.java:116)
    at opennlp.tools.namefind.DefaultNameContextGenerator.getContext(DefaultNameContextGenerator.java:39)
    at opennlp.tools.util.BeamSearch.bestSequences(BeamSearch.java:125)
    at opennlp.tools.util.BeamSearch.bestSequence(BeamSearch.java:198)
    at opennlp.tools.namefind.NameFinderME.find(NameFinderME.java:214)
    at opennlp.tools.namefind.NameFinderME.find(NameFinderME.java:198)

请帮我解决这个问题。

我与POSTaggerME有同样的问题,原因几乎可以肯定是因为您在线程之间共享一个NameFinderME实例

根据opennlp文档,大多数公开的库类都不是线程安全的: