About Services Tools Blog Contact us

Uniform Policy Rule Reader

Reads a school uniform policy PDF, including scans, and separates everyday shoe rules from sports shoe rules. Each restriction is saved as its own entry.

  • Document Understanding & OCR
  • Education
  • Pipeline
  • Productised
  • Local/private
  • 2026

The problem

Each school publishes its shoe rules inside a long uniform policy. Reading every PDF by hand and then sorting everyday shoes from sports shoes took too long to repeat for every school in a directory.

What it does

The PDF is downloaded and kept, then read with LlamaIndex, which also handles scanned pages. The Gemma model, running locally on Ollama, separates everyday shoes from sports shoes and writes guidelines, a shoe list and the restrictions. A later clean-up fixes entries where the two sections ended up in one box.

Outcomes

  • A policy PDF becomes two clear shoe-rule boxes.
  • Each restriction is stored as its own entry and not as a paragraph.
  • Scanned policies go through the same path as text PDFs.
  • Mixed sections can be repaired without rereading the PDF.

Simplified mockup

Interactive preview with sample data. Nothing is sent to a server.

Reedwharf Primary

Scanned footwear page from the Reedwharf uniform policy
Kept copy Scan
reedwharf-uniform.pdfpage 4 of 11

No text layer on this page. The same path is used for a text PDF.

Extract
Page 4 staged

Restriction rows

Saved
Reedwharf Primary
SectionRuleWhere
EverydayNo bootsPage 4
EverydayNo coloured solesPage 4
EverydayNo logoPage 4
EverydayHeel under 2 cmPage 4
EverydayClosed toePage 4
SportsTrainer for games onlyPage 4
SportsNot worn in classPage 4
SportsNo football boots on the playgroundPage 4

Mixed field

One field, two sections Needs repair

Stored under Everyday, because both sentences landed in the same cell.

Plain black polishable shoes, no logo. A trainer for games only, white or black.
Repair pass
PDF is not opened again

How it works

  1. Download the policy PDF and keep a copy.
  2. Read the text from the file, using text recognition on scanned pages.
  3. Store the text as a plain text document.
  4. Ask the Gemma model to separate everyday shoes from sports shoes.
  5. Write the guidelines, a shoe list and the restrictions.
  6. Repair entries where both sections ended up in one box.

Pipeline

flowchart LR
  A["Policy PDF"] --> B["Download and keep"]
  B --> C["Extract text"]
  C --> D["Markdown"]
  D --> E["Split shoe rules"]
  E --> F["Everyday shoes"]
  E --> G["Sports shoes"]
  F --> H["Restriction rows"]
  G --> H

Output