# Collecting User Inputs using Slot Filling

## Introduction

Slot Filling enables the Bot to pick out specific pieces of information from user utterance. These specific information could be a date, time or named entities (e.g. city) defined in the Ontology. The information that have picked out can then be slotted in variables of the preceding states of the conversation flow.&#x20;

#### Example

The following screenshots shows an example of Slot Filling in action, where the named entity ('paris') and date ('this wednesday') on the user utterance were extracted, and printed in the response to the user message

![](/files/-MRI9LqwgctxGpDSfXWs)

![](/files/-MRIGGgiGcYFA00Bzay-)

## Set Up Slot Filling

### Defining the Named Entities in Ontology

1\) Click on the Ontology tab on the navigation bar to access the Ontology Manager.

2\) Create a new Individual under the **Term** Class

3\) Enter the name of the entity as the **#label** and include the different possible answers as the **#altLabel**

![](/files/-MRIN_c_2RtTQQv4Y1eo)

4\) Define the **#slot** that this named entity will be used in. The slot will be used in configuring the Intent to pick out the named entity.&#x20;

![](/files/-MS0vX7nMCrnuL_2ewOc)

## Creating Intent with Slot Filling

### Defining the Slot Fillers

1\) After creating the Intent, open up the **Slot Fillers** to define the entities that need to be capture in the conversation.

![](/files/-MRIlDHAJRB0QuZBRiTI)

2\. Click on **Add Slot Filers**

3\. Enter a **Variable Name** for the slot. This variable name will be used to store the entity captured from the user's input.

4\. From the **Select Slot** dropdown list, choose the Named Entity defined in the Ontology that will be captured in this Slot. \
\
\&#xNAN;*Note: **date**, **datetime** and **time** are system default entities that can be used to capture date and time variable.*

![](/files/-MS0r_XNrisvnrXDSc_m)

### Configuring State for Slot Filling

1\) Enable **Data Collection** in the State that would be capturing the user's input

2\) Select **Slot** as the Variable Type to enable slot filling for this State

3\) Select the **Variable** defined in the earlier section ([Defining the Slot Fillers](/taiger-converse/advanced/collect-user-inputs-using-slot-filling.md#defining-the-slot-fillers))

![](/files/-MS0tmI7WHHDTa6Ncvny)

4\. Toggle **Skip if Answer exists in the Context** to allow the Bot to skip the state (i.e. not responding with the content of the state), if the slot is already filled in the previous user's input.

### Configuring Slot Validation for Slot Filling

1\) **Slot Validation** can be enabled to ensure that users are providing the correct inputs to the required slot defined in each State. \
\
For example, the user's input should contain a date type input when the State require a date, or a City name when the State is expecting to capture a location.&#x20;

2\) Select **Slot Validation** under **Validation Type** in the **Data Collection** Block

3\) Configure the number of **Maximum Attempts** before the Bot break out of the guided flow to a failure/error State as configured in **Next State After Exceed Max Attempt**

4\) Provide an appropriate **Validation Message** to let the user know what is the expected input required.&#x20;

![](/files/-MS1NDKPC9fnNiKsWgD6)


---

# 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://taiger.gitbook.io/taiger-converse/advanced/collect-user-inputs-using-slot-filling.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.
