Weights for htmlsift, a learned main-content extractor: raw HTML in, clean text, HTML or markdown out. Main content is a policy; these models learned WebMainBench's, and a few dozen labelled pages retrain them to yours.
Try it in the browser: htmlsift on Hugging Face Spaces.
mini/ — int8 ONNX bundle, runs on CPU. pip install htmlsiftbase/ — 311M encoder bundle (Granite r2, first 10 layers), GPU-capable. pip install htmlsift[full]The weights are fetched automatically on first use — you don't download them by hand.
import htmlsift
text = htmlsift.extract(html)
| model | WMB (ROUGE-5) | WCXB (word-F1, zero-shot) | DAnIEL (ROUGE-L, zero-shot) |
|---|---|---|---|
base recipe, 3 seeds |
0.9311 | 0.8633 | 0.9175 |
mini (0.3.0) |
0.9114 | 0.8529 | 0.8925 |
| trafilatura | 0.7525 | 0.8584 | 0.8255 |
| readability | 0.8016 | 0.7653 | 0.8904 |
| resiliparse | 0.7135 | 0.7909 | 0.7094 |
The shipped base seed scores 0.9288 on WMB test. Benchmarks, speed and memory are in the
package README.
Each package release pins one commit of this repo.
| htmlsift | revision | mini |
|---|---|---|
| 0.3.0 – 0.3.1 | a86f08a9ee595b89a54c144f225672e1cf5f9c4c |
311m-table-bigru-fABC-nb1-pf4-ema0.999-r128, seed 2 |
| 0.1.0 – 0.2.1 | 73ac2b978aef356e9e5772640a0c9444f2b67705 |
0.2.x mini (full-width table) |
Weights are licensed Apache-2.0. They are trained on WebMainBench (Apache-2.0) — please attribute WebMainBench when you use them.
base/weights.pt 965 MiBmini/mini-table-int8.onnx 33 MiBmini/mini-head-fABC.onnx 2 MiB