Gokul_NorthStar
Gokul_NorthStar

Reputation: 51

Is it possible to ignore or stop identifying entities inside (single/double)quotes on utterances in microsoft LUIS?

I am using MS LUIS to build a chat bot. When a filename comes in a question, it is detecting names,dates,numbers on the filename as real entities where they are not. The filenames are obviously coming inside quotes. Still LUIS is taking those as entities.

Is there a way to tell LUIS to stop identifying words inside quotes as entities. Any help will be greatly appreciated.

Upvotes: 0

Views: 55

Answers (1)

mdrichardson
mdrichardson

Reputation: 7241

Unfortunately, LUIS binds all possible entities it can and they cannot be selectively removed--they can only be completely removed from the app.

However, you can handle this within your code a few different ways:

Ignore the entities

When the result comes back from LUIS, you could maybe selectively look at the entities. Pseudo-code might be something like

// If turnContext.activity.Text doesn't contain "", do something with entities

Selectively send text to LUIS to be recognized

If you don't want LUIS to process filenames at all, you could also ignore them within your code. Code would be something like:

var recognizerResult = {};
if (!turnContext.activity.Text.contains("/"))
{
    recognizerResult = await _services.LuisServices[LuisKey].RecognizeAsync(turnContext, cancellationToken);
}

Ignore it in the UI

Flip the toggle to the top-right from Entity View to Tokens View

enter image description here

enter image description here

Add a new RegEx entity called filepath that eclipses the other entities

Entity regex: ^(.*/)([^/]*)$

Before:

enter image description here

After (note: I only RegEx'd for "/" and not "\"):

enter image description here

Upvotes: 1

Related Questions