An entity (a.k.a. a slot) appears in an utterance. It represents a value in an intent that can change between utterances or even be omitted entirely in some cases.
Many entity properties are language specific; see Multi-lingual models for details.
Entities can be defined using several formats: value_list, regular_expression, fst, or alias.
A simple list of allowable values.
Property | Required? | Description | Language-specific? |
---|---|---|---|
partial | Optional | If true, the list does not represent all possible values this entity is allowed to take, merely a subset of them. If false, the list is considered exact and the entity is not allowed to have values except for what is specified here. The default is false. | No |
values | Required | The list of allowable values. Value lists may reference other value lists, which has the net effect of creating a new entity with values appended to the original. To reference another entity, surround it with “${}”, e.g., ${baseEntityName}. | Yes |
value_map | Optional | Map of values to other expected values. This is useful when a conditional action or client command is expecting a specific value. The value on the left will be replaced by the value on the right for such purposes. | Yes |
format: value_list
partial: false
language_data:
en_US:
values:
- in
- out
A regular expression will be used to define allowable values for this entity. The regular expression syntax is defined at https://github.com/google/re2/wiki/Syntax
Property | Required? | Description | Language-specific? |
---|---|---|---|
expression | Required | The regular expression | Yes |
format: regular_expression
# Language specific specification
language_data:
en_US:
expression: (100|[0-9]{1,2})( percent| times)?
Uses a finite state transducer to model allowed entity values. The FST may be compiled into OpenFST’s binary format or be written in AT&T FSM text format. Either way, the symbol table must be embedded in the FST.
Property | Required? | Description | Language-specific? |
---|---|---|---|
file | Required | The name of the file containing the fst. | Yes |
is_binary | Required | True if OpenFST binary, false if AT&T FSM text | Yes |
format: fst
language_data:
en_US:
file: example.fst
is_binary: true