Entity

Prev Next

Available in Classic and VPC

An entity refers to a dictionary containing registered terms such as personal names, organization names, locations, dates, and product names. Chatbots use entities analyzed from user utterances to discern intent and extract slots. Defining words with the same meaning as an entity helps in understanding user utterances. After creating, modifying, or deleting an entity, you must build or complete the application of changed settings for the changes to be reflected in the chatbot service.

  • Types of entities
    • Domain entity: Entities that are frequently used only within a specific domain. They are divided into dictionary-based dictionary entities and regular expression pattern-based pattern entities.
    • System entity: Entities that are commonly available across all domains. They are provided as a built-in feature.
    • API entity: Entities that use entity data stored in an external database without defining entities directly within the Chatbot Builder.

Create domain entities

A domain entity is a collection of key words expected to be used within the relevant domain. For example, when creating a chatbot for coffee orders, you can register and use domain entities, such as the type and size of coffee required for the order.
To register a domain entity:

  1. In the NAVER Cloud Platform console, navigate to i_menu > Services > AI Services > CLOVA Chatbot > Domain.
  2. Click [Run builder] of the domain you want to run the Chatbot Builder.
  3. In the Chatbot Builder, click Entity > [Domain Entity] tab.
  4. Click [Create Entity].
Item Description
Entity name Enter the entity name
Entity type Select the entity type
  • Dictionary: Dictionary-based entity type. Data of dictionary entities is used in model training. You can’t register words duplicated in a domain entity as representative terms or synonyms.
  • Pattern: Regular expression pattern-based entity type. Pattern entities are not used in model training.
Set sensitive Information Set whether the information contained in the entity is sensitive. Unless it involves sensitive information in special cases, it is usually set as general information.
  • General information: The information contained in the entity is general information, not sensitive information.
  • General sensitive information: Information such as the user's name, phone number, and address. If a user enters data containing general sensitive information, such information is masked on interfaces such as the conversation history within the Chatbot Builder, and therefore not displayed to the chatbot creator. When inserting and using general sensitive information in chatbot responses, we recommend enabling the logging exclusion option to mask chatbot responses as well, since the chatbot may re-utter the user's sensitive information.
  • Special sensitive information: Special sensitive information such as the user's unique identification information (resident registration number, driver's license number) and passwords. If a user enters data containing special sensitive information, such information is masked on interfaces such as the conversation history within the Chatbot Builder, and therefore not displayed to the chatbot creator. In addition, we recommend setting the data as special sensitive information when special security processing is required because the chatbot engine logs are also masked. However, since no information is logged in the engine logs, debugging support is difficult to provide when failures occur. Therefore, the insertion and use of sensitive information in chatbot responses is restricted.
Register entities If you select dictionary entity as the entity type,
  • Representative term: Enter the representative term to register in the entity
  • Synonym: Enter a synonym for various expressions. When entering multiple synonyms, separate them with commas (,).
    If you select pattern entity as the entity type,
  • Analyze the entity as a pattern using regular expressions.
  • However, only dictionary entities, system entities, system variables, and domain variables can be entered into pattern entities.
  • See Regular Expression input guide when defining patterns.
  1. Once you have finished entering the entity information, click [Save].
  • Example: Pattern entity
    chatbot-chatbot-3-2_ex01_ko

  • Example: Dictionary entity
    chatbot-chatbot-3-2_ex02_ko

Create system entities

System entity is an entity that can be used across all domains. NAVER Cloud Platform manages them, and chatbot creators only enable the system entities they wish to use from among those registered.

Note

System entities referenced in tasks or regular expressions cannot be disabled.

`@SYSTEM_ANY

`@SYSTEM_ANY is used when you only want to store certain patterns from the user's free utterances. For example, it can be used to analyze entities such as personal names or search keywords that are difficult to define as dictionary entities or pattern entities.

  • `@SYSTEM_ANY can only be entered in regular expression questions.
  • `@SYSTEM_ANY can match any utterance. It is identical to the wildcard in regular expression syntax.
  • We recommend entering other possible patterns in addition to @SYSTEM_ANY, not just registering@SYSTEM_ANY alone.
