# 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).


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://fastino-1.gitbook.io/docs/models/text-to-json-experimental.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
