Intent management

更新时间:
复制 MD 格式

Intents are used to categorize and organize various user expressions.

1. Contents of an intent (as shown below)

2. Basic intent information

Intent name: Intent names must be unique within a bot. For example, if you have an intent named `General Affirmation`, an error occurs if you try to create another intent with the same name.

Intent alias: An alias is a user-friendly description of an intent. When the bot detects two similar intents, it uses the alias to ask the user for clarification. This feature is disabled by default.

Intent slot: An intent slot contains semantic information. For example, if a user's response matches the "busy" intent, you may want to ask when they are available for a callback. You can use an intent slot to collect this time information. As shown in the figure below, the intent is named `Collect Short-term Time`. If the user says they are available "in 30 minutes", the system captures the specific time 30 minutes from the current call time.

2.1. Intent utterances

Intent utterances fall into two categories: user utterances and utterance templates. In the utterance configuration for an intent, you can add user utterances and utterance templates. After you finish typing, press Enter to add the utterance.

2.2. User utterances

User utterance: User utterances are the different ways a user can express an intent. They should cover a wide variety of expressions.

This includes similar expressions, such as "in half an hour", "one hour", and "in thirty minutes".

This also includes different ways of expressing the same idea, such as "call me back in half an hour" and "call me again in thirty minutes".

Note: Add at least five user utterances for each intent.

Word tagging: When a user utterance contains specific parameter information, you can use word tagging to improve the bot's ability to recognize user parameters. This is especially helpful for two parameters that use the same recognition method.

For example: "Will it rain in Hangzhou tomorrow?"

In this sentence, "Hangzhou" is a city and "tomorrow" is a date. The user wants to know the weather for "Hangzhou" on the following day. You can use word tagging to link the city and the date to retrieve the correct weather information.

After tagging, if a user says something similar, such as "I want to check if it will rain in Hangzhou tomorrow", the bot can map "Hangzhou" and "tomorrow" to the correct parameters.

To tag a word: In the editor, select the word to map it to the corresponding intent parameter. After you finish, save the utterance to apply your changes.

image

2.3. Utterance templates (LGF)

Utterance template (LGF): Represents user utterances using template matching.

Utterance template (LGF) configuration strategy

(1) Gather utterances: Simulate or brainstorm user utterances from real-world scenarios, or retrieve them from raw corpus data.

(2) Select key words: Identify key words that confirm the intent.

(3) Expand key words: Add synonyms to enrich the corpus and increase coverage.

(4) Reorder key words: Rearrange the key words into combinations that still match the intent.

Supported syntax for utterance templates (LGF)

image

Note: All symbols used in the elements must be English characters.

Usage notes:

1. Symbols in LGF, such as "[]" and "()", must be entered using an English keyboard and used correctly to work correctly.

2. When using the logical NOT operator before a wildcard character rule, use "!" instead of ".". Otherwise, the LGF configuration will not work.

3. An entire LGF sentence cannot consist only of optional parts.

4. LGF rules for different intents must not overlap or block each other. This can cause incorrect intent matching.

Common LGF use cases

1. Use common wildcard characters to extract key words and improve sentence generalization.

The main purpose of this pattern is to ask if a credit card is needed:

.{0,5}(get|apply for|register|use|need|learn about|explain|introduce).{0,8}credit card.{0,5}

2. Use the logical NOT operator.

The main purpose of this pattern is to ask about buying a house.

(!renovation|rent){0,10}(need|want|recommend|introduce)(!renovation|rent){0,10}(property|real estate|floor plan|decorated)(!renovation|rent){0,10}

2.4. LGF validation rules and prompts

When you edit and save LGF rules, the system checks the syntax and provides prompts. The prompts fall into two categories:

(1) Error: Indicates a syntax error, a non-existent entity reference, or a configuration that could severely impact performance. You cannot save this configuration.

(2) Warning: Indicates that the syntax is valid but does not follow best practices. You can still save this configuration.

Common error prompts are shown below.

image

2.5. LGF FAQ

1. A meaningless wildcard character, such as .{0,0}, causes all LGF rules to fail.

image

2. If the NOT operator and a wildcard character are not separated by a required word, the NOT operator may not work as expected.

image

3. If an entity referenced in an utterance is a full match, you cannot use ${} to reference it directly. This will prevent the entity from being extracted correctly.

Instead, you can use the syntax for extracting a wildcard slot: I want to query .{any:0,10}

image

4. Avoid referencing too many slots in an LGF rule. Also, avoid creating overlapping LGF rules. These practices can lead to poor slot recognition.

image

5. When using the logical NOT operator for exclusion, if you want to apply the exclusion to the entire sentence, you must use the "!" character before each wildcard character.

image