🥷 Language Trainer Ninja v2.2
A keyboard-first Textual NLP workstation for sentiment analysis, model training, dataset inspection, notes, history, SQLite queries, and CSV/JSON export.
v2.2 model
The bundled model is now a calibrated classical NLP pipeline rather than the earlier small Naive Bayes/logistic baseline:
Word TF-IDF (1–3 grams) ─┐
├─ FeatureUnion ─ Linear SVM ─ 5-fold sigmoid calibration ─ probabilities
Char TF-IDF (3–5 grams) ─┘
Why both feature families:
- Word n-grams capture phrases such as
not good,really love, and longer contrast patterns. - Character n-grams improve handling of contractions, punctuation, spelling variation, and unseen word forms.
- A balanced Linear SVM supplies a strong decision boundary for sparse text.
- Sigmoid calibration turns SVM margins into class probabilities for the confidence display.
The starter corpus contains 1,500 balanced examples:
positive 500
neutral 500
negative 500
It includes straightforward sentiment, conversational phrasing, negation, contrast, and neutral operational language.
The built-in holdout score is useful as a regression check, but the starter corpus contains generated/template-assisted examples. Treat its very high holdout accuracy as an internal sanity metric, not as proof of production-level real-world accuracy.
Install
cd ~/Downloads/language-trainer-ninja-master
python3 -m venv .venv
source .venv/bin/activate
python -m pip install --upgrade pip
python -m pip install -e .
language-ninja
A trained models/sentiment_model.pkl is included, so Analyze can work immediately. Use Train → Train Model after changing the dataset.
Confidence
The TUI displays all three calibrated probabilities:
Prediction: NEGATIVE • HIGH CONFIDENCE
Winning probability: 82.8%
POS 9.5% NEU 7.6% NEG 82.8%
UI guidance:
HIGH 75–100%
MODERATE 55–74%
LOW below 55%
These labels describe the model's probability separation, not a guarantee of correctness.
Pages
Analyze
Paste conversational text and inspect the winning class plus positive, neutral, and negative probabilities. Every prediction is written to History.
Train
Train from a text,label CSV. The status panel reports row counts, algorithm, feature count, holdout accuracy, macro F1, and per-class precision/recall/F1.
Dataset
Inspect the examples used to train the model and export them to CSV or JSON.
Notes
Save experiment notes or attach a note to the most recent prediction.
History
Review every prediction with POS / NEU / NEG probabilities and a HIGH/MODERATE/LOW confidence level.
Database
Run read-only SELECT, WITH, and PRAGMA queries against the SQLite database.
Export
Export predictions, notes, datasets, and query results to ./exports/.
Rebuild the bundled corpus
The deterministic corpus generator is included:
python tools/build_starter_corpus.py
Then retrain from the TUI, or use the Python ML module.
Run tests
python -m pytest -q
Release files for language-ninja 2.2.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| language_ninja-2.2.1.tar.gz | 347.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| language_ninja-2.2.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 693.4 kB
Release files / language_ninja-2.2.1.tar.gz
| Download URL | language_ninja-2.2.1.tar.gz |
|---|---|
| Size | 347.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b5bcc4947abf26b03b133d0f2fbb07a803d9d882af310cef7db1c93dbcee85d1
|
|
BLAKE2b-256 checksum How to use checksums |
f0cb2de72a2d8b6477f2eaf85384071a84f1aa23fe11cf0be66fb1038d626454
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 26, 2026.
Transparency logRelease files / language_ninja-2.2.1-py3-none-any.whl
| Download URL | language_ninja-2.2.1-py3-none-any.whl |
|---|---|
| Size | 345.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e32eab4cc2fc9da9996f7a8ab84482be47e7dbcf6e0f2ffdbdc6e9aacb39fbe5
|
|
BLAKE2b-256 checksum How to use checksums |
6b9c66aa8dc9ac56061e94f68ef86d69d164403a69c37de9817f2cbbd8490755
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 26, 2026.
Transparency log