latex-formulas / README.md
三洋三洋
2023-07-26
3441264
|
raw
history blame
No virus
2.42 kB
metadata
license: openrail
task_categories:
  - image-to-text

Dataset Description

English version is here

这里有两个数据集:raw_formulastokenized_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]+

以下字符串也被视为一个词:

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