CoolFace
Datasetpublic

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.

sourceHugging Faceapache-2.0updated 3mo agoView on Hugging Face
2likes293downloads
Dataset Card

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.

ColumnTypeDescription
filenamestringPDF filename (e.g., 2023_Matematică_M_științe_subiect.pdf)
yearintegerAcademic year of the exam
subjectstringSubject code (e.g., Matematică)
profilestringEducational track (e.g., Real, Uman, Pedagogic) or empty if not specified
answer_sheetstringFilename of corresponding answer key/barem, or empty string if unavailable

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

  1. 1.Ingestion: Documents fetched via API from official Romanian Ministry of Education repositories
  2. 2.OCR: PDF pages converted to images (300 DPI) and processed through Vision-Language Model (Gemini/Hunyuan) with prompts optimized for Romanian mathematical notation
  3. 3.Cleaning:
  4. 4.Removal of running headers/footers
  5. 5.Deduplication of headers across multi-page documents
  6. 6.Table flattening and normalization
  7. 7.Consistent double-spacing between content blocks

Usage

Loading with Hugging Face Datasets

python
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

python
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_sheet values

Citation

bibtex
@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}
}