Regular expression question: What is `@SYSTEM_ANY?
  • However, when using optional regular expression patterns as well, matching words to `@SYSTEM_ANY cannot be guaranteed.
Regular expression question: [Describe](give|please) `@SYSTEM_ANY
-> When the user inputs "Describe Clova Chatbot," `@SYSTEM_ANY may match "Clova Chatbot".
  • If you only want to register `@SYSTEM_ANY, we recommend setting contexts or conditions to restrict the matching of that conversation to specific points in time.
Regular expression question: `@SYSTEM_ANY
-> When registering a regular expression question that only includes `@SYSTEM_ANY, it may always match the conversation when the user inputs an utterance.

Slot Module

Slot module is an entity that provides the most commonly used entities as shared modules when building quickstart.

  • It provides 4 system entities including DATE, TIME, PEOPLE, and NAME. When a utterance containing date, time, number of people, or name is received, it recognizes the patterns for date, time, and number of people within that utterance, stores them in the system entities, and passes the values.
  • When using these entities, you can utilize pattern entities such as Date, Time, People, and Name without creating them separately. Instead, you can turn on or off the required entities directly within the system entity.
Note
  • The system entities DATE, TIME, PEOPLE, and NAME cannot be entered into regular expression questions.

  • After turning on the entity, you must build it to use it.

Slot modules are used to specify user variables in response conditions or to enter user variables in response content.

  • To set response conditions, select [User Variables] tab and enter a part of the variable, such as `@DATE, in the [Value] field. A list of slot modules appears.
    chatbot-chatbot-3-2_slotnormalizer-2_ko

  • To enter a user variable in the response, select an entity from the dropdown list of values in the user variable field. When you enter a part of the variable, such as `@DATE, a list appears.
    chatbot-chatbot-3-2_slotnormalizer-1_ko

DATE

DATE is an entity that recognizes date input patterns, such as "today," "Christmas," "Buddha's Birthday," and "one year from now," and returns the corresponding date.

To use the DATE value within a system entity, turn on the entity to enable it. When the DATE is activated, the TIME Entity is also activated simultaneously.

Caution

The system entities date and datetime cannot be activated simultaneously. When the date is on and the datetime is on, then the date becomes off.

When handling the date in conversations, you can consider the following two patterns:

  • Making a reservation call at a restaurant, etc. -> analyzed : Future date
  • Requesting a transaction history from a credit card company -> alternative: Past date

When making a reservation by phone at a restaurant, you typically book a future date. But when requesting a transaction history from a credit card company, you typically review a past date.

The date value has two components, the analyzed and alternative values. This allows you to infer both future and past dates.
For example, if the current date is April 01, 2022, and you say "May 1," it will be analyzed as follows:

  • analyzed: 2022-05-01
  • alternative: 2021-05-01
Note
  • Currently, only the analyzed is available. The alternative will become available in the future.

  • As a result of the analysis, the alternative may be displayed on the interface. However, the specifications are subject to change.

Description of analysis values

attribute type description
`@{DATE.literal} string The exact value the user said.
e.g., December 25
`@{DATE.analyzed} - If the user responds with only partial information without providing a definite date.
e.g., 25th → Return an inferred future date. 
e.g., If the current date is December 24, 2022, it is analyzed as December 25, 2022.
`@{DATE.analyzed.value} string ex) 2020-12-25
`@{DATE.analyzed.year} number The analyzed year value.
e.g., 2021
`@{DATE.analyzed.month} number The analyzed month value.
e.g., 12
`@{DATE.analyzed.day} number The analyzed day value.
e.g., 25
`@{DATE.analyzed.dayOfWeek} number Represent the analyzed day of the week value as a number.
e.g., Monday - Sunday → 0-6
e.g., 5 → Saturday
`@{DATE.analyzed.type} string Display the type of the analyzed value.
  • availableDate: A valid date. If it does not fall under the following cases:
  • unavailableDate: A date not present in the calendar or a value outside the range that cannot be inferred from the slot module.
  • unavailableDateCombi: If the date and day of the week do not match.
  • multiDate: If the date appears multiple times.
  • `@{DATE.analyzed.relative} - The relative value between the current date information and the actual analyzed date information. Analyzed based on the analyzed.
    `@{DATE.analyzed.relative.year} number The relative value between the current year and the year of the actual analyzed date. Analyze based on the analyzed only when the alternative is availableDate, or when the user made a relative utterance.
    e.g., 2 years ago → -2
    `@{DATE.analyzed.relative.month} number The relative value between this month and the month of the actual analyzed date. Analyze based on the analyzed only when the alternative is availableDate, or when the user made a relative utterance.
    e.g., 2 months later → 2
    `@{DATE.analyzed.relative.week} number The relative value between this week and the week of the actual analyzed date. Analyze based on the analyzed only when the alternative is availableDate, or when the user made a relative utterance.
    e.g., 2 weeks ago → -2
    `@{DATE.analyzed.relative.day} number The relative value between today's date and the actual analyzed date. Analyze based on the analyzed only when the alternative is availableDate, or when the user made a relative utterance.
    e.g., 3 days later → 3
    `@{DATE.alternative} -
    • Alternative value: When the user responds with only partial information without providing a definite date.
      e.g., 25th
      • Return by inferring a future date as @{DATE.analyzed}.
      • Return by inferring a past date as @{DATE.alternative}.
    • When the user has provided a definite date.
      e.g., December 25, 2021
      • @{DATE.analyzed} and @{DATE.alternative} have the same value.
    `@{DATE.alternative.value} string ex) 2020-12-25
    `@{DATE.alternative.year} number Year of the alternative value.
    e.g., 2021
    `@{DATE.alternative.month} number Month of the alternative value.
    e.g., 12
    `@{DATE.alternative.day} number Day of the alternative value. 
    e.g., 25
    `@{DATE.alternative.dayOfWeek} number Represent the day of the week of the alternative value as a number: Monday - Sunday → 0-6
    e.g., 5 → Saturday
    `@{DATE.alternative.type} string Display the type of the analyzed value.
    • availableDate: If the date is valid or does not fall under the following cases:
    • unavailableDate: If the date is not on the calendar, or if an area that cannot be predicted by the slot module is missing.
    • unavailableDateCombi: If the date and day of the week do not match.
    • multiDate: When multiple dates are detected.
    `@{DATE.alternative.relative} - The relative value between the current date information and the actual analyzed date information. Analyzed based on the alternative.
    `@{DATE.alternative.relative.year} number The relative value between the current year and the year of the actual analyzed date. Analyze based on the analyzed only when the alternative is availableDate, or when the user made a relative utterance.
    e.g., 2 years ago → -2
    `@{DATE.alternative.relative.month} number The relative value between this month and the month of the actual analyzed date. Analyze based on the analyzed only when the alternative is availableDate, or when the user made a relative utterance.
    e.g., 2 months later → 2
    `@{DATE.alternative.relative.week} number The relative value between this week and the week of the actual analyzed date. Analyze based on the analyzed only when the alternative is availableDate, or when the user made a relative utterance.
    e.g., 2 weeks ago → -2
    `@{DATE.alternative.relative.day} number The relative value between today's date and the actual analyzed date. Analyze based on the analyzed only when the alternative is availableDate, or when the user made a relative utterance.
    e.g., 3 days later → 3

    Example 1: If the current date is May 31, 2022 and the user says "weekend."

    Attribute Value Description
    Analysis Estimated to be 6/4 or 6/5. A future Saturday or Sunday.
    year 2022 Both Saturday and Sunday are in 2022.
    month 6 Both Saturday and Sunday are in June.
    day null It depends on whether it's Saturday or Sunday.
    Type multiDate Multiple dates apply.

    Example 2: If the current date is May 02, 2022 and the user says "weekend."

    Attribute Value Description
    Analysis Estimated to be 5/7 or 5/8. A future Saturday or Sunday.
    year 2022 Both Saturday and Sunday are in 2022.
    month 5 Both Saturday and Sunday are in May.
    day null It depends on whether it's Saturday or Sunday.
    Type multiDate Multiple dates apply.

    Example 3: If the current date is May 31, 2022 and the user says "today."

    Attribute Value Description
    Analysis 2022-05-31 A decisive date.
    year 2022
    month 5
    day 31
    Type availableDate A valid date.

    Example 4: If the current date is May 31, 2022 and the user says "1."

    Attribute Value Description
    Analysis 2022-06-01 A definite date in the future.
    year 2022
    month 6
    day 1
    Type availableDate A valid date.
    • Example of an analyzed entity
    {
      "literal" : "December 25",
      "analyzed":
      {
        "value" : "2022-12-25",
        "year" : 2022,
        "month" : 12,
        "day" : 25,
        "dayOfWeek" : 5,
        "type" : "availableDate",
        "relative" : 
       {
         "year" : 0,
         "month" : 1,
         "week" : 1,
         "day" : 11
       }
      },
      "alternatives" :
      {
        "value" : "2021-12-25",
        "year" : 2021,
        "month" : 12,
        "day" : 25,
        "dayOfWeek" : 5,
        "type" : "availableDate",
        "relative" : 
       {
         "year" : -1,
         "month" : 1,
         "week" : 1,
         "day" : 11
       }
      }
     }
    }
    

    TIME

    TIME recognizes input patterns such as "7:30," "2 hours later," and "now," and places the corresponding time into the slot to deliver it.

    Note

    Since the slot module is themed around "reservations," all times are estimated to be divisible by 10-minute increments.
    For example, if the current time is 6:30 PM and the user says "7 minutes from now," the system returns 6:40 PM, not 6:37 PM.

    To activate the TIME, turn on the DATE.

    attribute type description
    `@{TIME.literal} string The exact value the user said.
    e.g., 7:30
    @{TIME.analyzed}|-|<ul><li>Analyzed value: When the user responds with only partial information without providing a definitive time. <ul><li> e.g., 7:00 <ul><li>Return by inferring a future time as @{TIME.analyzed}.</li> <li>Return by inferring a past time as @{TIME.alternative}.</li></ul></ul></ul> <ul><li>When the user has provided a definite time. <ul><li>e.g., 1:30 PM</li> <ul><li> @{TIME.analyzed} and&nbsp;@{TIME.alternative} have the same value.
    `@{TIME.analyzed.value} string ex) 19:30
    `@{TIME.analyzed.hour} number The analyzed time value.
    e.g., 19
    `@{TIME.analyzed.minute} number The analyzed minute value.
    e.g., 30
    `@{TIME.analyzed.type} string Display the type of the analyzed value.
    • availableTime: If the time is valid and does not fall under the following cases:
    • unavailableTime: If the value exceeds 24 hours or 60 minutes, or when an unpredictable area is missing.
    • multiTime: When multiple dates are detected.
    • @{TIME.analyzed.relative}: The relative value between the current time information and the actual analyzed time information. Analyzed based on the analyzed.
    `@{TIME.analyzed.relative.hour} number The relative value between the current hour and the actual analyzed hour. Analyzed based on the analyzed.
    e.g., 1 hour later → 1
    `@{TIME.analyzed.relative.minute} number The relative value between the current minute and the minute of the actual analyzed time. Analyzed based on the analyzed.
    e.g., 30 minutes later → 30
    `@{TIME.alternative} -
    • If the user responds with only partial information without providing a definite time.
      e.g., 7:00
      • Return by inferring a future time as @{TIME.analyzed}.
      • Return by inferring a past time as @{TIME.alternative}.
    • When the user has provided a definite time.
      e.g., 1:30 PM
      • @{TIME.analyzed} and @{TIME.alternative} have the same value.
    `@{TIME.alternative.value} string ex) 07:30
    `@{TIME.alternative.hour} number The analyzed time value.
    e.g., 7
    `@{TIME.alternative.minute} number The analyzed minute value.
    e.g., 30
    `@{TIME.alternative.type} string Display the type of the analyzed value.
    • If the availableTime is a valid time or does not fall under the following cases:
    • unavailableTime: If the value exceeds 24 hours or 60 minutes, or when an unpredictable area is missing.
    • multiTime: When multiple dates are detected.
    `@{TIME.alternative.relative} - The relative value between the current time information and the actual analyzed time information. Analyzed based on the alternative.
    `@{TIME.alternative.relative.hour} number The relative value between the current hour and the actual analyzed hour. Analyzed based on the alternative.
    e.g., 1 hour later → 1
    `@{TIME.alternative.relative.minute} number The relative value between the current minute and the minute of the actual analyzed time. Analyzed based on the alternative.
    e.g., 30 minutes later → 30
    • Example of an analyzed entity
    {
      "literal" : "7:30",
      "analyzed":
      {
        "value" : "19:30",
        "hour" : 19,
        "minute" : 30,
        "type" : "availableTime",
        "relative" : 
       {
         "hour" : 1,
        "minute" : 30,
        "second" : -30
       }
      },
      "alternatives" :
      {
        "value" : "07:30",
        "hour" : 7,
        "minute" : 30,
        "type" : "availableTime",
        "relative" : 
       {
         "hour" : 1,
        "minute" : 30,
        "second" : -30
       }
      }
    }
    

    People

    The People recognizes input patterns such as "1 adult, 2 children" or "3 adults," and delivers the total number of people or the number of adults/children by placing them into slots.
    You can turn on the People in the system entity to use it.

    Caution

    According to the current specifications, students are not counted as children.

    attribute type description
    `@{PEOPLE.literal} string The exact value the user said.
    e.g., "1 adult, 2 children"
    `@{PEOPLE.total} number Total number of people analyzed.
    e.g., 3
    `@{PEOPLE.numAdult} number Number of analyzed adults.
    e.g., 2; if child information is unavailable, always infer and fill in using the value of total.
    `@{PEOPLE.numChild} number Number of children analyzed.
    e.g., 1; if child information is unavailable, always infer as 0.
    `@{PEOPLE.type} string Display the type of the analyzed value.
    • availablePeople: Number of valid people.
    • multiPeople: When multiple people are detected.
    • Example of an analyzed entity
    {
      "literal" : "2 adults, 1 child",
      "total" : 3,
      "numAdult" : 2,
      "numChild" : 1,
      "type" : "availablePeople"
    }
    

    Name

    It can recognize names from user-entered values, place them into slots, and export them. 
    You can turn on the People in the system entity to use it.

    Caution

    It does not recognize names that are not personal names, such as organization names, company names, or nicknames.

    attribute type description
    `@{NAME.literal} string
    `@{NAME.lastName} string
    `@{NAME.firstName} string
    `@{NAME.type} string
    • Example of an analyzed entity
    {
      "literal" : "Jung-ah Sunwoo",
      "lastName" : "Sunwoo",
      "firstName" : "Jung-ah",
      "type" : "availableName"
    }
    

    How to use

    • Store in a user variable: You can select the desired field, such as @{DATE.analyzed.dayOfWeek}, and assign it to a user variable to use.
      chatbot-chatbot-3-2_slotnormalizer-3_ko

    • Task conversation

      • If it is a user response value: You can store it as a literal value and use it.
        chatbot-chatbot-3-2_slotnormalizer-4_ko

      • If it is a normalized value:
        You can store it as the value of @{DATE.analyzed}, @{TIME.analyzed}, @{PEOPLE.total}, or @{NAME.literal} and use it.
        chatbot-chatbot-3-2_slotnormalizer-5_ko

    • Response

      • You can use the user variables directly.
        chatbot-chatbot-3-2_slotnormalizer-3_ko

      • If you want to substitute it into a specific format, you can use it by placing it in a user variable.
        e.g., @{TIME:kr.time.partsDay}, is that correct?
        chatbot-chatbot-3-2_slotnormalizer-6_ko

    Note

    To substitute into a specific format, the user variable must be converted to JSON format.
    chatbot-chatbot-3-2_slotnormalizer-7_ko

    How to format the response

    format name user variable output detail e.g
    kr.date {"month" : M, "day" : D, "weekday" : "AAAA"} [M] [D] E.g., May 5
    kr.date.weekday {"month" : M, "day" : D, "weekday" : "AAAA"} [M] [D], [AAAA] [AAAA] = [Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday] May 5, Tuesday
    kr.time {”hour" : H, "minuet" : M} [H] [M] H = 24-hour system 23:30
    kr.time.partsDay {”hour" : H, "minuet" : M} [partsDay] [H] [M] H = 12-hour system 11:30 PM
    kr.time.twelveHour {”hour" : H, "minuet" : M} [H] [M] H = 12-hour system 11:30
    kr.people {"numPeople" : NNNN} [NNNN] 1 ≤ N < 50: Convert to ordinal form; 50 ≤ N: Convert to cardinal form 4 people
    kr.people.arabic {"numPeople" : NNNN} [NNNN] N: Arabic numerals as is 4 minutes
    kr.telNum "XXXYYYYZZZZ" [XXX]-[YYYY]-[ZZZZ] XYZ : Convert to cardinal form 010-2929-2929
    kr.telNum.fourDigits "XXXYYYYZZZZ" [ZZZZ] N : Convert to cardinal form 2929
    telNum.arabic "XXXYYYYZZZZ" [XXX]-[YYYY]-[ZZZZ] XYZ : Arabic numerals as is 090-1234-5678
    telNum.fourDigits.arabic "XXXYYYYZZZZ" [ZZZZ] XYZ : Arabic numerals as is 2929

    Create API-integrated entities

    API-integrated entities are used when there are entities that cannot be managed within the Chatbot Builder or entities whose information changes in real time. For example, API-integrated entities are used when it is difficult to manage sensitive data such as employee names or customer names by registering them as entities in the Chatbot Builder. By entering the API URL of a server capable of analyzing entities on your behalf, the system can transmit user utterances to that API server for entity analysis, receive the analyzed results, and proceed with the quickstart accordingly.

    API-integrated entities are used in the following cases:

    • Used as a task slot
    • When the entity condition is checked in the response conditions
    • When calling the action method v1

    To use API-integrated entities:

    1. In the NAVER Cloud Platform console, navigate to i_menu > Services > AI Services > CLOVA Chatbot > Domain.
    2. Click [Run builder] of the domain you want to run the Chatbot Builder.
    3. In the Chatbot Builder, click Entity > [API Entity] tab.
    4. Click [Edit] in the URL
    5. Enter the address of the API that can analyze the entity in the URL, and click [Save].
      • The chatbot makes a call that includes morphological analysis results derived from the provided URL.
    6. Click [Create Entity].
    7. When the window for creating an entity appears, enter the Entity name, click [Check for Duplicates], then click [Save].
    8. Verify the generated entity.
    • Request format
    {
      "query": "Live in Korea",
      "nlpResult": {
        "data": [
          {
            "words": [
              {
                "in": [
                  {
                    "morph": "Korea",
                    "tag": "NOUN",
                    "ner": "Ner=B-Name of the Korea entity",
                    "lemma": null,
                    "start": 0,
                    "end": 5,
                    "feature": 0,
                    "additionals": ""
                  },
                  {
                    "morph": "Live",
                    "tag": "NORMALVERB",
                    "ner": "Ner=O",
                    "lemma": "Living",
                    "start": 6,
                    "end": 11,
                    "feature": 0,
                    "additionals": "in"
                  }
                ],
                "word": "Live in Korea"
              }
            ]
          }
        ],
        "success": true
      }
    }
    
    • Response format
    {
      "code": "OK",
      "message": "Option[String]",
      "entity": [
        {
          "name": "Country",
          "userInput": "Korea",
          "represent": "Korea"
        }
      ]
    }
    

    Tag entities manually

    Dictionary entities can be tagged in general questions within a conversation. After registering an entity and completing the model build, words corresponding to that entity will be automatically tagged when registering general questions. Tagged entities appear in blue text within the question list of the conversation. Questions tagged with entities are reflected in the training of the conversation model, helping it recognize user utterances.
    If the conversation model is not yet built or entities are not automatically tagged, the chatbot creator can tag entities manually.
    To tag an entity manually:

    1. Complete the preliminary tasks.
      • Add "Pizza Type" entity, representative term: Potato pizza
        chatbot-chatbot-3-2_tag01_ko
    2. After registering your question, drag the words you want to tag as entities.
      • In this quickstart, drag the "Potato pizza."
        chatbot-chatbot-3-2_tag02_ko
    3. When the window for selecting an entity appears, select the Entity you want to tag and click [Apply].
      • You can add it as a new representative term, or add it as a synonym for an already registered representative term.
      • If no entity exists, click [Create Entity] to create a new one.
        chatbot-chatbot-3-2_tag03_ko
    4. Verify that entity tagging has been completed.
      chatbot-chatbot-3-2_tag04_ko