Set up your first extraction model

This article walks you through creating an extraction model, from naming it to measuring its accuracy. If you are not yet sure whether extraction is the right model type, read the "What is an extraction model?" article first.

Prerequisites

Before you begin, make sure you have:

  • Access to the Models section of the Tekst platform.
  • A clear list of the fields (entities) you want to pull out of each message.
  • A few representative example messages or documents you can use to check the results.

Step 1: Create the model

  1. Go to the Models section and select Add model.
  2. Choose Extraction model as the type.
  3. Select Let's get started.
  4. Enter a Model name and an optional Model description.
  5. Select Create Model.

The Create an extraction model form with the Model Name and Model Description fields and the Back and Create Model buttons

Step 2: Define your entities

Entities are the fields you want the model to extract. On the model's configuration screen:

  1. Select Add tag at the bottom of the table to add an entity for each value you need. To add several at once, use Upload from CSV.
  2. Give each entity a clear name and a description of what to look for.
  3. Set the output format for each entity (text, number, integer, true/false, or a structured object).
  4. For values that can appear more than once in a message, mark the entity as a list so the model can return several of them.
  5. If some values belong together, group them under a parent object entity.

Clear names and descriptions have a large effect on accuracy, so be specific about what each field means.

The entity table of an extraction model listing Customer name, Customer reference, Delivery date, Order lines and Order number with their format, and Add tag, Upload from CSV and Improve accuracy at the bottom

Your entities are saved as a draft as you go. A blue Draft badge appears next to the model name, and the changes stay out of live message processing until you publish in step 5. You can close the model and come back to the draft later.

Step 3: Build a test set

A test set is a collection of real messages for which you have confirmed the correct extracted values. It is how Tekst measures accuracy and how the model improves.

  1. Add conversations or documents to the test set.
  2. For each one, confirm the correct value for every entity (the "ground truth").
  3. Include a range of examples, including documents with different layouts and ones where some fields are missing.

Step 4: Review accuracy

Once you have a test set, Tekst evaluates the model and reports its accuracy per field and overall. Select a field in the accuracy view to compare the Correct value you confirmed with the value the model extracted, and see exactly where the model is going wrong.

For a full explanation of how the score is calculated, see the "How extraction accuracy is measured" article.

Step 5: Publish the model

Everything you have configured so far lives in a draft. Publishing is what makes it the version that extracts from live messages.

  1. Check the Draft badge next to the model name. It confirms there are unpublished changes.
  2. Select Publish in the top right of the model header.

The header of the Order details extraction model with the Draft badge next to its name, the accuracy reading 91% (Published: 84%), and the Publish button with an amber dot, the revert arrow and the overflow menu on the right

Tekst confirms with Model published. The Draft badge disappears, the status dot on the button turns green, and the button reads Published.

From here on, every change you make goes back into a new draft, so you can keep refining the model without disturbing what is running. To throw a draft away and return to the published version, use the revert arrow next to Publish.

For the full picture, see the "What is a model draft?" article.

What happens next

As your team corrects extracted values, those corrections feed back into the model and improve it over time. Tekst continuously monitors performance and retrains as needed - see How often are the AI models retrained?.

0 comments

Please sign in to leave a comment.