File size: 2,423 Bytes
e33cd78
 
 
 
 
 
 
473a9c8
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3441264
473a9c8
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3441264
473a9c8
 
fa8e214
473a9c8
3441264
fa8e214
 
 
 
 
 
 
 
 
 
 
473a9c8
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
---
license: openrail
task_categories:
- image-to-text
---

# Dataset Description
> English version is [here](./README_English.md)

这里有两个数据集:*raw_formulas**tokenized_formulas*。

我们在*arxiv*上爬取了约100万条未经过清洗以及文本分词的latex公式的图片文本对从而得到了*raw_formulas*数据集。在将*raw_formulas*数据集进行**清洗**以及**文本分词**后得到了*tokenized_formulas*数据集。

渲染公式对应的图片时,需要用到以下外部包:
* amsmath
* amsfonts
* amssymb
* mathtools

## 有关*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

## *tokenized_formulas*数据集的一些预处理细节
### 清洗
* 我们删除了*raw_formulas*中一些无用的垃圾数据
* 我们删除了*raw_formulas*中过于复杂的公式:
  * 公式对应的渲染图片高宽比如果大于0.8,那么公式会被删除
  * 字符长度大于200的公式被删除了
* *raw_formulas*公式中的以下内容被删除了:
  * \tag
  * \text
  * \begin{split}
  * \end{split}
  * \nonumber
  * \notag
* *raw_formulas*中的`equation、equation*、align、\[...\]`公式环境被替换成了`align*`公式环境,`gather`公式环境被替换成了`gather*`环境
* 我们删除了*raw_formulas*中包含自定义宏的公式,**只有以下的常见自定义宏被保留了**:
  * \newcommand{\R}{\mathbb{R}}
  * \newcommand{\N}{\mathbb{N}}
  * \newcommand{\Z}{\mathbb{Z}}
  * \newcommand{\Q}{\mathbb{Q}}
  * \newcommand{\C}{\mathbb{C}}
  * \newcommand{\avg}[1]{\left<#1\right>}
  * \newcommand{\Deriv}[2]{\frac{\mathrm{d} #1}{\mathrm{d} #2}}
  * \newcommand{\dd}{\mathrm{d}}
  * \newcommand{\norm}[1]{\left\lVert#1\right\rVert}
  * \newcommand{\abs}[1]{\left|#1\right|}
  * \newcommand{\vect}[1]{\mathbf{#1}}
### 分词
符合以下pattern的子串被视为一个词:
* \begin{.*?}
* \end\{.*?}
* \\[A-Za-z]+

以下字符串也被视为一个词:
* \\[
* \\]
* \\\
* \\{
* \\}
* \\_
* \\$
* \\&
* \\#
* \\%
* \\|
* '
* ''
* '''
* ''''
* '\^
* ''\^
* '''\^
* ''''\^