Entities

Entity types are used to control how data from end-user input is extracted.

Conversational Agents (Dialogflow CX) provides predefined system entities that can match many common types of data. For example, there are system entities for matching dates, times, colors, email addresses, and so on. You can also create your own custom entities for matching custom data. For example, you could define a vegetable entity that can match the types of vegetables available for purchase with a grocery store agent.

Entity terminology

The term entity is used in this documentation and in the Dialogflow CX console to describe the general concept of entities. When discussing entity details, it's important to understand more specific terms:

  • Entity type: Defines the type of information you want to extract from user input. For example, vegetable could be the display name of an entity type. Clicking Create from the Entity Types section of the Dialogflow CX console creates an entity type. When using the API, the term entity type refers to the EntityType type.

    Select a protocol and version for the EntityType reference:

    Protocol V3 V3beta1
    REST EntityType resource EntityType resource
    RPC EntityType interface EntityType interface
    C++ EntityTypesClient Not available
    C# EntityTypesClient Not available
    Go EntityTypesClient Not available
    Java EntityTypesClient EntityTypesClient
    Node.js EntityTypesClient EntityTypesClient
    PHP Not available Not available
    Python EntityTypesClient EntityTypesClient
    Ruby Not available Not available

  • Entity entry: For each entity type, there are many entity entries. Each entity entry provides a set of words or phrases that are considered equivalent. For example, if vegetable is an entity type, you could define these three entity entries:

    • carrot
    • scallion, green onion
    • bell pepper, sweet pepper

    When editing an entity type from the Dialogflow CX console, each row of the display is an entity entry. When using the API, the term entity entry refers to the Entity type (EntityType.Entity or EntityType_Entity for some client library languages).

  • Entity reference value and synonyms: Some entity entries have multiple words or phrases that are considered equivalent, like the scallion example above. For these entity entries, you provide one reference value and one or more synonyms.