# Slot filling without evaluating intent

**URL:** <https://forum.rasa.com/t/slot-filling-without-evaluating-intent/2280>\
**Category:** Rasa Open Source\
**Created:** [October 29, 2018, 3:12pm UTC](https://forum.rasa.com/t/slot-filling-without-evaluating-intent/2280 "2018-10-29T15:12:44Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![tbx](https://avatars.discourse-cdn.com/v4/letter/t/6a8cbe/32.png) [@tbx](https://forum.rasa.com/u/tbx)\
**Post date:** [October 29, 2018, 3:12pm UTC](https://forum.rasa.com/t/slot-filling-without-evaluating-intent/2280/1 "2018-10-29T15:12:44Z")

</div>

Hello everybody,

Is there any way to fill a slot directly by listening the next user input ? I tried to use a FormAction but the result is not the expected one.

Maybe it’s better with an example. Let’s take the example from the Rasa docs : Weather bot.

I want to extract the intent _ask\_weather_ and the entity _city_.

Now let’s get two potential user inputs :

- The user precised the location (Example : _What’s the weather in San Francisco ?_ → Intent = ask\_weather / “city” = San Francisco)
- The user didn’t precised the location (Example : _What’s the weather ?_ Intent = ask\_weather)

The first line can be tranlated to the following story :

> ```
> * ask_weather{"location": "San Francisco"}
> - action_give_weather
> 
> ```

For the second line, I want my bot to ask _For which city do you want to know the weather ?_.

Directly after that, I want the bot to listen the answer and that the next user utterance is directly interpreted as the expected answer and stored in the _city_ slot.

In terms of dialog, the result would be as follows :

1. [user] What’s the weather ?
2. [bot] For which city do you want to know the weather ?
3. [user] San Diego _# Slot filling here_
4. [bot] Here is the weather for San Diego : … _# Result from “action\_give\_weather”_

If I’m using a FormAction, I’m forced to detect an “inform” intent, which will potentially be misinterpreted, as follows :

> ```
> * ask_weather
> - utter_ask_location
> - weather_form
> - slot{"requested_slot": "location"}
> * inform{"location": "San Diego"}
> - slot{"location": "San Diego"}
> - action_give_weather
> 
> ```

When scenarios like that are multiplying in the stories, the second intent (_inform_ in the example above) is frequently misinterpreted (because this kind of intents are often composed of a single word).

Thanks in advance for your help 🙂

---

<div class="post-metadata">

**Author:** ![rohitharitash](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/rohitharitash/32/844_2.png) [@rohitharitash](https://forum.rasa.com/u/rohitharitash)\
**Post date:** [November 6, 2018, 11:34am UTC](https://forum.rasa.com/t/slot-filling-without-evaluating-intent/2280/2 "2018-11-06T11:34:05Z")

</div>

HI @ [souvikg10](http://forum.rasa.com/u/souvikg10)

Can you please give your thoughts.

Thanks and Regards Rohit Haritash

---

<div class="post-metadata">

**Author:** ![znat](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/znat/32/553_2.png) [@znat](https://forum.rasa.com/u/znat)\
**Post date:** [November 6, 2018, 2:27pm UTC](https://forum.rasa.com/t/slot-filling-without-evaluating-intent/2280/3 "2018-11-06T14:27:32Z")

</div>

That’s a very common problem and the easiest way I know to deal with it is the [addons](https://github.com/mrbot-ai/rasa-addons). (full disclosure: I am the maintainer) The idea is that for intents that are hard to pick up (usually made of proper nouns) you can tell Core that any user input after a certain action/utterance should be understood as `inform` See the intent substitution in the docs

Another way if you want to avoid an external package is to add more examples with cities and maybe use the lookup table feature to help NLU extract the right entity. The risk with that approach which will force you to tag entire utterances with a location entity is that one/two work utterances may be picked up as location as well. But I think Core offers a mechanism to filter entities based on intents

---

<div class="post-metadata">

**Author:** ![naoko](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/naoko/32/196_2.png) [@naoko](https://forum.rasa.com/u/naoko)\
**Post date:** [January 17, 2019, 4:54pm UTC](https://forum.rasa.com/t/slot-filling-without-evaluating-intent/2280/4 "2019-01-17T16:54:28Z")

</div>

I used FormAction plus setting fallback\_threshold to negative number to solve this problem. In FormAction validation, say the intent was incorrectly detected (other than ‘inform’ intent) you can re-ask the same question again by returning empty list. if it is okay to use user’s last intent, you can just set that value to the slot to fill etc. You don’t have to set fallback\_threashold to negative as long as the intent confidence is greater than threashold (regardless of intent detected) but problem occurs when detected intent confidence is zero. That’s when you want to set fallback\_threashold to negative on dialog training. So… how user can get out of potential trap? I do 2 things. (a) train hand off human intent and if detected, go ahead get out of form and set follow up action of you need (b) bot will utter special exit method that user can type (e.g. /exit) then it ends converstaion etc.

---

<div class="post-metadata">

**Author:** ![Ghostvv](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/ghostvv/32/211_2.png) [@Ghostvv](https://forum.rasa.com/u/Ghostvv)\
**Post date:** [January 17, 2019, 5:00pm UTC](https://forum.rasa.com/t/slot-filling-without-evaluating-intent/2280/5 "2019-01-17T17:00:26Z")

</div>

> [@naoko](#):
>
> fallback\_threshold to negative number

prediction of FormPolicy overrides Fallback prediction, so there is no need to do that with the new FormAction

---

<div class="post-metadata">

**Author:** ![naoko](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/naoko/32/196_2.png) [@naoko](https://forum.rasa.com/u/naoko)\
**Post date:** [January 21, 2019, 1:42pm UTC](https://forum.rasa.com/t/slot-filling-without-evaluating-intent/2280/6 "2019-01-21T13:42:15Z")

</div>

as Ghostvvv said, the latest master (merged on Jan 17) has fix to the following issue.

# FallbackPolicy shouldn’t act on NLU confidence if the last user message was part of a form

> <https://github.com/RasaHQ/rasa/issues/2869>
>
> \*\*Rasa Core version\*\*: 0.12.3
> 
> \*\*Rasa NLU version\*\*: 0.13.8
> 
> \*\*Rasa Core SDK… version\*\*: 0.12.1
> 
> \*\*Python version\*\*: 3.6.7
> 
> \*\*Operating system\*\* (windows, osx, ...): Linux Ubuntu 18.04
> 
> \*\*Issue\*\*: Hi, over the last few weeks I have been trying to find a way to find a way to handle generic user messages. In particular, in some specific cases, I would like the system to bypass intent recognition and entity extraction on what the user says, and just go on with the conversation according to the stories. Unfortunately I did not manage that, since the fallback action is always called if no intent is recognized with enough confidence, and the conversation is broken. So far I have temporarily solved the problem by adding some NLU examples of generic user sentences, but this can't really be a solution, since too many examples would be needed, and it would also create confusion when it comes to recognize different intents. Is there a way to just let the user say whatever he likes, possibly just save his sentence in a DB by means of an action and go on with the conversation regardless of the intent and entities?
> 
> Here follows, for clarity, an example of how I would like my stories to look like:
> 
> \`\`\`markdown
> \## My story
> \> some\_checkpoint
> - utter\_question\_1
> \* generic\_user\_input
> - action\_save\_user\_response\_in\_db
> - utter\_question\_2
> \* generic\_user\_input
> - action\_save\_user\_response\_in\_db
> ...
> \`\`\`
> 
> I have looked around and found something similar in other issues, but I didn't really understand how the solution would work. 
> 
> Thank you in advance for your help, let me know if more information is needed.

So I would give it try with latest master and see?

---

<div class="post-metadata">

**Author:** ![ADPowers](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/adpowers/32/3113_2.png) [@ADPowers](https://forum.rasa.com/u/ADPowers)\
**Post date:** [May 29, 2019, 5:50am UTC](https://forum.rasa.com/t/slot-filling-without-evaluating-intent/2280/7 "2019-05-29T05:50:48Z")

</div>

Does the addons package you have recommended work for rasa 1.0.X, after they merged nlu and core?

---

<div class="post-metadata">

**Author:** ![Elssa](https://avatars.discourse-cdn.com/v4/letter/e/7ab992/32.png) [@Elssa](https://forum.rasa.com/u/Elssa)\
**Post date:** [March 23, 2021, 9:08am UTC](https://forum.rasa.com/t/slot-filling-without-evaluating-intent/2280/8 "2021-03-23T09:08:08Z")

</div>

can you share an example

---

<div class="post-metadata">

**Author:** ![Elssa](https://avatars.discourse-cdn.com/v4/letter/e/7ab992/32.png) [@Elssa](https://forum.rasa.com/u/Elssa)\
**Post date:** [March 23, 2021, 9:08am UTC](https://forum.rasa.com/t/slot-filling-without-evaluating-intent/2280/9 "2021-03-23T09:08:36Z")

</div>

can you share the code? or an example
