Urgent.News

What's breaking now, across hundreds of outlets.

Tech

yolowpdf 0.2.0: Rebuilding the Math That PDF Throws Away

yolowpdf is a pure-Rust PDF-to-Markdown library that parses the format itself — no Poppler, no MuPDF. Version 0.2.0, released this week, is a consolidated release with two halves: the PDF core learned to reconstruct two-dimensional mathematics from glyph geometry, and the OCR side open-sourced its model suite. This post covers both, with the measured numbers. The problem: text survives PDF…

yolowpdf is a Rust-based library that converts PDFs into Markdown format without relying on external tools like Poppler or MuPDF. The latest version, 0.2.0, released this week, introduced significant improvements. Firstly, the PDF core was enhanced to reconstruct two-dimensional mathematics from glyph geometry. Secondly, the OCR side was open-sourced, providing access to its model suite. This article will discuss both components in detail, including performance metrics.

The issue with PDF extraction is that mathematical formulas are not stored in the file format. Instead, glyphs are placed at specific coordinates, causing text extractors to produce a linear sequence of characters. This results in loss of structure, such as the numerator and denominator in a fraction, or the limits of a summation, making it difficult for language models (LLMs) to process accurately.

Previous versions of yolowpdf struggled to handle math-heavy PDFs, achieving only 0.0881 on a benchmark suite, effectively ignoring those pages.

Version 0.2.0 addressed these problems by reconstructing geometry into structure before splitting lines. Rules, such as horizontal lines, were classified first, with shortest bars prioritized as fraction bars or overlines. Geometry-based fraction reconstruction followed TeXbook rules, ensuring accurate representation. Inner structures were folded first and re-inserted as single composite glyphs.

Big operators, matrices, and cases were handled accordingly, with drawn-as-image rules recovered during content-stream processing. Segmentation separated inline math from prose, ensuring reconstructed expressions re-entered the text flow properly.

Performance-wise, yolowpdf-0.2.0 showed a significant improvement. On the same born-digital set, the mean score increased from 0.5915 to 0.6950, with the math subset improving from 0.0881 to 0.6505. Processing speed also increased, handling 1,269 pages in 0.562 seconds (2,256 pages/second, p50 at 3.4 milliseconds per page). This was attributed to the library's optimized parsing, including a flat direct-indexed object table, zero-copy lexing, filter paths, reused inflate state, and prefix-only decoding.

Additionally, yolowpdf-ocr version 0.2.0 was released, featuring an open-source model suite. The suite includes five models: detection, multilingual recognition, Latin recognition, layout, and formula. Published on Hugging Face under MIT license, these models (BF16 safetensors) are smaller (109.59 MB) and faster compared to their predecessors.

The OCR suite also introduced a rectangular formula encoder and lossless MTP-4 speculative decoding, resulting in a 2.40 times speed improvement and 58% less memory usage on a scanned pages benchmark (0.4799 score, 2.40x faster, 938 MB peak memory vs. 2,225 MB in v1).

To use yolowpdf, simply read a PDF file and extract its content as Markdown:

```rust

fn main() {

let bytes = std::fs::read("document.pdf")?;

let doc = yolowpdf::extract(&bytes)?;

println!("{}", doc.markdown);

}

```

For scanned pages, yolowpdf-ocr can be used with the same code structure. The library and its models are available on GitHub (https://github.com/YOLOW92/yolowpdf) and crates.io (https://crates.io/crates/yolowpdf, https://crates.io/crates/yolowpdf-ocr), with the models hosted on Hugging Face (https://huggingface.co/YOLOW92/yolowocr-v2). More details, including the changelog, can be found in the repository.

Rewritten by urgent.news; may contain errors — check the original.

Source: dev.to

Read the original at dev.to →

Report a problem with this story

More in Tech

What I learned making a wipe sign in and sign up

One panel, two faces, and a line that leads the wipe. A sign in and sign up card where a link wipes the other form open from right to left with a thin edge line leading it.

  • Sign in and sign up card uses two faces on one panel with shared grid cell
  • 2px edge element animates across wipe front with cubic-bezier timing
  • Inert and aria-hidden hidden form gains focus after 380ms delay

7 Node.js Chunk Boundary Patterns: Retrieval Architecture for Game Listings

Short answer: for a retrieval architecture serving a travel itinerary planner or a game-listing index, make each chunk a stable fact, keep volatile fields separate, and carry one listing ID through…

  • Each chunk represents a stable fact with one listing ID
  • Retriever returns complete candidate with platform and region
  • Node.js pipeline keeps implementation boring and straightforward

Memory palace technique: how it works, what studies show

Originally published on Mindima Learn . In short: The memory palace technique links each thing you want to remember to a spot along a route you know well, then recalls it by walking that route in your…

  • Memory palace technique associates items with locations in familiar places.
  • Studies show biggest gains come after weeks of practice with ordered lists.
  • Memory athletes recall 70.8 words in 20 minutes, untrained recall 39.9.

More from Wednesday 25 November →