[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["很难理解","hardToUnderstand","thumb-down"],["信息或示例代码不正确","incorrectInformationOrSampleCode","thumb-down"],["没有我需要的信息/示例","missingTheInformationSamplesINeed","thumb-down"],["翻译问题","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-08-18。"],[[["\u003cp\u003eCustom entities can be modified with different options that change how entity matching and data extraction work, unlike system entities, which are pre-configured and unchangeable.\u003c/p\u003e\n"],["\u003cp\u003eThere are four main types of custom entities that can be created: Map, List, Composite (a specialized List entity), and Regexp, each serving different matching needs and data structures.\u003c/p\u003e\n"],["\u003cp\u003eAdditional settings beyond the entity types include Automated Expansion, which allows the agent to recognize unlisted values, and Fuzzy Matching, which ignores word order in matching.\u003c/p\u003e\n"],["\u003cp\u003eOptions such as "Redact in log" allow for the masking of extracted data in logs, while "Entity exclusions" help prevent the matching of specific phrases.\u003c/p\u003e\n"],["\u003cp\u003eEntities can be configured via the Dialogflow CX console or the API, with the console interface providing options like "Regexp entities" and "Automatically add entities," while the API uses fields such as \u003ccode\u003eEntityType.kind\u003c/code\u003e to define the entity type.\u003c/p\u003e\n"]]],[],null,["# Entity options\n\nThere are several entity options that change the behavior of entity matching\nand data extraction.\nThese options are pre-configured for\n[system entities](/dialogflow/cx/docs/concept/entity-system),\nso you can not change them for system entities.\nHowever, you can change them for your own\n[custom entities](/dialogflow/cx/docs/concept/entity-custom).\nYou can create different kinds of entities,\ndepending on the options selected:\n\n- [Map entity](#map)\n- [List entity](#list)\n- [Composite entity](#comp) (a special kind of list entity)\n- [Regexp entity](#regexp)\n\nThere are other options that do not determine the kind of entity,\nbut do affect the behavior of entity matching:\n\n- [Automated expansion](#expansion)\n- [Fuzzy matching](#fuzzy)\n- [Redact in log](#redact)\n- [Entity exclusions](#exclusion)\n\nThis document describes each of these options.\n\nWhere to find this data\n-----------------------\n\nWhen building an agent,\nit is most common to use the\nDialogflow CX console ([visit documentation](/dialogflow/cx/docs/concept/console), [open console](https://dialogflow.cloud.google.com/cx/projects)).\nThe instructions below focus on using the console.\nTo access entity options data:\n\n1. Open the [Dialogflow CX console](https://dialogflow.cloud.google.com/cx/projects).\n2. Choose your Google Cloud project.\n3. Select your agent.\n4. Select the **Manage** tab.\n5. Click **Entity Types**.\n6. See the following options for any existing entities (some of these may only be visible after expanding **Advanced options** ):\n - **Entities only (no synonyms)**\n - **Regexp entities**\n - **Automatically add entities**\n - **Fuzzy matching**\n - **Redact in log**\n - **Entity exclusions**\n\nIf you are building an agent using the API instead of the console,\nsee the `EntityType` type.\nThe API field names are similar to the console field names.\nThe instructions below highlight any important differences\nbetween the console and the API.\n\n\nGo to the EntityType API reference \n**Select a protocol and version for the EntityType reference:**\n\nClose\n\n\u003cbr /\u003e\n\nMap entity\n----------\n\n*Map entities* provide a map from reference values\nto synonyms for each reference value. Each map entity entry contains a single\nreference value and a list of synonyms. Optionally, you can also\n[set a DTMF pattern for each entity](/dialogflow/cx/docs/concept/parameter#dtmf).\n\nFor example, each of the following rows are entity entries for a `size` entity\ntype:\n\nNotice that the reference value is included in the synonym list\nfor each entity entry above.\nIn order for a reference value to be matched,\nit needs to be included as a synonym itself.\nWhen you initially enter a reference value with the console,\nit is automatically added as a synonym.\n\nIf any of the synonyms are matched for an end-user input part,\nthe associated reference value is extracted for the match\nand is used to resolve the associated\n[parameter](/dialogflow/cx/docs/concept/parameter)\nvalue.\n\nIt is okay for the reference value to be omitted from the synonym list.\nThis just means that it is not matched to an end-user input part,\nbut it is used as the extracted value when one of its synonyms is matched.\nThis is desirable when you use special strings for reference values\nthat are not typed or spoken by end-users.\n\nMany system entities are map entities.\nFor example, the `@sys.date` system entity matches common date inputs\nlike \"January 1, 2015\" or \"The first of January of 2015\".\nBoth of those inputs are mapped to a reference value in ISO-8601 format:\n\"2015-01-01T12:00:00-03:00\".\n\nTo create a map entity:\n\n- Using the console, uncheck the **Regexp entities** option and uncheck the **Entities only** option.\n- Using the API, set the `EntityType.kind` field to `KIND_MAP`.\n\n### Use AI generation to auto-generate synonyms\n\nInstead of entering synonyms manually, you can use an AI generator to\nauto-generate synonyms for your reference value. To do this, check the\n**Auto-generate X syonyms per entity** checkbox when you create a new reference\nvalue. The default value is 3 synonyms. Generating more than 15 synonyms at a\ntime can lead to errors. As a best practice, be sure to fill in the entity\ntype's **Description** field to generate more accurate synonyms for your\nreference value.\n\nFor information about using this feature to auto-generate and auto-translate\ndata for non-default languages, see the\n[multilingual agents documentation](/dialogflow/cx/docs/concept/agent-multilingual#ai_generate_language-specific_data)\n\nList entity\n-----------\n\n*List entities* provide a list of single value entity entries.\nThey do not have reference values and synonyms.\nFor example, each of the following rows are entity entries\nfor a `material` entity type:\n\nIf any value is matched for an end-user input part,\nthe value is extracted for the match\nand is used to resolve the associated\n[parameter](/dialogflow/cx/docs/concept/parameter)\nvalue.\n\nMany system entities are list entities.\nFor example, the `@sys.color` system entity matches common color inputs\nlike \"red\" or \"blue\".\nWhen a color is matched,\nthe extracted value does not map to any reference value.\nFor example, shades of red, such as \"scarlet\" or \"crimson\",\nare not mapped to \"red\" and are extracted\nas their original values \"scarlet\" and \"crimson\".\n\nTo create a list entity:\n\n- Using the console, uncheck the **Regexp entities** option and check the **Entities only** option.\n- Using the API, set the `EntityType.kind` field to `KIND_LIST`.\n\nComposite entity\n----------------\n\nA *composite entity* is a special kind of list entity.\nEntity entries for list entities typically contain simple words or phrases,\nbut they may also contain other entity types.\nWhen an entity type is referenced in another entity type,\nthe reference is called an *alias*.\nWhen a list entity contains aliases to other entity types,\nit is called a composite entity.\n\nWhen creating an alias,\nyou supply the name of the referenced entity type\nand a property name of your choosing.\nWhen a composite entity is matched at runtime,\nthe extracted value is returned as a JSON object,\nwith alias property names used as JSON property names.\nThe format for entering an alias is: \n\n```\n@entity-name:property-name\n```\n\nFor example, you could create a `place` entity type\nthat matches either a city or a state with the following entity entries:\n\nIf an end-user input contains a \"Nashville\" part,\nthe `place` entity type is matched.\nThe extracted value is returned as:\n`{\"city\": \"Nashville\"}`.\n\nYou can also use multiple entity aliases in an entity entry.\nConsider the following `move` custom entity type that contains\naliases to a `direction` entity type and the `@sys.number` system entity type:\n\n**Direction custom map entity type:**\n\n**Move custom list entity type:**\n\nIf the `move` entity is matched\nto an end-user input that contains \"five steps backward\",\nthe `move` entity will be matched.\nThe extracted value is returned as:\n`{\"steps\": 5, \"direction\": \"back\"}`.\n\nMany system entities are composite entities.\nFor example, the `@sys.unit-currency` system entity\nis used for matching amounts of money with a currency name.\nIt matches end-user inputs like \"50 euros\" or \"twenty dollars and five cents\".\nThe extracted value is returned as a JSON object like:\n`{\"amount\": 50, \"currency\": \"EUR\"}`\n\nRegexp entity\n-------------\n\nWith *regexp entities* , you can provide regular expressions for matching.\nFor more information,\nsee [Regexp entities](/dialogflow/cx/docs/concept/entity-regexp).\n\nTo create a regexp entity:\n\n- Using the console, check the **Regexp entities** option.\n- Using the API, set the `EntityType.kind` field to `KIND_REGEXP`.\n\nAutomated expansion (automatically add entities)\n------------------------------------------------\n\nYou can enable automated expansion for a custom entity type.\nWhen enabled, your agent can recognize values\nthat have not been explicitly provided.\nFor example, consider a shopping list entity type:\n\nIf an end-user input is \"I need to buy some carrots\",\n\"carrots\" will be matched for this entity type,\neven though it's not provided.\nThe agent recognizes that \"carrots\" is contextually similar to other values.\n\nYou should follow the best practices when considering automated expansion:\n\n- Enabling automated expansion doesn't guarantee entity extraction. For a finite list, you should provide the complete list instead of providing a partial list and enabling automated expansion.\n- If you enable automated expansion in more than one entity, it may cause conflicts and unexpected classification results.\n- To ensure better parameter extraction quality, it is crucial to provide diverse training data which cover all the use-cases in which a given entity can be found in the expected agent's traffic. With not enough examples, automated entities expansion might not work as expected.\n\nTo enable automated expansion:\n\n- Using the console, check the **Automatically add entities** option.\n- Using the API, set the `EntityType.autoExpansionMode` field to `AUTO_EXPANSION_MODE_DEFAULT`.\n\nFuzzy matching\n--------------\n\nYou can enable *fuzzy matching* for a custom entity.\nWith fuzzy matching enabled,\nthe ordering of the words in a value or synonym does not matter.\nFor more information,\nsee [Fuzzy matching](/dialogflow/cx/docs/concept/entity-fuzzy).\n\nTo enable fuzzy matching:\n\n- Using the console, check the **Fuzzy matching** option.\n- Using the API, set the `EntityType.enableFuzzyExtraction` field to `true`.\n\nRedact in log\n-------------\n\nIf you enable entity redaction,\nall runtime extracted parameter values for the entity type\nwill be redacted when logging.\n\nAs an alternative, you can\n[redact individual parameters](/dialogflow/cx/docs/concept/parameter#redact).\n\nEntity exclusions\n-----------------\n\nYou can add entity exclusions, which are phrases that shouldn't be matched.\nFor example, if you have a size entity type with entity *giant* (an adjective),\nyou might consider adding *giants* (a noun) as an exclusion."]]