# 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](https://docs.tonic.ai/textual/textual-install-administer/configuring-textual/enable-and-configure-textual-features/textual-config-model-based-custom-entity-type).
{% 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="entity-type-custom-model/model-entity-type-flow">model-entity-type-flow</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="entity-type-custom-model/model-entity-type-new">model-entity-type-new</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="entity-type-custom-model/selecting-and-reviewing-test-data">selecting-and-reviewing-test-data</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="entity-type-custom-model/model-entity-type-guidelines">model-entity-type-guidelines</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="entity-type-custom-model/selecting-the-training-data-for-your-models">selecting-the-training-data-for-your-models</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="entity-type-custom-model/creating-and-training-models-for-a-model-based-entity-type">creating-and-training-models-for-a-model-based-entity-type</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="entity-type-custom-model/entity-type-model-set-active">entity-type-model-set-active</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="entity-type-custom-model/entity-type-custom-model-rename">entity-type-custom-model-rename</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="entity-type-custom-model/enabling-and-disabling-the-entity-type-for-datasets">enabling-and-disabling-the-entity-type-for-datasets</a></td></tr></tbody></table>
