Templates

Structured data extraction

Quick explainer2 min readIntermediate

Structured data extraction uses a language model to pull specific fields out of messy text and return them in a fixed format, such as JSON, that software can use.

In plain words

You first define the shape you want, for example a person with a name and an age, as a schema. Then you send the text and the schema to the model. With a feature such as OpenAI's Structured Outputs, a finished reply is held to that schema unless the model refuses, though the docs say a reply can still fail to match in some cases. Libraries like Instructor wrap this up with Pydantic models in Python and check the result for you.

A quick example

Imagine a pile of customer emails. For each one you ask for the sender's name, the product mentioned and whether they want a refund, as a yes or no field. The model returns one tidy JSON record per email, ready to load into a spreadsheet or database.

Where you'll meet it

  • Turning emails, forms and web pages into database rows.
  • Feeding clean data to other tools and agents.

Related

Sources

  1. DocsStructured model outputs, OpenAI API docs · read 29 Sept 2026
  2. Docsinstructor, 567 Labs (GitHub) · read 29 Sept 2026

Checked by WhatIsAI against the sources above · 11 Nov 2026. Spotted an error? Report it.