asandeistefan/romanian-baccalaureate-mathematics
Romanian Baccalaureate in Mathematics A curated collection of Romanian Baccalaureate (BAC) mathematics examination papers and answer keys, transcribed from PDF to structured Markdown using Vision-Language Model OCR. Currently the years 2019 - 2025 were added, more will be processed soon. Directory Structure romanian-baccalaureate-mathematics/ ├── metadata.csv # Index of all exam papers ├── pdfs/ # Original PDF files │ ├──… See the full description on the dataset page: https://huggingface.co/datasets/asandeistefan/romanian-baccalaureate-mathematics.
Romanian Baccalaureate in Mathematics
A curated collection of Romanian Baccalaureate (BAC) mathematics examination papers and answer keys, transcribed from PDF to structured Markdown using Vision-Language Model OCR. Currently the years 2019 - 2025 were added, more will be processed soon.
Directory Structure
romanian-baccalaureate-mathematics/
├── metadata.csv # Index of all exam papers
├── pdfs/ # Original PDF files
│ ├── 2023_matematica_m1_subiect.pdf
│ └── ...
└── markdown/ # OCR-processed content
├── 2023_matematica_m1_subiect.md
└── ...Metadata CSV Schema
metadata.csv contains one row per exam paper (questions only). Answer sheets are linked via reference rather than duplicate entries.
Note: Rows where answer_sheet is empty indicate that no official answer key was published or available in the source API for that particular exam variant.
Markdown Format
Each .md file follows a normalized structure:
- Headers: Section headers marked with
## SUBIECTUL I,## SUBIECTUL al II-lea, etc. - Math: All mathematical notation in LaTeX (
$...$for inline,$$...$$for display) - Formatting:
- Exercise labels in bold (e.g.,
**1.**,**a)**) - Point values preserved (e.g.,
5p,3p) - Tables converted to plain text with pipe characters removed
- Boilerplate headers/footers stripped (Ministry logos, page numbers, etc.)
Data Processing Pipeline
- Ingestion: Documents fetched via API from official Romanian Ministry of Education repositories
- OCR: PDF pages converted to images (300 DPI) and processed through Vision-Language Model (Gemini/Hunyuan) with prompts optimized for Romanian mathematical notation
- Cleaning:
- Removal of running headers/footers
- Deduplication of headers across multi-page documents
- Table flattening and normalization
- Consistent double-spacing between content blocks
Usage
Loading with Hugging Face Datasets
from datasets import load_dataset
import pandas as pd
ds = load_dataset("asandeistefan/romanian-baccalaureate-mathematics", split="train")
df = pd.read_csv("metadata.csv")
with open(f"markdown/{df.iloc[0]['filename'].replace('.pdf', '.md')}") as f:
content = f.read()Loading with Pandas
import pandas as pd
df = pd.read_csv("metadata.csv")
print(f"Total exams: {len(df)}")
print(f"Years covered: {df['year'].min()} - {df['year'].max()}")Limitations
- OCR Artifacts: Despite cleaning, occasional transcription errors in complex geometric diagrams or handwritten annotations may persist
- Missing Answer Sheets: Some exam variants lack official answer keys in the source database; these entries have empty
answer_sheetvalues
Citation
@dataset{romanian_bac_math_2026,
title = {Romanian Baccalaureate in Mathematics Dataset},
author = {Asandei Stefan-Alexandru},
year = {2026,
publisher = {Hugging Face},
url = {https://huggingface.co/datasets/username/romanian-baccalaureate-mathematics}
}