# Intent classification poor even with exact matches

**URL:** <https://forum.rasa.com/t/intent-classification-poor-even-with-exact-matches/21131>\
**Category:** Rasa Open Source\
**Created:** [November 12, 2019, 9:54am UTC](https://forum.rasa.com/t/intent-classification-poor-even-with-exact-matches/21131 "2019-11-12T09:54:10Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![mikehuber](https://avatars.discourse-cdn.com/v4/letter/m/8edcca/32.png) [@mikehuber](https://forum.rasa.com/u/mikehuber)\
**Post date:** [November 12, 2019, 9:54am UTC](https://forum.rasa.com/t/intent-classification-poor-even-with-exact-matches/21131/1 "2019-11-12T09:54:10Z")

</div>

I am using Rasa with default configurations and default pipeline and pretrained\_embeddings\_spacy for intent classification. For one intent I defined 30 training sentences like “Give me an example”, “Can I have an example”, “One example please”, etc.

After running the pipeline and training the svm classifier the results of the intent recognition are very poor. Even when I use an exact match from the training data “Give me an example” the probability of the intent is only 0.08 and therefore below my threshold (0.2). Note that every training sentence contains the word “example” and no other intent does, so I would expect a much higher probability.

Any ideas how the intent classification can be improved?

---

<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:** [November 12, 2019, 5:36pm UTC](https://forum.rasa.com/t/intent-classification-poor-even-with-exact-matches/21131/2 "2019-11-12T17:36:49Z")

</div>

is it still the correct intent? how many intents do you have?

---

<div class="post-metadata">

**Author:** ![mikehuber](https://avatars.discourse-cdn.com/v4/letter/m/8edcca/32.png) [@mikehuber](https://forum.rasa.com/u/mikehuber)\
**Post date:** [November 12, 2019, 5:48pm UTC](https://forum.rasa.com/t/intent-classification-poor-even-with-exact-matches/21131/3 "2019-11-12T17:48:49Z")

</div>

Yes the intent is the right one but the confidence is too low. There are 12 intents.

---

<div class="post-metadata">

**Author:** ![mikehuber](https://avatars.discourse-cdn.com/v4/letter/m/8edcca/32.png) [@mikehuber](https://forum.rasa.com/u/mikehuber)\
**Post date:** [November 13, 2019, 8:05am UTC](https://forum.rasa.com/t/intent-classification-poor-even-with-exact-matches/21131/4 "2019-11-13T08:05:23Z")

</div>

Any ideas what the problem could be, or is it normal to have such a low confidence?

---

<div class="post-metadata">

**Author:** ![mikehuber](https://avatars.discourse-cdn.com/v4/letter/m/8edcca/32.png) [@mikehuber](https://forum.rasa.com/u/mikehuber)\
**Post date:** [November 13, 2019, 9:08am UTC](https://forum.rasa.com/t/intent-classification-poor-even-with-exact-matches/21131/5 "2019-11-13T09:08:29Z")

</div>

is there by default any stopword removal in spacy?

---

<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:** [November 14, 2019, 12:45pm UTC](https://forum.rasa.com/t/intent-classification-poor-even-with-exact-matches/21131/6 "2019-11-14T12:45:24Z")

</div>

this is confidence of svm classifier. It could be low due to the lack of training data

---

<div class="post-metadata">

**Author:** ![jonathanpwheat](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/jonathanpwheat/32/4880_2.png) [@jonathanpwheat](https://forum.rasa.com/u/jonathanpwheat)\
**Post date:** [November 15, 2019, 5:37pm UTC](https://forum.rasa.com/t/intent-classification-poor-even-with-exact-matches/21131/7 "2019-11-15T17:37:23Z")

</div>

As a test, what if you change your pipeline to `supervised_embeddings` and retrain? Do you get better responses?

---

<div class="post-metadata">

**Author:** ![mikehuber](https://avatars.discourse-cdn.com/v4/letter/m/8edcca/32.png) [@mikehuber](https://forum.rasa.com/u/mikehuber)\
**Post date:** [November 16, 2019, 7:34am UTC](https://forum.rasa.com/t/intent-classification-poor-even-with-exact-matches/21131/8 "2019-11-16T07:34:05Z")

</div>

The confidence was a bit better with supervised\_embeddings, but not much. How easy is it to include stopwords or tf idf weighting on the word vectors? And can I output the word vectors of my sentences for debugging?

---

<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:** [November 18, 2019, 11:07am UTC](https://forum.rasa.com/t/intent-classification-poor-even-with-exact-matches/21131/9 "2019-11-18T11:07:55Z")

</div>

you need to hack into spacyfeaturizer, to see the word vectors. For stop words removal, if you use spacy pipeline, you 'd need to write a custom component

---

<div class="post-metadata">

**Author:** ![rashmi.metri](https://avatars.discourse-cdn.com/v4/letter/r/f9ae1b/32.png) [@rashmi.metri](https://forum.rasa.com/u/rashmi.metri)\
**Post date:** [June 5, 2020, 7:36pm UTC](https://forum.rasa.com/t/intent-classification-poor-even-with-exact-matches/21131/10 "2020-06-05T19:36:13Z")

</div>

Hey how did you achieve this finally ?
