Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🧠 Adobe Hackathon Round 1 – PDF Outline Extractor

📘 Overview

This solution extracts a structured outline from a given PDF, including:

  • Document Title
  • Headings at H1, H2, and H3 levels
  • Page numbers for each heading

It generates a clean JSON output representing the hierarchy of the document. This is the first step toward building intelligent, interactive PDF experiences for the “Connecting the Dots” challenge.


📌 Why This Matters

PDFs are ubiquitous but lack machine-readable structure. This makes them difficult to navigate, analyze, or summarize programmatically.

By building a reliable outline extractor:

  • We enable smart navigation
  • We pave the way for semantic search and persona-driven insight
  • We create the foundation for futuristic document readers (Round 2 & 1B)

⚙️ Features

  • ✅ Parses any PDF up to 50 pages
  • ✅ Detects Title, H1, H2, H3 with page numbers
  • ✅ Outputs clean, schema-compliant JSON
  • ✅ Heuristic-based heading detection
  • ✅ Runs in a Docker container (CPU-only, offline)
  • ✅ Fully compliant with Adobe Hackathon constraints

🛠️ Architecture & Approach

🔧 Components

Module Responsibility
extract.py Extract text, font size, and positions
classify.py Classify headings using layout heuristics
main.py Entry point: Processes all PDFs in /input
utils.py JSON writing and helper functions

🧠 Heuristics

  • Font Size-Based Classification: Top 3 font sizes are mapped to H1, H2, H3
  • Short Line Filter: Ignores long paragraphs
  • Title Detection: First H1 encountered is treated as the title
  • Position-Aware: Headings tend to appear near top/left

📊 Example Output Format

{
  "title": "Understanding AI",
  "outline": [
    { "level": "H1", "text": "Introduction", "page": 1 },
    { "level": "H2", "text": "What is AI?", "page": 2 },
    { "level": "H3", "text": "History of AI", "page": 3 }
  ]
}

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages