> ## Documentation Index
> Fetch the complete documentation index at: https://docs.meibel.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Charts, formulas, and vision models

> How Meibel recognizes charts, formulas, seals, and pictures with vision models, and digitizes charts back into data series

## Overview

Some regions of a document resist ordinary text recognition: a formula is mathematical notation, not a line of words; a chart encodes its meaning in geometry and labels; a seal is stylized text arranged in a circle; a photograph carries information no character reader can extract. For these, character-level OCR returns fragments that lose the region's meaning.

Meibel handles them by routing each such region to a vision-language model, a model that reads an image and returns structured content. An initial layout stage labels a region as a formula, a chart, a seal, or a picture. Regions with those labels are then cropped from the page and sent to a model suited to the task, and the result is merged back into the element. Charts get a second treatment on top of this: a chart drawn as vector graphics is digitized from its geometry, and the recognized values are reconciled with what was drawn.

This page explains which regions are recognized this way, what each returns, and how charts are turned back into data.

## Which regions are recognized

Layout analysis gives every region a label naming its content role. That label determines whether a vision model reads the region. Four kinds of region are read this way, each with its own task.

| Region  | What the model returns                                                           |
| ------- | -------------------------------------------------------------------------------- |
| Formula | The mathematical notation of the expression                                      |
| Chart   | The chart's values as a structured table, reconciled with the digitized geometry |
| Seal    | The text contained in the seal or stamp                                          |
| Picture | A written description of the image                                               |

A page with none of these regions passes straight through without contacting a vision model, so a document of plain text and tables pays nothing for this stage.

## What each region contributes

**Formulas.** A region labeled as a formula returns its notation as the element's text. In the Markdown output, the formula renders as display math between `$$` delimiters so a reader or renderer treats it as an equation rather than as broken prose.

**Charts.** A chart returns its values as a structured table, so the numbers behind the plot come back as data rather than as an image. Those values are then reconciled with the chart's drawn geometry, a second analysis of the region that the sections below work through.

**Seals.** A seal or stamp returns its recognized text, which recovers content that would otherwise be lost inside a graphic.

**Pictures.** An image returns a written description of what it shows. The description travels with the figure, so an index or a language model has something meaningful to work with in place of an opaque image reference.

## Charts: two sources of truth, reconciled

A chart is a picture of data. The values that produced it are not stored in the file; they became lines, points, and axes when the chart was drawn. Recovering them means reading the chart the way a person does, and that can be done two ways, each covering the other's weakness.

**Geometry** gives the true shape of the chart. Reading the plotted paths and inverting them through the calibrated axes recovers where each plotted value sits and how the values move across the axes, faithful to what was drawn. What geometry alone cannot always pin down is the exact number, because a value read off an axis is only as precise as the spatial calibration.

**The vision model** gives exact values. It reads the chart and returns the values as a structured table, capturing numbers that a data label states outright. A table on its own carries no position for each value and no check against what the chart draws.

Meibel reconciles the two. It starts from the geometry, then matches each recognized value to the nearest geometric point within a tolerance. A value that matches replaces the geometric estimate and is marked as adjudicated by the model, while the point keeps its position on the page. A recognized value that disagrees with the geometry by more than the tolerance is treated as suspect: the geometry is kept and a warning is recorded, which guards against a model that misreads a number. When a chart has no usable vector geometry, such as an image of a chart in a scan, the values come from the vision model alone, and any text on the chart is recovered by OCR on the crop.

## What chart data contains

A digitized chart is a structured object carrying the series and everything needed to interpret them.

* **Series.** Each series has its points, and each point carries its `x` and `y` in data units, a confidence, a position on the page, and a note of where its value came from. A series also records its drawn color and dash pattern, which is how two monochrome lines are told apart.
* **Axis calibration.** Each axis records its scale, its detected tick marks, the fit from pixels to data values, and any title and unit.
* **Categories.** A chart with a categorical x-axis lists its category labels, such as a sequence of years or quarters.
* **Chart metadata.** The chart records its type, whether it came from vector geometry or an image, an overall confidence, and any warnings raised during digitization.

The exact fields are enumerated in the [output schema](/document-parsing/reference/output-schema).

## What is recovered

Chart digitization is strongest on the charts whose geometry is unambiguous.

* **Line and scatter charts** drawn as vector graphics are digitized from their geometry, including their series, points, and axis calibration.
* **Linear, logarithmic, and categorical axes** are supported, with the scale selected from the axis's own tick marks and labels.
* **Dual-axis charts** are detected. When a series cannot be assigned confidently to the left or right axis, it is marked ambiguous and a warning is recorded rather than guessing.
* **Values** come from the vision model reconciled with the geometry, so exact numbers stated as data labels are captured even where the calibration alone would only approximate them.

<Note>
  Bar, area, and pie charts are recognized and located as chart regions, and a vision model can still read their values, but their vector geometry is not digitized into series the way line and scatter charts are.
</Note>

## How the results appear

Vision model results reach you in the output, though where depends on the region and the format.

Formula notation and seal text sit in the element's text, so they appear in every rendering that carries text. In the structured result a chart element carries its digitized `chart_data` and its recognized labels on `ocr_text`. The Markdown output renders a chart's series as a table, either a category-by-series matrix when the series share an x-axis or a long series-x-value listing when they do not. [Choosing an output format](/document-parsing/guides/choosing-an-output-format) sets out which rendering carries which, and [extracting chart data](/document-parsing/guides/extracting-chart-data) works through reading these in code.

## Resilience

Recognizing a region depends on a model responding, so the pipeline is built to degrade rather than fail. A request that returns a transient error is retried with a widening delay between attempts. A region that still does not come back is logged and skipped, and the page continues with whatever other regions succeeded. One region's failure never stops the rest of the document, and a page where every vision model call fails still returns its text, its tables, and its layout.

## Related concepts

<CardGroup cols={2}>
  <Card title="How parsing works" icon="gears" href="/document-parsing/concepts/how-parsing-works">
    Where recognition and digitization sit in the pipeline.
  </Card>

  <Card title="Extracting chart data" icon="chart-simple" href="/document-parsing/guides/extracting-chart-data">
    Read a chart's series and labels from the output.
  </Card>

  <Card title="The parsed document" icon="diagram-project" href="/document-parsing/concepts/the-parsed-document">
    Where chart data sits in the element model.
  </Card>

  <Card title="Output schema" icon="code" href="/document-parsing/reference/output-schema">
    The chart data fields in full.
  </Card>
</CardGroup>
