Konoha is a Python library (v5.7.0) that provides a unified, easy-to-use interface for various Japanese tokenizers, including MeCab, Sudachi, and Sentencepiece. It allows developers to seamlessly switch between different tokenizers and also offers rule-based tokenizers (whitespace, character) and a sentence splitter. The library is actively maintained with its latest release in March 2026.
pip install 'konoha[all]'Verified import paths — ran on the pinned version, not inferred.
Demonstrates basic word-level tokenization of a Japanese sentence using the `WordTokenizer` with MeCab. Ensure the necessary tokenizer is installed as an extra.
Use `pip install 'konoha[all]'` or `pip install 'konoha[<tokenizer_name>]'` to include desired tokenizer dependencies.
Refer to the latest documentation or GitHub README for updated API paths when using the Konoha Docker image. For example, check release notes at `https://github.com/himkt/konoha/releases/tag/v4.6.4`.
Always pass the `model_path` argument when initializing `WordTokenizer('Sentencepiece', model_path="your/model.spm")`.Install konoha with the mecab extra: `pip install 'konoha[mecab]'` or `pip install 'konoha[all]'`.
Install konoha with the sudachi extra: `pip install 'konoha[sudachi]'` or `pip install 'konoha[all]'`.
Provide the path to your Sentencepiece model file: `WordTokenizer('Sentencepiece', model_path="path/to/your/model.spm")`.