shineware / PyKOMORAN

(Beta) PyKOMORAN is wrapped KOMORAN in Python using Py4J.
https://pydocs.komoran.kr
Apache License 2.0
41 stars 5 forks source link

대량으로 분석 시 Py4J Error #55

Closed simonezz closed 3 years ago

simonezz commented 3 years ago

안녕하세요. 형태소 분석시 PyKomoran을 잘 사용하고 있었는데 예상치 못한 에러 발생으로 문의드립니다.

문제 설명

무엇이, 어떻게 문제인가요?

22만개 정도의 텍스트 분석 시 처음 3만개 정도는 잘 되다가 다음과 같은 에러가 발생합니다. `Py4JError Traceback (most recent call last)

in 5 6 ----> 7 for vv in komoran.get_morphes_by_tags(t, tag_list=['VV','VX']): 8 v.add(vv+"다") 9 ~\anaconda3\envs\py37\lib\site-packages\PyKomoran\core.py in wrapper(self, *args, **kwargs) 66 if not self._komoran.isInitialized(): 67 raise KomoranError("Komoran is NOT initialized!") ---> 68 return func(self, *args, **kwargs) 69 70 return wrapper ~\anaconda3\envs\py37\lib\site-packages\PyKomoran\core.py in get_morphes_by_tags(self, sentence, tag_list) 177 raise KomoranError("Param tag_list should be list type") 178 --> 179 self._komoran.analyze(sentence) 180 return list(self._komoran.getMorphesByTags(tag_list)) 181 ~\anaconda3\envs\py37\lib\site-packages\py4j\java_gateway.py in __call__(self, *args) 1284 answer = self.gateway_client.send_command(command) 1285 return_value = get_return_value( -> 1286 answer, self.gateway_client, self.target_id, self.name) 1287 1288 for temp_arg in temp_args: ~\anaconda3\envs\py37\lib\site-packages\py4j\protocol.py in get_return_value(answer, gateway_client, target_id, name) 330 raise Py4JError( 331 "An error occurred while calling {0}{1}{2}. Trace:\n{3}\n". --> 332 format(target_id, ".", name, value)) 333 else: 334 raise Py4JError( Py4JError: An error occurred while calling o414272.analyze. Trace: py4j.Py4JException: Method analyze([class java.lang.Double]) does not exist at py4j.reflection.ReflectionEngine.getMethod(ReflectionEngine.java:318) at py4j.reflection.ReflectionEngine.getMethod(ReflectionEngine.java:326) at py4j.Gateway.invoke(Gateway.java:274) at py4j.commands.AbstractCommand.invokeMethod(AbstractCommand.java:132) at py4j.commands.CallCommand.execute(CallCommand.java:79) at py4j.GatewayConnection.run(GatewayConnection.java:238) at java.base/java.lang.Thread.run(Thread.java:832)` ## 재현 경로 _어떻게 하면 동일한 문제가 계속 발생하나요?_ 3만개 이상의 text iterative하게 실행 시 ## 기대 상황 _정상적인 상황에서는 어떻게 동작해야 한다고 생각하세요?_ 정상적으로 해당 태그에 해당하는 형태소를 보여줌 ## 환경 정보 _어떤 환경에서 이 문제가 발생하였나요?_ * OS 종류 / 버전: ubuntu 20.04 * PyKomoran 버전: 0.1.5 * Python 버전: 3.7 * Py4J 버전: 0.10.8 ## 추가 정보 _스크린샷이나 에러 로그 등, 추가 정보가 있다면 남겨주세요._ 제가 사용한 코드는 다음과 같습니다. ![image](https://user-images.githubusercontent.com/73181519/111722192-b190c100-88a4-11eb-83cb-3b48fba56702.png) https://github.com/shineware/PyKOMORAN/issues/48#issuecomment-504794685 와 같은 문제일까요? 감사합니다.
simonezz commented 3 years ago

text에 string이 아닌 Nan을 넣어 발생한 문제였습니다.