Skip to main content

🥷 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.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for language-ninja 2.2.0
File Size Uploaded
language_ninja-2.2.0.tar.gz 13.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for language-ninja 2.2.0
File Interpreter ABI Platform
language_ninja-2.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 26.0 kB

Release files / language_ninja-2.2.0.tar.gz

Download URL language_ninja-2.2.0.tar.gz
Size 13.2 kB
Tags Source
SHA-256 checksum
How to use checksums
1ee78aafd7faefd74af76f7909d217fd5a854e908bb7b94dfef27ef4d30b9341
BLAKE2b-256 checksum
How to use checksums
87539c7e8cf53fb76753fccdf3c14695cf885104eacd6551f92ca754a86c1632
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 25, 2026.

Transparency log

Release files / language_ninja-2.2.0-py3-none-any.whl

Download URL language_ninja-2.2.0-py3-none-any.whl
Size 12.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d55333d3a6ab56af1a902bd6598790d265244954910bbd761bdb2a73ac2040df
BLAKE2b-256 checksum
How to use checksums
33ec7e0e2c0185c48f98a1d15d7822f3a52ad00eae14d3840f43fe1a94b98ba6
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 25, 2026.

Transparency log

Release history Release notifications | RSS feed

2.2.1

2 release files

This release

2.2.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page