> For the complete documentation index, see [llms.txt](https://fastino-1.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://fastino-1.gitbook.io/docs/models/text-to-json-experimental.md).

# Text to JSON (experimental)

{% hint style="warning" %}
Please note that this is a research preview of our Text to JSON model&#x20;
{% endhint %}

## Overview

Fastino’s Text to JSON model is designed to generate structured information from unstructured text using user-defined schemas. The model excels at converting freeform natural language—such as clinical notes, user-generated input, or financial records—into machine-readable JSON. It recognizes implicit relationships between information in text, and converts that to user-defined nested structures and hierarchical entities. It can adapt to a wide range of information structuring use cases by simply changing the schema definition.

### Example Use Cases

* Structuring clinical notes into standardized fields for downstream analytics
* Extracting product details (e.g., price, brand, features) from descriptions or reviews
* Parsing key-value fields from legal contracts, support tickets, or surveys
* Pre-processing text for ingestion into databases or semantic search pipelines

## Usage

{% code title="Example Body" %}

```json
{
  "input": [
    {
      "text": "Patient reports ongoing migraines and nausea. Recommended starting sumatriptan 50mg once daily and ondansetron 4mg as needed. Follow-up in two weeks.",
      "parameters": {
        "extraction_schema": {
          "json_structures": [
            {
              "Medication": {
                "dose": "str",
                "name": "str",
                "frequency": "str"
              }
            }
          ]
        }
      }
    }
  ]
}
```

{% endcode %}

{% code title="Example Response" %}

```json
{
  "medication": [
    {
      "dose": "50mg",
      "frequency": "once daily",
      "name": "sumatriptan"
    },
    {
      "dose": "4mg",
      "frequency": "as needed",
      "name": "ondansetron"
    }
  ]
}
```

{% endcode %}

### Notes

* The "extraction\_schema" field allows you to define nested structures using intuitive JSON schemas. The current version of this model only support 2-level hierarchies
* The model supports plural extraction for list-style sections (e.g., multiple medications, instructions, or entries).
