Datasets:
Mathematical Expressions Dataset
Dataset Description
This dataset contains images of mathematical expressions along with their corresponding LaTeX code. Images will automatically be displayed as thumbnails in Hugging Face's Data Studio.
Dataset Summary
- Number of files: 17 Parquet files
- Estimated number of samples: 3,212,312
- Format: Parquet optimized for Hugging Face
- Features configured for thumbnails: ✅
- Columns:
latex
: LaTeX code of the mathematical expression (string)image
: Image of the mathematical expression (Image with decode=True)
Supported Tasks
- Image-to-Text: Conversion of mathematical expression images to LaTeX code
- OCR: Optical character recognition for mathematical characters
- Mathematical Expression Recognition: Recognition of mathematical expressions
Languages
The dataset contains mathematical expressions that are universal. The LaTeX code and associated metadata are primarily in English.
Dataset Structure
Data Fields
latex
: String with the LaTeX code that generates the mathematical expression.image
: PIL image containing the rendered mathematical expression.- Type:
datasets.Image(decode=True)
- Format: Images are automatically decoded to PIL.Image.
- Thumbnails: Automatically generated in Data Studio.
- Type:
Data Splits
Split | Examples |
---|---|
train | 3,212,312 |
Usage
from datasets import load_dataset
# Load the dataset
# Make sure to replace {repo_id_placeholder} with your actual Hugging Face repository ID
# For example: "your_username/your_dataset_name"
dataset = load_dataset("{repo_id}")
# Access a sample
sample = dataset['train'][0]
image = sample['image'] # Already a PIL.Image thanks to decode=True
latex_code = sample['latex']
print(f"LaTeX: {latex_code}")
image.show() # Display the image
# Images will also appear as thumbnails in Data Studio
Visualization
Images will automatically be displayed as thumbnails in Hugging Face's Data Studio thanks to the Features configuration:
from datasets import Features, Value, Image
features = Features({
"latex": Value("string"),
"image": Image(decode=True) # This generates the thumbnails
})
Dataset Creation
This dataset was created by converting WebDataset (.tar) files to Parquet format optimized for Hugging Face.
Source Data
- Original format: WebDataset (.tar)
- Conversion: Using a custom Python script.
- Optimization: Parquet format with Snappy compression (default for
pyarrow.parquet.write_table
if not specified otherwise, actual compression depends on how your Parquet files were created). - Features: Explicitly configured for automatic thumbnails.
Technical Details
Image Handling
- Storage: Images are stored as bytes within the Parquet file.
- Decoding: Automatic to PIL.Image when loading the dataset using
datasets.Image(decode=True)
. - Thumbnails: Automatically generated by Hugging Face Data Studio.
- Compatibility: Works with image formats supported by PIL (Pillow) when decoded.
Considerations for Using the Data
Social Impact of Dataset
This dataset can be used to:
- Improve mathematical expression recognition tools.
- Develop OCR systems specialized in mathematics.
- Create accessibility tools for mathematical content.
Licensing Information
- Apache 2.0
Citation Information
If you use this dataset in your research, please cite it as follows:
@misc{ToniDO_TeXtract_parquet_2025},
author = {ToniDO},
title = {{TeXtract_parquet (Parquet Format)}},
year = {2025},
publisher = {Hugging Face},
version = {1.0.0},
url = {https://huggingface.co/datasets/YOUR_HF_USER/YOUR_DATASET_NAME_HERE}
}
- Downloads last month
- 126