Skip to main content

Trafilatura and ReaderLM-v2: compare the work they perform

Trafilatura and ReaderLM-v2 can both turn supplied HTML into selected document content. Trafilatura uses rules and fallback extractors. ReaderLM-v2 generates Markdown or JSON with a language model. Compare the required output, source coverage, and operating cost before selecting an approach.

Extraction rules and generated output

Trafilatura's parsing and extraction stages beside ReaderLM-v2's tokenization and generation stagesTwo approaches to processing supplied HTML

Python Trafilatura parses HTML with lxml, removes candidate boilerplate, and selects content using signals such as text and link density. Its pipeline can compare fallback results from readability-lxml and jusText.12 The fast=True option skips fallback work; its speed and quality consequences depend on the input.

ReaderLM-v2 uses a Qwen2.5-1.5B-Instruct base with about 1.54 billion parameters. Its model card describes 28 transformer layers, 12 query heads, two key/value heads, 29 supported languages, and a combined input/output context up to 512K tokens.3 These are model specifications, not throughput or fidelity guarantees.

The paper describes synthetic HTML/Markdown data, long-context training, supervised fine-tuning, preference optimization, and further reinforcement training. It uses contrastive loss to address repetition.4 Generated output still needs comparison with the source.

Keep each evaluation attached to its implementation

Jina's benchmark includes main-content extraction into Markdown. It is not merely conversion of all markup, including navigation. Its datasets and metrics nevertheless differ from the ScrapingHub article benchmark and the SIGIR study, so their values do not establish a cross-tool ranking.5

Implementation and evaluationReported result
rs-trafilatura project run on ScrapingHubF1 0.966
Python Trafilatura in SIGIR 2023Macro mean F1 0.883
ReaderLM-v2 in Jina's January 2025 launch evaluationROUGE-L 0.84; Jaro-Winkler 0.82; WER 0.62
ReaderLM-v2-pro in the same launch evaluationROUGE-L 0.86; Jaro-Winkler 0.83; WER 0.39

The first row belongs to the Rust port, while the second belongs to Python Trafilatura.65 Neither measures Trafilaturacore or Markdownee. F1 is an aggregate overlap measure, not the proportion of pages extracted perfectly.

The Jina launch post reports GPT-4o at ROUGE-L 0.69 and Qwen2.5-32B-Instruct at 0.71 in that evaluation, plus JSON-schema pass rates of 0.98 for v2 and 0.99 for pro.7 The later paper uses different checkpoint labels and reports 0.99 for its final JSON result. Keep those sources separate.4

Schema conformance measures output shape. It does not prove that every extracted value is correct.

Measure runtime costs on comparable work

The rs-trafilatura project reports approximately 14.1 ms per article and 21.8 ms across its mixed page set in its own Linux benchmark.6 Those measurements do not describe Python Trafilatura, Trafilaturacore, network fetching, or browser rendering.

Jina reports 67 input tokens/s and 36 output tokens/s for a T4 example. The model card also supports CPU inference.3 A GPU is therefore an execution choice, not a mandatory condition for running the model. Input length, output length, hardware, precision, and batching affect practical performance.

Compare the same captured HTML, requested output, and hardware constraints. Include fetching and rendering only when both measured pipelines perform them. A page-per-second figure and a generated-token-per-second figure cannot be compared without that context.

Inspect the failure modes that matter

Rule-based selection can omit unusual content or retain page furniture. Generative conversion can produce plausible output that differs from the source. Inspect headings, tables, links, code, and missing passages for either approach.

Trafilatura has multiple output formats, including Markdown; it is not restricted to flattening tables into text. ReaderLM's training targets structured Markdown and JSON, but GFM table syntax still cannot represent arbitrary merged-cell HTML layouts.7

The SIGIR 2023 comparison favored heuristic methods among the systems it evaluated. It predates ReaderLM-v2 and cannot establish that model's quality.5 Similarly, the linked Ollama report concerns first-generation reader-lm in 2024, not v2.8

Neither a supplied-HTML extractor nor this model fetches missing JavaScript content by itself. Arrange browser capture when the content is absent from the response, then evaluate extraction separately.

Choose an interface and output contract

Use the Trafilatura comparison for Python extractor choices. Evaluate ReaderLM-v2 when generated Markdown or schema-shaped JSON fits the task and its inference requirements fit the deployment. The HTML-to-Markdown guide covers converters and hosted services as well.

ReaderLM-v2 is CC BY-NC 4.0, which means no commercial use without a separate agreement3.

The Rust port's license is MIT OR Apache-2.0. Keep that port-specific statement separate from Python Trafilatura's licensing.

Markdownee wraps Trafilaturacore with fetching, browser rendering, crawling, and format conversion. The Core engine is offline and pure TypeScript; its accuracy is not established by another port's benchmark. The format guide helps select the representation your content pipeline needs.

Citations

  1. Adrien Barbaresi: Trafilatura: A Web Scraping Library and Command-Line Tool for Text Discovery and Extraction. Proceedings of ACL-IJCNLP 2021: System Demonstrations, pp. 122-131

  2. Jan Pomikalek: Removing Boilerplate and Duplicate Content from Web Corpora. PhD dissertation, Masaryk University, 2011

  3. Jina AI: ReaderLM-v2 Model Card. Hugging Face. Retrieved March 27, 2026 2 3

  4. Jina AI: ReaderLM-v2: Small Language Model for HTML to Markdown and JSON. arXiv:2503.01151, 2025 2

  5. Janek Bevendorff, Sanket Gupta, Johannes Kiesel, Benno Stein: An Empirical Comparison of Web Content Extraction Algorithms. Proceedings of SIGIR 2023 2 3

  6. Murrough Foley: rs-trafilatura — Rust port of Trafilatura. Retrieved May 31, 2026 2

  7. Jina AI: ReaderLM v2: Frontier Small Language Model for HTML to Markdown and JSON. Retrieved March 27, 2026 2

  8. Ollama: reader-lm - heavy hallucinations?. GitHub issue, 2024

Updated: September 7, 2026