# Error in intent classification

**URL:** <https://forum.rasa.com/t/error-in-intent-classification/26506>\
**Category:** Rasa Open Source\
**Created:** [March 24, 2020, 5:34pm UTC](https://forum.rasa.com/t/error-in-intent-classification/26506 "2020-03-24T17:34:25Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![boutaina](https://avatars.discourse-cdn.com/v4/letter/b/d07c76/32.png) [@boutaina](https://forum.rasa.com/u/boutaina)\
**Post date:** [March 24, 2020, 5:34pm UTC](https://forum.rasa.com/t/error-in-intent-classification/26506/1 "2020-03-24T17:34:26Z")

</div>

Hello , please can anyone help me , Im using Rasa for months now and I started having an issue recently , I actually built a model based on 5 different intents (with different amount of data) and the model is working fine when I use same words from data BUT as soon as I try a new sentence which normally is not in the scope , it gives me the intent ‘small\_talk’ which is one of the 5 intents with a very high confidence . That’s noot logical so can anyone tell me what should I do . Should I change the hyperparameters of change the classifier (Im using the embedding classifier) . Thank you !

---

<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:** [March 25, 2020, 10:56am UTC](https://forum.rasa.com/t/error-in-intent-classification/26506/2 "2020-03-25T10:56:15Z")

</div>

what version of Rasa Open Source and what config are you using?

---

<div class="post-metadata">

**Author:** ![boutaina](https://avatars.discourse-cdn.com/v4/letter/b/d07c76/32.png) [@boutaina](https://forum.rasa.com/u/boutaina)\
**Post date:** [April 2, 2020, 9:38am UTC](https://forum.rasa.com/t/error-in-intent-classification/26506/3 "2020-04-02T09:38:17Z")

</div>

I have the 1.8.2 version of Rasa with this config file pipeline:

- name: “WhitespaceTokenizer\_omran\_ar” case\_sensitive: false
- name: “CountVectorsFeaturizer”
- name: “EmbeddingIntentClassifier” batch\_strategy: sequence
- name: “Extracteur\_omran”

policies:

- name: EmbeddingPolicy max\_history: 5 epochs: 200 batch\_size: 50
- name: “MemoizationPolicy” max\_history: 5
- name: “FallbackPolicy” nlu\_threshold: 0.4 core\_threshold: 0.3
- name: MappingPolicy

---

<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:** [April 2, 2020, 10:12am UTC](https://forum.rasa.com/t/error-in-intent-classification/26506/4 "2020-04-02T10:12:58Z")

</div>

Given your config the behavior is very logical. `CountVectorsFeaturizer` creates vocabulary from the training data. If your input sentence consist of unseen words, it ignores them. Please take a look here [Components](https://rasa.com/docs/rasa/nlu/components/#countvectorsfeaturizer) at `Handling Out-Of-Vocabulary (OOV) words:` or try using some pretrained embeddings in addition: [Choosing a Pipeline](https://rasa.com/docs/rasa/nlu/choosing-a-pipeline/#a-longer-answer)

---

<div class="post-metadata">

**Author:** ![boutaina](https://avatars.discourse-cdn.com/v4/letter/b/d07c76/32.png) [@boutaina](https://forum.rasa.com/u/boutaina)\
**Post date:** [April 2, 2020, 12:38pm UTC](https://forum.rasa.com/t/error-in-intent-classification/26506/5 "2020-04-02T12:38:20Z")

</div>

Im sorry but I just read the article about handling oov and I still don’t get it , I tried this solution where I added the word oov in the data of a new intent ‘outofcontext’ and added this line - name: “intent\_featurizer\_count\_vectors” OOV\_token: oov as I saw in a post . Did I do something wrong or is the solution not complete cause I dont really get the other solution about pretrained embeddings

---

<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:** [April 2, 2020, 12:45pm UTC](https://forum.rasa.com/t/error-in-intent-classification/26506/6 "2020-04-02T12:45:35Z")

</div>

sounds correct, I would add a couple of examples with different amount of `oov` words

---

<div class="post-metadata">

**Author:** ![boutaina](https://avatars.discourse-cdn.com/v4/letter/b/d07c76/32.png) [@boutaina](https://forum.rasa.com/u/boutaina)\
**Post date:** [April 3, 2020, 12:59pm UTC](https://forum.rasa.com/t/error-in-intent-classification/26506/7 "2020-04-03T12:59:41Z")

</div>

I still have the same error actually ,I actually added the oov words in the data I’ll show u some I think there is something wrong cause it’s still not working a lot of insignificant sentences get associated to other intents even if I added the ‘outofcontext’ intent that contains data {“text”: “peux tu oov”, “intent”: “outofcontext”,} , {“text”: “oov oov”,“intent”: “outofcontext”, } can you please give any kind of advice to make it right please ?

---

<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:** [April 3, 2020, 1:31pm UTC](https://forum.rasa.com/t/error-in-intent-classification/26506/8 "2020-04-03T13:31:23Z")

</div>

did adding `oov` improve the situation?

---

<div class="post-metadata">

**Author:** ![boutaina](https://avatars.discourse-cdn.com/v4/letter/b/d07c76/32.png) [@boutaina](https://forum.rasa.com/u/boutaina)\
**Post date:** [April 6, 2020, 1:20pm UTC](https://forum.rasa.com/t/error-in-intent-classification/26506/9 "2020-04-06T13:20:24Z")

</div>

No it didn’t , it’s still associating new phrases to other intents is there any other solution or is it not working because I didn’t put much data in the ooc intent ?

---

<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:** [April 6, 2020, 9:33pm UTC](https://forum.rasa.com/t/error-in-intent-classification/26506/10 "2020-04-06T21:33:53Z")

</div>

I understand it didn’t solve the problem, but do you see any improvements?

---

<div class="post-metadata">

**Author:** ![boutaina](https://avatars.discourse-cdn.com/v4/letter/b/d07c76/32.png) [@boutaina](https://forum.rasa.com/u/boutaina)\
**Post date:** [April 7, 2020, 4:29pm UTC](https://forum.rasa.com/t/error-in-intent-classification/26506/11 "2020-04-07T16:29:09Z")

</div>

No improvements , I added more data and still no improvement
