For example, let us observe the state just for the slot "food" in a short dialogue.
Note 1: This is slightly refined/improved from what you've seen in the video. I've removed any dealings with bad ASR since you'll be working with textual inputs.
Note 2: If you built the NLU based on HW4 descriptions, you'll have null
as a value for "not mentioned" in there. This maps to None
in this example.
However, instead of "not mentioned in the current turn", a None
inside
the belief state means the probability for the given slot "not mentioned ever".
The belief state for food looks like this before the dialogue starts:
food: {None: 1.0}
Note that this is just for your imagination and for consistent rule application. If you want to, you can start your implementation straight from Turn 1.
Let's assume that the system poses a starting question and the user replies:
Sys: Hi, how can I help?
Usr: I want Chines
You can see that the user made a typo. The NLU isn't very confident about that, so you can get e.g. this probability distribution:
NLU: food=None: 0.8, food=Chinese: 0.2
The state, given our update rule, is now simple -- all the probability was under None, so we can redistribute it according to the current values:
food: {None: 0.8, Chinese: 0.2}
The probability for Chinese is too low, so the system doesn't understand and the user needs to confirm in the 2nd state:
Sys: I'm sorry I didn't understand
Usr: Iwant Chinese
Now the NLU is more confident. Since the user has made another typo, it's not completely sure. Let's assume we get this probability distribution from our NLU system:
NLU: food=Chinese: 0.7, food=Italian: 0.2, food=None: 0.1
Now we have a 0.1 probability that food wasn't mentioned in this turn, so we take that amount to redistribute the previous probability. We add the non-null values from this turn, with their new probabilities. So this is how the computation looks like:
food: 0.1 x previous = {None: 0.08, Chinese: 0.02}
+ new: {Chinese: 0.7, Italian: 0.2}
And this is the resulting state:
food: {None: 0.08, Chinese: 0.72, Italian: 0.2}