Datasets:
Commit ·
7d54959
verified ·
0
Parent(s):
Duplicate from linxy/LaTeX_OCR
Browse filesCo-authored-by: Lin Xueyuan <linxy@users.noreply.huggingface.co>
Files changed (17)
- .gitattributesAdded+55
- README.mdAdded+219
- full/test-00000-of-00001.parquetAdded+3
- full/train-00000-of-00001.parquetAdded+3
- full/validation-00000-of-00001.parquetAdded+3
- human_handwrite/test-00000-of-00001.parquetAdded+3
- human_handwrite/train-00000-of-00001.parquetAdded+3
- human_handwrite/validation-00000-of-00001.parquetAdded+3
- human_handwrite_print/test-00000-of-00001.parquetAdded+3
- human_handwrite_print/train-00000-of-00001.parquetAdded+3
- human_handwrite_print/validation-00000-of-00001.parquetAdded+3
- small/test-00000-of-00001.parquetAdded+3
- small/train-00000-of-00001.parquetAdded+3
- small/validation-00000-of-00001.parquetAdded+3
- synthetic_handwrite/test-00000-of-00001.parquetAdded+3
- synthetic_handwrite/train-00000-of-00001.parquetAdded+3
- synthetic_handwrite/validation-00000-of-00001.parquetAdded+3
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455*.7z filter=lfs diff=lfs merge=lfs -text*.arrow filter=lfs diff=lfs merge=lfs -text*.bin filter=lfs diff=lfs merge=lfs -text*.bz2 filter=lfs diff=lfs merge=lfs -text*.ckpt filter=lfs diff=lfs merge=lfs -text*.ftz filter=lfs diff=lfs merge=lfs -text*.gz filter=lfs diff=lfs merge=lfs -text*.h5 filter=lfs diff=lfs merge=lfs -text*.joblib filter=lfs diff=lfs merge=lfs -text*.lfs.* filter=lfs diff=lfs merge=lfs -text*.lz4 filter=lfs diff=lfs merge=lfs -text*.mlmodel filter=lfs diff=lfs merge=lfs -text*.model filter=lfs diff=lfs merge=lfs -text*.msgpack filter=lfs diff=lfs merge=lfs -text*.npy filter=lfs diff=lfs merge=lfs -text*.npz filter=lfs diff=lfs merge=lfs -text*.onnx filter=lfs diff=lfs merge=lfs -text*.ot filter=lfs diff=lfs merge=lfs -text*.parquet filter=lfs diff=lfs merge=lfs -text*.pb filter=lfs diff=lfs merge=lfs -text*.pickle filter=lfs diff=lfs merge=lfs -text*.pkl filter=lfs diff=lfs merge=lfs -text*.pt filter=lfs diff=lfs merge=lfs -text*.pth filter=lfs diff=lfs merge=lfs -text*.rar filter=lfs diff=lfs merge=lfs -text*.safetensors filter=lfs diff=lfs merge=lfs -textsaved_model/**/* filter=lfs diff=lfs merge=lfs -text*.tar.* filter=lfs diff=lfs merge=lfs -text*.tar filter=lfs diff=lfs merge=lfs -text*.tflite filter=lfs diff=lfs merge=lfs -text*.tgz filter=lfs diff=lfs merge=lfs -text*.wasm filter=lfs diff=lfs merge=lfs -text*.xz filter=lfs diff=lfs merge=lfs -text*.zip filter=lfs diff=lfs merge=lfs -text*.zst filter=lfs diff=lfs merge=lfs -text*tfevents* filter=lfs diff=lfs merge=lfs -text# Audio files - uncompressed*.pcm filter=lfs diff=lfs merge=lfs -text*.sam filter=lfs diff=lfs merge=lfs -text*.raw filter=lfs diff=lfs merge=lfs -text# Audio files - compressed*.aac filter=lfs diff=lfs merge=lfs -text*.flac filter=lfs diff=lfs merge=lfs -text*.mp3 filter=lfs diff=lfs merge=lfs -text*.ogg filter=lfs diff=lfs merge=lfs -text*.wav filter=lfs diff=lfs merge=lfs -text# Image files - uncompressed*.bmp filter=lfs diff=lfs merge=lfs -text*.gif filter=lfs diff=lfs merge=lfs -text*.png filter=lfs diff=lfs merge=lfs -text*.tiff filter=lfs diff=lfs merge=lfs -text# Image files - compressed*.jpg filter=lfs diff=lfs merge=lfs -text*.jpeg filter=lfs diff=lfs merge=lfs -text*.webp filter=lfs diff=lfs merge=lfs -text123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219---license: apache-2.0size_categories:- 100K<n<1Mtask_categories:- image-to-textdataset_info:- config_name: default features: - name: image dtype: image - name: text dtype: string splits: - name: train num_bytes: 392473380.05 num_examples: 76318 download_size: 383401054 dataset_size: 392473380.05- config_name: full features: - name: image dtype: image - name: text dtype: string splits: - name: train num_bytes: 385291867 num_examples: 76318 - name: validation num_bytes: 43364061.55 num_examples: 8475 - name: test num_bytes: 47643036.303 num_examples: 9443 download_size: 473618552 dataset_size: 483485587.878- config_name: human_handwrite features: - name: image dtype: image - name: text dtype: string splits: - name: train num_bytes: 16181778 num_examples: 1200 - name: validation num_bytes: 962283 num_examples: 68 - name: test num_bytes: 906906 num_examples: 70 download_size: 18056029 dataset_size: 18050967- config_name: human_handwrite_print features: - name: image dtype: image - name: text dtype: string splits: - name: train num_bytes: 3152122.8 num_examples: 1200 - name: validation num_bytes: 182615 num_examples: 68 - name: test num_bytes: 181698 num_examples: 70 download_size: 1336052 dataset_size: 3516435.8- config_name: small features: - name: image dtype: image - name: text dtype: string splits: - name: train num_bytes: 261296 num_examples: 50 - name: validation num_bytes: 156489 num_examples: 30 - name: test num_bytes: 156489 num_examples: 30 download_size: 588907 dataset_size: 574274- config_name: synthetic_handwrite features: - name: image dtype: image - name: text dtype: string splits: - name: train num_bytes: 496610333.066 num_examples: 76266 - name: validation num_bytes: 63147351.515 num_examples: 9565 - name: test num_bytes: 62893132.805 num_examples: 9593 download_size: 616418996 dataset_size: 622650817.3859999configs:- config_name: default data_files: - split: train path: full/train-*- config_name: full data_files: - split: train path: full/train-* - split: validation path: full/validation-* - split: test path: full/test-*- config_name: human_handwrite data_files: - split: train path: human_handwrite/train-* - split: validation path: human_handwrite/validation-* - split: test path: human_handwrite/test-*- config_name: human_handwrite_print data_files: - split: train path: human_handwrite_print/train-* - split: validation path: human_handwrite_print/validation-* - split: test path: human_handwrite_print/test-*- config_name: small data_files: - split: train path: small/train-* - split: validation path: small/validation-* - split: test path: small/test-*- config_name: synthetic_handwrite data_files: - split: train path: synthetic_handwrite/train-* - split: validation path: synthetic_handwrite/validation-* - split: test path: synthetic_handwrite/test-*tags:- code---
# LaTeX OCR 的数据仓库
本数据仓库是专为 [LaTeX_OCR](https://github.com/LinXueyuanStdio/LaTeX_OCR) 及 [LaTeX_OCR_PRO](https://github.com/LinXueyuanStdio/LaTeX_OCR) 制作的数据,来源于 `https://zenodo.org/record/56198#.V2p0KTXT6eA` 以及 `https://www.isical.ac.in/~crohme/` 以及我们自己构建。
如果这个数据仓库有帮助到你的话,请点亮 ❤️like ++
后续追加新的数据也会放在这个仓库 ~~
> 原始数据仓库在github [LinXueyuanStdio/Data-for-LaTeX_OCR](https://github.com/LinXueyuanStdio/Data-for-LaTeX_OCR).
## 数据集
本仓库有 5 个数据集
1. `small` 是小数据集,样本数 110 条,用于测试2. `full` 是印刷体约 100k 的完整数据集。实际上样本数略小于 100k,因为用 LaTeX 的抽象语法树剔除了很多不能渲染的 LaTeX。3. `synthetic_handwrite` 是手写体 100k 的完整数据集,基于 `full` 的公式,使用手写字体合成而来,可以视为人类在纸上的手写体。样本数实际上略小于 100k,理由同上。4. `human_handwrite` 是手写体较小数据集,更符合人类在电子屏上的手写体。主要来源于 `CROHME`。我们用 LaTeX 的抽象语法树校验过了。5. `human_handwrite_print` 是来自 `human_handwrite` 的印刷体数据集,公式部分和 `human_handwrite` 相同,图片部分由公式用 LaTeX 渲染而来。
## 使用
加载训练集
- name 可选 small, full, synthetic_handwrite, human_handwrite, human_handwrite_print- split 可选 train, validation, test
```python>>> from datasets import load_dataset>>> train_dataset = load_dataset("linxy/LaTeX_OCR", name="small", split="train")>>> train_dataset[2]["text"]\rho _ { L } ( q ) = \sum _ { m = 1 } ^ { L } \ P _ { L } ( m ) \ { \frac { 1 } { q ^ { m - 1 } } } .>>> train_dataset[2]{'image': <PIL.PngImagePlugin.PngImageFile image mode=RGB size=200x50 at 0x15A5D6CE210>, 'text': '\\rho _ { L } ( q ) = \\sum _ { m = 1 } ^ { L } \\ P _ { L } ( m ) \\ { \\frac { 1 } { q ^ { m - 1 } } } .'}>>> len(train_dataset)50```
加载所有```python>>> from datasets import load_dataset>>> dataset = load_dataset("linxy/LaTeX_OCR", name="small")>>> datasetDatasetDict({ train: Dataset({ features: ['image', 'text'], num_rows: 50 }) validation: Dataset({ features: ['image', 'text'], num_rows: 30 }) test: Dataset({ features: ['image', 'text'], num_rows: 30 })})```
123version https://git-lfs.github.com/spec/v1oid sha256:908015e4c891792d36ea8070e9e0d90b61b1f89f2b0ddf7a647b236b5b59496asize 47575275123version https://git-lfs.github.com/spec/v1oid sha256:93505f9a92a4860ed5ba247882c89f91118093c862c7cb9d46f496b42222f2f8size 383401054123version https://git-lfs.github.com/spec/v1oid sha256:cbef2077fe9518a060e308e714d55f31fe8f7c06f8e9bb8282126e2538daf2f8size 42633842123version https://git-lfs.github.com/spec/v1oid sha256:56461d611a855d48d2e78b5716bdd26ebe150b12df2619701e4db450cf242497size 905665123version https://git-lfs.github.com/spec/v1oid sha256:7f60c687aa83469552784d2f1c404d848a5e18f126468962e24dca84c54c67e2size 16189089123version https://git-lfs.github.com/spec/v1oid sha256:a658403d893e25eb9834bc499206702c8881a888f0e1edaac413da07ae827336size 961275123version https://git-lfs.github.com/spec/v1oid sha256:8d0a04b441330589a02095b0984d76bd77984646675c8d1a005b14daf84365d0size 78567123version https://git-lfs.github.com/spec/v1oid sha256:ed636f707fba2cebc9b21d29bd65538744d329af837caa9922ded9ca7a00306asize 1180941123version https://git-lfs.github.com/spec/v1oid sha256:a8cbe5e5b63d64062a38be0ff91927089fd1038d15b5c95bda019274c8382d9esize 76544123version https://git-lfs.github.com/spec/v1oid sha256:9b5c3cad9a0130649e12edd383317ef76525b490b3e75ba37f20dbaa38ccfe6bsize 161866123version https://git-lfs.github.com/spec/v1oid sha256:d5ab0d3488cd4e005587e7c684e7b30b3964f00b3df00cd73ed540c38754763fsize 265175123version https://git-lfs.github.com/spec/v1oid sha256:9b5c3cad9a0130649e12edd383317ef76525b490b3e75ba37f20dbaa38ccfe6bsize 161866123version https://git-lfs.github.com/spec/v1oid sha256:83b47dd05a62bb590e70789e901e6d834489469f3b335024b48eaac0fca68483size 61759146123version https://git-lfs.github.com/spec/v1oid sha256:b5ae0ec1de57f498acf6fc0531d324c38b8547e4f761c081f7ce24d2602262edsize 492809356123version https://git-lfs.github.com/spec/v1oid sha256:ee3ecb13595e4c4e6363865289054bccbf59f6c30e78440d86a61ace444247b7size 61850494.gitattributesAdded+55
README.mdAdded+219
full/test-00000-of-00001.parquetAdded+3
full/train-00000-of-00001.parquetAdded+3
full/validation-00000-of-00001.parquetAdded+3
human_handwrite/test-00000-of-00001.parquetAdded+3
human_handwrite/train-00000-of-00001.parquetAdded+3
human_handwrite/validation-00000-of-00001.parquetAdded+3
human_handwrite_print/test-00000-of-00001.parquetAdded+3
human_handwrite_print/train-00000-of-00001.parquetAdded+3
human_handwrite_print/validation-00000-of-00001.parquetAdded+3
small/test-00000-of-00001.parquetAdded+3
small/train-00000-of-00001.parquetAdded+3
small/validation-00000-of-00001.parquetAdded+3
synthetic_handwrite/test-00000-of-00001.parquetAdded+3
synthetic_handwrite/train-00000-of-00001.parquetAdded+3
synthetic_handwrite/validation-00000-of-00001.parquetAdded+3