--- license: other license_name: ai-pubs-open-rail-m-modified license_link: https://github.com/datalab-to/surya/blob/v0.17.1/MODEL_LICENSE tags: - ocr - layout-detection - table-recognition - document-conversion --- # raw2md-models This repository holds a copy of the model weights that the engine of [raw2md](https://github.com/MikeDolg/raw2md) uses. **raw2md** is a command-line tool that converts PDF, DjVu, and scanned documents to Markdown. **raw2md** downloads these files from this repository at a fixed revision. ## Origin Datalab created and trained these models for [surya](https://github.com/datalab-to/surya/tree/v0.17.1). Each folder is a copy of a checkpoint that `surya-ocr` 0.17.1 downloads from `https://models.datalab.to`. The checkpoint names come from [`surya/settings.py`](https://github.com/datalab-to/surya/blob/v0.17.1/surya/settings.py) at the tag `v0.17.1`. | Folder | Task | Size | | -------------------------------------- | ----------------------------- | -----: | | `layout/surya-2025_09_23` | page layout | 1.4 GB | | `text_recognition/surya-2025_09_23` | text recognition (OCR) | 1.4 GB | | `ocr_error_detection/surya-2025_02_18` | detection of a bad text layer | 271 MB | | `table_recognition/surya-2025_02_18` | table structure | 211 MB | | `text_detection/surya-2025_05_07` | text line detection | 77 MB | ## Changes The files are not changed. Each folder holds the same bytes as the original checkpoint, and `manifest.json` lists the files of the checkpoint. The layout `/-/` names the task, the source of the model, and the date of the checkpoint. ## License The weights are under the AI Pubs Open RAIL-M License (Modified) of Datalab. [`DATALAB_MODEL_LICENSE`](DATALAB_MODEL_LICENSE) holds the full text. It is the file `MODEL_LICENSE` in surya `v0.17.1`, without changes. The GPL-3.0-or-later license of the raw2md code does not apply to these files. You receive the files under `DATALAB_MODEL_LICENSE`, and these terms apply to you: - Section 8 applies the same license to all copies and derivatives of the model, and to the output. - Paragraph 5 makes the use restrictions in Attachment A apply to the model and to the derivatives of the model. - A use outside Attachment A needs a commercial license from Datalab: . Attachment A of `DATALAB_MODEL_LICENSE`, quoted in full: ```text Attachment A USE RESTRICTIONS As conditions to the Licenses set forth in this Agreement, You agree not to use, reproduce, modify, create or Distribute the Model, Derivatives of the Model, or Output (collectively, “Use”) in any of the following ways: 1. Legal: (a) In any way that violates any applicable national, federal, state, local or international law or regulation; or (b) to directly or indirectly infringe or misappropriate any third party intellectual property rights (including those of Licensor or any Contributor) 2. Commercial: (a) for any purpose if You (your employer, or the entity you are affiliated with) generated more than two million US Dollars ($2,000,000) in gross revenue in the prior year, except where Your Use is limited to personal use or research purposes; (b) for any purpose if You (your employer, or the entity you are affiliated with) has raised more than two million US dollars ($2,000,000) in total equity or debt funding from any source, except where Your Use is limited to personal use or research purposes; or (c) for any purpose if You (your employer, or the entity you are affiliated with) provides or otherwise makes available any product or service that competes with any product or service offered by or made available by Licensor or any of its affiliates. Commercial and broader use licenses may be available from Licensor at the following URL: https://www.datalab.to/ ``` The `README.md` files in `ocr_error_detection/surya-2025_02_18` and `table_recognition/surya-2025_02_18` come from the original checkpoints. Their metadata names `cc-by-nc-sa-4.0`. This metadata keeps the license under which surya published its weights until August 2025, and the checkpoint files stay unchanged. Since then, surya applies the license in `DATALAB_MODEL_LICENSE` to its weights, and surya `v0.17.1` loads these checkpoints under that license. The surya repository at `v0.17.1` states that its model weights use the license in `DATALAB_MODEL_LICENSE`. ## Credits Thanks to Datalab for surya, for [marker](https://github.com/datalab-to/marker), and for the weights. The original models are in the [surya repository](https://github.com/datalab-to/surya). This repository is not affiliated with Datalab, and Datalab does not endorse raw2md.