Difference between revisions of "GDE/Current/User/Slots"
(Published) |
(Published) |
||
Line 17: | Line 17: | ||
*A built-in predefined slot type available in Dialog Engine | *A built-in predefined slot type available in Dialog Engine | ||
− | * | + | *A custom slot type that you can create in the '''Slot Types''' screen. |
{{AnchorDiv|predefined=}} | {{AnchorDiv|predefined=}} | ||
===Predefined Slot Types=== | ===Predefined Slot Types=== | ||
− | |||
There are four built-in slot types available by default in Dialog Engine: | There are four built-in slot types available by default in Dialog Engine: | ||
Line 49: | Line 48: | ||
}}{{Section | }}{{Section | ||
|sectionHeading=Add a custom slot type | |sectionHeading=Add a custom slot type | ||
− | |||
|alignment=Vertical | |alignment=Vertical | ||
− | |structuredtext=*Click '''Add Slot Type''' from the '''Slot Types''' page. or click '''Add Slot Type''' in the left pane. | + | |structuredtext=A custom slot type allows you to define slot types and use them to identify intents. For example, you may require a location slot to denote cities for your travel bot. You can define a custom slot type and use that location slot to mark up locations in your utterances. |
+ | |||
+ | Dialog Engine supports two types of custom slot types: a list type and a regular expression (regex) based type. | ||
+ | |||
+ | If your custom slot type data is a set of predefined words in the utterance, say like location names, use the list slot type. If your bot has to identify a complex content in the utterance, say a flight number or flight code, a regex pattern is more useful in defining the slot type. | ||
+ | |||
+ | ===Adding a set of custom values to a slot type=== | ||
+ | |||
+ | *Click '''Add Slot Type''' from the '''Slot Types''' page. or click '''Add Slot Type''' in the left pane. | ||
*Enter a name for the custom slot type and click '''Save'''. | *Enter a name for the custom slot type and click '''Save'''. | ||
− | *Type a value for the custom | + | *Select '''List''' as the custom slot type. |
+ | *Type a value for the custom slot and press '''Enter'''. | ||
*Add more entity values as needed. | *Add more entity values as needed. | ||
+ | |||
+ | You can also add synonyms for an entity so that Dialog Engine can recognize the value when identifying the slots. For example, an entity value of ''New York'' can have the synonyms: ''Big Apple'' or ''NYC''. This allows the bot to understand that when the user says ''NYC'', it is mapped to ''New York''. | ||
+ | |||
+ | *Select the '''Allow Synonyms''' checkbox to enable adding synonyms. | ||
+ | |||
+ | *Click the '''Enter synonym''' field next to the entity value and type an alternate name or value this entity value can have and press '''Enter'''. | ||
+ | *Add more synonyms, if needed. | ||
+ | |||
+ | To delete any synonyms, hover over the synonym and click the X that appears. | ||
+ | |||
+ | ===Using a regular expression to map to a slot type=== | ||
+ | You can use regular expressions (regex or regexp) to map values to slot types. For example, if you want to match flight codes for your travel bot, you might want to know the flight number for handling any cancellations, the regex pattern, ''^[A-Z]{2}\d{3,4}$'' will match any phrases in the utterance that match this pattern as a flight number. | ||
+ | |||
+ | *Click '''Add Slot Type''' from the '''Slot Types''' page. or click '''Add Slot Type''' in the left pane. | ||
+ | *Enter a name for the custom slot type and click '''Save'''. | ||
+ | *Choose '''Regular Expression''' as the custom slot type. | ||
+ | *Type a regular expression and press '''Enter'''. | ||
|Status=No | |Status=No | ||
}}{{Section | }}{{Section | ||
Line 63: | Line 87: | ||
*In the '''Utterances''' tab, double-click a specific word/phrase in an utterance. | *In the '''Utterances''' tab, double-click a specific word/phrase in an utterance. | ||
− | *Choose a slot name from the '''Select Slot''' menu. The selected word/phrase is now indicated as a slot value | + | *Choose a slot name from the '''Select Slot''' menu. The selected word/phrase is now indicated as a slot value by a colored underline for the phrase. |
*Click '''Save''' to save the changes to your bot. | *Click '''Save''' to save the changes to your bot. | ||
|FAQHeading=How do I map slots with utterances | |FAQHeading=How do I map slots with utterances | ||
Line 78: | Line 102: | ||
|alignment=Vertical | |alignment=Vertical | ||
|structuredtext=You can delete a slot by selecting a slot from the '''Slots''' tab and clicking the '''Delete''' button. | |structuredtext=You can delete a slot by selecting a slot from the '''Slots''' tab and clicking the '''Delete''' button. | ||
− | |||
− | |||
− | |||
− | |||
|Status=No | |Status=No | ||
}} | }} | ||
}} | }} |
Revision as of 10:55, April 2, 2020
Contents
A Slot is a specific piece of information that can be derived from an utterance and mapped to an entity.
What are slots?
Dialog Engine is designed to parse an utterance provided by the user and identify their intent. Dialog Engine uses a process called slot filling to identify pieces of information and maps them to corresponding entities. Each mapping of an intent to a discrete piece of information is termed a slot. Based on the slots identified and mapped, the bot can continue the conversation with the user.
Suppose the input is: I want to book two rooms. This utterance allows the bot to identify a single entity: number of rooms required. And the bot might respond up with follow-up questions.
Slot filling allows collecting multiple pieces of information about the user's intent. Consider, I want to book two rooms for three nights starting tomorrow. The bot identifies slots mentioned in the conversation: two rooms, three nights, and tomorrow and maps them accordingly to the corresponding entities.
Dialog Engine supports two types of slots:
- A built-in predefined slot type available in Dialog Engine
- A custom slot type that you can create in the Slot Types screen.
Predefined Slot Types
There are four built-in slot types available by default in Dialog Engine:
de:datetime
: maps any date and time values.de:amountOfMoney
: maps any amount values.de:duration
: maps any duration type values.de:number
: maps any numeric values.
Add a slot
You can add slots to an utterance in two ways: from the Slots tab or from the Utterance tab.
- From the Slots tab, click Add Slot.
- Enter a name to identify the slot.
- Select an entity for the slot name. You can choose from a predefined slot type or any custom slot type.
- Check Slot Required if you want this slot to be mandatory in the utterance.
- Enter the prompt to be displayed to the user. Add more prompts, if needed.
- Click Save.
To add slots from the Utterance tab, select and click a word or phrase that will be extracted as a slot value and select Add New Slot.
Add a custom slot type
A custom slot type allows you to define slot types and use them to identify intents. For example, you may require a location slot to denote cities for your travel bot. You can define a custom slot type and use that location slot to mark up locations in your utterances.
Dialog Engine supports two types of custom slot types: a list type and a regular expression (regex) based type.
If your custom slot type data is a set of predefined words in the utterance, say like location names, use the list slot type. If your bot has to identify a complex content in the utterance, say a flight number or flight code, a regex pattern is more useful in defining the slot type.
Adding a set of custom values to a slot type
- Click Add Slot Type from the Slot Types page. or click Add Slot Type in the left pane.
- Enter a name for the custom slot type and click Save.
- Select List as the custom slot type.
- Type a value for the custom slot and press Enter.
- Add more entity values as needed.
You can also add synonyms for an entity so that Dialog Engine can recognize the value when identifying the slots. For example, an entity value of New York can have the synonyms: Big Apple or NYC. This allows the bot to understand that when the user says NYC, it is mapped to New York.
- Select the Allow Synonyms checkbox to enable adding synonyms.
- Click the Enter synonym field next to the entity value and type an alternate name or value this entity value can have and press Enter.
- Add more synonyms, if needed.
To delete any synonyms, hover over the synonym and click the X that appears.
Using a regular expression to map to a slot type
You can use regular expressions (regex or regexp) to map values to slot types. For example, if you want to match flight codes for your travel bot, you might want to know the flight number for handling any cancellations, the regex pattern, ^[A-Z]{2}\d{3,4}$ will match any phrases in the utterance that match this pattern as a flight number.
- Click Add Slot Type from the Slot Types page. or click Add Slot Type in the left pane.
- Enter a name for the custom slot type and click Save.
- Choose Regular Expression as the custom slot type.
- Type a regular expression and press Enter.
Map a slot
After you define slots, you can map specific words to corresponding entities, and Dialog Engine will pick up those slot values.
- In the Utterances tab, double-click a specific word/phrase in an utterance.
- Choose a slot name from the Select Slot menu. The selected word/phrase is now indicated as a slot value by a colored underline for the phrase.
- Click Save to save the changes to your bot.
Modify a slot's information
You can modify any of the slot information by selecting a slot from the Slots tab and clicking the Edit button.
Delete a slot
You can delete a slot by selecting a slot from the Slots tab and clicking the Delete button.