|
|
---
|
|
|
dataset_info:
|
|
|
features:
|
|
|
- name: latex
|
|
|
dtype: string
|
|
|
- name: image
|
|
|
dtype: image
|
|
|
splits:
|
|
|
- name: train
|
|
|
num_bytes: 66713771
|
|
|
num_examples: 12312
|
|
|
download_size: 66713771
|
|
|
dataset_size: 66713771
|
|
|
configs:
|
|
|
- config_name: default
|
|
|
data_files:
|
|
|
- split: train
|
|
|
path: "*.parquet"
|
|
|
language:
|
|
|
- en
|
|
|
tags:
|
|
|
- mathematics
|
|
|
- latex
|
|
|
- computer-vision
|
|
|
- OCR
|
|
|
size_categories:
|
|
|
- 10K<n<100K
|
|
|
task_categories:
|
|
|
- image-to-text
|
|
|
pretty_name: Mathematical Expressions Dataset
|
|
|
viewer: true
|
|
|
---
|
|
|
|
|
|
# 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**: 1 Parquet files
|
|
|
- **Estimated number of samples**: 12,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.
|
|
|
|
|
|
### Data Splits
|
|
|
|
|
|
| Split | Examples |
|
|
|
|-------|-----------|
|
|
|
| train | 12,312 |
|
|
|
|
|
|
## Usage
|
|
|
|
|
|
```python
|
|
|
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("ToniDO/TeXtract_augraphy_v1")
|
|
|
|
|
|
# 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:
|
|
|
|
|
|
```python
|
|
|
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:
|
|
|
|
|
|
```bibtex
|
|
|
@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/ToniDO/TeXtract_augraphy_v1}
|
|
|
}
|
|
|
```
|
|
|
|