Kaihou NLP Engine is a tiny Python library that analyses the morphosyntax of a sentence with spaCy and prints a friendly description, ready to be integrated into larger translation projects such as Kaihou Engine.
- Universal POS tags and dependency relations (spaCy).
- Human‑readable translations of technical tags.
- Rich‑styled pretty‑printed tree (dark theme).
- Simple CLI (
nlp_engine.cli) with interactive menu. - Easy to extend with additional languages.
git clone https://github.com/houtarou-d/kaihou-nlp-engine.git
cd kaihou-nlp-engine
pip install -r requirements.txt
python -m spacy download es_core_news_sm # or another model# Analyse a sentence (default language)
python -m nlp_engine.cli analyze "The children are playing in the park"
# List supported language codes
python -m nlp_engine.cli list‑langs- Open
nlp_engine/analyzer.py. - Extend the
model_mapdictionary insideSpaCyAnalyzer.__init__, e.g.:model_map = {"es": "es_core_news_sm", "en": "en_core_news_sm", "it": "it_core_news_sm"}
- Run
python -m spacy download <model_name>to install the model. - The CLI will automatically accept the new
--langcode.
It serves as the linguistic analysis base that Kaihou Engine imports to provide precise, context‑aware translations.
The spaCy library that provides the NLP backbone
The Rich library for beautiful terminal output
The Click library for the CLI framework
The Python community for its extensive ecosystem
And of course every contributor who has helped improve Kaihou NLP Engine!
MIT – feel free to adapt and share!