I have a question about KONLPY KKMA error. No matching overloads found for kr.lucypark.kkma.KkmaInterface.morphAnalyzer(list)

Asked 2 years ago, Updated 2 years ago, 141 views

KONLPY's KKMA is in use, and I put the text listed in the list, and there is an error I didn't know how to solve the error, so I asked you this question Thank you

No matching overloads found for kr.lucypark.kkma.KkmaInterface.morphAnalyzer(list), options are: public java.util.List kr.lucypark.kkma.KkmaInterface.morphAnalyzer(java.lang.String) throws java.lang.Exception

from konlpy.tag import Kkma

text = []
for i in list_:
    if not "\"\n" in i :
        text.append(i)

kkma = Kkma()
sentences = kkma.sentences(text)

python konlpy nlp

2022-09-20 11:39

1 Answers

>>> from konlpy.tag import Kkma
>>> k = Kkma()

>>> text_list = ["Nice to meet you," "Who are you," "Did you eat?"]
>>> k.sentences(text_list)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\PYENVS\v3864\lib\site-packages\konlpy\tag\_kkma.py", line 89, in sentences
    sentences = self.jki.morphAnalyzer(phrase)
TypeError: No matching overloads found for kr.lucypark.kkma.KkmaInterface.morphAnalyzer(list), options are:
        public java.util.List kr.lucypark.kkma.KkmaInterface.morphAnalyzer(java.lang.String) throws java.lang.Exception

>>> text = "Hello, nice to meet you. Who do you think you are?"
>>> k.sentences(text)
["Hello", "Nice to meet you", "Who do you want to be", "Kka?"]
>>>

>>> k.sentences("\n".join(text_list))
["Nice to meet you."] "Who are you?" Did you eat?']


2022-09-20 11:39

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.