Extracting properties

Raw fields become 22 art-historically validated metadata fields.

Splitting Data According to a Data Model

The raw output of the index card recognition provides five text blocks per card. They do reflect what is written on the card, but are not yet systematically searchable: a birth/death date, for instance, is still embedded in the artist field, and a material description is still embedded in the work description.

In this step, an AI further breaks down each of these blocks and maps the content to a data model consisting of 22 catalog fields — ranging from the artist’s name, birth/death dates, location, material, and dimensions to provenance and photographer. This turns free-flowing text into structured metadata that can be filtered, counted, and linked with other collections.

Technical Processing

The input consists of the JSON files from the previous step. A Gemini 2.5 model (Flash or Pro, depending on card quality) is accessed via the Instructor library, which enforces a strict output schema using Pydantic models: 22 fields, distributed across five categories (Origin, Location, Artwork Details, Classification, Photo Details).

An extensively developed system prompt (“expert in art history and data science”) teaches the model to handle OCR errors and field deviations flexibly. A cross-validation pipeline then checks the output against the original OCR text and generates HTML reports on potential hallucinations, field errors, and missing inventory numbers.

The structured data is stored in a DuckDB file (cards.duckdb), which serves as an analytics layer for statistics on missing fields, completeness, and quality per series.

Data Sources & Tools

  • Input: JSON from Step 1
  • Model: Google Gemini 2.5 Flash/Pro via Instructor
  • Schema: 22-field Pydantic model with five categories
  • Output: Structured JSON, DuckDB analytics database, HTML validation reports
  • Repository: entity_extraction (internal)