# Managing model-based custom entity types

{% hint style="info" %}
**Required global permission - either:**

* Create custom entity types
* Edit any custom entity type

Self-hosted instances must also [configure a connection to the LLM to use](/textual/textual-install-administer/configuring-textual/enable-and-configure-textual-features/textual-config-model-based-custom-entity-type.md).
{% endhint %}

While a regex-based entity type identifies values that match regular expressions, for a model-based custom entity type, you train a model to identify the entity values.

A model-based entity type is useful when the values are identified more by context than by format. For example, for an entity type that identifies the names of health conditions, it would not be possible to set up regular expressions that identify the values.

You iterate over text-based guidelines that identify the entity type values in a smaller set of data, then use a larger set of data to train one or more models.

Each trained model is based on a selected version of the guidelines.

You select the trained model to use for the custom entity type, and select the datasets to enable the custom entity type for.

## Getting started

<table data-view="cards"><thead><tr><th></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td><strong>Overview of the model definition process</strong><br><br>General workflow to define a model-based custom entity type<br><br></td><td><a href="/pages/fzZxxDMoTgoMgfNPGJoY">/pages/fzZxxDMoTgoMgfNPGJoY</a></td></tr><tr><td><strong>Start a new entity type</strong><br><br>Begin the process of creating a new model-based custom entity type</td><td><a href="/pages/xSyLu6SbvPAOsnlOQuMC">/pages/xSyLu6SbvPAOsnlOQuMC</a></td></tr></tbody></table>

## Defining the entity type

<table data-view="cards"><thead><tr><th></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td><strong>Select test data</strong><br><br>Identify the entity values in a small set of files.</td><td><a href="/pages/HmnEoIYTP5iKEqsMBr99">/pages/HmnEoIYTP5iKEqsMBr99</a></td></tr><tr><td><strong>Refine model guidelines</strong><br><br>Fine-tune the guidelines used to identify values for the entity type.</td><td><a href="/pages/9tY2muP0CcrNvjbG3oMV">/pages/9tY2muP0CcrNvjbG3oMV</a></td></tr><tr><td><strong>Select training data</strong><br><br>Assemble a much larger set of files to use to train models for the entity type.</td><td><a href="/pages/Y5YzLEnHqGJ04jvWlbsy">/pages/Y5YzLEnHqGJ04jvWlbsy</a></td></tr><tr><td><strong>Create and train models</strong><br><br>Create models that are based on a selected guidelines version, and train those models on the training data.</td><td><a href="/pages/edcZUeuSesHLg5hdStEs">/pages/edcZUeuSesHLg5hdStEs</a></td></tr></tbody></table>

## Activating and managing an entity type

<table data-view="cards"><thead><tr><th></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td><strong>Select the active model</strong><br><br>Identify the trained model to use for the entity type.</td><td><a href="/pages/JdGtH9SZT7Wm9WsHxEMq">/pages/JdGtH9SZT7Wm9WsHxEMq</a></td></tr><tr><td><strong>Rename or delete the entity type</strong><br><br>Change the entity type name or delete the entity type.</td><td><a href="/pages/QuZaNTMZq85RfE9AT30r">/pages/QuZaNTMZq85RfE9AT30r</a></td></tr><tr><td><strong>Enable and disable the entity type in datasets</strong><br><br>Identify the datasets that use the entity type.</td><td><a href="/pages/wuBCv4c0LVs2Kc5txJBr">/pages/wuBCv4c0LVs2Kc5txJBr</a></td></tr><tr><td><strong>Export and import an entity type</strong><br><br>Export the entity type to an encrypted .zip file, and import the entity type into another instance.</td><td><a href="/pages/jKjp7WhUCbTfIMBaNrTI">/pages/jKjp7WhUCbTfIMBaNrTI</a></td></tr></tbody></table>


---

# 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://docs.tonic.ai/textual/entity-types/entity-type-custom-model.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.
