Photo by Arturo Castaneyra on Unsplash

Recently IBM Watson Assistant Updated Fuzzy Matching

And How This Improves Chatbot Understanding

Introduction

On 4 February 2022 IBM Watson Assistant updated fuzzy matching.

There are various methods and approaches to managing a conversation from a chatbot perspective. These can include:

  • Disambiguation
  • Digression
  • Fallback Prompts & Dialogs
  • Graphic Conversational Components
  • Forms / Slot Filling
  • And more…

These elements have something in common…

All of these elements are employed as part of an active dialog exchange between the user and the chatbot; hence involving the user.

One element which can be implemented which does not require user involvement is detecting anomalies in user input and automatically correcting user input prior to issuing the input to the NLU.

In this story I am looking at autocorrection and fuzzy matching. And why the two do not clash…

Correcting User Input

On 4 February 2022 fuzzy matching behavior was improved by IBM, by limiting the interactions between different fuzzy matching features.

Fuzzy matching components are comprised of:

  • Stemming — The feature recognizes the stem form of entity values that have several grammatical forms. For example, the stem of ‘bananas’ would be ‘banana’, while the stem of ‘running’ would be ‘run’.
  • Misspelling — The feature is able to map user input to the appropriate corresponding entity despite the presence of misspellings or slight syntactical differences. For example, if you define giraffe as a synonym for an animal entity, and the user input contains the terms giraffes or girafe, the fuzzy match is able to map the term to the animal entity correctly.
  • Partial match — With partial matching, the feature automatically suggests substring-based synonyms present in the user-defined entities, and assigns a lower confidence score as compared to the exact entity match.

One element the chatbot can use to manage and advance the conversation is by correcting user input without consultation. Obviously there is a fine line here; correcting user input with a relative level of confidence that the correct intent and entity will be targeted.

Two ways of correcting user input are:

  • Auto Correction
  • Fuzzy Matching

Auto Correction

Autocorrection, as we all know, corrects words misspelled when a user enters an utterance to the chatbot. Hence, when autocorrection is enabled, the misspelled words in the utterance are corrected on the fly; without user intervention or consultation.

Autocorrection needs to be explicitly activated in your skill and secondly, it needs to be noted that this feature is only supported in certain languages.

Activation of Autocorrection within an IBM Watson Assistant Skill

There might be instances where autocorrection is not desirable.

Example utterance in the test pane with two spelling errors. Automatic correction is applied.

You will see from the example here, in the test pane, a sentence is entered with two spelling errors.

When the words from the input are misspelled, they are corrected automatically, and an “A” icon is displayed.

The corrected utterance is underlined and can be reviewed.

Below is a list of input types which is not corrected, to avoid overcorrection.

Also, words that belong in this skill, meaning words that have implied significance because they occur in entity values, entity synonyms, or intent user examples are also not corrected.

To avoid overcorrection, your assistant does not correct the spelling of the following types of input:

~ Capitalized words

~ Emojis

~ Location entities, such as states and street addresses

~ Numbers and units of measurement or time

~ Proper nouns, such as common first names or company names

~ Text within quotation marks

~ Words containing special characters, such as hyphens (-), asterisks (*), ampersands (&), or at signs (@), including those used in email addresses or URLs.

Because the the following sentence is an intent example for the #Cancel intent;

{
"intents": [
{
"intent": "Cancel",
"examples": [
{
"text": "can you please cacnel it"
}
],
"description": "Cancel the current request"
}

When entering the misspelled word “cacnel”, it is not corrected.

Fuzzy Matching

Fuzzy matching needs to be activated within individual entities. This increases the ability of Watson Assistant to recognize misspelled entity values.

Activating fuzzy matching within the entity

Fuzzy matching within Watson Assistant uses a dictionary lookup approach to match a word from the user input to an existing entity value or synonym in the skill’s training data.

Fuzzy matching can be deactivated or activated on specific entities based on the likelihood that the chatbot’s performance will be enhanced by it.

Example of fuzzy matching on the input “christmass daay”

In this example, the entity is @holiday with a few examples. Amongst which the utterance of christmas day exist.

So, for example, if the user enters christmass daay fuzzy matching picks up that the two utterances mean the same thing.

When fuzzy matching is toggled off for this entity; Watson will automatically retrain the model.

After training, if the same input is given, christmass daay, ,and no entity is detected.

It is advisable to test a sample of data and make small iterative changes. You will notice that the spelling is not corrected, yet correctly matched.

Can Both Be Used In A Skill?

The short answer, is yes…you can use both.

But two things need to be noted.

Firstly…

If autocorrection and fuzzy matching are both enabled, priority is given to fuzzy matching and thereafter autocorrection is actioned.

Secondly…

Fuzzy matching will be employed to identify the most appropriate entity, but the word or words are not corrected. I have found this true to some extend, if the word’s spelling is too far off; autocorrection kicks in.

Left ~ Slight variations in spelling enforces fuzzy matching without autocorrection. Right ~ Bigger variations in spelling invokes fuzzy matching & autocorrection is employed.

Looking at the image here; on the left, a slight variations in spelling enforces fuzzy matching without autocorrection. However, on the right, bigger variations in spelling invokes fuzzy matching & autocorrection is employed.

When you see this, you might think there is inconsistencies in your chatbot. But, this is not the case. You can see this as each of the features playing their part in assisting the chatbot to understand the meaning of the user input.

Conclusion

When features are enabled within the skill or assistant, it is of essence to understand the ramifications within the conversational environment. Perceived inconsistencies can be introduced which in fact is just a lack of understanding regarding the features activated.

I always like to create a small prototype, and by means of iterative augmentation and testing, functionality can be enhanced. With a full understanding of each change’s impact.

--

--

--

NLP/NLU, Chatbots, Voice, Conversational UI/UX, CX Designer, Developer, Ubiquitous User Interfaces. www.cobusgreyling.me

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Change in Computer Vision Technologies Begins!

GPT-3| Unsupervised Creativity of AI

Artificial Intelligence in Urban Planning

Top 10 benefits of chatbot replacing with customer service for Shopify websites.

Updated: The Current Conversational AI & Chatbot Landscape

AI for Analysts and the Enterprise

10 Revolutionary Changes Brought by RPA and Advanced AI in the Insurance Industry

Artificial Intelligence is Here to Stay

Get the Medium app

Cobus Greyling

Cobus Greyling

NLP/NLU, Chatbots, Voice, Conversational UI/UX, CX Designer, Developer, Ubiquitous User Interfaces. www.cobusgreyling.me

More from Medium

This Is How Cognigy Implemented Digression

How We Build a Conversational AI Chatbot at MoMo

Evaluating Chatbot Systems