NLU vocabulary
Summarize
Summary of NLU vocabulary
NLU vocabulary items enable your ServiceNow system to better recognize the diverse ways users express their requests by mapping various words, phrases, or patterns to standardized synonyms. This improves the model’s confidence and accuracy in intent prediction, helping your Virtual Agent and other NLU-powered features understand user input more effectively.
Show less
Vocabulary Usage and Types
- Regular vocabulary items: Represent words or phrases, including business-specific terms or acronyms, in a case-insensitive way.
- Pattern vocabulary items: Use regular expressions (regex) to match specific formats such as email addresses, phone numbers, or case-sensitive acronyms, allowing precise recognition of terms that might otherwise be ambiguous.
Vocabulary Sources
Vocabulary sources reference ServiceNow tables or static lists (e.g., catalog items or conference rooms) and allow you to manage multiple related values under a single synonym. These sources can be reused across NLU models and referenced in training utterances and entity values using the @ symbol. This approach saves time and ensures consistency when handling sets of objects users might mention.
Practical Application in Intents
Using vocabulary items and sources within intent training utterances enhances the system’s ability to correctly interpret user inputs. For example:
- Adding acronyms like sfcrm as vocabulary items with synonyms improves recognition and intent matching.
- Defining pattern vocabulary with regex helps distinguish common words used as specific product names (e.g., capitalized Word) to increase prediction confidence.
Additionally, annotating software names or key terms as entities enables extraction and use in Virtual Agent conversations.
Regex Usage Tips
Pattern vocabulary items are case-sensitive by default and support word boundary markers (e.g., \bIT\b) to precisely match acronyms without capturing similar words. You can toggle case sensitivity within regex patterns to tailor matching behavior.
Benefits for ServiceNow Customers
- Improves natural language understanding by accounting for varied user expressions and domain-specific language.
- Enhances intent prediction accuracy and consistency, reducing misunderstandings in user requests.
- Enables efficient management of vocabulary related to business objects via reusable vocabulary sources.
- Supports advanced pattern recognition through regex for complex or ambiguous terms.
Use NLU vocabulary items to help the system recognize the various ways your users express their requests. Use vocabulary sources to help the system recognize objects in tables or lists, such as names of conference rooms or catalog items.
Vocabulary usage and context
Vocabulary helps your model with the various words and phrases that it may encounter from your users. Since humans are not computers, they may come up with different ways to say the same thing. For example, if one user inputs an acronym rather than the full phrase, the system might be able to predict the correct intent by using the context in the utterance. However, by defining the acronym with a vocabulary item, you raise the model's confidence level and capability to predict intents correctly.
Vocabulary items cover the varying words or phrases that might appear in utterances. The vocabulary items are mapped to the synonyms that you provide, for intent prediction. This helps the system recognize the various ways your users express their requests, while at the same time ensuring the consistency, confidence, and accuracy of predictions.
Vocabulary item types
| Type | Definition |
|---|---|
| Regular | A word or phrase that is not commonly known, such as a business or industry specific term or acronym. Regular vocabulary is case insensitive, so all case variations will be captured by the vocabulary you create. |
| Pattern | A regular expression (regex) that can capture specific formats such as email addresses and phone numbers. |
Vocabulary sources
- Use a vocabulary item for an individual word, phrase, or pattern that can easily be mapped to a single synonym for the model to use.
- Use a vocabulary source to reference a ServiceNow table or list so that the values can all be replaced by the single synonym you define. Vocabulary sources can be reused across all your NLU models.
Use vocabulary sources when your user utterances refer to objects in a set. The sources can be referenced from a list of values from a ServiceNow table or a static list that you define, such as a list of catalog items or conference rooms. Once you create and save these sources, you can use the @ symbol to specify them in training utterances. You can also use these sources as entity values.
For example, say you already have a list of all the conference rooms for your office. You can create a vocabulary source to reference that list rather than typing each conference room name into your intent's training utterances.
To create vocabulary sources, refer to Create a table vocabulary source and Create a list vocabulary source.
Vocabulary usage in relation to an intent
| Utterance | Issue and Solution |
|---|---|
| "I need to access sfcrm" |
|
| "I need to install Word" |
|
Use a single word or short phrase as a synonym for best results. You can map multiple vocabulary items to one synonym. Do not map one vocabulary item to multiple synonyms.
For more context and examples, see Create an NLU intent.
A Regex example for a pattern vocabulary item
Let's say that you want to use a vocabulary item to identify the acronym IT, and map it to the synonym information technology.
Regular vocabulary items are case-insensitive by default. This means that a regular vocabulary item would match both the acronym IT and the common word it. So you decide to use a pattern vocabulary item.
The regex pattern that you can use is \bIT\b. The \b is a word boundary marker. This ensures that the pattern would not match ITSM or JIT, for example. The default case sensitivity of pattern vocabulary items means that \bIT\b would not match the common word it.
Regex details: You can turn off case sensitivity in a pattern by using (?i). You can end that mode by using a minus sign as in (?-i). For example, (?i)te(?-i)st should match both test and TEst, but not teST or TEST.
For more information, see Using regular expressions in entities.