THUCTC icon indicating copy to clipboard operation
THUCTC copied to clipboard

运行demo报错

Open luluforever opened this issue 6 years ago • 2 comments


Category List: 0 财经 1 教育 2 房产 3 星座 4 科技 5 时尚 6 彩票 7 体育 8 游戏 9 时政 10 股票 11 娱乐 12 社会 13 家居

九月 30, 2018 5:27:35 下午 org.thunlp.language.english.EnglishWordSegment loadStopwords 警告: Property 'wordsegment.stopwords.en.file' is not valid, will use default word list instead. Exception in thread "main" java.lang.NullPointerException at org.thunlp.text.classifiers.LiblinearTextClassifier.classify(LiblinearTextClassifier.java:544) at org.thunlp.text.classifiers.BasicTextClassifier.classifyText(BasicTextClassifier.java:477) at Demo.runLoadModelAndUse(Demo.java:72) at Demo.main(Demo.java:120)

luluforever avatar Sep 30 '18 09:09 luluforever

老哥 你解决了嘛 是什么问题?

lsolator avatar Feb 23 '19 14:02 lsolator

In LiblinearTextClassifier.java : line 544: Term [] terms = testVectorBuilder.build(words, true) ; -> In LiblinearTextClassifier.java -> void init() -> testVectorBuilder = null ; 这边要付一个DocumentVector, 因此 testVectorBuilder = DocumentVector(new Lexicon(new File("训练好的model所用的lexicon")) 然后这样就知道是lexicon加载的问题。。。 最后发现是loadmodel的filename问题,这边直接填包含四个文件的目录。

k0nat4 avatar Jul 15 '21 07:07 k0nat4