在Stanford NER上创建NER模型时出错

时间:2017-06-06 13:56:59

标签: stanford-nlp

当我创建NER模型时,我收到如下错误消息:

Exception in thread "main" java.lang.RuntimeException: Got NaN for prob in CRFLogConditionalObjectiveFunction.calculate() - this may well indicate numeric underflow due to overly long documents.
    at edu.stanford.nlp.ie.crf.CRFLogConditionalObjectiveFunction.calculate(CRFLogConditionalObjectiveFunction.java:427)
    at edu.stanford.nlp.optimization.AbstractCachingDiffFunction.ensure(AbstractCachingDiffFunction.java:140)
    at edu.stanford.nlp.optimization.AbstractCachingDiffFunction.valueAt(AbstractCachingDiffFunction.java:145)
    at edu.stanford.nlp.optimization.QNMinimizer.lineSearchMinPack(QNMinimizer.java:1460)
    at edu.stanford.nlp.optimization.QNMinimizer.minimize(QNMinimizer.java:1008)
    at edu.stanford.nlp.optimization.QNMinimizer.minimize(QNMinimizer.java:857)
    at edu.stanford.nlp.optimization.QNMinimizer.minimize(QNMinimizer.java:851)
    at edu.stanford.nlp.optimization.QNMinimizer.minimize(QNMinimizer.java:93)
    at edu.stanford.nlp.ie.crf.CRFClassifier.trainWeights(CRFClassifier.java:1919)
    at edu.stanford.nlp.ie.crf.CRFClassifier.train(CRFClassifier.java:1726)
    at edu.stanford.nlp.ie.AbstractSequenceClassifier.train(AbstractSequenceClassifier.java:758)
    at edu.stanford.nlp.ie.AbstractSequenceClassifier.train(AbstractSequenceClassifier.java:746)
    at edu.stanford.nlp.ie.crf.CRFClassifier.main(CRFClassifier.java:3034)

要创建NER,我只使用了Stanford NER网站[这里]的Java代码。 1

Java代码是:

java -cp stanford-ner.jar edu.stanford.nlp.ie.crf.CRFClassifier -prop 06012017_training.prop

此外,用于创建NER的TSV文件为35.369MB。 我试图只创建一个标题为“SYS”的标签。

如何克服此错误并成功创建NER模型? 提前谢谢。

0 个答案:

没有答案