Text2DB: Integration-Aware Information Extraction with Large Language Model Agents

Yizhu Jiao, Sha Li, Sizhe Zhou, Heng Ji, Jiawei Han

Overview

TEXT2DB introduces a new paradigm for Information Extraction (IE) that focuses on "integration-awareness"—the ability of a model to not just extract data from text, but to seamlessly ingest it into a target database while respecting its specific schema and constraints. To solve this, the authors present OPAL, an LLM agent framework that uses an Observe-Plan-Analyze loop to generate and refine Python-based extraction plans, significantly outperforming traditional end-to-end extraction methods.

The Text2DB Task: Bridging Text and Databases

Traditional Information Extraction (IE) systems typically operate in a vacuum, extracting entities and relations based on a fixed, pre-defined ontology. However, in real-world applications, this data is usually destined for a structured database (DB) or knowledge base (KB).

The Text2DB task: converting unstructured text into structured database updates while respecting schema constraints.

The paper proposes the TEXT2DB task, where a model is given a user instruction (e.g., "Add this new movie to the database"), a set of documents, and an existing database. The goal is to update the database correctly and autonomously.

Core Challenges in Integration-Aware IE

The authors identify a major "mismatch" problem between raw text and structured storage, characterized by three primary hurdles:

  1. Schema Mismatch: Extracted fields might not match the database's specific column names or data types.
  2. Granularity Ambiguity: If a DB column is labeled "Location," the model must determine if it should extract a city, state, or country based on existing data patterns.
  3. Integrity Constraints: New data must respect primary/foreign key relationships and normalization rules (e.g., specific date formats).
Three core challenges addressed by Text2DB: (1) Dynamic Schema Adaptation, (2) Extraction Ambiguity Resolution, and (3) Data Integration Integrity.

Methodology: The OPAL Framework

The researchers developed OPAL (Observe-Plan-Analyze LLM), a multi-agent framework designed to act as a bridge between unstructured text and structured databases.

  • The Observer (Database Expert): This agent analyzes the DB schema and existing entries. It provides the Planner with a "summary observation," including value ranges and formats, and fetches few-shot examples from the DB to demonstrate exactly how data should be formatted.
  • The Planner (Function-Calling Agent): Instead of generating raw text, the Planner writes a Python script. It uses a library of 10 specialized tools, including standard IE functions (NER, Relation Extraction) and DB integration functions (Entity Linking, Data Normalization, Row Population).
  • The Analyzer (Code Feedback Agent): Before the code is executed, the Analyzer performs static and dynamic analysis. It checks for syntax errors, logic flaws (like missing foreign keys), and potential DB integrity violations, providing feedback to the Planner for iterative refinement.

Benchmark and Results

The authors introduced a new TEXT2DB Benchmark consisting of 240 instances across 203 unique databases, combining WikiTables for domain diversity and the BIRD dataset for complex, multi-table schemas.

Key findings include:

  • Integration is the Bottleneck: 15% of errors in baseline studies were purely due to integration issues (like entity mislinking or normalization failures), even when extraction was correct.
  • OPAL Superiority: OPAL achieved an overall 34.11% F1 score, nearly tripling the performance of a standard one-shot GPT-4 baseline (12.08%).
  • Difficulty Scaling: On "Hard" tasks involving multi-table DBs, the gap was even wider. The one-shot baseline plummeted to 2.51% F1, while OPAL maintained a 23.21% F1, proving the necessity of the agentic workflow for complex schemas.

Conclusion and Future Work

While OPAL significantly advances the state of integration-aware IE, limitations remain. The framework is highly dependent on the underlying LLM's code-generation reliability and can still suffer from hallucinations in information-dense documents. Future work will address conflict resolution—handling cases where source text contradicts existing database information—and expanding the tool library to include a wider range of open-source IE models.

Summary updated

BibTeX
@inproceedings{jiao2024text,
  author = {Yizhu Jiao and Sha Li and Sizhe Zhou and Heng Ji and Jiawei Han},
  title = {{Text2DB: Integration-Aware Information Extraction with Large Language Model Agents}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2024},
  doi = {10.18653/v1/2024.findings-acl.12},
}
Figure