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

# Generative OCR optimization

After partitioning, you can have a vision language model (VLM) optimize the fidelity of text blocks that Unstructured
initially processed during its partitioning phase.

Here are a few examples of Unstructured's output of text blocks that were initially processed, and the more accurate
version of these text blocks that were optimized by using Claude Sonnet 4. Irrelevant lines of output have been omitted here for brevity.

Example 1: Vertical watermarked text

<img src="https://mintcdn.com/unstructured-53/7V13mJi2iZBZVTP5/img/ui/enriching/generative-ocr-watermark.png?fit=max&auto=format&n=7V13mJi2iZBZVTP5&q=85&s=7b0f23e8446dd7ce620e7651c50edeea" alt="Vertical watermarked text example" width="143" height="626" data-path="img/ui/enriching/generative-ocr-watermark.png" />

Before (vertical watermarked text, represented incorrectly):

```json theme={null}
{
    "...": "...",
    "text": "3 2 0 2 t c O 9 2 ] V C . s c [ 2 v 9 0 8 6 1 . 0 1 3 2 : v i X r",
    "...": "..."
}
```

After (vertical watermarked text, now represented correctly from the original content):

```json theme={null}
{
    "...": "...",
    "text": "arXiv:2310.16809v2 [cs.CV] 29 Oct 2023",
    "...": "..."
}
```

Example 2: Hyperlink

<img src="https://mintcdn.com/unstructured-53/7V13mJi2iZBZVTP5/img/ui/enriching/generative-ocr-hyperlink.png?fit=max&auto=format&n=7V13mJi2iZBZVTP5&q=85&s=b6839365e38048b688ad2e110198cb14" alt="Hyperlinked text example" width="507" height="188" data-path="img/ui/enriching/generative-ocr-hyperlink.png" />

Before (hyperlink, represented incorrectly):

```json theme={null}
{
    "...": "...",
    "text": "con/Yuliang-Liu/MultinodalOCR|",
    "...": "..."
}
```

After (hyperlink, now represented correctly from the original content):

```json theme={null}
{
    "...": "...",
    "text": "https://github.com/Yuliang-Liu/MultimodalOCR",
    "...": "..."
}
```

Example 3: Chinese characters

<img src="https://mintcdn.com/unstructured-53/7V13mJi2iZBZVTP5/img/ui/enriching/generative-ocr-image.png?fit=max&auto=format&n=7V13mJi2iZBZVTP5&q=85&s=d7c523324999fc3da8752920d5fb3795" alt="Chinese characters example" width="269" height="200" data-path="img/ui/enriching/generative-ocr-image.png" />

Before (Chinese characters, represented incorrectly):

```json theme={null}
{
    "...": "...",
    "text": "GT SHE GPT4-V: EHES",
    "...": "..."
}
```

After (Chinese characters, now represented correctly from the original content, expressed as Unicode):

```json theme={null}
{
    "...": "...",
    "text": "GT : \u91d1\u724c\u70e7\u814a GPT4-V: \u6587\u9759\u5019\u9e1f",
    "...": "..."
}
```

## Improve text fidelity with generative OCR

To have Unstructured perform generative OCR optimization, do the following:

* For **Unstructured UI** users, add an [Enrichment node](/ui/workflows#custom-workflow-node-types) of type **Generative OCR**
  to an Unstructured [custom workflow](/ui/workflows#create-a-custom-workflow).
* For **Unstructured API** users, add a [Generative OCR task](/api-reference/workflow/nodes/enrichment/enrichment-generative-ocr).
  You add this task as either as an object in a `workflow_nodes` array
  (for curl) or as a `WorkflowNode` in a `WorkflowNodes` collection (for Python). This object or collection applies whenever you
  [create a workflow](/api-reference/api/workflow/create-workflow),
  [update a workflow](/api-reference/api/workflow/update-workflow), or
  [create an on-demand workflow job](/api-reference/api/job/create-job).
