# An operating question for Rasa's KerasPolicy

**URL:** <https://forum.rasa.com/t/an-operating-question-for-rasas-keraspolicy/14851>\
**Category:** Rasa Open Source\
**Created:** [August 27, 2019, 6:45am UTC](https://forum.rasa.com/t/an-operating-question-for-rasas-keraspolicy/14851 "2019-08-27T06:45:34Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![cstsai](https://avatars.discourse-cdn.com/v4/letter/c/7993a0/32.png) [@cstsai](https://forum.rasa.com/u/cstsai)\
**Post date:** [August 27, 2019, 6:45am UTC](https://forum.rasa.com/t/an-operating-question-for-rasas-keraspolicy/14851/1 "2019-08-27T06:45:34Z")

</div>

Hi, there! In the Rasa’s website, it tells us as follows: " The `KerasPolicy` uses a neural network implemented in Keras to select the next action. The default architecture is based on an LSTM…" (please refer to the website: [Policies](https://rasa.com/docs/rasa/core/policies/#keras-policy))

Actually, this KerasPolicy is filled in a file “config.yml” which is introduced in NLU-training stage (not in dialog management stage or we say Rasa-Core stage). But, the stories dataset are trained in Rasa-Core stage. My problem is: How does this KerasPolicy be explained in predicting(or select) the next action of stories? (because these two models in NLU and dialog-management stages are seems independent.) It seems that stories are dependent on NLU-stage again(this is a little confuse for me!). thanks a lot.

---

<div class="post-metadata">

**Author:** ![Cekir](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/cekir/32/8115_2.png) [@Cekir](https://forum.rasa.com/u/Cekir)\
**Post date:** [September 17, 2020, 5:23pm UTC](https://forum.rasa.com/t/an-operating-question-for-rasas-keraspolicy/14851/2 "2020-09-17T17:23:54Z")

</div>

Actually, The policy is run both during training and during action prediction. During training, The neural network is trained with the provided stories, and during prediction the neural network transforms the vector of features (intents, slots and previous actions) into the vector of probabilities for each action. Then, the highest probability is chosen.
