Repository navigation
Cleanup, README rewrite, fresh demo media and committed results - #9
Merged
Merged
Conversation
- 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
#7 and #8 were merged into their stacked base branches rather than into
main, somaincurrently has only #6. This PR brings the rest tomainin 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.pychecks the README in CI (0 skips); latency, size and batching claims corrected against regenerated results;transformers>=5for the ML extras; bold explanation rendering.New in this PR
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.Checks
pytest tests/ -q96 passed, 0 skipped ·ruffclean ·vultureclean ·mypyclean on 35 files.