ochq vikp commited on
Commit
2381e81
·
0 Parent(s):

Duplicate from datalab-to/indra-ocr

Browse files

Co-authored-by: Vikas Paruchuri <vikp@users.noreply.huggingface.co>

.gitattributes ADDED
@@ -0,0 +1,50 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ *.7z filter=lfs diff=lfs merge=lfs -text
2
+ *.arrow filter=lfs diff=lfs merge=lfs -text
3
+ *.bin filter=lfs diff=lfs merge=lfs -text
4
+ *.bz2 filter=lfs diff=lfs merge=lfs -text
5
+ *.ckpt filter=lfs diff=lfs merge=lfs -text
6
+ *.ftz filter=lfs diff=lfs merge=lfs -text
7
+ *.gz filter=lfs diff=lfs merge=lfs -text
8
+ *.h5 filter=lfs diff=lfs merge=lfs -text
9
+ *.joblib filter=lfs diff=lfs merge=lfs -text
10
+ *.lfs.* filter=lfs diff=lfs merge=lfs -text
11
+ *.mlmodel filter=lfs diff=lfs merge=lfs -text
12
+ *.model filter=lfs diff=lfs merge=lfs -text
13
+ *.msgpack filter=lfs diff=lfs merge=lfs -text
14
+ *.npy filter=lfs diff=lfs merge=lfs -text
15
+ *.npz filter=lfs diff=lfs merge=lfs -text
16
+ *.onnx filter=lfs diff=lfs merge=lfs -text
17
+ *.ot filter=lfs diff=lfs merge=lfs -text
18
+ *.parquet filter=lfs diff=lfs merge=lfs -text
19
+ *.pb filter=lfs diff=lfs merge=lfs -text
20
+ *.pickle filter=lfs diff=lfs merge=lfs -text
21
+ *.pkl filter=lfs diff=lfs merge=lfs -text
22
+ *.pt filter=lfs diff=lfs merge=lfs -text
23
+ *.pth filter=lfs diff=lfs merge=lfs -text
24
+ *.rar filter=lfs diff=lfs merge=lfs -text
25
+ *.safetensors filter=lfs diff=lfs merge=lfs -text
26
+ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
27
+ *.tar.* filter=lfs diff=lfs merge=lfs -text
28
+ *.tar filter=lfs diff=lfs merge=lfs -text
29
+ *.tflite filter=lfs diff=lfs merge=lfs -text
30
+ *.tgz filter=lfs diff=lfs merge=lfs -text
31
+ *.wasm filter=lfs diff=lfs merge=lfs -text
32
+ *.xz filter=lfs diff=lfs merge=lfs -text
33
+ *.zip filter=lfs diff=lfs merge=lfs -text
34
+ *.zst filter=lfs diff=lfs merge=lfs -text
35
+ *tfevents* filter=lfs diff=lfs merge=lfs -text
36
+ speed.png filter=lfs diff=lfs merge=lfs -text
37
+ speed_score.png filter=lfs diff=lfs merge=lfs -text
38
+ examples/table_rotated.png filter=lfs diff=lfs merge=lfs -text
39
+ examples/multi_column.png filter=lfs diff=lfs merge=lfs -text
40
+ examples/chinese_tables.png filter=lfs diff=lfs merge=lfs -text
41
+ examples/rotated_letter.png filter=lfs diff=lfs merge=lfs -text
42
+ examples/table_pmc.png filter=lfs diff=lfs merge=lfs -text
43
+ examples/chinese_essay.png filter=lfs diff=lfs merge=lfs -text
44
+ throughput.png filter=lfs diff=lfs merge=lfs -text
45
+ assets/examples/chinese_essay.png filter=lfs diff=lfs merge=lfs -text
46
+ assets/examples/multi_column.png filter=lfs diff=lfs merge=lfs -text
47
+ assets/examples/rotated_letter.png filter=lfs diff=lfs merge=lfs -text
48
+ assets/examples/table_pmc.png filter=lfs diff=lfs merge=lfs -text
49
+ assets/examples/handwriting_letter.png filter=lfs diff=lfs merge=lfs -text
50
+ assets/examples/korean_letter.png filter=lfs diff=lfs merge=lfs -text
LICENSE ADDED
@@ -0,0 +1,59 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ AI PUBS OPEN RAIL-M LICENSE (MODIFIED)
2
+
3
+ Version 0.1, March 2, 2023 (Modified)
4
+ http://licenses.ai/
5
+
6
+ PLEASE READ THESE TERMS CAREFULLY BEFORE USING THE MODEL OR A DERIVATIVE WORKS OF THE MODEL MADE AVAILABLE IN CONNECTION WITH THESE TERMS. BY DOWNLOADING, REPRODUCING, DISTRIBUTING OR USING THE MODEL OR A DERIVATIVE WORK OF THE MODEL IN ANY MANNER, YOU (“YOU”) AGREE TO BE BOUND BY THESE TERMS (THE “AGREEMENT”) TO THE EXCLUSION OF ALL OTHER TERMS. YOU REPRESENT AND WARRANT THAT YOU HAVE THE AUTHORITY TO ENTER INTO THIS AGREEMENT; IF YOU ARE ENTERING INTO THIS AGREEMENT ON BEHALF OF AN ORGANIZATION OR ENTITY, REFERENCES TO AND “YOU” IN THIS AGREEMENT, REFER TO THAT ORGANIZATION OR ENTITY. IF YOU DO NOT AGREE TO ALL OF THE FOLLOWING, YOU MAY NOT DOWNLOAD, REPRODUCE, DISTRIBUTE OR USE THE MODEL OR A DERIVATIVE WORK OF THE MODEL IN ANY MANNER.
7
+ Section I: PREAMBLE
8
+ This OpenRAIL-M License, as modified, is generally applicable to any machine-learning Model.
9
+ The “Open” nomenclature indicates that the licensed Model is be freely accessible to downstream and other users. The “RAIL” nomenclature indicates that there are use restrictions prohibiting the use of the Model. These restrictions are intended to avoid potential misuse. This License specifies that the use restrictions in the original License must apply to such derivatives.
10
+ NOW THEREFORE, You and Licensor agree as follows:
11
+ 1. Definitions
12
+ (a) “Complementary Material” means the applicable source code and scripts used to define, run, load, benchmark or evaluate the Model, and used to prepare data for training or evaluation, if any. This includes any accompanying documentation, tutorials, examples, and any related information, if any. Complementary Material is not licensed under this License.
13
+ (b) "Contribution" means any work, including the original version of the Model and any modifications or additions to that Model or Derivatives of the Model thereof, that is intentionally submitted to Licensor for inclusion in the Model by the rights owner or by an individual or legal entity authorized to submit on behalf of the rights owner. For the purposes of this definition, “submitted” means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Model, but excluding communication that is conspicuously marked or otherwise designated in writing by the rights owner as "Not a Contribution."
14
+ (c) "Contributor" means Licensor and any individual or legal entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Model.
15
+ (d) “Data” means a collection of information and/or content extracted from the dataset used with the Model, including to train, pretrain, or otherwise evaluate the Model. The Data is not licensed under this License.
16
+ (e) “Derivatives of the Model” means all modifications to the Model, works based on the Model, or any other model which is created or initialized by transfer of patterns of the weights, parameters, activations or output of the Model, to the other model, in order to cause the other model to perform similarly to the Model, including - but not limited to - distillation methods entailing the use of intermediate data representations or methods based on the generation of synthetic data by the Model for training the other model.
17
+ (f) “Distribution” means any transmission, reproduction, publication, distribution, or other sharing of the Model or Derivatives of the Model to a third party, including providing the Model as a hosted service made available by electronic or other remote means, including but not limited to API-based or web access.
18
+ (g) “Harm” includes but is not limited to physical, mental, psychological, financial and reputational damage, pain, or loss
19
+ (h) "License" means the terms and conditions for use, reproduction, and Distribution as defined in this document.
20
+ (i) “Licensor” means the rights owner or entity authorized by the rights owner that is granting the License, including the persons or entities that may have rights in the Model and/or distributing the Model.
21
+ (j) “Model” means any accompanying machine-learning based assemblies (including checkpoints), consisting of learnt weights, parameters (including optimizer states), corresponding to the model architecture as embodied in the Complementary Material, that have been trained or tuned, in whole or in part on the Data, using the Complementary Material.
22
+ (k) “Output” means the results of operating a Model as embodied in informational content resulting therefrom.
23
+ (l) “Third Parties” means individuals or legal entities that are not under common control with Licensor or You.
24
+ (m) "You" (or "Your") means an individual or legal entity exercising permissions granted by this License and/or making use of the Model for whichever purpose and in any field of use, including usage of the Model in an end-use application, including but not limited to a chatbot, translator, or image generator.
25
+ Section II: INTELLECTUAL PROPERTY RIGHTS
26
+ Both copyright and patent grants may apply to the Model and Derivatives of the Model. The Model and Derivatives of the Model are subject to additional terms as described in Section III, which shall govern the use of the Model and Derivatives of the Model even in the event Section II is held unenforceable.
27
+ 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare, publicly display, publicly perform, sublicense, and distribute the Model and Derivatives of the Model.
28
+ 3. Grant of Patent License. Subject to the terms and conditions of this License and where and as applicable, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this paragraph) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Model and/or Derivatives of the Model where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Model or Derivatives of the Model to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Model or Derivative of the Model and/or a Contribution incorporated within the Model or Derivative of the Model constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for the Model and/or Derivative of the Model shall terminate as of the date such litigation is asserted or filed.
29
+ Section III: CONDITIONS OF USAGE, DISTRIBUTION AND REDISTRIBUTION
30
+ 4. Distribution and Redistribution. You may host the Model or Derivatives of the Model for remote access by Third Parties, including but not limited to software-as-a-service, reproduce, or Distribute copies of the Model or Derivatives of the Model thereof in any medium, with or without modifications, provided that You meet the conditions in this Section III:
31
+ (a) Use-based restrictions in paragraph 5 MUST be included as an enforceable provision by You in any type of legal agreement (for example, a license) governing the use and/or distribution of the Model or Derivatives of the Model, and You shall give notice to subsequent users You Distribute to, that the Model and Derivatives of the Model are subject to paragraph 5;
32
+ (b) You must give any Third Party recipients of the Model or Derivatives of the Model a copy of this License;
33
+ (c) You must cause any modified files to carry prominent notices stating that You changed the files; and
34
+ (d) You must retain all copyright, patent, trademark, and attribution notices excluding those notices that do not pertain to any part of the Model or Derivatives of the Model.
35
+ You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions, consistent with paragraph 4.a., for use, reproduction, or Distribution of Your modifications, or for any such Derivatives of the Model as a whole, provided Your use, reproduction, and Distribution of the Model otherwise complies with the conditions stated in this License.
36
+ 5. Use-based restrictions. The restrictions set forth in Attachment A are considered Use-based restrictions. Accordingly, You cannot use the Model or the Derivatives of the Model in violation of such restrictions. You may use the Model subject to this License, including only for lawful purposes and in accordance with the License. Use may include creating any content with, fine-tuning, updating, running, training, evaluating and/or re-parametrizing the Model. You shall require all of Your users who use the Model or a Derivative of the Model to comply with the terms of this paragraph 5.
37
+ 6. The Output You Generate. Except as set forth herein, Licensor claims no rights in the Output You generate using the Model. You are solely responsible for the Output you generate and its subsequent uses. No use of the Output can contravene any provision as stated in the License.
38
+ 7. Attribution. In connection with any Output, or use of Distribution of any Model or Derivatives of the Model, You agree to give appropriate credit and attribution to Licensor, provide a link to the original Model or Derivatives of the Model, provide a copy of this License, and identify any changes You have made to the Model or Derivatives of the Model (collectively, the “Attribution”). The Attribution must not suggest endorsement by any Licensor.
39
+ 8. Share-a-Like. As a condition to the license and authorizations herein, You agree to apply this License (to the exclusion of all others) to any and all copies of the Model, Derivatives of the Model, any changes or improvements to the Model or Derivatives of the Model, and to the Output and any derivatives, changes or improvements to or of the Output.
40
+ Section IV: OTHER PROVISIONS
41
+ 9. Updates and Runtime Restrictions. To the maximum extent permitted by law, Licensor reserves the right to restrict (remotely or otherwise) usage of the Model in violation of this License, update the Model through electronic means, or cause modification to the Output resulting from updates to the Model based.
42
+ 10. Trademarks and related. Nothing in this License permits You to make use of Licensors’ trademarks, trade names, logos or to otherwise suggest endorsement or misrepresent the relationship between the parties; and any rights not expressly granted herein are reserved by the Licensors.
43
+ 11. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Model (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Model and Derivatives of the Model, and assume any risks associated with Your exercise of permissions under this License.
44
+ 12. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Model (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.
45
+ 13. Accepting Warranty or Additional Liability. While Distributing the Model or Derivatives of the Model, You may choose to charge a fee in exchange for support, warranty, indemnity, or other obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor or Licensor, and only if You agree to indemnify, defend, and hold each Contributor and the Licensor harmless for any liability incurred by, or claims asserted against, such Contributor or Licensor by reason of your accepting any such warranty or additional liability.
46
+ 14. If any provision of this License is held to be invalid, illegal or unenforceable, the remaining provisions shall be unaffected thereby and remain valid as if such provision had not been set forth herein.
47
+ END OF TERMS AND CONDITIONS
48
+
49
+  Attachment A
50
+ USE RESTRICTIONS
51
+ 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:
52
+ 1. Legal:
53
+ (a) In any way that violates any applicable national, federal, state, local or international law or regulation; or
54
+ (b) to directly or indirectly infringe or misappropriate any third party intellectual property rights (including those of Licensor or any Contributor)
55
+ 2. Commercial:
56
+ (a) for any purpose if You (your employer, or the entity you are affiliated with) generated more than twenty million US Dollars ($20,000,000) in gross revenue in the prior year, except where Your Use is limited to personal use or research purposes;
57
+ (b) for any purpose if You (your employer, or the entity you are affiliated with) has raised more than twenty million US dollars ($20,000,000) in total equity or debt funding from any source, except where Your Use is limited to personal use or research purposes; or
58
+ (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.
59
+ Commercial and broader use licenses may be available from Licensor at the following URL: https://www.datalab.to/
README.md ADDED
@@ -0,0 +1,416 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ library_name: onnx
3
+ license: openrail
4
+ license_link: LICENSE
5
+ pipeline_tag: image-to-text
6
+ language:
7
+ - en
8
+ - fr
9
+ - de
10
+ - es
11
+ - it
12
+ - pt
13
+ - nl
14
+ - pl
15
+ - cs
16
+ - sk
17
+ - ro
18
+ - hu
19
+ - sv
20
+ - da
21
+ - no
22
+ - fi
23
+ - tr
24
+ - az
25
+ - uz
26
+ - vi
27
+ - id
28
+ - ms
29
+ - sw
30
+ - ha
31
+ - yo
32
+ - ru
33
+ - uk
34
+ - bg
35
+ - sr
36
+ - el
37
+ - zh
38
+ - ja
39
+ - ko
40
+ - ar
41
+ - fa
42
+ - ur
43
+ - ps
44
+ - he
45
+ - hi
46
+ - mr
47
+ - ne
48
+ - bn
49
+ - ta
50
+ - te
51
+ - kn
52
+ - ml
53
+ - gu
54
+ - pa
55
+ - or
56
+ - th
57
+ - lo
58
+ - km
59
+ - my
60
+ - si
61
+ - ka
62
+ - hy
63
+ - am
64
+ tags:
65
+ - ocr
66
+ - onnx
67
+ - cpu
68
+ - pdf
69
+ - markdown
70
+ - layout
71
+ - document-parsing
72
+ - handwriting
73
+ - multilingual
74
+ ---
75
+
76
+ <p align="center">
77
+ <img src="assets/datalab-logo.png" alt="Datalab Logo" width="150"/>
78
+ </p>
79
+ <h1 align="center">Datalab</h1>
80
+ <p align="center">
81
+ <strong>State of the Art models for Document Intelligence</strong>
82
+ </p>
83
+ <p align="center">
84
+ <a href="https://opensource.org/licenses/Apache-2.0"><img src="https://img.shields.io/badge/Code%20License-Apache_2.0-green.svg" alt="Code License"></a>
85
+ <a href="https://www.datalab.to/pricing"><img src="https://img.shields.io/badge/Model%20License-OpenRAIL--M-blue.svg" alt="Model License"></a>
86
+ <a href="https://discord.gg/KuZwXNGnfH"><img src="https://img.shields.io/badge/Discord-Join%20us-5865F2?logo=discord&logoColor=white" alt="Discord"></a>
87
+ <a href="https://huggingface.co/datalab-to/indra-ocr"><img src="https://img.shields.io/badge/Models-Hugging%20Face-yellow" alt="Models"></a>
88
+ </p>
89
+ <p align="center">
90
+ <a href="https://www.datalab.to"><img src="https://img.shields.io/badge/Homepage-datalab.to-blue" alt="Homepage"></a>
91
+ <a href="https://documentation.datalab.to"><img src="https://img.shields.io/badge/Docs-Read%20the%20docs-blue" alt="Docs"></a>
92
+ <a href="https://www.datalab.to/playground"><img src="https://img.shields.io/badge/Datalab%20Playground-Try%20it-orange" alt="Datalab Playground"></a>
93
+ </p>
94
+
95
+ <hr/>
96
+
97
+ # Indra OCR
98
+
99
+ Indra OCR is a 1M-parameter OCR model that runs on CPU. It turns PDFs and images into markdown, text, or JSON with boxes, and it reads handwriting, 80+ languages, and pages at any angle.
100
+
101
+ - **Accurate** - 66.7 on [OmniParseBench](https://github.com/datalab-to/omni_parse_bench) (71.4 with `--math`), ahead of PaddleOCR's full PP-StructureV3 pipeline (58.4). Its text score (46.7) is ahead of PaddleOCR's PP-OCR text models (35.8) and Tesseract (19.3).
102
+ - **Fast** - about 44 pages/s on 32 CPU cores, 15x Tesseract and 10x PaddleOCR's PP-OCR text models on the same machine type and pages, and about 210 ms per page on 4 cores ([benchmarks](#benchmarks))
103
+ - **80+ languages** - Latin-script languages, Russian and the Cyrillic languages, Greek, Chinese, Japanese, Korean, Arabic, Persian, Urdu, Hebrew, Hindi and the Indic languages, Thai, Khmer and more ([languages](#languages))
104
+ - **Handwriting** - handwritten pages and forms (25.2% on the OmniParseBench handwriting tests, see [limitations](#limitations))
105
+ - **Real-world scans** - sideways, upside down, tilted up to 45 degrees, light text on dark ground
106
+ - **Layout** - a box, a label and a reading order for every line and block (headings, lists, tables, captions, footnotes, page headers)
107
+ - **Digital PDFs** - reads the text layer in any script, and OCRs only what is missing
108
+ - **Small** - ONNX Runtime, no PyTorch, no GPU
109
+
110
+ Indra OCR is named for [Indra](https://en.wikipedia.org/wiki/Indra).
111
+
112
+ <img src="assets/throughput.png" width="700px"/>
113
+
114
+ ## Try Datalab's Managed Platform
115
+
116
+ Indra OCR is built for speed on CPUs. When you need the highest accuracy, on handwriting, math, complex tables and degraded scans, our managed platform runs [Chandra](https://github.com/datalab-to/chandra), our state of the art OCR model, with zero data retention by default, SOC 2 Type 2, and custom BAAs.
117
+
118
+ If you have high volume workloads, we offer a batch processing service that can handle 1B+ pages a day.
119
+
120
+ Get started with **$5 in free credits** - [sign up](https://www.datalab.to/?utm_source=hf-indra-ocr) - or try Chandra in our [public playground](https://www.datalab.to/playground?utm_source=hf-indra-ocr).
121
+
122
+ ## Quickstart
123
+
124
+ ```shell
125
+ pip install indra-ocr
126
+
127
+ indra-ocr paper.pdf # markdown to stdout
128
+ indra-ocr *.pdf --out results/ # one .md per input, all cores
129
+ indra-ocr scan.png --format json # lines, boxes, layout blocks, confidences
130
+
131
+ indra-ocr-viewer # local web viewer on http://localhost:8765
132
+ ```
133
+
134
+ The first run downloads the models (about 76 MB) from [Hugging Face](https://huggingface.co/datalab-to/indra-ocr).
135
+
136
+ ## Examples
137
+
138
+ Real Indra OCR outputs on OmniParseBench pages. Colored boxes are layout blocks with their label, faint blue boxes are lines, drawn from the JSON output with no edits.
139
+
140
+ <table>
141
+ <tr>
142
+ <td width="50%"><img src="assets/examples/handwriting_letter.png"/><br/><sub>A handwritten letter in cursive: Indra OCR finds every line and reads the body of the letter.</sub></td>
143
+ <td width="50%"><img src="assets/examples/korean_letter.png"/><br/><sub>A scanned Korean letter: each line goes to the recognizer for its script.</sub></td>
144
+ </tr>
145
+ </table>
146
+
147
+ **[See more examples, with the markdown output for each →](https://github.com/datalab-to/indra/blob/main/EXAMPLES.md)**
148
+
149
+
150
+ # License
151
+
152
+ The code is [Apache 2.0](https://github.com/datalab-to/indra/blob/main/LICENSE). The model weights use a modified OpenRAIL-M license ([LICENSE](https://huggingface.co/datalab-to/indra-ocr/blob/main/LICENSE)).
153
+
154
+ # Commercial usage
155
+
156
+ This code is Apache 2.0, and our model weights use a modified OpenRAIL-M license (free for research, personal use, and startups under $20M funding/revenue, cannot be used competitively with our API). To remove the OpenRAIL license requirements, or for broader commercial licensing, visit our pricing page [here](https://www.datalab.to/pricing?utm_source=hf-indra-ocr).
157
+
158
+ # Installation
159
+
160
+ ```shell
161
+ pip install indra-ocr
162
+ ```
163
+
164
+ The default models are about 76 MB: 30 MB of networks and 46 MB of language models for unsure lines. The main recognizer, `rec.onnx` (Latin script), has about 1.25M parameters, and all default models together have 7.3M (the optional math models are extra).
165
+
166
+ For the latest code from GitHub instead: `pip install git+https://github.com/datalab-to/indra.git`. To let the viewer compare with Tesseract, install `pip install "indra-ocr[tesseract]"` and a Tesseract binary.
167
+
168
+ Python 3.10 or newer, tested on Linux (x86_64 and aarch64, Python 3.10 to 3.13) and macOS (Apple silicon). It installs ONNX Runtime, OpenCV and pypdfium2, and no PyTorch. The models download from Hugging Face on the first run and are cached. To use a local copy, set `INDRA_OCR_MODEL_DIR` or pass `--model-dir`.
169
+
170
+ # Usage
171
+
172
+ ## CLI
173
+
174
+ ```shell
175
+ indra-ocr paper.pdf # markdown to stdout
176
+ indra-ocr *.pdf --out results/ # one .md per input
177
+ indra-ocr scan.png --format json # lines, boxes, layout blocks, confidences, timings
178
+ indra-ocr paper.pdf --format text # plain text, one line per detected line
179
+ indra-ocr paper.pdf --mode ocr --timings # ignore the text layer, OCR every page; timings on stderr
180
+ indra-ocr paper.pdf --keep-furniture # keep page headers and footers in the markdown
181
+ indra-ocr *.pdf --out results/ --cores 8 # limit the cores (default: all usable cores)
182
+ indra-ocr paper.pdf --math # write math as LaTeX (off by default; slower on math pages)
183
+ ```
184
+
185
+ **CLI Options:**
186
+ - `--out DIR`: write one file per input (`.md`, `.txt` or `.jsonl`)
187
+ - `--format [md|text|json]`: output format (default: md)
188
+ - `--mode [auto|ocr|text]`: `auto` reads the text layer where it passes the checks and OCRs elsewhere (default). `ocr` never reads the text layer. `text` uses the text layer even when the checks fail
189
+ - `--no-image-ocr`: on text-layer pages, do not OCR text inside images
190
+ - `--cores N`: cores to use, one worker process each (default: all usable cores)
191
+ - `--dpi`: render resolution for PDFs (default: 200)
192
+ - `--max-pages N`: read at most N pages per file
193
+ - `--password`: password for encrypted PDFs
194
+ - `--keep-furniture`: keep page headers and footers in the markdown
195
+ - `--math`: write math as LaTeX (`$...$`); off by default, see [Math](#math)
196
+ - `--timings`: print per-page source and time to stderr
197
+ - `--model-dir`: folder with the models (default: download)
198
+
199
+ The CLI continues past files it cannot read, and exits with 1 if any failed.
200
+
201
+ ## From python
202
+
203
+ ```python
204
+ import indra_ocr
205
+
206
+ conv = indra_ocr.load(threads=4) # mode="auto" | "ocr" | "text"
207
+ for i, page in conv.convert("paper.pdf"):
208
+ print(page.source, page.timings["total_ms"])
209
+ print(page.markdown) # headings, lists, tables as HTML
210
+ page.blocks # [{"label", "bbox", "text"}] in reading order
211
+ page.lines # [Line(box, text, conf)] in reading order
212
+ ```
213
+
214
+ An image file works the same way as a PDF (PNG, JPEG, TIFF, BMP, WebP; one page per TIFF frame). For an image already in memory, pass a grayscale `uint8` numpy array to `conv.ocr`:
215
+
216
+ ```python
217
+ import cv2
218
+ import indra_ocr
219
+
220
+ conv = indra_ocr.load(threads=4)
221
+ for i, page in conv.convert("scan.png"): # an image file
222
+ print(page.text)
223
+
224
+ gray = cv2.cvtColor(cv2.imread("photo.jpg"), cv2.COLOR_BGR2GRAY)
225
+ page = conv.ocr(gray) # an image in memory
226
+ print(page.markdown)
227
+ ```
228
+
229
+ Runnable examples: [`examples/ocr_image.py`](https://github.com/datalab-to/indra/blob/main/examples/ocr_image.py) (one image to markdown, text or JSON with boxes) and [`examples/quickstart.ipynb`](https://github.com/datalab-to/indra/blob/main/examples/quickstart.ipynb).
230
+
231
+ For many pages or files, `convert_many` runs one single-threaded worker process per core, one page per task, and returns results in input order:
232
+
233
+ ```python
234
+ import indra_ocr
235
+
236
+ if __name__ == "__main__": # worker processes re-import this file
237
+ for path, result in indra_ocr.convert_many(["a.pdf", "b.pdf"], cores=None):
238
+ if isinstance(result, indra_ocr.InputError):
239
+ continue # unreadable or locked file
240
+ for i, page in result:
241
+ print(path, i, page.source)
242
+ ```
243
+
244
+ Without the `if __name__ == "__main__":` guard (needed on macOS and Windows), `convert_many` warns and reads everything in one process.
245
+
246
+ `indra_ocr.load` takes `path` (model folder), `threads`, `dpi`, `mode`, `image_ocr`, `furniture` and `math`. `conv.convert` takes `max_pages` and `password`.
247
+
248
+ ## Viewer
249
+
250
+ ```shell
251
+ indra-ocr-viewer --port 8765 # open http://localhost:8765
252
+ ```
253
+
254
+ A local web viewer: drop in a PDF or an image, and each page shows its lines, layout blocks and reading order over the page, with the rendered markdown, the markdown source, the lines with their confidences, the JSON output and the time of each stage. The pipeline options (text layer or OCR, math, headers and footers, reading order, OCR of text inside images, dpi, page limit) are set in the page, and lines, blocks, block labels and reading order can each be shown or hidden. Files stay on your machine. `--tesseract` lets the page compare with Tesseract (needs `pytesseract` and a Tesseract install). Over SSH, forward the port: `ssh -N -L 8765:localhost:8765 host`.
255
+
256
+ ## Output
257
+
258
+ Every page is a `Page` with:
259
+
260
+ - `markdown`: headings (`##`), paragraphs, lists, and tables as HTML. Page headers and footers are left out unless `furniture=True` / `--keep-furniture`
261
+ - `text`: one line per detected line, in reading order
262
+ - `lines`: `Line(box, text, conf)`, box is `x0, y0, x1, y1` in image pixels
263
+ - `blocks`: layout blocks in reading order, `{"label", "bbox", "text"}`
264
+ - `source`: `text` (PDF text layer), `ocr`, `hybrid` (text layer + OCR of text inside images) or `error`
265
+ - `rotation`, `skew`: the quarter or half turn applied (degrees), and the small tilt straightened
266
+ - `vertical`: the page is set in vertical columns (Chinese, Japanese): it was read turned a quarter turn, and its boxes are on the page as it is
267
+ - `timings`: per-step milliseconds, with `total_ms`
268
+ - `note`: why the page took its path
269
+
270
+ Block labels: `Text`, `Section-Header`, `Page-Header`, `Page-Footer`, `List-Group`, `Table`, `Caption`, `Footnote`, `Table-Of-Contents`, `Form`. `--format json` writes one JSON object per page with all of these fields.
271
+
272
+ # Languages
273
+
274
+ **OCR (scans and images):** we measured 95 languages on held-out printed pages: 83 read at character F1 0.90 or higher, and 67 at 0.95 or higher. Four recognizers, and a line classifier that sends each line to one of them:
275
+
276
+ - `rec.onnx`: Latin (about 50 languages, with the letters of Hausa, Fula, Akan, Azerbaijani and Uzbek and the tone marks of Vietnamese and Yoruba), Cyrillic, Greek, and handwriting in Latin script.
277
+ - `rec_cjk.onnx`: Chinese (simplified and traditional), Japanese (kana and kanji), Korean.
278
+ - `rec_rtl.onnx`: Arabic, Persian, Urdu, Pashto, Kurdish, Hebrew. Lines come out in logical order, and a right-to-left page reads its right column first.
279
+ - `rec_world.onnx`: Devanagari (Hindi, Marathi, Nepali), Bengali, Tamil, Telugu, Kannada, Malayalam, Gujarati, Gurmukhi, Odia, Thai, Lao, Khmer, Myanmar, Sinhala, Georgian, Armenian, Ethiopic.
280
+
281
+ When the classifier is not sure of a line, the main recognizer reads it too, and the more confident reading wins.
282
+
283
+ OmniParseBench, per script (tests in parentheses):
284
+
285
+ | Script | Score | Script | Score |
286
+ |---|---|---|---|
287
+ | Latin (9,406) | 61.6 | Thai (39) | 87.2 |
288
+ | Chinese (136) | 64.0 | Lao (52) | 96.2 |
289
+ | Korean (24) | 79.2 | Khmer (34) | 70.6 |
290
+ | Japanese kana (19) | 57.9 | Tamil (25) | 84.0 |
291
+ | Devanagari (23) | 69.6 | Telugu (33) | 87.9 |
292
+ | Bengali (40) | 77.5 | Kannada (48) | 93.8 |
293
+ | Arabic (13) | 69.2 | Malayalam (40) | 65.0 |
294
+ | Hebrew (30) | 80.0 | Gujarati (15) | 80.0 |
295
+ | Georgian (14) | 100 | Gurmukhi (31) | 64.5 |
296
+ | Armenian (60) | 100 | Ethiopic (43) | 100 |
297
+
298
+ Most scripts have few tests, so one test moves a score by 2 to 8 points. On [OmniDocBench](https://github.com/opendatalab/OmniDocBench) v1.5 (OCR only, 1,651 pages, our run without the formula metric), the text edit distance is 0.114 on English pages and 0.237 on simplified Chinese pages (lower is better), and table TEDS is 0.47.
299
+
300
+ **Vertical text.** Chinese and Japanese pages set in vertical columns are read turned a quarter turn, so each column is a line for the CJK recognizer. Scans are found by the orientation model, digital PDFs by their text layer. `page.vertical` is set, and boxes are on the page as it is.
301
+
302
+ **Text layer (digital PDFs): any script.** We checked text mode on 1,125 pages from 75 language families. On pages whose layer passes the checks, Indra OCR keeps at least 98% of the layer's characters in every family, including Arabic, Hebrew, Persian, Urdu, Thai, Khmer, Lao, Myanmar, Georgian, Armenian, Ethiopic, the Indic scripts, Chinese, Japanese and Korean. Right-to-left lines keep their right-to-left order.
303
+
304
+ # Limitations
305
+
306
+ Indra OCR is built for speed on clean print. It is not the right tool for:
307
+
308
+ - **Complex tables.** Tables with merged or spanning cells, cell text that wraps over several lines, nested headers, or no ruling lines can come out with cells in the wrong rows or columns. Simple grid tables read well.
309
+ - **Handwriting.** Handwritten pages read, but not well: 25.2% on the OmniParseBench handwriting tests, and about a third of the words on held-out handwritten pages. Cursive and faint pencil read worst.
310
+ - **Scripts outside the OCR list.** Syriac, Tibetan, Mongolian, Santali, Meitei and other scripts not listed under [Languages](#languages) work only through a digital PDF's text layer. Khmer and Malayalam OCR are fair (65 to 71 on OmniParseBench). Written Cantonese characters (嘅 咗 冇) are not in the Chinese recognizer.
311
+ - **Latin languages with many diacritics.** Some of them (Kurmanji, Czech, Lithuanian, Icelandic, Turkish, Slovak) read less well: the recognizer sometimes writes a close diacritic instead of the right one (ñ for ň, ú for ů, é for ė). English, French, German and Spanish are not affected.
312
+ - **Degraded scans.** Old, faded or low-resolution scans read poorly (29.5% on the OmniParseBench degraded-scan tests).
313
+
314
+ Also:
315
+
316
+ - Math comes out as plain text unless `--math` is on (see [Math](#math)).
317
+ - Vertical pages read their columns right to left and their tiers top to bottom; a newspaper whose articles wind across tiers can come out in the wrong article order. Vertical scans read less well than horizontal ones.
318
+ - Very wide, banner-shaped pages read poorly.
319
+ - Labels inside engineering drawings often come out as small tables.
320
+ - Pages above 100 megapixels at 200 dpi render at a lower dpi, so small text on them can be lost.
321
+
322
+ For these documents, [Chandra on Datalab](https://www.datalab.to/?utm_source=hf-indra-ocr) is the accurate option.
323
+
324
+ # Math
325
+
326
+ Math is off by default. With `--math` (or `indra_ocr.load(math=True)`), a small classifier finds the lines that hold math, and a second recognizer reads them as text with inline LaTeX (`we have $x _ { i } \leq 1$`).
327
+
328
+ On OmniParseBench (all 2,937 pages, default settings otherwise):
329
+
330
+ | | headline | text | tables | layout | math tests |
331
+ |---|---|---|---|---|---|
332
+ | Indra OCR | 66.7 | 46.7 | 61.1 | 92.2 | 14.0 |
333
+ | Indra OCR `--math` | **71.4** | **62.7** | 59.6 | 92.0 | **55.8** |
334
+ | PaddleOCR PP-StructureV3 | 58.4 | 55.6 | 47.8 | 71.7 | – |
335
+
336
+ - With `--math`, Indra OCR is ahead of PaddleOCR's PP-StructureV3 on the headline, text, tables and layout. Without it, PP-StructureV3 leads on text.
337
+ - Tables lose 1.5 points: numbers in some table cells are read as math.
338
+ - `--math` is slower. On x86, one page at a time on 4 vCPUs in auto mode, the median page takes 357 ms with `--math` and 212 ms without. With one single-threaded worker per core, throughput is about 30% lower on 4 cores and 38% lower on 32 (measured in one container on 300 OmniParseBench pages).
339
+
340
+ The math models download only when `--math` is on.
341
+
342
+ # Benchmarks
343
+
344
+ ## OmniParseBench
345
+
346
+ [OmniParseBench](https://github.com/datalab-to/omni_parse_bench) has 16,288 pass/fail tests on 2,937 pages. The headline is the mean of the text, tables and layout families. All runs: x86, 4 vCPUs per engine, one page at a time, every engine on the same pages with the same scorer and its default settings.
347
+
348
+ <img src="assets/speed_score.png" width="700px"/>
349
+
350
+ | engine | headline | text | tables | layout | median ms / page |
351
+ |---|---|---|---|---|---|
352
+ | Indra OCR (auto: text layer + OCR) | 66.7 | 46.7 | **61.1** | **92.2** | **212** |
353
+ | Indra OCR (OCR only)‡ | 61.2 | 40.7 | 52.7 | 90.3 | 344 |
354
+ | Indra OCR `--math` (auto) | **71.4** | **62.7** | 59.6 | 92.0 | 357 |
355
+ | PaddleOCR PP-OCRv6 small, text models only (RapidOCR) | – | 35.8 | 0.0 | – | 2,685 |
356
+ | PaddleOCR PP-StructureV3 (2,918 pages\*) | 58.4 | 55.6 | 47.8 | 71.7 | 40,958 |
357
+ | Tesseract 5 (our run, Latin model) | – | 19.3 | 0.0 | – | 5,496 |
358
+
359
+ - Indra OCR's accuracy comes from the benchmark's own Indra OCR adapter and scorer (omni-parse-bench 1.0.0rc1, dataset revision 961c0f89), as on the OmniParseBench leaderboard. ‡The OCR-only row and the other engines come from our runs of the same pages and scorer. The median ms column comes from the x86 run below.
360
+ - The PP-OCR text models and Tesseract output lines, not tables or layout blocks, so their table scores are 0 and their layout family is not scored.
361
+ - PP-StructureV3 is PaddleOCR's full document pipeline (layout, tables, formulas). Without `--math`, it reads text better than Indra OCR (55.6 vs 46.7). With `--math`, Indra OCR is ahead on text too (62.7). It takes about 190 times as long per page as Indra OCR's default mode. \*One of its 150 shards stalled for 6 hours on its first page, so its row leaves out 19 pages.
362
+ - Faster settings exist, but we did not score their accuracy. Tesseract with the `eng` model and 1 thread takes 3.4 s a page (6.1 s as run). PP-StructureV3 without formula, seal and chart recognition, unwarping and orientation, and with its mobile OCR models, takes 10.5 s a page. Indra OCR is still 16-50x faster per page.
363
+ - The OmniParseBench leaderboard's own Tesseract run scores 17.6 on text.
364
+ - Median latency varies by about 15% between runs of the same code, so compare engines within one run. The Indra OCR rows come from one run. The other engines ran earlier, on the same container type and pages.
365
+
366
+ **Chinese** (136 OmniParseBench Chinese tests): Indra OCR 64.0, PaddleOCR PP-OCRv5 mobile Chinese text models 65.4, PP-StructureV3 68.4.
367
+
368
+ ## olmOCR-bench
369
+
370
+ Born-digital splits and old scans, our harness, 200 dpi:
371
+
372
+ | split | Indra OCR | Tesseract 4 |
373
+ |---|---|---|
374
+ | headers_footers | 91.2 | 35.5 |
375
+ | multi_column | 70.0 | 70.4 |
376
+ | long_tiny_text | 67.9 | 64.0 |
377
+ | table_tests | 60.5 | 1.0 |
378
+ | old_scans | 20.0 | 18.4 |
379
+
380
+ ## Throughput
381
+
382
+ The CLI and `convert_many` run one single-threaded worker process per usable core, one page per task, so a single long PDF also uses every core. `--cores` limits it.
383
+
384
+ Pages per second on x86 (AMD EPYC 9004 Genoa, 34 cores, no GPU), on the same 300 OmniParseBench pages, with one single-threaded worker per core, OCR mode and default settings. The other engines ran once on the same machine type and pages.
385
+
386
+ | engine | 4 cores | 8 cores | 16 cores | 32 cores |
387
+ |---|---|---|---|---|
388
+ | Indra OCR | **6.2** | **11.9** | **23.7** | **43.9** |
389
+ | PaddleOCR PP-OCRv6 small, text models only (RapidOCR) | 0.65 | 1.24 | 2.42 | 4.28 |
390
+ | Tesseract 5 | 0.78 | 1.37 | 2.27 | 2.92 |
391
+ | PaddleOCR PP-StructureV3\* | ≤ 0.022 | ≤ 0.044 | ≤ 0.089 | ≤ 0.18 |
392
+
393
+ At 32 cores, Indra OCR is 10x PaddleOCR's PP-OCR text models and 15x Tesseract. \*PP-StructureV3 ran a time-capped subset of other OmniParseBench pages in an earlier run, so its numbers are upper bounds.
394
+
395
+ Throughput depends on the CPU: on other x86 container types we measured 25 to 51 pages per second at 32 cores.
396
+
397
+ Model loading and one warm-up page per worker are not timed.
398
+
399
+ ## Reproducing
400
+
401
+ ```shell
402
+ git clone https://github.com/datalab-to/indra.git && cd indra
403
+ pip install indra-ocr 'omni-parse-bench[benchmark]'
404
+ python bench/opb_indra.py --out runs/opb_auto --mode auto --procs 8
405
+ ```
406
+
407
+ Each page runs in a single-threaded worker process, page headers and footers kept. `--mode ocr` gives the OCR-only row, `--math` the `--math` row, `--suites` scores only the listed suites, `--limit N` scores the first N pages, and `--models` points at a local model folder. The run writes `summary.json` (the benchmark's own summary, plus median and p90 ms per page) and `pages.jsonl` (per page: time, source, tests passed). The tables above come from our x86 harness, which gives each page 4 threads. This script gives each page one thread, so its times differ, and its scores can differ by a few tenths of a point.
408
+
409
+ # Credits
410
+
411
+ Thank you to the following open source projects:
412
+
413
+ - [ONNX Runtime](https://github.com/microsoft/onnxruntime)
414
+ - [pypdfium2](https://github.com/pypdfium2-team/pypdfium2)
415
+ - [OpenCV](https://github.com/opencv/opencv)
416
+ - [Hugging Face Hub](https://github.com/huggingface/huggingface_hub)
assets/datalab-logo.png ADDED
assets/examples/handwriting_letter.png ADDED

Git LFS Details

  • SHA256: bed634b6df330b040cd52d8d9104433f54e458c16ed87607c406c009b98ecd25
  • Pointer size: 131 Bytes
  • Size of remote file: 369 kB
assets/examples/korean_letter.png ADDED

Git LFS Details

  • SHA256: 973d6e2aca838ba5da72ab691bd8d0d9820e907002ca398eb884a1c87a8efb29
  • Pointer size: 131 Bytes
  • Size of remote file: 407 kB
assets/speed_score.png ADDED

Git LFS Details

  • SHA256: 83e72fbb5369a045cb6038318337d4a9138217fe394b1a11e7cb0760f46fc7b6
  • Pointer size: 131 Bytes
  • Size of remote file: 127 kB
assets/throughput.png ADDED

Git LFS Details

  • SHA256: 76812c7807427c1117a8c2fbd0d9070557e911870736a7921fd8e56d49edfcc3
  • Pointer size: 130 Bytes
  • Size of remote file: 88.1 kB
config.json ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "model_type": "indra-ocr",
3
+ "library": "indra-ocr",
4
+ "install": "pip install indra-ocr",
5
+ "framework": "onnxruntime",
6
+ "files": [
7
+ "det.onnx",
8
+ "lm.npz",
9
+ "lm_cjk.npz",
10
+ "lm_world.npz",
11
+ "math_dec_init.onnx",
12
+ "math_dec_step.onnx",
13
+ "math_enc.onnx",
14
+ "mathcls.onnx",
15
+ "meta.json",
16
+ "order.onnx",
17
+ "orient.onnx",
18
+ "rec.onnx",
19
+ "rec_cjk.onnx",
20
+ "rec_rtl.onnx",
21
+ "rec_world.onnx",
22
+ "script.onnx"
23
+ ],
24
+ "note": "Indra OCR runs the .onnx files with onnxruntime (pip install indra-ocr). The .npz files are n-gram language models for unsure lines. model.safetensors holds the float weights of rec.onnx, the Latin-script recognizer, for the Hub parameter count; the package does not use it."
25
+ }
det.onnx ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f2bd4cba23e9c328cf7ec824634e423e191a2c6aacbbf35c62bd79dd70f62f59
3
+ size 389948
lm.npz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6c0fb618a363a0acdd05d4f5b0edd9e8146d2d990541b87f6130bbfe17cea58d
3
+ size 15695957
lm_cjk.npz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6d64f13f4f90f4e529bd63340c6df76238d007feaef2abb903d8cd28d92bc2f3
3
+ size 18955160
lm_world.npz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:34df5e74a2fcbb9cf5e7f360a559375ffa2e04d2d2943a42308c177bcb444d5d
3
+ size 11641215
math_dec_init.onnx ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:919417fde9962c3318aeb478c1fe3955dd2bb8cd34476c68debed2ba39e5dcd6
3
+ size 1356364
math_dec_step.onnx ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5ff6e6cbaf0dea70314f66222a1469736a8c5e7994fab06a5b4e53c90469239f
3
+ size 8429418
math_enc.onnx ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d4e4a6c40dad1ee988d32c6403b1590ca42864d4483bbe1e671c5dbb999a5a97
3
+ size 9889575
math_meta.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"config": {"height": 64, "front": [32, 64, 96], "channels": 192, "expansion": 384, "blocks": 6, "kernel": 9, "se_reduction": 4, "attn_layers": 2, "attn_heads": 8, "attn_ffn": 768, "dec_layers": 3, "dec_heads": 8, "dec_ffn": 768, "max_tokens": 320, "n_tokens": 652}, "tokens": [" ", "!", "\"", "$", "'", "(", ")", "*", "+", ",", "-", ".", "/", "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", ":", ";", "<", "=", ">", "?", "@", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "[", "\\ ", "\\!", "\\#", "\\%", "\\&", "\\,", "\\/", "\\:", "\\;", "\\AA", "\\Bar", "\\Bbbk", "\\Big", "\\Bigg", "\\Biggl", "\\Biggr", "\\Bigl", "\\Bigr", "\\Bumpeq", "\\Cap", "\\Cup", "\\Ddot", "\\Delta", "\\Dot", "\\Downarrow", "\\Game", "\\Gamma", "\\Hat", "\\Im", "\\Join", "\\L", "\\Lambda", "\\Leftarrow", "\\Leftrightarrow", "\\Lleftarrow", "\\Longleftarrow", "\\Longleftrightarrow", "\\Longrightarrow", "\\Lsh", "\\O", "\\Omega", "\\P", "\\Phi", "\\Pi", "\\Pr", "\\Psi", "\\Re", "\\Rightarrow", "\\Rrightarrow", "\\Rsh", "\\S", "\\Sigma", "\\Subset", "\\Supset", "\\Theta", "\\Tilde", "\\Uparrow", "\\Updownarrow", "\\Upsilon", "\\Vdash", "\\Vec", "\\Vert", "\\Vvdash", "\\Xi", "\\_", "\\acute", "\\aleph", "\\alpha", "\\amalg", "\\angle", "\\approx", "\\approxeq", "\\arcsin", "\\arctan", "\\arg", "\\ast", "\\asymp", "\\atop", "\\b", "\\backprime", "\\backsim", "\\backsimeq", "\\backslash", "\\bar", "\\barwedge", "\\because", "\\beta", "\\beth", "\\between", "\\bf", "\\big", "\\bigcap", "\\bigcirc", "\\bigcup", "\\bigg", "\\biggl", "\\biggr", "\\bigl", "\\bigoplus", "\\bigr", "\\bigstar", "\\bigtriangledown", "\\bigtriangleup", "\\bigwedge", "\\binom", "\\blacktriangle", "\\blacktriangledown", "\\blacktriangleleft", "\\blacktriangleright", "\\bmod", "\\boldmath", "\\boldsymbol", "\\bot", "\\bowtie", "\\boxdot", "\\boxminus", "\\boxplus", "\\boxtimes", "\\breve", "\\bullet", "\\bumpeq", "\\cal", "\\cap", "\\cdot", "\\cdots", "\\centering", "\\cfrac", "\\check", "\\checkmark", "\\chi", "\\circ", "\\circeq", "\\circledast", "\\circledcirc", "\\circleddash", "\\clubsuit", "\\colon", "\\complement", "\\cong", "\\copyright", "\\cos", "\\cosh", "\\cot", "\\coth", "\\csc", "\\cup", "\\curlyeqprec", "\\curlyeqsucc", "\\curlyvee", "\\curlywedge", "\\curvearrowleft", "\\curvearrowright", "\\d", "\\dag", "\\dagger", "\\daleth", "\\dashv", "\\ddag", "\\ddagger", "\\ddot", "\\deg", "\\delta", "\\diagup", "\\diamond", "\\diamondsuit", "\\dim", "\\displaystyle", "\\div", "\\divideontimes", "\\dot", "\\doteq", "\\dotplus", "\\dots", "\\dotsb", "\\dotsc", "\\doublebarwedge", "\\downarrow", "\\downdownarrows", "\\downharpoonleft", "\\downharpoonright", "\\ell", "\\emph", "\\emptyset", "\\enspace", "\\ensuremath", "\\epsilon", "\\eqcirc", "\\eqsim", "\\eqslantgtr", "\\eqslantless", "\\equiv", "\\eta", "\\eth", "\\exists", "\\exp", "\\fallingdotseq", "\\flat", "\\forall", "\\frac", "\\frown", "\\gamma", "\\ge", "\\geq", "\\geqq", "\\geqslant", "\\gets", "\\gg", "\\ggg", "\\gimel", "\\gnapprox", "\\gneq", "\\gneqq", "\\gnsim", "\\grave", "\\gtrapprox", "\\gtrdot", "\\gtreqless", "\\gtreqqless", "\\gtrless", "\\gtrsim", "\\hat", "\\hbar", "\\hdots", "\\heartsuit", "\\hookleftarrow", "\\hookrightarrow", "\\hslash", "\\i", "\\iff", "\\iiint", "\\iint", "\\imath", "\\implies", "\\in", "\\infty", "\\int", "\\intercal", "\\iota", "\\it", "\\j", "\\jmath", "\\kappa", "\\ker", "\\l", "\\lVert", "\\lambda", "\\land", "\\langle", "\\lbrace", "\\lbrack", "\\lceil", "\\ldots", "\\le", "\\left", "\\leftarrow", "\\leftarrowtail", "\\leftharpoondown", "\\leftharpoonup", "\\leftleftarrows", "\\leftrightarrow", "\\leftrightarrows", "\\leftrightharpoons", "\\leftrightsquigarrow", "\\leftthreetimes", "\\leq", "\\leqq", "\\leqslant", "\\lessapprox", "\\lessdot", "\\lesseqgtr", "\\lesseqqgtr", "\\lessgtr", "\\lesssim", "\\lfloor", "\\lg", "\\lim", "\\limits", "\\ll", "\\llcorner", "\\lll", "\\ln", "\\lnapprox", "\\lneq", "\\lneqq", "\\lnot", "\\lnsim", "\\log", "\\longleftarrow", "\\longleftrightarrow", "\\longmapsto", "\\longrightarrow", "\\looparrowleft", "\\looparrowright", "\\lor", "\\lrcorner", "\\ltimes", "\\lvert", "\\mapsto", "\\mathbb", "\\mathbf", "\\mathcal", "\\mathfrak", "\\mathinner", "\\mathit", "\\mathnormal", "\\mathop", "\\mathopen", "\\mathord", "\\mathrel", "\\mathring", "\\mathrm", "\\mathscr", "\\mathsection", "\\mathsf", "\\mathtt", "\\measuredangle", "\\mho", "\\mid", "\\mod", "\\models", "\\mp", "\\mu", "\\multimap", "\\nLeftarrow", "\\nLeftrightarrow", "\\nRightarrow", "\\nVDash", "\\nVdash", "\\nabla", "\\natural", "\\ncong", "\\ne", "\\nearrow", "\\neg", "\\neq", "\\nexists", "\\ngeq", "\\ngtr", "\\ni", "\\nleftarrow", "\\nleftrightarrow", "\\nleq", "\\nless", "\\nmid", "\\nonumber", "\\normalfont", "\\not", "\\notin", "\\nparallel", "\\nprec", "\\nrightarrow", "\\nsim", "\\nsubseteq", "\\nsucc", "\\nsupseteq", "\\ntrianglelefteq", "\\ntrianglerighteq", "\\nu", "\\nvDash", "\\nvdash", "\\nwarrow", "\\o", "\\odot", "\\oint", "\\omega", "\\ominus", "\\operatorname", "\\operatorname*", "\\oplus", "\\oslash", "\\otimes", "\\overleftarrow", "\\overleftrightarrow", "\\overline", "\\overrightarrow", "\\overset", "\\parallel", "\\partial", "\\perp", "\\phantom", "\\phi", "\\pi", "\\pitchfork", "\\pm", "\\pmb", "\\pmod", "\\pounds", "\\prec", "\\precapprox", "\\preccurlyeq", "\\preceq", "\\precneqq", "\\precnsim", "\\precsim", "\\prime", "\\prod", "\\propto", "\\protect", "\\psi", "\\qquad", "\\quad", "\\rVert", "\\rangle", "\\rbrace", "\\rbrack", "\\rceil", "\\rfloor", "\\rho", "\\right", "\\rightarrow", "\\rightarrowtail", "\\rightharpoondown", "\\rightharpoonup", "\\rightleftarrows", "\\rightleftharpoons", "\\rightrightarrows", "\\rightsquigarrow", "\\rightthreetimes", "\\risingdotseq", "\\romannumeral", "\\rtimes", "\\rvert", "\\sb", "\\scriptscriptstyle", "\\scriptsize", "\\scriptstyle", "\\searrow", "\\sec", "\\setminus", "\\sf", "\\sharp", "\\sigma", "\\sim", "\\simeq", "\\sin", "\\sinh", "\\slash", "\\small", "\\smash", "\\smile", "\\sp", "\\spadesuit", "\\sphericalangle", "\\sqcap", "\\sqcup", "\\sqrt", "\\sqsubset", "\\sqsubseteq", "\\sqsupset", "\\sqsupseteq", "\\stackrel", "\\star", "\\subset", "\\subseteq", "\\subseteqq", "\\subsetneq", "\\substack", "\\succ", "\\succapprox", "\\succcurlyeq", "\\succeq", "\\succnapprox", "\\succneqq", "\\succnsim", "\\succsim", "\\sum", "\\supset", "\\supseteq", "\\supsetneq", "\\supsetneqq", "\\surd", "\\swarrow", "\\tan", "\\tau", "\\textbf", "\\textit", "\\textless", "\\textmd", "\\textmu", "\\textnormal", "\\textrm", "\\textsc", "\\textsf", "\\textsl", "\\textstyle", "\\textsubscript", "\\textsuperscript", "\\texttt", "\\textup", "\\therefore", "\\theta", "\\tilde", "\\times", "\\tiny", "\\to", "\\top", "\\triangle", "\\triangledown", "\\triangleleft", "\\trianglelefteq", "\\triangleq", "\\triangleright", "\\trianglerighteq", "\\tt", "\\twoheadleftarrow", "\\twoheadrightarrow", "\\ulcorner", "\\underbrace", "\\underline", "\\underset", "\\uparrow", "\\updownarrow", "\\upharpoonleft", "\\upharpoonright", "\\uplus", "\\upsilon", "\\upuparrows", "\\urcorner", "\\vDash", "\\varDelta", "\\varLambda", "\\varOmega", "\\varPhi", "\\varPsi", "\\varepsilon", "\\varkappa", "\\varnothing", "\\varphi", "\\varpi", "\\varrho", "\\varsigma", "\\vartheta", "\\vartriangle", "\\vartriangleleft", "\\vartriangleright", "\\vdash", "\\vdots", "\\vec", "\\vee", "\\veebar", "\\vert", "\\vphantom", "\\wedge", "\\widehat", "\\widetilde", "\\wp", "\\wr", "\\xi", "\\xrightarrow", "\\zeta", "\\{", "\\|", "\\}", "]", "^", "_", "`", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "{", "|", "}", "~", "°", "–", "’", "⁄"]}
mathcls.onnx ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:818b1556e9ef337958db6be0c9791299d3f74a4575586b0cd469aaae9534ff96
3
+ size 191005
meta.json ADDED
The diff for this file is too large to render. See raw diff
 
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e9b0b74c12176516548664a46429758ac7c1088dd43524534fc7272e221a6762
3
+ size 5013304
order.onnx ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a42db2e8b536ad3d84045a4b7f9b0a72667cf8be4aa02d63f7b38004719fb180
3
+ size 2973138
orient.onnx ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:20eaf670f55a7cf9facfe1bdd6c7b8e40be75bbf4d48a3df43f66aa3bbd874fd
3
+ size 371802
rec.onnx ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:475972a2710be4a3cbfeb2bc7f3624ffd563de07de42476fc7a290d4e1ece484
3
+ size 5042161
rec_cjk.onnx ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4a035516a17e62cdf33a4fe2d88077654cb8841cff024685cdef4e351694ef50
3
+ size 10176018
rec_rtl.onnx ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:468796bd684486a8388c30c8b4ed2a26e3eeb1f8ff02831c24c2e12c79a2a834
3
+ size 4812710
rec_world.onnx ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c8d1e59f21b04966f179d2d2d8e22b230d22110b3f89855bbbf2624a58c40043
3
+ size 5627990
script.onnx ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b6ce4e926e19c243faaf37bd46880398bf2cb4ae56a29e1177a3b017c1280e36
3
+ size 191630