Giter Club home page Giter Club logo

python-support's Introduction

KoalaNLP

Version MIT License API Doc

Build Status Code coverage Known Vulnerabilities

분석기별 품사비교표 nodeJS python scala

소개

KoalaNLP는 한국어 처리의 통합 인터페이스를 지향하는 Java/Kotlin/Scala Library입니다.

이 프로젝트는 서로 다른 형태의 형태소 분석기를 모아, 동일한 인터페이스 아래에서 사용할 수 있도록 하는 것이 목적입니다. (정렬은 개발단체/개발자명 국문 가나다순)

주1-1 Arirang 분석기의 출력을 형태소분석에 적합하게 조금 다듬었으므로, 원본과 약간 다른 결과를 낼 수도 있습니다.

주1-2 UTagger의 2019-7 버전도 공개되어 있지만, 리눅스 개발환경을 위한 라이브러리 파일이 공개되어있지 않아 지원하지 않습니다.

분석기의 개선이나 추가 등을 하고 싶으시다면,

  • 개발이 직접 가능하시다면 pull request를 보내주세요. 테스트 후 반영할 수 있도록 하겠습니다.
  • 개발이 어렵다면 issue tracker에 등록해주세요. 검토 후 답변해드리겠습니다.

특징

KoalaNLP는 다음과 같은 특징을 가지고 있습니다.

  1. 복잡한 설정이 필요없는 텍스트 분석:

    모델은 자동으로 Maven으로 배포되기 때문에, 각 모델을 별도로 설치할 필요가 없습니다.

  2. 코드 2~3 줄로 수행하는 텍스트 처리:

    모델마다 다른 복잡한 설정 과정, 초기화 과정은 필요하지 않습니다. Dependency에 추가하고, 객체를 생성하고, 분석 메소드를 호출하는 3줄이면 끝납니다.

  3. 모델에 상관 없는 동일한 코드, 동일한 결과:

    모델마다 실행 방법, 실행 결과를 표현하는 형태가 다릅니다. KoalaNLP는 이를 정부 및 관계기관의 표준안에 따라 표준화합니다. 따라서 모델에 독립적으로 응용 프로그램 개발이 가능합니다.

  4. Java, Kotlin, Scala, Python 3, NodeJS에서 크게 다르지 않은 코드:

    KoalaNLP는 여러 프로그래밍 언어에서 사용할 수 있습니다. 어디서 개발을 하더라도 크게 코드가 다르지 않습니다.

참고

모든 코드는 Kotlin으로 작성되어 있습니다. Java나 Scala에 비해서 유지 보수에 편리하다고 판단하여 변경하였습니다.

  • Kotlin의 사용법은 Try Kotlin (공식)에서 학습하실 수 있습니다.
  • 모든 코드는 Java와 Kotlin에서 완벽히 상호 호환됩니다.
  • 더불어 기존 1.x의 Scala 사용을 지원하기 위해서 koalanlp-scala를 통해 Implicit 변환을 지원합니다.

License 조항

이 프로젝트 자체(KoalaNLP-core)와 인터페이스 통합을 위한 코드는 소스코드에 저작권 귀속에 대한 별도 지시사항이 없는 한 v1.8.0부터 MIT License을 따르며, 원본 분석기의 License와 저작권은 각 저작권자가 지정한 바를 따릅니다.

단, GPL의 저작권 조항에 따라, GPL 하에서 이용이 허가되는 패키지들의 저작권은 해당 저작권 규정을 따릅니다.

  • Hannanum 및 NLP_HUB: GPL v3
  • KKMA: GPL v2 (GPL v2를 따르지 않더라도, 상업적 이용시 별도 협의 가능)
  • KOMORAN 3.x: Apache License 2.0
  • Open Korean Text: Apache License 2.0
  • UTagger: 교육 및 연구용으로 사용시 제한 없음. 상업용인 경우 울산대와 기술이전 등의 유료 협약 필요
  • SEunjeon: Apache License 2.0
  • 아리랑: Apache License 2.0
  • RHINO: MIT (참고: 이전 버전은 GPL v3)
  • Daon: 지정된 조항 없음
  • ETRI: 별도 API 키 발급 동의 필요
  • Khaiii: Apache License 2.0

Dependency 추가

Java 패키지 목록

패키지명 설명 버전 License (원본)
koalanlp-core 통합 인터페이스의 정의가 등재된 중심 묶음입니다. Version MIT
koalanlp-scala Scala를 위한 편의기능 (Implicit conversion 등) Version MIT
koalanlp-server HTTP 서비스 구성을 위한 패키지입니다. (2.x 개발중) MIT
koalanlp-kmr 코모란 Wrapper / 분석범위: 형태소 Version Apache 2.0
koalanlp-eunjeon 은전한닢 Wrapper / 분석범위: 형태소 Version Apache 2.0
koalanlp-arirang 아리랑 Wrapper / 분석범위: 형태소 2-1 Version Apache 2.0
koalanlp-rhino RHINO Wrapper / 분석범위: 형태소 2-1 Version MIT
koalanlp-daon Daon Wrapper / 분석범위: 형태소 2-1 Version MIT(별도 지정 없음)
koalanlp-khaiii Kakao Khaiii Wrapper / 분석범위: 형태소 2-3 Version Apache 2.0
koalanlp-utagger 울산대 UTagger Wrapper / 분석범위: 형태소 2-4 Version 교육/연구용 무료, 상업용 별도협약
koalanlp-okt Open Korean Text Wrapper / 분석범위: 문장분리, 형태소 Version Apache 2.0
koalanlp-kkma 꼬꼬마 Wrapper / 분석범위: 형태소, 의존구문 2-1 Version GPL v2
koalanlp-hnn 한나눔 Wrapper / 분석범위: 문장분리, 형태소, 구문분석, 의존구문 2-1 Version GPL v3
koalanlp-etri ETRI Open API Wrapper / 분석범위: 형태소, 구문분석, 의존구문, 개체명, 의미역 Version MIT2-2

주2-1 꼬꼬마, 한나눔, 아리랑, RHINO 분석기는 타 분석기와 달리 Maven repository에 등재되어 있지 않아, 원래는 수동으로 직접 추가하셔야 합니다. 이 점이 불편하다는 것을 알기에, KoalaNLP는 assembly 형태로 해당 패키지를 포함하여 배포하고 있습니다. 포함된 패키지를 사용하려면, assembly classifier를 사용하십시오. "assembly" classifier가 지정되지 않으면, 각 분석기 라이브러리가 빠진 채로 dependency가 참조됩니다.

주2-2 ETRI의 경우 Open API를 접근하기 위한 코드 부분은 KoalaNLP의 License 정책에 귀속되지만, Open API 접근 이후의 사용권에 관한 조항은 ETRI에서 별도로 정한 바를 따릅니다. 따라서, ETRI의 사용권 조항에 동의하시고 키를 발급하셔야 하며, 다음 위치에서 발급을 신청할 수 있습니다: 키 발급 신청

주2-3 Khaiii 분석기의 경우는 Java가 아닌 C++로 구현되어 사용 전 분석기의 설치가 필요합니다. Python3.6 및 CMake 3.10+만 설치되어 있다면 설치 자체가 복잡한 편은 아니니 여기를 참조하여 설치해보세요. 참고로, KoalaNLP가 Travis CI에서 패키지를 자동 테스트하기 위해 구현된 bash script는 여기에 있습니다.

주2-4 UTagger 분석기의 경우에도 C/C++로 구현되어, 사용 전 분석기의 설치가 필요합니다. 윈도우와 리눅스(우분투, CentOS)용 라이브러리 파일만 제공되며, 설치 방법은 여기를 참조하십시오.

실행환경

  • KoalaNLP의 모든 코드는 OpenJDK 12에서 테스트 되었습니다.
  • Kotlin의 경우는 1.3.50이 기준입니다.
  • Scala의 경우는 KoalaNLP-scala 패키지의 버전에 따릅니다. 단, 은전한닢과 Open Korean Text는 의존하는 라이브러리가 Scala에서 개발되어 Scala에서 사용시 제한이 있을 수 있으며, 이는 scala-koalanlp를 참조하십시오.
  • Python과 NodeJS는 각각의 저장소를 참고하십시오: nodejs-koalanlp py-koalanlp

Gradle

ext.koala_version = '2.1.4'

repositories {
    mavenCentral()
    jcenter()
    maven { url "https://jitpack.io" } // 코모란의 경우에만 추가.
}

dependencies{
    // 코모란의 경우
    implementation "kr.bydelta:koalanlp-kmr:${ext.koala_version}" 
    // 은전한닢 프로젝트(Mecab-ko)의 경우
    implementation "kr.bydelta:koalanlp-eunjeon:${ext.koala_version}"
    // 아리랑의 경우
    implementation "kr.bydelta:koalanlp-arirang:${ext.koala_version}:assembly"
    // RHINO의 경우 
    implementation "kr.bydelta:koalanlp-rhino:${ext.koala_version}:assembly"
    // Daon의 경우
    implementation "kr.bydelta:koalanlp-daon:${ext.koala_version}:assembly"
    // OpenKoreanText의 경우
    implementation "kr.bydelta:koalanlp-okt:${ext.koala_version}" 
    // 꼬꼬마의 경우
    implementation "kr.bydelta:koalanlp-kkma:${ext.koala_version}:assembly"
    // 한나눔의 경우
    implementation "kr.bydelta:koalanlp-hnn:${ext.koala_version}:assembly" 
    // ETRI Open API의 경우
    implementation "kr.bydelta:koalanlp-etri:${ext.koala_version}"
    // Khaiii의 경우 (Khaiii C++ 별도 설치 필요)
    implementation "kr.bydelta:koalanlp-khaiii:${ext.koala_version}"
    // REST Server Service의 경우 (준비중)
    implementation "kr.bydelta:koalanlp-server:${ext.koala_version}"
}

SBT

(버전은 Latest Release 기준입니다. SNAPSHOT을 사용하시려면, latest.integration을 사용하세요.)

val koalaVer = "2.1.4"

// 코모란 분석기의 경우
resolvers += "jitpack" at "https://jitpack.io/"
libraryDependencies += "kr.bydelta" % "koalanlp-kmr" % koalaVer

// 은전한닢 분석기의 경우
libraryDependencies += "kr.bydelta" % "koalanlp-eunjeon" % koalaVer

// 아리랑 분석기의 경우
libraryDependencies += "kr.bydelta" % "koalanlp-arirang" % koalaVer classifier "assembly"

// RHINO 분석기의 경우
libraryDependencies += "kr.bydelta" % "koalanlp-rhino" % koalaVer classifier "assembly"

// Daon 분석기의 경우
libraryDependencies += "kr.bydelta" % "koalanlp-daon" % koalaVer classifier "assembly"

// Open Korean Text 분석기의 경우
libraryDependencies += "kr.bydelta" % "koalanlp-okt" % koalaVer

// 꼬꼬마 분석기의 경우
libraryDependencies += "kr.bydelta" % "koalanlp-kkma" % koalaVer classifier "assembly"

// 한나눔 분석기의 경우
libraryDependencies += "kr.bydelta" % "koalanlp-hannanum" % koalaVer classifier "assembly"

// ETRI 분석기의 경우
resolvers += Resolver.JCenterRepository
libraryDependencies += "kr.bydelta" % "koalanlp-etri" % koalaVer

// Khaiii 분석기의 경우 (Khaiii C++ 별도 설치 필요)
resolvers += Resolver.JCenterRepository
libraryDependencies += "kr.bydelta" % "koalanlp-khaiii" % koalaVer

// UTagger 분석기의 경우 (UTagger C++ 별도 설치 필요)
resolvers += Resolver.JCenterRepository
libraryDependencies += "kr.bydelta" % "koalanlp-utagger" % koalaVer

// REST Server Service의 경우 (준비중)
libraryDependencies += "kr.bydelta" % "koalanlp-server" % koalaVer

Maven

Maven을 사용하시는 경우, 다음과 같습니다. ${TAGGER_PACK}위치에는 원하는 품사분석기의 패키지를 써주시고, ${TAGGER_VER}위치에는 품사분석기의 버전을 써주세요.

<dependency>
  <groupId>kr.bydelta</groupId>
  <artifactId>koalanlp-${TAGGER.PACK}</artifactId>
  <version>${TAGGER_VER}</version>
</dependency>

Classifier를 추가하실 경우, <artifactId>다음 행에 다음 코드를 추가하세요.

  <classifier>assembly</classifier>

예를 들어서, 꼬꼬마 분석기(koalanlp-kkma) 버전 2.1.3을 추가하고자 한다면, 아래와 같습니다.

<dependency>
  <groupId>kr.bydelta</groupId>
  <artifactId>koalanlp-kkma</artifactId>
  <classifier>assembly</classifier>
  <version>2.1.3</version>
</dependency>

사용방법

아래에는 대표적인 특징만 기술되어 있습니다.

상세한 사항은 Usage, Sample 또는 API Doc을 참고하십시오.

여러 패키지의 사용

통합 인터페이스는 여러 패키지간의 호환이 가능하게 설계되어 있습니다. 이론적으로는 타 패키지의 품사 분석 결과를 토대로 구문 분석이 가능합니다.

Note:

  • 본 분석의 결과는 검증되지 않았습니다.
  • 신조어 등으로 인해 한나눔이나 꼬꼬마에서 품사 분석이 제대로 수행되지 않을 경우를 위한 기능입니다.
  • 사용자 정의 사전은 TaggerParser의 대상이 되는 패키지에 모두에 추가하여야 합니다.
  • 타 패키지의 분석 결과는 ETRI 분석기의 입력으로 쓸 수 없습니다.

Kotlin

/* 패키지 명: 한나눔(hnn), 코모란(kmr), 꼬꼬마(kkma), 은전한닢(eunjeon), 트위터(twt), 아리랑(arirang) */
// 예시에서는 트위터 문장분석기, 은전한닢 품사 분석, 꼬꼬마 구문 분석을 진행함.
import kr.bydelta.koala.twt.SentenceSplitter
import kr.bydelta.koala.eunjeon.Tagger
import kr.bydelta.koala.kkma.Parser

val splitter = SentenceSplitter()
val tagger = Tagger()
val parser = Parser()

val paragraph = "누군가가 말했다. Python에는 KoNLPy가 있다. Kotlin은 KoalaNLP가 있다."
val sentences = splitter(paragraph)
val tagged = sentences.map{ tagger.tagSentence(it) }
val parsed = tagged.map{ parser.parse(it) }

Scala

import kr.bydelta.koala.twt.SentenceSplitter
import kr.bydelta.koala.eunjeon.Tagger
import kr.bydelta.koala.kkma.Parser

val splitter = new SentenceSplitter
val tagger = new Tagger
val parser = new Parser

val paragraph = "누군가가 말했다. Python에는 KoNLPy가 있다. Scala는 KoalaNLP가 있었다."
val sentences = splitter.invoke(paragraph)
val tagged = sentences.map(tagger.tagSentence)
val parsed = tagged.map(parser.parse)

Java

import kr.bydelta.koala.twt.SentenceSplitter;
import kr.bydelta.koala.eunjeon.Tagger;
import kr.bydelta.koala.kkma.Parser;
import kr.bydelta.koala.Sentence;

SentenceSplitter splitter = new SentenceSplitter();
Tagger tagger = new Tagger();
Tagger parser = new Parser();

String paragraph = "누군가가 말했다. Python에는 KoNLPy가 있다. Java는 KoalaNLP가 있었다.";
List<String> sentences = splitter.invoke(paragraph);
for(String line : sentences){
  Sentence tagged = tagger.tagSentence(line);
  Sentence parsed = parser.parse(tagged);
}

품사분석기별 결과 비교

Sample: 결과비교를 참조해주세요.

