KoNLPy

0.6.0 · active · verified Fri Apr 17

KoNLPy (Korean Natural Language Processing in Python) is a Python package designed for Korean text analysis. It provides a consistent API for various popular Korean NLP tools written primarily in Java, including Hannanum, Kkma, Komoran, Mecab (unsupported on Windows), and Okt (Open Korean Text). The current version is 0.6.0, and while its release cadence is irregular, the library is actively maintained to integrate new upstream NLP tools.

Common errors

Warnings

Install

Imports

Quickstart

This quickstart demonstrates basic Korean text processing using the `Okt` (Open Korean Text) tagger, including morphological analysis, part-of-speech tagging, and noun extraction. Ensure a JDK is installed and configured for this to run.

from konlpy.tag import Okt

okt = Okt()
text = "아버지가 방에 들어가신다."

print(f"Original text: {text}")
print(f"Tokenization: {okt.morphs(text)}")
print(f"Part-of-speech tagging: {okt.pos(text)}")
print(f"Nouns: {okt.nouns(text)}")

view raw JSON →