Datasets:
Rename README_English.md to README_zh.md
Browse files- README_English.md +0 -98
- README_zh.md +77 -0
README_English.md
DELETED
@@ -1,98 +0,0 @@
|
|
1 |
-
---
|
2 |
-
license: openrail
|
3 |
-
task_categories:
|
4 |
-
- image-to-text
|
5 |
-
---
|
6 |
-
# Dataset Description
|
7 |
-
There are two datasets here: *raw_formulas* and *tokenized_formulas*.
|
8 |
-
|
9 |
-
We crawled approximately 1 million uncleaned and untokenized latex formula image-text pairs from *arxiv*, resulting in the *raw_formulas* dataset. After cleaning and tokenizing the *raw_formulas* dataset, we obtained the *tokenized_formulas* dataset.
|
10 |
-
|
11 |
-
When rendering images corresponding to the formulas, the following external packages are required:
|
12 |
-
|
13 |
-
* amsmath
|
14 |
-
* amsfonts
|
15 |
-
* amssymb
|
16 |
-
* mathtools
|
17 |
-
|
18 |
-
## Details about the *raw_formulas* dataset
|
19 |
-
We crawled latex formulas containing the following formula environments:
|
20 |
-
* equation
|
21 |
-
* align
|
22 |
-
* align*
|
23 |
-
* gather
|
24 |
-
* gather*
|
25 |
-
|
26 |
-
The formulas do not contain the following content:
|
27 |
-
* \label
|
28 |
-
* %
|
29 |
-
* \quad
|
30 |
-
* \qquad
|
31 |
-
* \vspace
|
32 |
-
* \hspace
|
33 |
-
* \resizebox
|
34 |
-
* \scalebox
|
35 |
-
* \rotatebox
|
36 |
-
* \parbox
|
37 |
-
* \fbox
|
38 |
-
* \makebox
|
39 |
-
* \raisebox
|
40 |
-
* \addvspace
|
41 |
-
* \hfill
|
42 |
-
* \vfill
|
43 |
-
* \textwidth
|
44 |
-
* \textheight
|
45 |
-
* \rule
|
46 |
-
|
47 |
-
## Preprocessing details of the *tokenized_formulas* dataset
|
48 |
-
### Cleaning
|
49 |
-
* We removed some useless junk data from *raw_formulas*.
|
50 |
-
* We removed overly complex formulas from *raw_formulas*:
|
51 |
-
* Formulas with a render image aspect ratio greater than 0.8 were deleted.
|
52 |
-
* Formulas with a character length greater than 200 were deleted.
|
53 |
-
* The following content in *raw_formulas* formulas was removed:
|
54 |
-
* \tag,
|
55 |
-
* \text
|
56 |
-
* \begin{split}
|
57 |
-
* \end{split}
|
58 |
-
* \nonumber
|
59 |
-
* \notag
|
60 |
-
* In *raw_formulas*, the `equation, equation*, align, \[...\]` formula environments were replaced with the `align*` formula environment, and the `gather` formula environment was replaced with the `gather*` environment.
|
61 |
-
* We removed formulas containing custom macros from *raw_formulas*, only the following common custom macros were retained:
|
62 |
-
* \newcommand{\R}{\mathbb{R}}
|
63 |
-
* \newcommand{\N}{\mathbb{N}}
|
64 |
-
* \newcommand{\Z}{\mathbb{Z}}
|
65 |
-
* \newcommand{\Q}{\mathbb{Q}}
|
66 |
-
* \newcommand{\C}{\mathbb{C}}
|
67 |
-
* \newcommand{\avg}[1]{\left<#1\right>}
|
68 |
-
* \newcommand{\Deriv}[2]{\frac{\mathrm{d} #1}{\mathrm{d} #2}}
|
69 |
-
* \newcommand{\dd}{\mathrm{d}}
|
70 |
-
* \newcommand{\norm}[1]{\left\lVert#1\right\rVert}
|
71 |
-
* \newcommand{\abs}[1]{\left|#1\right|}
|
72 |
-
* \newcommand{\vect}[1]{\mathbf{#1}}
|
73 |
-
|
74 |
-
### Tokenization
|
75 |
-
Substrings that match the following pattern are considered a word:
|
76 |
-
* \begin{.*?}
|
77 |
-
* \end{.*?}
|
78 |
-
* \\[A-Za-z]+
|
79 |
-
|
80 |
-
The following strings are also considered a word:
|
81 |
-
* \\[
|
82 |
-
* \\]
|
83 |
-
* \\{
|
84 |
-
* \\}
|
85 |
-
* \\_
|
86 |
-
* \\$
|
87 |
-
* \\&
|
88 |
-
* \\\#
|
89 |
-
* \\%
|
90 |
-
* \\|
|
91 |
-
* '
|
92 |
-
* ''
|
93 |
-
* '''
|
94 |
-
* ''''
|
95 |
-
* '^
|
96 |
-
* ''^
|
97 |
-
* '''^
|
98 |
-
* ''''^
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
README_zh.md
ADDED
@@ -0,0 +1,77 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
license: openrail
|
3 |
+
task_categories:
|
4 |
+
- image-to-text
|
5 |
+
---
|
6 |
+
|
7 |
+
# Dataset Description
|
8 |
+
|
9 |
+
这里有两个数据集:**raw_formulas**和**cleaned_formulas**(这个数据集有*550K*个公式-图片对)。
|
10 |
+
|
11 |
+
我们在*arxiv*上爬取了约100万条未经过清洗以及文本分词的latex公式的图片文本对从而得到了*raw_formulas*数据集。
|
12 |
+
在将*raw_formulas*数据集进行**清洗**并加入[im2latex-100K](https://zenodo.org/records/56198#.V2px0jXT6eA)数据集后得到了*cleaned_formulas*数据集(一个具有*550K*公式-图片对的数据集)。
|
13 |
+
|
14 |
+
渲染公式对应的图片时,需要用到以下外部包:
|
15 |
+
* amsmath
|
16 |
+
* amsfonts
|
17 |
+
* amssymb
|
18 |
+
* mathtools
|
19 |
+
|
20 |
+
## 用法
|
21 |
+
加载 **raw_formulas** 数据集:
|
22 |
+
|
23 |
+
```python
|
24 |
+
from datasets import load_dataset
|
25 |
+
data = load_dataset("OleehyO/latex-formulas", "raw_formulas")
|
26 |
+
```
|
27 |
+
|
28 |
+
加载 **cleaned_formulas** 数据集:
|
29 |
+
```python
|
30 |
+
from datasets import load_dataset
|
31 |
+
data = load_dataset("OleehyO/latex-formulas", "cleaned_formulas")
|
32 |
+
```
|
33 |
+
|
34 |
+
## 有关*raw_formulas*数据集的一些细节
|
35 |
+
我们爬取了包含以下公式环境的latex公式:
|
36 |
+
* equation
|
37 |
+
* align
|
38 |
+
* align*
|
39 |
+
* gather
|
40 |
+
* gather*
|
41 |
+
|
42 |
+
公式中不存在以下内容:
|
43 |
+
* \label
|
44 |
+
* %
|
45 |
+
* \quad
|
46 |
+
* \qquad
|
47 |
+
* \vspace
|
48 |
+
* \hspace
|
49 |
+
* \resizebox
|
50 |
+
* \scalebox
|
51 |
+
* \rotatebox
|
52 |
+
* \parbox
|
53 |
+
* \fbox
|
54 |
+
* \makebox
|
55 |
+
* \raisebox
|
56 |
+
* \addvspace
|
57 |
+
* \hfill
|
58 |
+
* \vfill
|
59 |
+
* \textwidth
|
60 |
+
* \textheight
|
61 |
+
* \rule
|
62 |
+
|
63 |
+
## *cleaned_formulas*数据集的一些预处理细节
|
64 |
+
### 清洗
|
65 |
+
* 我们删除了*raw_formulas*和[im2latex-100K](https://zenodo.org/records/56198#.V2px0jXT6eA)中一些无用的垃圾数据
|
66 |
+
* 我们删除了*raw_formulas*和[im2latex-100K](https://zenodo.org/records/56198#.V2px0jXT6eA)中过于复杂的公式:
|
67 |
+
* 公式对应的渲染图片高宽比如果大于0.8,那么公式会被删除
|
68 |
+
* 字符长度大于200的公式被删除了
|
69 |
+
* 在*raw_formulas*和[im2latex-100K](https://zenodo.org/records/56198#.V2px0jXT6eA)的公式中,以下内容被删除了:
|
70 |
+
* \tag
|
71 |
+
* \text
|
72 |
+
* \begin{split}
|
73 |
+
* \end{split}
|
74 |
+
* \nonumber
|
75 |
+
* \notag
|
76 |
+
* *raw_formulas*和中的`equation、equation*、align、\[...\]`公式环境均被替换成了`align*`公式环境
|
77 |
+
* 我们删除了*raw_formulas*中包含自定义宏的公式。
|