python-support's People

Contributors

bgnkim avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

python-support's Issues

finalize 후 initialize()를 다시 하려는데 안되네요.

finalize() 후에, 다시 initialize()하려고 하는데, 아래처럼 에러가 납니다.

py4j.java_gateway Socket listening on ('127.0.0.1', 25334)
jip JVM initialization procedure is completed.
py4j.java_gateway Callback Server Shutting Down
False
py4j.java_gateway Callback Server Starting
py4j.java_gateway Socket listening on ('127.0.0.1', 25334)
Traceback (most recent call last):
  File "/home/user01/.local/lib/python3.5/site-packages/koalanlp/Util.py", line 188, in initialize
    check_jvm()
  File "/home/user01/.local/lib/python3.5/site-packages/koalanlp/jvm.py", line 34, in check_jvm
    class_of('java.lang.String')('123')
  File "/home/user01/.local/lib/python3.5/site-packages/py4j/java_gateway.py", line 1552, in __call__
    answer = self._gateway_client.send_command(command)
  File "/home/user01/.local/lib/python3.5/site-packages/py4j/java_gateway.py", line 1012, in send_command
    connection = self._get_connection()
  File "/home/user01/.local/lib/python3.5/site-packages/py4j/java_gateway.py", line 956, in _get_connection
    raise Py4JNetworkError("Gateway is not connected.")
py4j.protocol.Py4JNetworkError: Gateway is not connected.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "jvm_test.py", line 17, in <module>
    initialize(java_options="-Xmx10g -Xms10g -Dfile.encoding=utf-8", HNN='2.0.3')
  File "/home/user01/.local/lib/python3.5/site-packages/koalanlp/Util.py", line 190, in initialize
    raise Exception("JVM test failed because %s" % str(e))
