Mining Patterns from Secondary Sources: Using Large Language Models for Structured Data Extraction in Comparative Historical Geography

Historical geographers rely on comprehensive secondary sources to identify patterns and generate hypotheses across cases, yet we often spend research visits manually extracting information that should be our starting point, not our endpoint. The challenge of transforming unstructured narrative text into structured, analysable data creates a bottleneck between source availability and comparative analysis. This paper presents a case study demonstrating how Large Language Models (LLMs), combined with structured output schemas and traditional validation methods, can transform hundreds of narrative documents into queryable datasets, enabling systematic comparative analysis.

The Challenge: My PhD examines histories of 19th-century land reclamation of which Denmark was a short secondary case. I worked with Kjeld Hansen's Folk & Fortællinger fra Det Tabte Land, a comprehensive study of 350+ drainage projects available as individual Danish-language PDFs. Each 2-5 page document contains rich information about initiators of the project, financing, technology, and outcomes, but in narrative form unsuitable for systematic comparison. 

The Methodology: I developed a workflow combining batch translation (MarianMT), pattern recognition (Python), and LLM-assisted extraction (OpenAI API) to transform these PDFs into structured data. The novelty was in using JSON schemas to constrain LLM outputs, significantly reducing hallucination which although reduced, remains a major concern with LLM outputs.

Rather than conversational prompts ("Who initiated this project?"), which encourage plausible-sounding fabrication, I used API calls with strict JSON templates requiring specific fields (project name, dates, actors, outcomes) or explicit null values, thus providing permission to indicate missing information and avoid hallucination. This approach also produces consistent, machine-readable results which could then be analysed via dataframes. I also validated LLM outputs through parallel methods: extracting initiator categories both via LLM and traditional rule-based classification, achieving 85% agreement. 

The Results: The workflow produced a georeferenced, queryable dataset of 327 projects with temporal, spatial, and categorical metadata which was completed in one week versus the weeks manual processing would require. This enabled pattern-finding that revealed systematic differences between English-led and Danish-led projects: English investments often failed after 5-10 years despite substantial capital, while Danish efforts persisted through similar setbacks. This is precisely the kind of “but why?” puzzle that should be the starting point of a historical geography research project, not one achieved through five weeks of data mining, and which is what this workflow enabled. 

Broader Implications: This case study demonstrates LLMs' potential for humanities research when used critically and transparently. The approach is applicable to similar scenarios: grey literature databases, excavation reports, museum catalogues, or any corpus where repetitive information appears in unstructured narrative form. However, it requires human oversight, appropriate scope, validation mechanisms, and an understanding and transparency of limitations.

The paper addresses both methodological innovations (structured outputs reducing LLM hallucination) and practical workflows (batch processing, validation strategies, when automation fails). It argues that LLMs represent valuable tools for humanities research as assistants enabling pattern-finding at scales previously impractical for time constrained individual researchers.