verbatim-sum-24m)verbatim-sum-24m is a 20.47 MB (19.76 MB ONNX model + 0.71 MB tokenizer) neural extractive summarizer built for length-controlled, single-paragraph summaries (for example 50, 60, 70, or 100 words) with 0% hallucination guaranteed.
Because every output sentence is selected verbatim from the source document by a document-level neural scorer, names, numbers, dates, and quotes are preserved intact. It runs in 31 to 78 ms on standard Linux VPS CPUs (88.9 MB RAM RSS, no PyTorch required), 38 to 62 ms in the browser on WebGPU, and 240 ms in browser CPU-only WASM.
23,996,673 (all-MiniLM-L6-v2 6-layer encoder, d=384, plus a 1-layer 6-head Inter-Sentence Transformer and document-context fusion head)verbatim-sum-24m.onnx: 19.76 MB, tokenizer.json: 0.71 MB)MatMulNBits (block_size=32, accuracy_level=1 MLAS INT8 CPU kernels and native WGSL WebGPU shaders) + per-row INT8 Gather embeddings + SDPA graph optimization (17 redundant IsNaN and duplicate Where nodes removed with 0.0000000 numerical difference)0.0% (1,200 / 1,200 unseen test documents verified 100% verbatim)Trained on 40,302 oracle-labeled documents (1,200 validation, 1,200 unseen test) combining greedy BERTSUM joint ROUGE-1+2 oracles and continuous soft per-sentence ROUGE targets. verbatim-sum-24m beats the matched-budget Lead baseline on all 6 unseen domains:
| Domain | Test docs | Lead ROUGE-1 | Verbatim-Sum 24M ROUGE-1 | Lift (R1) | ROUGE-2 | ROUGE-L |
|---|---|---|---|---|---|---|
Policy (BillSum) |
137 | 35.82 | 40.93 | +5.12 | 18.35 | 26.56 |
Dialogue (DialogSum) |
120 | 29.28 | 33.38 | +4.11 | 13.43 | 26.84 |
News (XSum) |
146 | 17.82 | 21.10 | +3.28 | 3.69 | 14.62 |
Science (PubMed) |
46 | 28.97 | 30.52 | +1.55 | 8.08 | 16.63 |
News (CNN/DailyMail) |
702 | 31.21 | 31.73 | +0.52 | 12.02 | 21.87 |
News (BBC News) |
49 | 58.09 | 58.60 | +0.51 | 45.87 | 41.27 |
| All 1,200 unseen docs | 1,200 | 30.92 | 32.70 | +1.78 | 13.10 | 22.61 |
rouge-score (600 unseen test docs): ROUGE-1 36.34 (+3.35 over Lead 32.99), ROUGE-2 15.01, ROUGE-L 24.42 (+2.47 over Lead 21.95).4.73 words MAE across dynamic 30 to 140 word targets (3.35 words MAE at a fixed 60-word target).| Runtime | Warm latency | Footprint | Faithfulness |
|---|---|---|---|
Browser WebGPU ([email protected], Intel Arc) |
38 to 62 ms | 20.47 MB download | 100% verbatim |
| Linux / Python CPU (6 threads, ONNX Runtime) | 31 to 62 ms | 88.9 MB RAM RSS | 100% verbatim |
| Linux / Python CPU (4 threads) | 39 to 50 ms | 88.9 MB RAM RSS | 100% verbatim |
| Linux / Python CPU (2 threads, small VPS) | 63 to 78 ms | 88.9 MB RAM RSS | 100% verbatim |
| Browser CPU-only (4-thread SIMD WASM) | 240 ms | 20.47 MB download | 100% verbatim |
git clone https://huggingface.co/Uddipan242/verbatim-sum-24m
cd verbatim-sum-24m
pip install -r requirements-inference.txt
python runtime/python/server.py --host 0.0.0.0 --port 8080
Call the HTTP API:
curl -X POST http://127.0.0.1:8080/api/summarize \
-H "Content-Type: application/json" \
-d '{"text": "Your article text...", "words": 60}'
Or run the CLI directly:
python runtime/python/extractive_summarizer.py --words 60 --file article.txt
huggingface_hubfrom huggingface_hub import snapshot_download
import sys
repo_dir = snapshot_download("Uddipan242/verbatim-sum-24m")
sys.path.insert(0, f"{repo_dir}/runtime/python")
from extractive_summarizer import ExtractiveSummarizer
summarizer = ExtractiveSummarizer(repo_dir)
result = summarizer.summarize(article_text, target_words=60)
print(result["summary"])
print(result["word_count"], result["latency_ms"], result["faithfulness"])
With python runtime/python/server.py --port 8080 running, open:
http://localhost:8080/runtime/web/index.html (automatic WebGPU, fallback to WASM)http://localhost:8080/runtime/web/index.html?backend=wasm (browser CPU-only multi-threaded SIMD WASM)http://localhost:8080/runtime/web/index.html?backend=api (routes directly to the VPS CPU API)The pure-JavaScript WordPiece tokenizer and sentence splitter in runtime/web/extractive_summarizer.js are verified at 100.0% (156 / 156) exact parity against Python tokenizers.
[CLS] S1 [SEP] [CLS] S2 [SEP] ...) with alternating segment IDs and 4 global position features (normalized position, lead-3 indicator, log word length, and numeric/quote flag).bert-base-uncased WordPiece vocabulary). Because outputs are strictly verbatim extracts, the model does not paraphrase across sentences; very long single sentences may cause final word counts to vary by a few words around the target.