flagg19
flagg19

Reputation: 1782

Slot-filling fills multiple slots at once and makes a mess with strings like "13:00"

I have an intent with three required slots (let's call them: slot_a, slot_b, slot_c) all of type @sys.number. When the intent gets detected the system prompts me asking for the missing slots:

What's slot_a?

me: 1

What's slot_b?

me: 2

What's slot_c?

me: 3

And this works well. Problems start when I add speech-to-text, because sometimes the system understands "1:00", "2:00", "3:00" instead of simple numbers, and when those are given to dialogflow it behaves like this:

What's slot_a?

me: 1 (but get converted as "1:00")

dialogflow splits "1" and "00", and assigns "1" to a and "0" to b.

What's slot_c?

me: 3 (but get converted as "3:00")

dialogflow had b already so it asked directly for c.

This is happening with it-IT locale, and I don't know how to fight it. Having it converting "1" to "1:00" is the first half of the problem, but I could work around it in the fulfillment, but then dialogflow splits on : and doesn't give me any chance to input the next missing slot.

EDIT Adding a screenshot of the intent:

enter image description here

I've used the Try it now area on the right, writing:

  1. "whatever" (to trigger the intent)
  2. "1:00" (to fill the slot_a as the system prompted me to do)

The result is that slot_b was also filled with "0", and now it's asking me to fill slot_c, and I have no way to input the real slot_b.

Upvotes: 3

Views: 346

Answers (1)

Prisoner
Prisoner

Reputation: 50701

There are a couple of things in play here.

The first is that "1:00" isn't a number. What it is depends on how you want to interpret it. If this was for entity type @sys.time, you could consider it a time, for example, and it would fit into one slot.

Dialogflow seems be trying to be helpful with the slot filling, which is usually intended to fill in gaps in user entry, rather than have to prompt for them. So if it can fill values into a parameter, it does. In this case, it sees "1:00", it needs to fill in two numbers, so it does so.

How you fix this depends on what you're trying to do. If the entity type is really a time, use @sys.time or something similar. If it is a string that you need to parse, then @sys.any might be more appropriate.

If this really should be a number - what would you expect "1:00" to do? Discard the ":00" part? Ignore it completely?

In a worst case, you may need to just prompt for each of them yourself manually instead of trying to use slot filling. This gives you more flexibility in how you handle the inputs.

It isn't clear why the speech-to-text is turning a number utterance into a time unless you also have something else that is expecting a time. If this is the issue - this is the bigger problem, and something to examine.

Upvotes: 2

Related Questions