Skip to content

Cleanup, README rewrite, fresh demo media and committed results - #9

Merged
pavan-dangeti merged 13 commits into
mainfrom
docs/fresh-media
Oct 1, 2026
Merged

pavan-dangeti merged 13 commits into
mainfrom
docs/fresh-media

Conversation

@pavan-dangeti

Copy link
Copy Markdown
Owner

#7 and #8 were merged into their stacked base branches rather than into main, so main currently has only #6. This PR brings the rest to main in one merge.

Contents

From #7 (cleanup): dead code and restating comments removed, legacy trainer deleted, ruff and vulture gates in CI, honest empty-dashboard chart, visible feedback errors, fixed guide links. analyze() output byte-identical before and after on 804 messages.

From #8 (results and docs): result files committed so tests/test_docs_honesty.py checks the README in CI (0 skips); latency, size and batching claims corrected against regenerated results; transformers>=5 for the ML extras; bold explanation rendering.

New in this PR

  • README rewritten in a design-review format: summary of the two serving candidates, architecture, key decisions with rejected alternatives and evidence, evaluation and robustness with reproduce commands, operations, data, getting started, limitations.
  • Demo regenerated from the running app by scripts/record_demo.py: GIF (8.7 MB, renders inline), MP4 (2.2 MB, committed and linked), and seven screenshots captured in the same browser session. The old screenshots are removed; the WhatsApp capture is kept and labelled as taken on a phone.
  • Dashboard layout fix: the language chart overflowed the page at 1280 px and hid its legend.

Checks

pytest tests/ -q 96 passed, 0 skipped · ruff clean · vulture clean · mypy clean on 35 files.

- src/train.py and the legacy pickles it produced: the served model is
  trained by scripts/train_tfidf.py, and the only reader of the old pickles
  was ScamShieldInference.extract_evidence, which nothing called.
- Unused: detector latin_count and matched, ONNX binary_output,
  transformer _batch_forward, inference models_dir, a loop variable in
  generate_synthetic.
- __main__ smoke blocks; the one in database.py wrote a fake row into the real
  analysis log.
- The Windows lib/ sys.path hack in main.py (there is no lib/ directory).
- The Predictor protocol is now the declared return type of load_predictor
  instead of unused.

analyze() output is byte-identical before and after on 804 validation
messages (540 scams, 373 evidence spans).
…rt order

ruff.toml pins the rule set (pyflakes, import order, commented-out code) so
results do not depend on the installed ruff version's defaults. vulture runs at
80% confidence, which skips framework entry points such as FastAPI routes.
…ide links

- The language chart showed English: 1 when there was no data, a data point
  that never happened; it now shows an empty chart.
- Feedback that the API rejects (now including an unknown message id) left
  both buttons disabled with no message; it now says so and re-enables them.
- The About tab and docs/adding_a_language.md linked to file:///d:/ paths
  on another machine and to the removed legacy trainer; they now describe
  build_dataset, train_tfidf and evaluate_with_ci.
- Restating comments in app.js removed; the escaping rationale kept.
…erisks

Markdown is converted after HTML escaping, so it only ever adds <strong> tags.
Comparing ONNX numbers from export_model with PyTorch numbers from a different
day overstated the speed-up (5x); measured in one run it is 2.6x.
Encoders trained on Colab are saved by transformers 5 (TokenizersBackend) and do
not load under 4.x. Token ids for XLM-R are identical under both versions on all
1,554 validation messages, so published numbers are unaffected.
scripts/record_demo.py drives the web UI in Chromium and writes an MP4 (for
releases, not committed) and a GIF under 10 MB. Removes the unused frame PNGs.
…ate them

results/*.json were gitignored, so tests/test_docs_honesty.py skipped in CI and
the README was checked against nothing. They are small and contain no message
text. Regenerated: the five-model validation comparison (unchanged F1, it had
been overwritten by a single-model run), CPU latency for all six models in one
run, and encoder throughput at batch sizes 1, 8 and 32.
…esults

- ONNX int8 is 2.6x faster than PyTorch on CPU, not 5x.
- The augmented baseline is 16.6 MB, not the same 10.2 MB artefact.
- Batching lowers encoder throughput on CPU (178 -> 91 msg/s), so the design
  doc's advice to batch is replaced with the measurement.
Problem statement, live demo and GIF first; a results table with the command
for every number; architecture diagrams; model comparison, LLM arms,
robustness, serving capacity, data summary, how to run, limitations. Results
are marked validation-only until the hand-labelled test set is frozen. States
plainly that the live demo serves the baseline and why.
Summary table of the two serving candidates, architecture, the key decisions
with the rejected alternative and the evidence for each, evaluation and
robustness with reproduce commands, operations (capacity, failure modes,
observability, privacy), data, getting started, limitations. Detail tables
are collapsible so the page reads quickly. All figures are unchanged and
still checked against results/ by tests/test_docs_honesty.py.
…idths

Grid fr columns cannot shrink below a Chart.js canvas's intrinsic width, which
pushed the language chart off-screen and hid its legend at 1280 px.
…g app

scripts/record_demo.py now captures the screenshots in the same browser session
as the video. The MP4 (2.2 MB) is committed so the README can link it. The old
screenshots are replaced; the WhatsApp capture is kept, labelled as taken on a
phone, because a script cannot regenerate it.
@pavan-dangeti
pavan-dangeti merged commit a8ed5af into main Oct 1, 2026
3 checks passed
@pavan-dangeti
pavan-dangeti deleted the docs/fresh-media branch October 1, 2026 05:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant