[英]SystemError: java.nio.file.InvalidPathException:
I'm trying to learn some Korean NLP by using KoNLPy library.我正在尝试通过使用 KoNLPy 库来学习一些韩语 NLP。 This is the code that I used:
这是我使用的代码:
from konlpy.tag import Kkma
kkma=Kkma()
print(kkma.morphs("열심히 코딩한 당신, 연휴에는 여행을 가봐요"))
And I keep seeing this error:我一直看到这个错误:
Traceback (most recent call last):
File "c:\Study\NLP\2_tokenization.py", line 65, in <module>
kkma=Kkma()
File "C:\Users\ai\Anaconda3\lib\site-packages\konlpy\tag\_kkma.py", line 95, in __init__
jvm.init_jvm(jvmpath, max_heap_size)
File "C:\Users\ai\Anaconda3\lib\site-packages\konlpy\jvm.py", line 64, in init_jvm
jpype.startJVM(jvmpath, '-Djava.class.path=%s' % classpath,
File "C:\Users\ai\Anaconda3\lib\site-packages\jpype\_core.py", line 221, in startJVM
_jpype.startup(jvmpath, tuple(args),
SystemError: java.nio.file.InvalidPathException: Illegal char <*> at index 52:
C:\Users\ai\Anaconda3\Lib\site-packages\konlpy\java\*
But since I'm only at the beginning level and only just familiar with python, I can't figure out why this is happening.但由于我只是处于初级阶段,并且只熟悉 python,我无法弄清楚为什么会发生这种情况。 It seems like a problem related with JAVA.
这似乎是与 JAVA 相关的问题。
I had this same problem and I'm a beginner to so I nearly gave up, but I played around with some of the code in the konlpy module itself and got it working: Here's the fix:我遇到了同样的问题,我是初学者,所以我几乎放弃了,但我玩弄了 konlpy 模块本身中的一些代码并让它工作:这是修复:
It's mmmmprobably not a perfect solution because I have no idea what those asterisks were doing there in the first place, so I'm not sure what other problems taking them out will cause.这可能不是一个完美的解决方案,因为我不知道那些星号一开始在那里做了什么,所以我不确定将它们取出会导致什么其他问题。 BUT by doing this I finally got rid of the "SystemError: java.nio.file.InvalidPathException" and was able to make an instance of the Kkma() class and use it, so if that's all you need then hopefully this is enough:]
但是通过这样做,我终于摆脱了“SystemError:java.nio.file.InvalidPathException”并且能够创建 Kkma() class 的实例并使用它,所以如果这就是你所需要的,那么希望这就足够了: ]
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.