jasperdew commited on
Commit
c3f97e6
·
verified ·
1 Parent(s): c6a2deb

Rewrite card: PDF to Markdown positioning, quick start, licence in plain words

Browse files
Files changed (1) hide show
  1. README.md +27 -16
README.md CHANGED
@@ -18,17 +18,16 @@ tags:
18
  - onnx
19
  - rag
20
  - pdf-to-markdown
 
21
  ---
22
 
23
- # PDFluent formula recognition (ONNX): math formula image to LaTeX
24
 
25
- This model converts cropped images of display math formulas from PDFs to LaTeX, for developers building document-processing and PDF-to-Markdown pipelines.
26
 
27
- Model name: `formula-own-v1`. Encoder, decoder and vocabulary are three files: `encoder.onnx`, `decoder.onnx`, `vocab.json`.
28
 
29
- ## Quick start
30
-
31
- With the PDFluent SDK (Python, SDK 1.3.0 or newer):
32
 
33
  ```bash
34
  pip install pdfluent
@@ -36,13 +35,13 @@ pdfluent models install formula
36
  ```
37
 
38
  ```python
39
- import pdfluent
40
-
41
- doc = pdfluent.open("paper.pdf")
42
- markdown = doc.extract_markdown(formula_model=True) # display formulas appear as $$...$$
43
- print(markdown)
44
  ```
45
 
 
 
 
 
46
  With plain onnxruntime, to load the three files and inspect the interface:
47
 
48
  ```python
@@ -60,6 +59,14 @@ for name, sess in (("encoder", encoder), ("decoder", decoder)):
60
 
61
  Image preprocessing and the decoding loop are implemented in the SDK. If you drive the model yourself, decode greedily from `<bos>` (id 1) until `<eos>` (id 2) and map ids back to LaTeX tokens with `vocab.json`.
62
 
 
 
 
 
 
 
 
 
63
  ## Inputs and outputs
64
 
65
  The model takes a greyscale image of a formula and its width as input. It outputs token ids mapped to LaTeX via the vocabulary. In the PDFluent SDK 1.3.0, enable it with `pdfluent models install formula` and `formula_model=True` in `extract_markdown`. The SDK wraps the LaTeX in `$$ ... $$` in the Markdown output.
@@ -88,11 +95,13 @@ Provenance: [PROVENANCE.md](PROVENANCE.md). Digests of the three weight files ar
88
  - Display formulas only, no inline formulas.
89
  - Input must be a tight crop of one formula; layout detection is handled by the SDK.
90
 
91
- ## Licence
 
 
92
 
93
- Weights are offered under AGPL-3.0-only or the PDFluent Commercial Licence. Commercial use without AGPL obligations requires the commercial licence: https://pdfluent.com/license. Copyright 2026 Innovation Trigger B.V. Training papers retain their original CC BY and CC0 licences.
94
 
95
- Licence texts: [LICENSE](LICENSE) (AGPL-3.0) and [LICENSE-COMMERCIAL](LICENSE-COMMERCIAL).
96
 
97
  ## Citation
98
 
@@ -111,9 +120,11 @@ Licence texts: [LICENSE](LICENSE) (AGPL-3.0) and [LICENSE-COMMERCIAL](LICENSE-CO
111
 
112
  - Website: https://pdfluent.com
113
  - Documentation: https://pdfluent.com/docs
114
- - Licence: https://pdfluent.com/license
115
  - SDK source and releases: https://github.com/pdfluent/pdfluent-sdk
 
116
  - Organisation: https://huggingface.co/PDFluent
117
  - Formula recognition model: https://huggingface.co/PDFluent/formula-recognition-onnx
118
  - Heading level classifier: https://huggingface.co/PDFluent/pdf-heading-level-classifier
119
- - Layout ground-truth sample: https://huggingface.co/datasets/PDFluent/pdf-document-layout-ground-truth
 
 
18
  - onnx
19
  - rag
20
  - pdf-to-markdown
21
+ - document-parsing
22
  ---
23
 
24
+ # PDFluent Formula Recognition (ONNX): Math Formula to LaTeX for PDF to Markdown
25
 
26
+ Convert cropped images of PDF display math formulas into LaTeX with this ONNX model. For developers building PDF-to-Markdown and RAG pipelines, it plugs into the PDFluent SDK, which scores the highest overall on opendataloader-bench of the engines on its public leaderboard*. Formulas output as $$...$$ blocks in your Markdown.
27
 
28
+ \* Measured with the benchmark's own harness and evaluator on its 200 documents, PDFluent SDK 1.3.0, `quality="auto"` with `keep_furniture=True`, on Linux (CPU only), 29 October 2026: 0.9168 overall against 0.907 for opendataloader [hybrid], 0.885 for nutrient and 0.882 for docling. Competitor figures are taken from the benchmark's public README (read 2 November 2026), not re-run by us (our own re-run of opendataloader [hybrid] on 28 October 2026 gave 0.9068). PDFluent is not on that leaderboard; the results are submitted in a pull request: https://github.com/opendataloader-project/opendataloader-bench/pull/37. Development was optimised for this benchmark among its targets. The scores are measured on the benchmark's own 200 documents. The 19-measure result on our own held-out half and the separate checks are on pdfluent.com/benchmarks. The scores come from a release candidate wheel of 1.3.0 that reported version 1.2.0. Speed is not published. The run keeps page headers and footers, because the benchmark's ground truth counts them as content. The difference is one run without a confidence interval.
29
 
30
+ ## Use it in two lines
 
 
31
 
32
  ```bash
33
  pip install pdfluent
 
35
  ```
36
 
37
  ```python
38
+ import pdfluent; print(pdfluent.open("paper.pdf").extract_markdown(formula_model=True)) # display formulas appear as $$...$$
 
 
 
 
39
  ```
40
 
41
+ The formula model is off by default. The command above installs it and the flag switches it on.
42
+
43
+ ## Inspect the ONNX files without the SDK
44
+
45
  With plain onnxruntime, to load the three files and inspect the interface:
46
 
47
  ```python
 
59
 
60
  Image preprocessing and the decoding loop are implemented in the SDK. If you drive the model yourself, decode greedily from `<bos>` (id 1) until `<eos>` (id 2) and map ids back to LaTeX tokens with `vocab.json`.
61
 
62
+ ## What you get
63
+
64
+ - ONNX files (encoder.onnx, decoder.onnx, vocab.json) for local inference
65
+ - LaTeX output in $$...$$ for Markdown compatibility
66
+ - Direct integration into PDFluent SDK parsing workflows
67
+ - Training provenance file listing all arXiv source papers
68
+ - Licence choice: AGPL-3.0-only or PDFluent Commercial Licence
69
+
70
  ## Inputs and outputs
71
 
72
  The model takes a greyscale image of a formula and its width as input. It outputs token ids mapped to LaTeX via the vocabulary. In the PDFluent SDK 1.3.0, enable it with `pdfluent models install formula` and `formula_model=True` in `extract_markdown`. The SDK wraps the LaTeX in `$$ ... $$` in the Markdown output.
 
95
  - Display formulas only, no inline formulas.
96
  - Input must be a tight crop of one formula; layout detection is handled by the SDK.
97
 
98
+ ## Licence in plain words
99
+
100
+ Model weights are AGPL-3.0-only or available under the PDFluent Commercial Licence. AGPL works for open-source projects. Closed-source products or those avoiding AGPL obligations need the commercial licence. Details at https://pdfluent.com/license.
101
 
102
+ ## Try PDFluent
103
 
104
+ Run `pip install pdfluent`, install the formula model and watch display formulas in your own papers come out as LaTeX. See the SDK at github.com/pdfluent/pdfluent-sdk and docs at pdfluent.com/docs.
105
 
106
  ## Citation
107
 
 
120
 
121
  - Website: https://pdfluent.com
122
  - Documentation: https://pdfluent.com/docs
123
+ - SDK on PyPI: https://pypi.org/project/pdfluent/
124
  - SDK source and releases: https://github.com/pdfluent/pdfluent-sdk
125
+ - Licence: https://pdfluent.com/license
126
  - Organisation: https://huggingface.co/PDFluent
127
  - Formula recognition model: https://huggingface.co/PDFluent/formula-recognition-onnx
128
  - Heading level classifier: https://huggingface.co/PDFluent/pdf-heading-level-classifier
129
+ - Layout ground-truth dataset: https://huggingface.co/datasets/PDFluent/pdf-document-layout-ground-truth
130
+ - Collection: https://huggingface.co/collections/PDFluent/pdfluent-document-ai-6ae99736adab8c6d90781ab5