latex-formulas / README_English.md
三洋三洋
2023-07-26
3441264
|
raw
history blame
2.49 kB
metadata
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:

  • \[
  • \]
  • \{
  • \}
  • \_
  • \$
  • \&
  • \#
  • \%
  • \|
  • '
  • ''
  • '''
  • ''''
  • '^
  • ''^
  • '''^
  • ''''^