rhoknp

raw JSON →
1.8.0 verified Fri May 01 auth: no python

Yet another Python binding for Juman++/KNP/KWJA. Current version: 1.8.0. Provides a modern Python interface for Japanese morphological analysis (Juman++), dependency/case structure analysis (KNP), and anaphora resolution (KWJA). Follows semantic versioning with frequent patch releases.

pip install rhoknp
error ModuleNotFoundError: No module named 'rhoknp.juman'
cause Importing from deprecated submodule path used in versions <1.0.0.
fix
Change import to 'from rhoknp import Jumanpp'.
error JumanppNotFoundError: Juman++ command not found
cause The jumanpp executable is not installed or not on PATH.
fix
Install Juman++ (e.g., 'apt install jumanpp' on Ubuntu or download from https://github.com/ku-nlp/jumanpp).
breaking In v1.0.0, the import path changed from 'rhoknp.juman.jumanpp' to 'rhoknp'. Old syntax no longer works.
fix Use 'from rhoknp import Jumanpp' instead of 'from rhoknp.juman.jumanpp import Jumanpp'.
deprecated The 'analyze_sentence' method is deprecated in v1.5.0. Use 'analyze' instead.
fix Replace jumanpp.analyze_sentence(text) with jumanpp.analyze(text).
gotcha The Jumanpp/Knp/Kwja objects require the underlying executables (jumanpp, knp, kwja) to be installed on the system PATH. pip install rhoknp does not install them.
fix Install the required binaries separately (e.g., via apt, Homebrew, or source).

Basic morphological analysis with Juman++.

from rhoknp import Jumanpp
jumanpp = Jumanpp()
result = jumanpp.analyze("太郎は本を読んだ。")
for morpheme in result.morphemes:
    print(morpheme.surf, morpheme.reading)