# Trained model is very inconsistent

**URL:** <https://forum.rasa.com/t/trained-model-is-very-inconsistent/28893>\
**Category:** Rasa Open Source\
**Created:** [May 15, 2020, 12:36pm UTC](https://forum.rasa.com/t/trained-model-is-very-inconsistent/28893 "2020-05-15T12:36:24Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![SriSatyaLokesh](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/srisatyalokesh/32/9666_2.png) [@SriSatyaLokesh](https://forum.rasa.com/u/SriSatyaLokesh)\
**Post date:** [May 15, 2020, 12:36pm UTC](https://forum.rasa.com/t/trained-model-is-very-inconsistent/28893/1 "2020-05-15T12:36:24Z")

</div>

Every time i train my model my chatbot is giving different replys. some times i tried forcing the model train using `--force` and results are exceptionally good. I’m not sure why this is happening. But sometimes it is failing to extract intents and entities which were extracted correctly in previous model. Here is our `config.yml`

```auto
language: en
pipeline:
  - name: "lib.sana_custom_components.SanaSpellCheckerEN"
  - name: "lib.sana_custom_components.SanaTrueCaseConvertor"
  - name: SpacyNLP
  - name: SpacyTokenizer
  - 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

# Configuration for Rasa Core.
# https://rasa.com/docs/rasa/core/policies/
policies:
  - name: MemoizationPolicy
  - name: MappingPolicy
  - name: TEDPolicy
    max_history: 5
    epochs: 100
  - name: FormPolicy
  - name: TwoStageFallbackPolicy
    nlu_threshold: 0.3
    core_threshold: 0.3
    fallback_core_action_name: "action_default_fallback"
    fallback_nlu_action_name: "action_default_fallback"
    deny_suggestion_intent_name: "out_of_scope"

```

---

<div class="post-metadata">

**Author:** ![stephens](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/stephens/32/1632_2.png) [@stephens](https://forum.rasa.com/u/stephens)\
**Post date:** [May 18, 2020, 9:40pm UTC](https://forum.rasa.com/t/trained-model-is-very-inconsistent/28893/2 "2020-05-18T21:40:58Z")

</div>

Welcome Satya,

What version of Rasa are you using?

---

<div class="post-metadata">

**Author:** ![SriSatyaLokesh](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/srisatyalokesh/32/9666_2.png) [@SriSatyaLokesh](https://forum.rasa.com/u/SriSatyaLokesh)\
**Post date:** [May 19, 2020, 7:21am UTC](https://forum.rasa.com/t/trained-model-is-very-inconsistent/28893/3 "2020-05-19T07:21:35Z")

</div>

```auto
rasa==1.9.6
rasa-sdk==1.9.0

```

---

<div class="post-metadata">

**Author:** ![akelad](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/akelad/32/69_2.png) [@akelad](https://forum.rasa.com/u/akelad)\
**Post date:** [May 19, 2020, 8:57am UTC](https://forum.rasa.com/t/trained-model-is-very-inconsistent/28893/4 "2020-05-19T08:57:35Z")

</div>

Hi @SriSatyaLokesh to get reproducible training results, you should set a `random_seed` for some of the NLU components and policies. So your config would look like this:

```auto
language: en
pipeline:
  - name: "lib.sana_custom_components.SanaSpellCheckerEN"
  - name: "lib.sana_custom_components.SanaTrueCaseConvertor"
  - name: SpacyNLP
  - name: SpacyTokenizer
  - name: RegexFeaturizer
  - name: LexicalSyntacticFeaturizer
  - name: CountVectorsFeaturizer
  - name: CountVectorsFeaturizer
    analyzer: "char_wb"
    min_ngram: 1
    max_ngram: 4
  - name: DIETClassifier
    epochs: 100
    random_seed: 42
  - name: EntitySynonymMapper
  - name: ResponseSelector
    random_seed: 42
    epochs: 100

policies:
  - name: MemoizationPolicy
  - name: MappingPolicy
  - name: TEDPolicy
    random_seed: 42
    max_history: 5
    epochs: 100
  - name: FormPolicy
  - name: TwoStageFallbackPolicy
    nlu_threshold: 0.3
    core_threshold: 0.3
    fallback_core_action_name: "action_default_fallback"
    fallback_nlu_action_name: "action_default_fallback"
    deny_suggestion_intent_name: "out_of_scope"

```

Please be aware that if you have drastically inconsistent results though, that may be an indicator that your training data needs some improvements. So it may be worth investing some time into adding more examples to your NLU data
