HanLP icon indicating copy to clipboard operation
HanLP copied to clipboard

加载新训练好的CRF模型时出错

Open Judyqing opened this issue 7 years ago • 0 comments

注意事项

请确认下列注意事项:

  • 我已仔细阅读下列文档,都没有找到答案:
  • 我已经通过Google和issue区检索功能搜索了我的问题,也没有找到答案。
  • 我明白开源社区是出于兴趣爱好聚集起来的自由社区,不承担任何责任或义务。我会礼貌发言,向每一个帮助我的人表示感谢。
  • [x] 我在此括号内输入x打钩,代表上述事项确认完毕。

版本号

当前最新版本号是: 我使用的版本是:hanlp 1.7.0

我的问题

训练好CRF模型后,在使用CRFLexicalAnalyzer或者CRFSegmenter分词时,加载时出错, 具体错误是 Exception in thread "main" java.lang.NumberFormatException: For input string: "1@?@@?@" at java.lang.NumberFormatException.forInputString(Unknown Source) at java.lang.Integer.parseInt(Unknown Source) at java.lang.Integer.parseInt(Unknown Source) at com.hankcs.hanlp.model.crf.LogLinearModel.convert(LogLinearModel.java:124) at com.hankcs.hanlp.model.crf.LogLinearModel.(LogLinearModel.java:101) at com.hankcs.hanlp.model.crf.CRFTagger.(CRFTagger.java:41) at com.hankcs.hanlp.model.crf.CRFSegmenter.(CRFSegmenter.java:47) at com.hankcs.hanlp.model.crf.CRFLexicalAnalyzer.(CRFLexicalAnalyzer.java:71) at fenci.CRFCWSTrain.main(CRFCWSTrain.java:59)

想问一下,出现上述错误可能是由哪些原因导致的,在调用HanLP和CRF++模型的时候都会出现上述问题。感谢。

Judyqing avatar Jan 09 '19 09:01 Judyqing