# How slot influence conversation

**URL:** <https://forum.rasa.com/t/how-slot-influence-conversation/37414>\
**Category:** Rasa Open Source\
**Created:** [November 25, 2020, 8:34pm UTC](https://forum.rasa.com/t/how-slot-influence-conversation/37414 "2020-11-25T20:34:03Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dani966IT](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/dani966it/32/12234_2.png) [@Dani966IT](https://forum.rasa.com/u/Dani966IT)\
**Post date:** [November 25, 2020, 8:34pm UTC](https://forum.rasa.com/t/how-slot-influence-conversation/37414/1 "2020-11-25T20:34:03Z")

</div>

Hi, i am new with Rasa, so i am sorry if i will tell stupid things. I would ask how a entity that i put in a slot can influence my stories, in particular i use RegexEntityExtractor for extract an simple code of six digits that i received from user and i would like to follow different sories depending on value of this code.

My simple example:

**nlu.yml**

`
    - regex: id_story
  examples: |
    - [\d{6}]
`
`
`- `intent: stories_selector
examples: |
`
`
` - `000001
`

**stories.yml** ``

`
`
`

story: story 000001
steps:

intent: stories_selector
slot_was_set:

id_story: 000001

action: utter_sory_000001

`- `
story: story 000002
steps:
`
`
intent: stories_selector
slot_was_set:

id_story: 000002

` - `action: utter_sory_000002
`

and of course in domain.yml i have also defined the intent, entity, slot, responses and actions.

Thank for your time.

---

<div class="post-metadata">

**Author:** ![fkoerner](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/fkoerner/32/11784_2.png) [@fkoerner](https://forum.rasa.com/u/fkoerner)\
**Post date:** [November 27, 2020, 8:24am UTC](https://forum.rasa.com/t/how-slot-influence-conversation/37414/2 "2020-11-27T08:24:15Z")

</div>

Hi @Dani966IT! Welcome to the forum 🙂

This looks like a pretty good start to me! (`nlu.yml` has some wonky formatting, but I’m guessing this happened when you pasted it here). You probably want to change the example for the intent `stories_selector` as below. The only difference is that in the example below we have labeled `[000001]` as the `id_story` slot. This allows the model to generalize to other values that follow the `id_story` pattern of six digits.

`- intent: stories_selector:`

`examples: |`

`-[000001](id_story)`

Let me know if that works for you!

---

<div class="post-metadata">

**Author:** ![Dani966IT](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/dani966it/32/12234_2.png) [@Dani966IT](https://forum.rasa.com/u/Dani966IT)\
**Post date:** [December 4, 2020, 5:21pm UTC](https://forum.rasa.com/t/how-slot-influence-conversation/37414/4 "2020-12-04T17:21:20Z")

</div>

@fkoerner i tried in this way, but he doesn’t work really well.

It set correctly slot, in all cases, but it predict correctly (with almost 70% confience) only if i send s000010 and s000002; if i send s000001 the confience is 22% and it call fallback action.

The question is, why if slot is set correctly? There is some wrong in config.yml (i use a config file found in a example).

Thanks for you patience.

`
nlu.yml

regex: id_story
examples: |

[s\d{6}] (id_story)

intent: selected_story_000001
examples: |

[s000001] (id_story)

intent: selected_story_000002
examples: |

[s000002] (id_story)

intent: selected_story_000010
examples: |

[s000010] (id_story)

stories.yml

story: story 000001
steps:

intent: selected_story_000001
slot_was_set:

id_story: s000001

action: utter_sory_000001

story: story 000002
steps:

intent: selected_story_000002
slot_was_set:

id_story: s000002

action: utter_sory_000002

story: story 000010
steps:

intent: selected_story_000010
slot_was_set:

id_story: s000010

action: utter_sory_000010

domains.yml
entities:

id_story

slots:
```
   000001_step1:

       type: bool
       initial_value: false
        influence_conversation: true

```
config.yml
pipeline:

name: WhitespaceTokenizer

name: RegexFeaturizer

name: LexicalSyntacticFeaturizer

name: CountVectorsFeaturizer

name: CountVectorsFeaturizer
analyzer: char_wb
min_ngram: 1
max_ngram: 4

name: DIETClassifier
epochs: 100

name: EntitySynonymMapper

name: ResponseSelector
epochs: 100

name: FallbackClassifier
threshold: 0.3
ambiguity_threshold: 0.1

policies:

name: MemoizationPolicy

name: TEDPolicy
max_history: 5
epochs: 100

name: RulePolicy

`

---

<div class="post-metadata">

**Author:** ![Dani966IT](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/dani966it/32/12234_2.png) [@Dani966IT](https://forum.rasa.com/u/Dani966IT)\
**Post date:** [December 4, 2020, 5:49pm UTC](https://forum.rasa.com/t/how-slot-influence-conversation/37414/5 "2020-12-04T17:49:07Z")

</div>

I think i founded a solution, one story that only set the slot, with a checkpoint at the end, and other three stories that start from checkpoint and with “slot\_was\_set” rasa could choose the right one.

I will update the post, it could be helpful for other new user like me.

---

<div class="post-metadata">

**Author:** ![fkoerner](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/fkoerner/32/11784_2.png) [@fkoerner](https://forum.rasa.com/u/fkoerner)\
**Post date:** [December 8, 2020, 8:31am UTC](https://forum.rasa.com/t/how-slot-influence-conversation/37414/6 "2020-12-08T08:31:42Z")

</div>

Hi @Dani966IT sorry for the slow response – but one other thing you can try is to use [rules](https://rasa.com/docs/rasa/rules/) instead of stories. They are slightly “stricter” than the stories, but the drawback is that they can’t generalize like stories do. However, your use case looks like rules could work: your stories are quite short 🙂
