在11.5.2《线性支持向量机文本分类器实现》中运行
LinearSVMClassifier=SafeJClass(‘com.hankcs.hanlp.classification.classifiers.LinearSVMClassifier’)
出现以下报错:
Traceback (most recent call last):
File “”, line 1, in
LinearSVMClassifier = SafeJClass(‘com.hankcs.hanlp.classification.classifiers.LinearSVMClassifier’)
File “C:\Users\striker\Anaconda3\lib\site-packages\pyhanlp_init_.py”, line 162, in init
self._proxy = JClass(proxy) if type(proxy) is str else proxy
File “C:\Users\striker\Anaconda3\lib\site-packages\jpype_jclass.py”, line 130, in new
return _JClassNew(args[0], **kwargs)
File “C:\Users\striker\Anaconda3\lib\site-packages\jpype_jclass.py”, line 213, in _JClassNew
javaClass = _jpype.PyJPClass(arg)
java.lang.NoClassDefFoundError: java.lang.NoClassDefFoundError: com/hankcs/hanlp/classification/classifiers/LinearSVMClassifier
请问何晗老师怎么解决呢?下一句IOUtil=SafeJClass(‘com.hankcs.hanlp.corpus.io.IOUtil’)就是正常的。