Information Extraction with LLM

Extracting target attributes from unstructured documents and converting them into structured records using an LLM. The model ingests free-form prose and generates draft schema-conforming records for deterministic verification.

General Meaning

Natural language documents such as municipal subsidy guidelines, press releases, and application requirements lack rigid formatting. Traditional web scrapers and regular expressions break easily when facing minor layout reorganizations, colloquial phrasing, or typographic discrepancies across multiple publishers.

Information extraction with large language models leverages semantic comprehension to parse narrative paragraphs and reliably pull out targeted variables, such as eligible recipients, grant amounts, or deadlines. Rather than generating creative prose, the model functions strictly as an intelligent data parser that maps natural language into normalized key-value fields.

Why It Matters

  • Handling diverse linguistic expressions: Flexibly interprets disparate municipal wordings and synonyms into uniform schema fields.
  • Dramatically reducing development overhead: Eliminates the need to construct and maintain brittle per-site scraping parsers.
  • Automating structured dataset ingestion: Transforms unstructured web texts into database-ready rows, powering search and comparison platforms.

How the Site Factory Uses It

In the Site Factory, public subsidy and administrative data pipelines use local models such as gemma4:12b via an information extraction engine (engine/extract.py). System prompts enforce rigid worker boundaries (RULES), constraining the LLM to behave strictly as an objective transcriber without paraphrasing or assuming unmentioned facts.

The extraction schema requires {"value": ..., "quote": ...} for each field (needs_quote), mandating an exact verbatim quote within 120 characters from the source. In engine/llm.py, parameters are locked to temperature: 0, fixed seed: 42, and "think": false for deterministic output. The result is only saved as drafts.json and never published directly; downstream check_sources.py validates quotes against original HTML. If time runs out, timeouts via --until or MQ_DEADLINE trigger exit code 75 to yield cleanly.

Caveats & Operational Rules

  • Never publish LLM output without verification: Even top-tier models can hallucinate numbers; Python-based deterministic checks must verify quotes against source texts before publishing.
  • Do not allow the extraction model to write creative prose: Tasks must focus strictly on verbatim transcription, while user-facing summaries are synthesized downstream using vetted templates.

Related Terms

References

  • Book: Dan Jurafsky & James H. Martin, *Speech and Language Processing*, Chapter 17 (Information Extraction)

Verified: 2026-11-08