eKoNLPy
eKoNLPy is a Python library for Korean text processing in economic and financial research. It provides a MeCab based tagger with an economic vocabulary and lexicon based sentiment analyzers for Korean and English text.
This documentation follows the repository source, which may include unreleased changes. Published versions are listed on PyPI.
Install
python -m pip install ekonlpy
eKoNLPy supports Python 3.9 or newer, below Python 4. The main CI matrix tests Python 3.12-3.14 on Linux, macOS, and Windows, and Python 3.9-3.11 on Linux. For Jupyter or Colab, install into the active kernel:
%pip install ekonlpy
Quick start
from ekonlpy import Mecab
tagger = Mecab()
print(tagger.pos("금통위는 금리정책을 결정했다."))
The default tagger applies eKoNLPy's extended vocabulary. Use
Mecab(use_original_tagger=True) for the underlying fugashi/MeCab tagger.
Instances keep their dictionaries, synonyms, and lemmas separate from one
another. See the documentation for tagging,
custom vocabularies, sentiment analyzers, and the CLI.
Sentiment example
from ekonlpy.sentiment import MPKO
analyzer = MPKO(kind=1)
tokens = analyzer.tokenize("금리 인상이 필요하다")
print(analyzer.get_score(tokens))
The sentiment package also exports EUKO, , , , and .
uses KoNLPy's Java backed tokenizer and is optional. The separate
analyzer is another optional KoNLPy integration.