latex-formulas / README_zh.md
OleehyO's picture
Upload README_zh.md with huggingface_hub
d4afad3 verified
---
license: openrail
task_categories:
- image-to-text
---
# 大新闻‼️
📮 [2024-02] 我们使用latex-formulas数据集训练了一个公式识别模型[TexTeller](https://github.com/OleehyO/TexTeller?tab=readme-ov-file),它可以将latex公式转换为图片,并且有着**很高的准确率**以及**很强的泛化能力**,可以**覆盖大部分公式识别场景**
> 详情信息请参阅[TexTeller的github仓库](https://github.com/OleehyO/TexTeller?tab=readme-ov-file)
# Dataset Description
这里有两个数据集:**raw_formulas**和**cleaned_formulas**(这个数据集有*550K*个公式-图片对)。
我们在*arxiv*上爬取了约100万条未经过清洗以及文本分词的latex公式的图片文本对从而得到了*raw_formulas*数据集。
在将*raw_formulas*数据集进行**清洗**并加入[im2latex-100K](https://zenodo.org/records/56198#.V2px0jXT6eA)数据集后得到了*cleaned_formulas*数据集(一个具有*550K*公式-图片对的数据集)。
渲染公式对应的图片时,需要用到以下外部包:
* amsmath
* amsfonts
* amssymb
* mathtools
## 用法
加载 **raw_formulas** 数据集:
```python
from datasets import load_dataset
data = load_dataset("OleehyO/latex-formulas", "raw_formulas")
```
加载 **cleaned_formulas** 数据集:
```python
from datasets import load_dataset
data = load_dataset("OleehyO/latex-formulas", "cleaned_formulas")
```
## 有关*raw_formulas*数据集的一些细节
我们爬取了包含以下公式环境的latex公式:
* equation
* align
* align*
* gather
* gather*
公式中不存在以下内容:
* \label
* %
* \quad
* \qquad
* \vspace
* \hspace
* \resizebox
* \scalebox
* \rotatebox
* \parbox
* \fbox
* \makebox
* \raisebox
* \addvspace
* \hfill
* \vfill
* \textwidth
* \textheight
* \rule
## *cleaned_formulas*数据集的一些预处理细节
### 清洗
* 我们删除了*raw_formulas*和[im2latex-100K](https://zenodo.org/records/56198#.V2px0jXT6eA)中一些无用的垃圾数据
* 我们删除了*raw_formulas*和[im2latex-100K](https://zenodo.org/records/56198#.V2px0jXT6eA)中过于复杂的公式:
* 公式对应的渲染图片高宽比如果大于0.8,那么公式会被删除
* 字符长度大于200的公式被删除了
* 在*raw_formulas*和[im2latex-100K](https://zenodo.org/records/56198#.V2px0jXT6eA)的公式中,以下内容被删除了:
* \tag
* \text
* \begin{split}
* \end{split}
* \nonumber
* \notag
* *raw_formulas*和中的`equation、equation*、align、\[...\]`公式环境均被替换成了`align*`公式环境
* 我们删除了*raw_formulas*中包含自定义宏的公式。