File size: 2,492 Bytes
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
---
license: openrail
task_categories:
- image-to-text
---
# Dataset Description
There are two datasets here: *raw_formulas* and *tokenized_formulas*.

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.

When rendering images corresponding to the formulas, the following external packages are required:

* amsmath
* amsfonts
* amssymb
* mathtools

## Details about the *raw_formulas* dataset
We crawled latex formulas containing the following formula environments:
* equation
* align
* align*
* gather
* gather*

The formulas do not contain the following content:
* \label
* %
* \quad
* \qquad
* \vspace
* \hspace
* \resizebox
* \scalebox
* \rotatebox
* \parbox
* \fbox
* \makebox
* \raisebox
* \addvspace
* \hfill
* \vfill
* \textwidth
* \textheight
* \rule

## Preprocessing details of the *tokenized_formulas* dataset
### Cleaning
* We removed some useless junk data from *raw_formulas*.
* We removed overly complex formulas from *raw_formulas*:
* Formulas with a render image aspect ratio greater than 0.8 were deleted.
* Formulas with a character length greater than 200 were deleted.
* The following content in *raw_formulas* formulas was removed:
  * \tag,
  * \text
  * \begin{split}
  * \end{split}
  * \nonumber
  * \notag
* 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.
* We removed formulas containing custom macros from *raw_formulas*, only the following common custom macros were retained:
  * \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}}

### Tokenization
Substrings that match the following pattern are considered a word:
* \begin{.*?}
* \end{.*?}
* \\[A-Za-z]+

The following strings are also considered a word:
* \\[
* \\]
* \\{
* \\}
* \\_
* \\$
* \\&
* \\\#
* \\%
* \\|
* '
* ''
* '''
* ''''
* '^
* ''^
* '''^
* ''''^