Exception: JVM test failed because Gateway is not connected.`

왜 그런 건지 혹시 알 수 있을까요?

그리고 아래 코드 링크처럼 exception 메세지에 보니, koalanlp.Util.done()을 하라고 하는데, done()이란 함수가 빠진 건가요, 아니면 finalize()를 의미하는 건가요?

"Please call koalanlp.Util.done() when you want to re-initialize the JVM with other options.")

Py4JJavaError

기초정보

  • Python 버전이 얼마입니까?
    • 3.5.x
    • 3.6.x
    • [ O ] 3.7.x (jupyter lab)
  • KoalaNLP 버전이 얼마인가요?
    • 1.x
    • [ O ] 2.x
  • 문제의 유형은 어떤 것인가요?
    • [ O ] 버그리포트
    • 개선점제안
    • 사용법질문
    • 기타

재연을 위한 정보

  • 어떤 문장을 시도하셨습니까?
충돌과 폭발 등 극단상황에 대한 발주자 또는 건축주의 특별한 요구가 있는 경우에는 이를 고려하여 설계하여야 한다.

또한,

내구성능검증에서 복합열화를 무시할 수 없을 경우에는 이를 고려하여야 한다.
  • KoalaNLP를 사용한 코드 부분을 보여주세요.
from koalanlp.Util import initialize, finalize
from koalanlp import API
from koalanlp.proc import Parser

initialize(hnn='LATEST')
parser = Parser(API.HNN)
parsed = parser(sentence) # sentence에 해당 문장을 입력했음 

본문

  • 아래와 같은 에러 메세지가 발생하여 등록합니다.
[root] Java에서 처리하던 중에 문제가 발생했습니다. 문제가 계속된다면, Issue를 등록해주세요.
Traceback (most recent call last):
  File "/opt/anaconda3/lib/python3.7/site-packages/koalanlp/proc.py", line 213, in analyze
    result += py_list(self.__api.analyze(string(paragraph)), item_converter=Sentence.fromJava)
  File "/opt/anaconda3/lib/python3.7/site-packages/py4j/java_gateway.py", line 1310, in __call__
    answer, self.gateway_client, self.target_id, self.name)
  File "/opt/anaconda3/lib/python3.7/site-packages/py4j/protocol.py", line 328, in get_return_value
    format(target_id, ".", name), value)
py4j.protocol.Py4JJavaError: An error occurred while calling o209.analyze.
: java.lang.StringIndexOutOfBoundsException: begin 1, end -1, length 4
	at java.base/java.lang.String.checkBoundsBeginEnd(String.java:3756)
	at java.base/java.lang.String.substring(String.java:1902)
	at kaist.cilab.parser.corpusconverter.sejong2treebank.sejongtree.NonterminalNode.readPennInformation(NonterminalNode.java:98)
	at kaist.cilab.parser.corpusconverter.sejong2treebank.sejongtree.ParseTree.<init>(ParseTree.java:57)
	at kr.bydelta.koala.hnn.Parser.parseTreeOf(proc.kt:512)
	at kr.bydelta.koala.hnn.Parser.attachProperty(proc.kt:492)
	at kr.bydelta.koala.hnn.Parser.attachProperty(proc.kt:376)
	at kr.bydelta.koala.proc.CanAnalyzeProperty$DefaultImpls.analyze(processors.kt:625)
	at kr.bydelta.koala.proc.CanParseDependency$DefaultImpls.analyze(processors.kt)
	at kr.bydelta.koala.hnn.Parser.analyze(proc.kt:376)
	at jdk.internal.reflect.GeneratedMethodAccessor33.invoke(Unknown Source)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:564)
	at py4j.reflection.MethodInvoker.invoke(MethodInvoker.java:244)
	at py4j.reflection.ReflectionEngine.invoke(ReflectionEngine.java:357)
	at py4j.Gateway.invoke(Gateway.java:282)
	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)

koalanlp 2.1.7, initialize 에러

기초정보

  • Python 버전이 얼마입니까?
    • 3.5.x
    • 3.6.x
  • KoalaNLP 버전이 얼마인가요?
    • 1.x
    • 2.x
  • 문제의 유형은 어떤 것인가요?
    • 버그리포트
    • 개선점제안
    • 사용법질문
    • 기타

재연을 위한 정보

  • 어떤 문장을 시도하셨습니까?
[여기에 문장을 넣어주세요]
  • KoalaNLP를 사용한 코드 부분을 보여주세요.
# 여기에 사용한 코드부분을 보여주세요.
initialize(KKMA='LATEST')

Screenshot from 2021-12-09 11-35-28

본문

  • koalanlp 2.1.7 버전을 사용하려는 시도 중입니다.
    pom 파일과 jar 파일의 다운로드 기능이 제대로 작동하지 않는 것 같습니다.
    Screenshot from 2021-12-09 11-29-15

  • OS 환경은 ubuntu 18.04 LTS, 파이썬 인터프리터 버전은 3.6이고, 다음은 현재 설치해 놓은 라이브러리입니다.
    Screenshot from 2021-12-09 11-32-18

초기화 문제(Java와 통신 중에 필요한 클래스가 없다는 것을 확인했습니다.)

기초정보

  • KoalaNLP 버전은 얼마였나요?
  • 어떤 프로그래밍 언어에서 문제가 생겼습니까? ([]안에 x표하여 표기해주세요)
    • Kotlin
    • Java
    • Scala
    • 기타 JVM 계열 언어
  • 문제의 유형은 어떤 것인가요?
    • 버그리포트
    • 개선점제안
    • 사용법질문
    • 기타

재연을 위한 정보

  • 어떤 문장을 시도하셨습니까?
[고용노동부는 이런 내용을 담은 ‘2019년 사업 종류별 산재보험료율’을 지난해 12월 31일 공고했다. 지난해 산재보험의 평균 보험료율은 업종별 평균요율(1.65%)과 출퇴근재해 요율(0.15%)을 합해 1.8%였다. 올해는 업종별 평균요율(1.5%)을 0.15%포인트 인하하면서 산재보험의 전체 평균 보험요율도 0.15%포인트 인하됐다.]
  • KoalaNLP를 사용한 코드 부분을 보여주세요.

캡처

image

본문

  • 아래에 본문을 입력해주세요.
    문장분리 사용하려고 하면 계속해서 오류가 납니다. 아래와 같이 에러가 납니다. 계속 다시 설치해도 오류가 납니다. koalanlp/Utils.py에서 http를 https로 다 바꿨지만 아직도 동일한 오류가 납니다.

<오류 메시지>
[koalanlp.jip] [Checking] pom file C:\Users\win10.m2\repository\kr/bydelta/koalanlp-okt/2.1.4/koalanlp-okt-2.1.4.pom
[koalanlp.jip] [Skipped] pom file not found at C:\Users\win10.m2\repository\kr/bydelta/koalanlp-okt/2.1.4/koalanlp-okt-2.1.4.pom
[koalanlp.jip] [Checking] pom file C:\Users\win10.ivy2\cache\kr/bydelta/koalanlp-okt/2.1.4/koalanlp-okt-2.1.4.pom
[koalanlp.jip] [Skipped] pom file not found at C:\Users\win10.ivy2\cache\kr/bydelta/koalanlp-okt/2.1.4/koalanlp-okt-2.1.4.pom
[koalanlp.jip] [Checking] pom file https://oss.sonatype.org/content/repositories/public/kr/bydelta/koalanlp-okt/2.1.4/koalanlp-okt-2.1.4.pom
[koalanlp.jip] [Checking] pom file C:\Users\win10.m2\repository\kr/bydelta/koalanlp-hnn/2.1.4/koalanlp-hnn-2.1.4.pom
[koalanlp.jip] [Skipped] pom file not found at C:\Users\win10.m2\repository\kr/bydelta/koalanlp-hnn/2.1.4/koalanlp-hnn-2.1.4.pom
[koalanlp.jip] [Checking] pom file C:\Users\win10.ivy2\cache\kr/bydelta/koalanlp-hnn/2.1.4/koalanlp-hnn-2.1.4.pom
[koalanlp.jip] [Skipped] pom file not found at C:\Users\win10.ivy2\cache\kr/bydelta/koalanlp-hnn/2.1.4/koalanlp-hnn-2.1.4.pom
[koalanlp.jip] [Checking] pom file https://oss.sonatype.org/content/repositories/public/kr/bydelta/koalanlp-hnn/2.1.4/koalanlp-hnn-2.1.4.pom
[koalanlp.jip] [Checking] pom file C:\Users\win10.m2\repository\org/openkoreantext/open-korean-text/2.3.1/open-korean-text-2.3.1.pom
[koalanlp.jip] [Skipped] pom file not found at C:\Users\win10.m2\repository\org/openkoreantext/open-korean-text/2.3.1/open-korean-text-2.3.1.pom
[koalanlp.jip] [Checking] pom file C:\Users\win10.ivy2\cache\org/openkoreantext/open-korean-text/2.3.1/open-korean-text-2.3.1.pom
[koalanlp.jip] [Skipped] pom file not found at C:\Users\win10.ivy2\cache\org/openkoreantext/open-korean-text/2.3.1/open-korean-text-2.3.1.pom
[koalanlp.jip] [Checking] pom file https://oss.sonatype.org/content/repositories/public/org/openkoreantext/open-korean-text/2.3.1/open-korean-text-2.3.1.pom
[koalanlp.jip] [Checking] pom file C:\Users\win10.m2\repository\org/jetbrains/kotlin/kotlin-stdlib/1.3.50/kotlin-stdlib-1.3.50.pom
[koalanlp.jip] [Skipped] pom file not found at C:\Users\win10.m2\repository\org/jetbrains/kotlin/kotlin-stdlib/1.3.50/kotlin-stdlib-1.3.50.pom
[koalanlp.jip] [Checking] pom file C:\Users\win10.ivy2\cache\org/jetbrains/kotlin/kotlin-stdlib/1.3.50/kotlin-stdlib-1.3.50.pom
[koalanlp.jip] [Skipped] pom file not found at C:\Users\win10.ivy2\cache\org/jetbrains/kotlin/kotlin-stdlib/1.3.50/kotlin-stdlib-1.3.50.pom
[koalanlp.jip] [Checking] pom file https://oss.sonatype.org/content/repositories/public/org/jetbrains/kotlin/kotlin-stdlib/1.3.50/kotlin-stdlib-1.3.50.pom
[koalanlp.jip] [Checking] pom file C:\Users\win10.m2\repository\kr/bydelta/koalanlp-core/2.1.4/koalanlp-core-2.1.4.pom
[koalanlp.jip] [Skipped] pom file not found at C:\Users\win10.m2\repository\kr/bydelta/koalanlp-core/2.1.4/koalanlp-core-2.1.4.pom
[koalanlp.jip] [Checking] pom file C:\Users\win10.ivy2\cache\kr/bydelta/koalanlp-core/2.1.4/koalanlp-core-2.1.4.pom
[koalanlp.jip] [Skipped] pom file not found at C:\Users\win10.ivy2\cache\kr/bydelta/koalanlp-core/2.1.4/koalanlp-core-2.1.4.pom
[koalanlp.jip] [Checking] pom file https://oss.sonatype.org/content/repositories/public/kr/bydelta/koalanlp-core/2.1.4/koalanlp-core-2.1.4.pom
[koalanlp.jip] [Checking] pom file C:\Users\win10.m2\repository\net/sf/py4j/py4j/0.10.8.1/py4j-0.10.8.1.pom
[koalanlp.jip] [Skipped] pom file not found at C:\Users\win10.m2\repository\net/sf/py4j/py4j/0.10.8.1/py4j-0.10.8.1.pom
[koalanlp.jip] [Checking] pom file C:\Users\win10.ivy2\cache\net/sf/py4j/py4j/0.10.8.1/py4j-0.10.8.1.pom
[koalanlp.jip] [Skipped] pom file not found at C:\Users\win10.ivy2\cache\net/sf/py4j/py4j/0.10.8.1/py4j-0.10.8.1.pom
[koalanlp.jip] [Checking] pom file https://oss.sonatype.org/content/repositories/public/net/sf/py4j/py4j/0.10.8.1/py4j-0.10.8.1.pom
[koalanlp.jip] [Checking] pom file C:\Users\win10.m2\repository\org/sonatype/oss/oss-parent/7/oss-parent-7.pom
[koalanlp.jip] [Skipped] pom file not found at C:\Users\win10.m2\repository\org/sonatype/oss/oss-parent/7/oss-parent-7.pom
[koalanlp.jip] [Checking] pom file C:\Users\win10.ivy2\cache\org/sonatype/oss/oss-parent/7/oss-parent-7.pom
[koalanlp.jip] [Skipped] pom file not found at C:\Users\win10.ivy2\cache\org/sonatype/oss/oss-parent/7/oss-parent-7.pom
[koalanlp.jip] [Checking] pom file https://oss.sonatype.org/content/repositories/public/org/sonatype/oss/oss-parent/7/oss-parent-7.pom
[koalanlp.jip] [Checking] pom file C:\Users\win10.m2\repository\org/jetbrains/annotations/13.0/annotations-13.0.pom
[koalanlp.jip] [Skipped] pom file not found at C:\Users\win10.m2\repository\org/jetbrains/annotations/13.0/annotations-13.0.pom
[koalanlp.jip] [Checking] pom file C:\Users\win10.ivy2\cache\org/jetbrains/annotations/13.0/annotations-13.0.pom
[koalanlp.jip] [Skipped] pom file not found at C:\Users\win10.ivy2\cache\org/jetbrains/annotations/13.0/annotations-13.0.pom
[koalanlp.jip] [Checking] pom file https://oss.sonatype.org/content/repositories/public/org/jetbrains/annotations/13.0/annotations-13.0.pom
[koalanlp.jip] [Checking] pom file C:\Users\win10.m2\repository\org/jetbrains/kotlin/kotlin-stdlib-jdk8/1.3.50/kotlin-stdlib-jdk8-1.3.50.pom
[koalanlp.jip] [Skipped] pom file not found at C:\Users\win10.m2\repository\org/jetbrains/kotlin/kotlin-stdlib-jdk8/1.3.50/kotlin-stdlib-jdk8-1.3.50.pom
[koalanlp.jip] [Checking] pom file C:\Users\win10.ivy2\cache\org/jetbrains/kotlin/kotlin-stdlib-jdk8/1.3.50/kotlin-stdlib-jdk8-1.3.50.pom
[koalanlp.jip] [Skipped] pom file not found at C:\Users\win10.ivy2\cache\org/jetbrains/kotlin/kotlin-stdlib-jdk8/1.3.50/kotlin-stdlib-jdk8-1.3.50.pom
[koalanlp.jip] [Checking] pom file https://oss.sonatype.org/content/repositories/public/org/jetbrains/kotlin/kotlin-stdlib-jdk8/1.3.50/kotlin-stdlib-jdk8-1.3.50.pom
[koalanlp.jip] [Checking] pom file C:\Users\win10.m2\repository\org/jetbrains/kotlin/kotlin-stdlib-common/1.3.50/kotlin-stdlib-common-1.3.50.pom
[koalanlp.jip] [Skipped] pom file not found at C:\Users\win10.m2\repository\org/jetbrains/kotlin/kotlin-stdlib-common/1.3.50/kotlin-stdlib-common-1.3.50.pom
[koalanlp.jip] [Checking] pom file C:\Users\win10.ivy2\cache\org/jetbrains/kotlin/kotlin-stdlib-common/1.3.50/kotlin-stdlib-common-1.3.50.pom
[koalanlp.jip] [Skipped] pom file not found at C:\Users\win10.ivy2\cache\org/jetbrains/kotlin/kotlin-stdlib-common/1.3.50/kotlin-stdlib-common-1.3.50.pom
[koalanlp.jip] [Checking] pom file https://oss.sonatype.org/content/repositories/public/org/jetbrains/kotlin/kotlin-stdlib-common/1.3.50/kotlin-stdlib-common-1.3.50.pom
[koalanlp.jip] [Checking] pom file C:\Users\win10.m2\repository\com/twitter/twitter-text/1.14.3/twitter-text-1.14.3.pom
[koalanlp.jip] [Skipped] pom file not found at C:\Users\win10.m2\repository\com/twitter/twitter-text/1.14.3/twitter-text-1.14.3.pom
[koalanlp.jip] [Checking] pom file C:\Users\win10.ivy2\cache\com/twitter/twitter-text/1.14.3/twitter-text-1.14.3.pom
[koalanlp.jip] [Skipped] pom file not found at C:\Users\win10.ivy2\cache\com/twitter/twitter-text/1.14.3/twitter-text-1.14.3.pom
[koalanlp.jip] [Checking] pom file https://oss.sonatype.org/content/repositories/public/com/twitter/twitter-text/1.14.3/twitter-text-1.14.3.pom
[koalanlp.jip] [Checking] pom file C:\Users\win10.m2\repository\org/scala-lang/scala-library/${scala.version}/scala-library-${scala.version}.pom
[koalanlp.jip] [Skipped] pom file not found at C:\Users\win10.m2\repository\org/scala-lang/scala-library/${scala.version}/scala-library-${scala.version}.pom
[koalanlp.jip] [Checking] pom file C:\Users\win10.ivy2\cache\org/scala-lang/scala-library/${scala.version}/scala-library-${scala.version}.pom
[koalanlp.jip] [Skipped] pom file not found at C:\Users\win10.ivy2\cache\org/scala-lang/scala-library/${scala.version}/scala-library-${scala.version}.pom
[koalanlp.jip] [Checking] pom file https://oss.sonatype.org/content/repositories/public/org/scala-lang/scala-library/${scala.version}/scala-library-${scala.version}.pom
[koalanlp.jip] [Skipped] Pom file not found at https://oss.sonatype.org/content/repositories/public/org/scala-lang/scala-library/${scala.version}/scala-library-${scala.version}.pom
[koalanlp.jip] [Checking] pom file https://jcenter.bintray.com/org/scala-lang/scala-library/${scala.version}/scala-library-${scala.version}.pom
[koalanlp.jip] [Skipped] Pom file not found at https://jcenter.bintray.com/org/scala-lang/scala-library/${scala.version}/scala-library-${scala.version}.pom
[koalanlp.jip] [Checking] pom file https://jitpack.io/org/scala-lang/scala-library/${scala.version}/scala-library-${scala.version}.pom
[koalanlp.jip] [Skipped] Pom file not found at https://jitpack.io/org/scala-lang/scala-library/${scala.version}/scala-library-${scala.version}.pom
[koalanlp.jip] [Checking] pom file https://repo1.maven.org/maven2/org/scala-lang/scala-library/${scala.version}/scala-library-${scala.version}.pom
[koalanlp.jip] [Skipped] Pom file not found at https://repo1.maven.org/maven2/org/scala-lang/scala-library/${scala.version}/scala-library-${scala.version}.pom
[koalanlp.jip] [Checking] pom file https://insecure.repo1.maven.org/maven2/org/scala-lang/scala-library/${scala.version}/scala-library-${scala.version}.pom
[koalanlp.jip] [Skipped] Pom file not found at https://insecure.repo1.maven.org/maven2/org/scala-lang/scala-library/${scala.version}/scala-library-${scala.version}.pom
[koalanlp.jip] [Checking] pom file https://oss.sonatype.org/content/repositories/snapshots/org/scala-lang/scala-library/${scala.version}/scala-library-${scala.version}.pom
[koalanlp.jip] [Skipped] Pom file not found at https://oss.sonatype.org/content/repositories/snapshots/org/scala-lang/scala-library/${scala.version}/scala-library-${scala.version}.pom
[koalanlp.jip] [Warning] Artifact is not found: org.scala-lang:scala-library:${scala.version}
[koalanlp.jip] [Checking] pom file C:\Users\win10.m2\repository\org/jetbrains/kotlin/kotlin-stdlib-jdk7/1.3.50/kotlin-stdlib-jdk7-1.3.50.pom
[koalanlp.jip] [Skipped] pom file not found at C:\Users\win10.m2\repository\org/jetbrains/kotlin/kotlin-stdlib-jdk7/1.3.50/kotlin-stdlib-jdk7-1.3.50.pom
[koalanlp.jip] [Checking] pom file C:\Users\win10.ivy2\cache\org/jetbrains/kotlin/kotlin-stdlib-jdk7/1.3.50/kotlin-stdlib-jdk7-1.3.50.pom
[koalanlp.jip] [Skipped] pom file not found at C:\Users\win10.ivy2\cache\org/jetbrains/kotlin/kotlin-stdlib-jdk7/1.3.50/kotlin-stdlib-jdk7-1.3.50.pom
[koalanlp.jip] [Checking] pom file https://oss.sonatype.org/content/repositories/public/org/jetbrains/kotlin/kotlin-stdlib-jdk7/1.3.50/kotlin-stdlib-jdk7-1.3.50.pom
[koalanlp.jip] [Downloading] jar from https://oss.sonatype.org/content/repositories/public/kr/bydelta/koalanlp-okt/2.1.4/koalanlp-okt-2.1.4.jar
[koalanlp.jip] [Downloading] jar from https://oss.sonatype.org/content/repositories/public/kr/bydelta/koalanlp-hnn/2.1.4/koalanlp-hnn-2.1.4-assembly.jar
[koalanlp.jip] [Downloading] jar from https://oss.sonatype.org/content/repositories/public/org/openkoreantext/open-korean-text/2.3.1/open-korean-text-2.3.1.jar
[koalanlp.jip] [Downloading] jar from https://oss.sonatype.org/content/repositories/public/org/jetbrains/kotlin/kotlin-stdlib/1.3.50/kotlin-stdlib-1.3.50.jar
[koalanlp.jip] [Downloading] jar from https://oss.sonatype.org/content/repositories/public/kr/bydelta/koalanlp-core/2.1.4/koalanlp-core-2.1.4.jar
[koalanlp.jip] [Downloading] jar from https://oss.sonatype.org/content/repositories/public/net/sf/py4j/py4j/0.10.8.1/py4j-0.10.8.1.jar
[koalanlp.jip] [Downloading] jar from https://oss.sonatype.org/content/repositories/public/org/jetbrains/annotations/13.0/annotations-13.0.jar
[koalanlp.jip] [Downloading] jar from https://oss.sonatype.org/content/repositories/public/org/jetbrains/kotlin/kotlin-stdlib-jdk8/1.3.50/kotlin-stdlib-jdk8-1.3.50.jar
[koalanlp.jip] [Downloading] jar from https://oss.sonatype.org/content/repositories/public/org/jetbrains/kotlin/kotlin-stdlib-common/1.3.50/kotlin-stdlib-common-1.3.50.jar
[koalanlp.jip] [Downloading] jar from https://oss.sonatype.org/content/repositories/public/com/twitter/twitter-text/1.14.3/twitter-text-1.14.3.jar
[koalanlp.jip] [Downloading] jar from https://oss.sonatype.org/content/repositories/public/org/jetbrains/kotlin/kotlin-stdlib-jdk7/1.3.50/kotlin-stdlib-jdk7-1.3.50.jar
[koalanlp.jip] [Downloading] https://oss.sonatype.org/content/repositories/public/kr/bydelta/koalanlp-okt/2.1.4/koalanlp-okt-2.1.4.jar 20369 bytes to download
[koalanlp.jip] [Downloading] Download https://oss.sonatype.org/content/repositories/public/kr/bydelta/koalanlp-okt/2.1.4/koalanlp-okt-2.1.4.jar completed in 2.030107 secs
[koalanlp.jip] [Downloading] https://oss.sonatype.org/content/repositories/public/org/openkoreantext/open-korean-text/2.3.1/open-korean-text-2.3.1.jar 1740278 bytes to download
[koalanlp.jip] [Downloading] Download https://oss.sonatype.org/content/repositories/public/org/openkoreantext/open-korean-text/2.3.1/open-korean-text-2.3.1.jar completed in 3.136679 secs
[koalanlp.jip] [Downloading] https://oss.sonatype.org/content/repositories/public/kr/bydelta/koalanlp-core/2.1.4/koalanlp-core-2.1.4.jar 247555 bytes to download
[koalanlp.jip] [Downloading] Download https://oss.sonatype.org/content/repositories/public/kr/bydelta/koalanlp-core/2.1.4/koalanlp-core-2.1.4.jar completed in 2.852445 secs
[koalanlp.jip] [Downloading] https://oss.sonatype.org/content/repositories/public/org/jetbrains/kotlin/kotlin-stdlib/1.3.50/kotlin-stdlib-1.3.50.jar 1326269 bytes to download
[koalanlp.jip] [Downloading] Download https://oss.sonatype.org/content/repositories/public/org/jetbrains/kotlin/kotlin-stdlib/1.3.50/kotlin-stdlib-1.3.50.jar completed in 3.998941 secs
[koalanlp.jip] [Downloading] https://oss.sonatype.org/content/repositories/public/org/jetbrains/annotations/13.0/annotations-13.0.jar 17536 bytes to download
[koalanlp.jip] [Downloading] Download https://oss.sonatype.org/content/repositories/public/org/jetbrains/annotations/13.0/annotations-13.0.jar completed in 2.050517 secs
[koalanlp.jip] [Downloading] https://oss.sonatype.org/content/repositories/public/net/sf/py4j/py4j/0.10.8.1/py4j-0.10.8.1.jar 122939 bytes to download
[koalanlp.jip] [Downloading] Download https://oss.sonatype.org/content/repositories/public/net/sf/py4j/py4j/0.10.8.1/py4j-0.10.8.1.jar completed in 2.389604 secs
[koalanlp.jip] [Downloading] https://oss.sonatype.org/content/repositories/public/org/jetbrains/kotlin/kotlin-stdlib-jdk8/1.3.50/kotlin-stdlib-jdk8-1.3.50.jar 15476 bytes to download
[koalanlp.jip] [Downloading] Download https://oss.sonatype.org/content/repositories/public/org/jetbrains/kotlin/kotlin-stdlib-jdk8/1.3.50/kotlin-stdlib-jdk8-1.3.50.jar completed in 1.944012 secs
[koalanlp.jip] [Downloading] https://oss.sonatype.org/content/repositories/public/org/jetbrains/kotlin/kotlin-stdlib-common/1.3.50/kotlin-stdlib-common-1.3.50.jar 170934 bytes to download
[koalanlp.jip] [Downloading] Download https://oss.sonatype.org/content/repositories/public/org/jetbrains/kotlin/kotlin-stdlib-common/1.3.50/kotlin-stdlib-common-1.3.50.jar completed in 2.573874 secs
[koalanlp.jip] [Downloading] https://oss.sonatype.org/content/repositories/public/com/twitter/twitter-text/1.14.3/twitter-text-1.14.3.jar 50458 bytes to download
[koalanlp.jip] [Downloading] Download https://oss.sonatype.org/content/repositories/public/com/twitter/twitter-text/1.14.3/twitter-text-1.14.3.jar completed in 2.278401 secs
[koalanlp.jip] [Downloading] https://oss.sonatype.org/content/repositories/public/org/jetbrains/kotlin/kotlin-stdlib-jdk7/1.3.50/kotlin-stdlib-jdk7-1.3.50.jar 3129 bytes to download
[koalanlp.jip] [Downloading] Download https://oss.sonatype.org/content/repositories/public/org/jetbrains/kotlin/kotlin-stdlib-jdk7/1.3.50/kotlin-stdlib-jdk7-1.3.50.jar completed in 2.027206 secs
[koalanlp.jip] [Downloading] https://oss.sonatype.org/content/repositories/public/kr/bydelta/koalanlp-hnn/2.1.4/koalanlp-hnn-2.1.4-assembly.jar 81401911 bytes to download
[koalanlp.jip] [Downloading] Download https://oss.sonatype.org/content/repositories/public/kr/bydelta/koalanlp-hnn/2.1.4/koalanlp-hnn-2.1.4-assembly.jar completed in 82.371813 secs
[koalanlp.jip] JVM initialization procedure is completed.
split: 0%| | 0/1892982 [00:00<?, ?it/s][root] Java와 통신 중에 필요한 클래스가 없다는 것을 확인했습니다. 자바 Jar 파일을 강제로 다시 다운로드하는 것을 추천합니다. 처음 initialize() 함수를 호출하실 때, force_download=True를 추가해주세요.
(예) initialize(KKMA="LATEST", force_download=True).
이렇게 해도 문제가 계속된다면, Issue를 등록해주세요.
Traceback (most recent call last):
File "C:\Users\win10\Anaconda3\envs\pt\lib\site-packages\koalanlp\proc.py", line 39, in sentences
result += py_list(self.__api.invoke(string(paragraph)), lambda x: x)
File "C:\Users\win10\Anaconda3\envs\pt\lib\site-packages\py4j\java_gateway.py", line 1257, in call
answer, self.gateway_client, self.target_id, self.name)
File "C:\Users\win10\Anaconda3\envs\pt\lib\site-packages\py4j\protocol.py", line 328, in get_return_value
format(target_id, ".", name), value)
py4j.protocol.Py4JJavaError: An error occurred while calling o212.invoke.
: java.lang.NoClassDefFoundError: scala/collection/immutable/StringOps
at org.openkoreantext.processor.tokenizer.KoreanSentenceSplitter$.(KoreanSentenceSplitter.scala:30)
at org.openkoreantext.processor.tokenizer.KoreanSentenceSplitter$.(KoreanSentenceSplitter.scala)
at org.openkoreantext.processor.OpenKoreanTextProcessor$.splitSentences(OpenKoreanTextProcessor.scala:144)
at org.openkoreantext.processor.OpenKoreanTextProcessor.splitSentences(OpenKoreanTextProcessor.scala)
at kr.bydelta.koala.okt.SentenceSplitter.sentences(proc.kt:162)
at kr.bydelta.koala.proc.CanSplitSentence$DefaultImpls.invoke(processors.kt:63)
at kr.bydelta.koala.okt.SentenceSplitter.invoke(proc.kt:153)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:564)
at py4j.reflection.MethodInvoker.invoke(MethodInvoker.java:244)
at py4j.reflection.ReflectionEngine.invoke(ReflectionEngine.java:357)
at py4j.Gateway.invoke(Gateway.java:282)
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)
Caused by: java.lang.ClassNotFoundException: scala.collection.immutable.StringOps
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:602)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
... 18 more

Traceback (most recent call last):
File "C:/Users/win10/PycharmProjects/PT/data_prepro/compare_sent_spliter.py", line 82, in
main()
File "C:/Users/win10/PycharmProjects/PT/data_prepro/compare_sent_spliter.py", line 64, in main
okt_lines = okt_split(line)
File "C:/Users/win10/PycharmProjects/PT/data_prepro/compare_sent_spliter.py", line 33, in okt_split
paragraph = splitter.sentences(line)
File "C:\Users\win10\Anaconda3\envs\pt\lib\site-packages\koalanlp\proc.py", line 41, in sentences
error_handler(e)
File "C:\Users\win10\Anaconda3\envs\pt\lib\site-packages\koalanlp\jvm.py", line 207, in error_handler
raise e
File "C:\Users\win10\Anaconda3\envs\pt\lib\site-packages\koalanlp\proc.py", line 39, in sentences
result += py_list(self.__api.invoke(string(paragraph)), lambda x: x)
File "C:\Users\win10\Anaconda3\envs\pt\lib\site-packages\py4j\java_gateway.py", line 1257, in call
answer, self.gateway_client, self.target_id, self.name)
File "C:\Users\win10\Anaconda3\envs\pt\lib\site-packages\py4j\protocol.py", line 328, in get_return_value
format(target_id, ".", name), value)
py4j.protocol.Py4JJavaError: An error occurred while calling o212.invoke.
: java.lang.NoClassDefFoundError: scala/collection/immutable/StringOps
at org.openkoreantext.processor.tokenizer.KoreanSentenceSplitter$.(KoreanSentenceSplitter.scala:30)
at org.openkoreantext.processor.tokenizer.KoreanSentenceSplitter$.(KoreanSentenceSplitter.scala)
at org.openkoreantext.processor.OpenKoreanTextProcessor$.splitSentences(OpenKoreanTextProcessor.scala:144)
at org.openkoreantext.processor.OpenKoreanTextProcessor.splitSentences(OpenKoreanTextProcessor.scala)
at kr.bydelta.koala.okt.SentenceSplitter.sentences(proc.kt:162)
at kr.bydelta.koala.proc.CanSplitSentence$DefaultImpls.invoke(processors.kt:63)
at kr.bydelta.koala.okt.SentenceSplitter.invoke(proc.kt:153)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:564)
at py4j.reflection.MethodInvoker.invoke(MethodInvoker.java:244)
at py4j.reflection.ReflectionEngine.invoke(ReflectionEngine.java:357)
at py4j.Gateway.invoke(Gateway.java:282)
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)
Caused by: java.lang.ClassNotFoundException: scala.collection.immutable.StringOps
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:602)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
... 18 more

KSS 탑재 문의

기초정보

  • Python 버전이 얼마입니까?
    • 3.5.x
    • 3.6.x
  • KoalaNLP 버전이 얼마인가요?
    • 1.x
    • 2.x
  • 문제의 유형은 어떤 것인가요?
    • 버그리포트
    • 개선점제안
    • 사용법질문
    • 기타

본문

안녕하세요. 저는 한국어 문장분리 패키지인 KSS를 개발하고 있는 고현웅이라고 합니다. 이번에 박상길님으로부터 패키지를 이전받았고, 알고리즘을 많이 개선했는데요. KSS의 접근성 향상 및 koalanlp의 문장분리기능 성능 개선을 위해 해당 패키지의 문장문리 모듈과 단락청킹 기능을 이 패키지에 탑재할 수 있는지에 관해 문의드립니다.

Tagger API를 통해서 문장을 분석하면 원문의 띄어쓰기가 무조건 변경되어 분석의 어려움이 있습니다.

기초정보

  • Python 버전이 얼마입니까? 3.6
    • 3.5.x
    • 3.6.x
  • KoalaNLP 버전이 얼마인가요? 2.0.9
    • 1.x
    • 2.x
  • 문제의 유형은 어떤 것인가요? 개선점제안
    • 버그리포트
    • 개선점제안
    • 사용법질문
    • 기타

재연을 위한 정보

  • 어떤 문장을 시도하셨습니까?
[1989년 2월 15일 여의도 농민 폭력 시위를 주도한 혐의(폭력행위등처벌에관한법률위반)으로 지명수배되었다. 1989년 3월 12일 서울지방검찰청 공안부는 임종석의 사전구속영장을 발부받았다. 같은 해 6월 30일 평양축전에 임수경을 대표로 파견하여 국가보안법위반 혐의가 추가되었다. 경찰은 12월 18일~20일 사이 서울 경희대학교에서 임종석이 성명 발표를 추진하고 있다는 첩보를 입수했고, 12월 18일 오전 7시 40분 경 가스총과 전자봉으로 무장한 특공조 및 대공과 직원 12명 등 22명의 사복 경찰을 승용차 8대에 나누어 경희대학교에 투입했다. 1989년 12월 18일 오전 8시 15분 경 서울청량리경찰서는 호위 학생 5명과 함께 경희대학교 학생회관 건물 계단을 내려오는 임종석을 발견, 검거해 구속을 집행했다. 임종석은 청량리경찰서에서 약 1시간 동안 조사를 받은 뒤 오전 9시 50분 경 서울 장안동의 서울지방경찰청 공안분실로 인계되었다.]
  • KoalaNLP를 사용한 코드 부분을 보여주세요.
from koalanlp.Util import initialize, finalize
from koalanlp.proc import *
from koalanlp import API

#초기화 합니다.
initialize(java_options="-Xmx4g -Dfile.encoding=utf-8", KMR="2.0.6", EUNJEON="2.0.6", DAON="2.0.6")

# mecab(은전한닢) 품사분석기
tagger_ej = Tagger(API.EUNJEON)

# -> return : koalanlp.data.Sentence
tt =  "1989년 2월 15일 여의도 농민 폭력 시위를 주도한 혐의(폭력행위등처벌에관한법률위반)으로 지명수배되었다. 1989년 3월 12일 서울지방검찰청 공안부는 임종석의 사전구속영장을 발부받았다. 같은 해 6월 30일 평양축전에 임수경을 대표로 파견하여 국가보안법위반 혐의가 추가되었다. 경찰은 12월 18일~20일 사이 서울 경희대학교에서 임종석이 성명 발표를 추진하고 있다는 첩보를 입수했고, 12월 18일 오전 7시 40분 경 가스총과 전자봉으로 무장한 특공조 및 대공과 직원 12명 등 22명의 사복 경찰을 승용차 8대에 나누어 경희대학교에 투입했다. 1989년 12월 18일 오전 8시 15분 경 서울청량리경찰서는 호위 학생 5명과 함께 경희대학교 학생회관 건물 계단을 내려오는 임종석을 발견, 검거해 구속을 집행했다. 임종석은 청량리경찰서에서 약 1시간 동안 조사를 받은 뒤 오전 9시 50분 경 서울 장안동의 서울지방경찰청 공안분실로 인계되었다."
position = 0
text = ''
text_encoding = ''
morp_list = []
position_list = []
lemma_list = []

#1.문장전체 파싱
tagged_ej = tagger_ej.tagSentence(tt)

#1.1.원문장 인코딩
tt_encoding = tt.encode()

#2 koalanlp 파싱
for i, sentence in enumerate(tagged_ej):
  print(i+1,'번째 문장')
  print(sentence) #koalanlp.data.Sentence 
  for _, word in enumerate(sentence):
    #2.2.1 위치정보 계산
    tt_temp_encoding = tt_encoding

    word_surface = word.getSurface()
    m_word_encoding = word_surface.encode()
    print('word_surface :', word_surface)

    tt_len = len(m_word_encoding)

    print(tt_temp_encoding.decode())

    for j, _ in enumerate(tt_temp_encoding):
      if ( m_word_encoding == tt_encoding[:tt_len] ):
        text += word_surface
        tt_encoding = tt_temp_encoding[tt_len + j:]
        print('OK')
        break
      else if ( m_word_encoding == tt_encoding[:tt_len] ):
        print(j)
        print(tt_temp_encoding[j:j+1])
        text += tt_temp_encoding[j:j+1].decode()
        position += 1
        tt_encoding = tt_temp_encoding[j+1:]

    #2-2-3. 각 형태소의 위치 최종위치계산
    start_position = position
    end_position = start_position + len(word_surface.encode())
    position = end_position

    #단어의 형태소별로 처리
    print(word.surface,'=', word.singleLineString()) #koalanlp.data.Word
    morphemes_m = word.morphemes #koalanlp.data.Morpheme	
    for _, morp_pos in enumerate(morphemes_m):
      #2-2-4. 품사별로 생성처리
      morp = morp_pos.getSurface() + '/' + str(morp_pos.getTag()) + '/' + str(start_position)
      morp_list.append(morp)
      position_list.append( int(start_position) )
      lemma_list.append( morp_pos.getSurface() )
    
#2-2-5
text += tt_encoding.decode()

tt==text, morp_list, position_list, lemma_list

본문

  • 아래에 본문을 입력해주세요.
    위와 같은 코드를 통해서 Tagger API를 통해 나온 문장과 원문의 문장을 순차적으로
    byte비교하여 형태소/품사/원문에서의 byte 위치를 만드는 전처리를 하고 있습니다.
    하지만
    -> word_surface : 분경
    -> 분 경 서울청량리경찰서는 호위 학생 5명과~
    원문은 '분 경'으로 띄어서 처리되어있는데, Tagger API를 통해 분석을 하고나면 '분경'으로 붙어서 처리되어 원문에서의 위치를 찾을 수가 없습니다. Tagger API 통해 분석된 문장이 기존의 띄어쓰기를 유지할 수 있는 option이 있었으면 좋겠습니다.

initialize error `'xml.etree.ElementTree.Element' object has no attribute 'getchildren'`

기초정보

  • Python 버전이 얼마입니까?
    3.9.7
  • KoalaNLP 버전이 얼마인가요?
    koalanlp-2.1.7
  • 문제의 유형은 어떤 것인가요?
    • [ x] 버그리포트
    • 개선점제안
    • 사용법질문
    • 기타

재연을 위한 정보

  • KoalaNLP를 사용한 코드 부분을 보여주세요.
from koalanlp.Util import initialize, finalize
from koalanlp.proc import *
from koalanlp import API

# 초기화 합니다.
initialize(java_options="-Xmx4g -Dfile.encoding=utf-8", KKMA="2.0.2", EUNJEON="2.0.2", ETRI="2.0.2").

본문

안녕하세요, 패키지를 써보고 싶은데 initialize 하면 에러 메세지가 뜹니다, 수정할 수 있는 방법이 있을까요?
'xml.etree.ElementTree.Element' object has no attribute 'getchildren'

initialize 에 다른 옵션을 써도 마찬가지입니다 (예: initialize(java_options="-Xmx4g", ETRI="LATEST"))

'JavaPackage' object is not callable koalanlp

기초정보

  • Python 버전이 얼마입니까?
    • 3.5.x
    • 3.6.x
  • KoalaNLP 버전이 얼마인가요?
    • 1.x
    • 2.x
  • 문제의 유형은 어떤 것인가요?
    • 버그리포트
    • 개선점제안
    • 사용법질문
    • 기타

재연을 위한 정보

  • 어떤 문장을 시도하셨습니까?
[여기에 문장을 넣어주세요]
  • KoalaNLP를 사용한 코드 부분을 보여주세요.
from koalanlp.Util import initialize, finalize
from koalanlp import API
from koalanlp.proc import Parser

initialize(java_options="-Xmx4g", KKMA="2.0.4", ETRI="2.0.4")

parser = Parser(API.HNN) # 또는 API.KKMA, API.ETRI

본문

  • 아래에 본문을 입력해주세요.
    parser 정의 단계에서 다음과 같은 에러가 뜨는데 원인을 모르겠습니다.
    'JavaPackage' object is not callable koalanlp

initialize with 2 process.

기초정보

  • Python 버전이 3.6.9
  • KoalaNLP 버전이 2.1.3
  • 문제의 유형은 어떤 것인가요?
    그냥 쓰면 아무 문제 없는 데, 제가 uwsgi 사용하여, multiprocess 처리 하고 싶은데 initialize는 안 됩니다.
[py4j.java_gateway] An error occurred while trying to start the callback server (127.0.0.1:25334)
Traceback (most recent call last):
  File "/home/ubuntu/TTS/TTS_web_service/venv/lib/python3.6/site-packages/py4j/java_gateway.py", line 2207, in start
    self.server_socket.bind((self.address, self.port))
OSError: [Errno 98] Address already in use
[2020-08-24 16:12:08,239] ERROR in app: Exception on /api-inference [POST]
Traceback (most recent call last):
  File "/home/ubuntu/TTS/TTS_web_service/venv/lib/python3.6/site-packages/py4j/java_gateway.py", line 2207, in start
    self.server_socket.bind((self.address, self.port))
OSError: [Errno 98] Address already in use
그리고
py4j.protocol.Py4JNetworkError: An error occurred while trying to start the callback server (127.0.0.1:25334)

문제 발생합니다. 혹시 해결 방안 있으세요? 성과를 나눠 주셔서 감사합니다.

초기화 함수 initialize 관련

안녕하세요 좋은 툴을 만들어주셔서 감사합니다.

다름이 아니라 초기화 함수 initialize와 관련하여 궁금한게 있습니다.

# 초기화 합니다.
initialize(packages=[API.KKMA, API.EUNJEON], version="1.9.2", java_options="-Xmx4g -Dfile.encoding=utf-8")

이 함수를 실행할 때마다 pom repo 검색하고 jar파일을 다운 받던데
혹시 이 과정을 skip할 수 있는 방법이 있을까요?

답변 부탁드려요.

감사합니다.

장고서버에 koalanlp를 이용한 프로젝트를 올리려고 합니다..

기초정보

  • Python 버전은요? (Version of the Python)? 3.6(가상환경)
  • KoalaNLP 버전은요? (Version of KoalaNLP)? 1.1.7
  • 문제의 유형은 어떤 것인가요? (Type of this issue)?
    • 사용법질문. Question about using KoalaNLP

본문

  • 아래에 본문을 입력해주세요. (Describe your issue here.)

안녕하세요, koalanlp를 사용하여 개인적인 프로젝트를 진행중인 학생입니다.

다름이 아니라, koalanlp를 사용한 프로젝트를, 장고 서버에 올려서 배포를 하려고 하는데,
문제가 발생하는 것 같습니다.

로컬환경에선 전혀 문제가 없지만,
파이썬3.6 가상환경 + AWS Elasticbeanstalk 환경에서 배포를 시도하면,
koalanlp 와 하위모듈인 pyjnius모듈 설치과정에서 에러가 발생합니다!
(Unable to determine JDK_HOME)

제가 알기로는, pyjnius모듈을 통해서, jdk,jre경로를 찾아서 자바클래스를 import해주는 것 같은데,
장고서버에 배포를 하는 것은 불가능 한건가요?

혹시, 배포를 해보신 분이나, 아시는 내용이 있으면 답변 부탁드립니다..
감사합니다!!!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.