ml-figs / README.md
salamnocap's picture
Update README.md
8bb1709 verified
---
license: cc-by-nc-4.0
language:
- en
tags:
- education
- figure
- caption
- books
pretty_name: ML-Figs
size_categories:
- 1K<n<10K
---
[![GitHub](https://img.shields.io/badge/github-%23121011.svg?style=for-the-badge&logo=github&logoColor=white)](https://github.com/salamnocap/ml-figs-ldm)
# ML-FIGS πŸ“šπŸ“Š
This dataset comprises a collection of **4,256 figures** and corresponding metadata extracted from **43 different machine learning books**. Each directory represents one book and contains a subdirectory with **images** and a **JSON file** holding metadata for each figure. The dataset is organized hierarchically as follows:
```python
ml-figs/
β”œβ”€β”€ Book_1/
β”‚ β”œβ”€β”€ image/
β”‚ β”‚ β”œβ”€β”€ Figure1.png
β”‚ β”‚ β”œβ”€β”€ Figure2.png
β”‚ β”‚ └── ...
β”‚ └── Book_1.json
β”œβ”€β”€ Book_2/
β”‚ β”œβ”€β”€ image/
β”‚ β”‚ β”œβ”€β”€ Figure1.png
β”‚ β”‚ β”œβ”€β”€ Figure2.png
β”‚ β”‚ └── ...
β”‚ └── Book_2.json
β”œβ”€β”€ ...
β”‚
β”œβ”€β”€ mlfigs_train.json
β”‚
└── mlfigs_test.json
```
Each **JSON file** in the dataset represents the metadata for all the figures within a particular book. A typical entry for a figure in the JSON file includes the following attributes:
- **caption**: Describes the content of the figure. For example, "Figure 25: Gradient Descent (4/4)".
- **captionBoundary**: The bounding box of the caption text within the page, represented as a dictionary:
- **x1, x2**: Horizontal boundaries of the caption.
- **y1, y2**: Vertical boundaries of the caption.
- **figType**: The type of figure (usually "Figure", "Table", or other structural elements).
- **imageText**: A list of any text recognized within the figure image.
- **name**: The unique identifier for each figure within the book (e.g., "25").
- **page**: The page number on which the figure appears.
- **regionBoundary**: The bounding box of the entire figure within the page, defined as:
- **x1, x2**: Horizontal boundaries of the figure.
- **y1, y2**: Vertical boundaries of the figure.
- **renderDpi**: The DPI (dots per inch) resolution used when rendering the image.
- **renderURL**: The path to the corresponding figure image file within the image/ directory.
- **ocr**: OCR (Optical Character Recognition) data, capturing any text detected within the figure.
- **text** : A list of strings, representing the recognized text within the figure. These are typically individual words or symbols extracted by the OCR system.
- **left** : Horizontal coordinates (in pixels) representing the left edge of each recognized text element.
- **top** : Vertical coordinates (in pixels) representing the top edge of each recognized text element.
- **width** : Width of each recognized text element, providing the horizontal span of the text box.
- **height** : Height of each recognized text element.
- **conf** : Each recognized text element is assigned a confidence score ranging from 0 to 100, indicating the OCR system's confidence in its recognition.
# πŸ“• Citation
```bibtex
@misc{salamat_kuantaiuly_2025,
author = { Salamat Kuantaiuly },
title = { ml-figs (Revision 8695d1b) },
year = 2025,
url = { https://huggingface.co/datasets/salamnocap/ml-figs },
doi = { 10.57967/hf/5251 },
publisher = { Hugging Face }
}
```