# Empty String for Intent Classification

**URL:** <https://forum.rasa.com/t/empty-string-for-intent-classification/36602>\
**Category:** Rasa Open Source\
**Created:** [November 4, 2020, 12:56am UTC](https://forum.rasa.com/t/empty-string-for-intent-classification/36602 "2020-11-04T00:56:51Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![kmegalokonomos](https://avatars.discourse-cdn.com/v4/letter/k/f14d63/32.png) [@kmegalokonomos](https://forum.rasa.com/u/kmegalokonomos)\
**Post date:** [November 4, 2020, 12:56am UTC](https://forum.rasa.com/t/empty-string-for-intent-classification/36602/1 "2020-11-04T00:56:51Z")

</div>

Hello everyone. Suppose we have an empty string for classification how is this supposedly being handled and what confidence/intent would be returned, if we are using a CountVectorFeaturizer?

Possible examples could be the following:

- A user writes a single word that happens to be a stop word
- A user writes an out of vocabulary word and the setting for out of vocabulary words is to ignore them

Currently in my setup all such cases go to the same intent and actually with a pretty good confidence (around 0.80). Is this expected? And how would I care for such cases?

Thank u in advance for your help

---

<div class="post-metadata">

**Author:** ![kmegalokonomos](https://avatars.discourse-cdn.com/v4/letter/k/f14d63/32.png) [@kmegalokonomos](https://forum.rasa.com/u/kmegalokonomos)\
**Post date:** [November 4, 2020, 8:31am UTC](https://forum.rasa.com/t/empty-string-for-intent-classification/36602/2 "2020-11-04T08:31:43Z")

</div>

Good morning, I noticed in the documentation the following:

“If during prediction time a message contains **only** words unseen during training and no Out-Of-Vocabulary preprocessor was used, an empty intent `None` is predicted with confidence `0.0` .”

This is actually what I wanted. But this is not what is happening! It actually predicts a random intent with a pretty high confidence so I cant even use fallback. Any thoughts on whats happening?

---

<div class="post-metadata">

**Author:** ![dakshvar22](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/dakshvar22/32/3993_2.png) [@dakshvar22](https://forum.rasa.com/u/dakshvar22)\
**Post date:** [November 6, 2020, 9:02am UTC](https://forum.rasa.com/t/empty-string-for-intent-classification/36602/3 "2020-11-06T09:02:00Z")

</div>

Hi @kmegalokonomos, can you please share your pipeline configuration here?

---

<div class="post-metadata">

**Author:** ![kmegalokonomos](https://avatars.discourse-cdn.com/v4/letter/k/f14d63/32.png) [@kmegalokonomos](https://forum.rasa.com/u/kmegalokonomos)\
**Post date:** [November 7, 2020, 8:05am UTC](https://forum.rasa.com/t/empty-string-for-intent-classification/36602/4 "2020-11-07T08:05:33Z")

</div>

Hello @dakshvar22,

This is one of the pipelines, but to tell you the truth I have tried all sort of variations to try and identify where the problem is:

pipeline:

- name: SpacyNLP model: el\_core\_news\_lg case\_sensitive: false
- name: SpacyTokenizer token\_pattern: (?u)\b\w+\b
- name: LexicalSyntacticFeaturizer token\_pattern: (?u)\b\w+\b
- name: CountVectorsFeaturizer
- name: CountVectorsFeaturizer analyzer: char\_wb min\_ngram: 5 max\_ngram: 8
- name: DIETClassifier epochs: 100
- name: EntitySynonymMapper
- name: ResponseSelector retrieval\_intent: faq epochs: 100
- name: ResponseSelector retrieval\_intent: chitchat epochs: 100
- name: FallbackClassifier threshold: 0.4 ambiguity\_threshold: 0.1

All the best, Konstantinos

---

<div class="post-metadata">

**Author:** ![Yasmine](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/yasmine/32/12868_2.png) [@Yasmine](https://forum.rasa.com/u/Yasmine)\
**Post date:** [February 2, 2021, 2:33pm UTC](https://forum.rasa.com/t/empty-string-for-intent-classification/36602/5 "2021-02-02T14:33:19Z")

</div>

Hey Konstantinos,

I’m running into the same issue, did you find out the problem?

In my case, I have two retrieval intents (faq and chitchat) like you, and when I provide a random input even with arabic letters Rasa NLU returns a very good confidence (eg: 0.99…) which is incorrect because I don’t have an intent with arabic letters.

Thanks!

---

<div class="post-metadata">

**Author:** ![kmegalokonomos](https://avatars.discourse-cdn.com/v4/letter/k/f14d63/32.png) [@kmegalokonomos](https://forum.rasa.com/u/kmegalokonomos)\
**Post date:** [February 3, 2021, 2:06pm UTC](https://forum.rasa.com/t/empty-string-for-intent-classification/36602/6 "2021-02-03T14:06:34Z")

</div>

Hello Yasmin, no unfortunately I didn’t find out why this was happening. It still is happening. However I created an out\_of\_scope intent and entered an out of vocabulary token “OOV” that now classifies this stuff under the new intent.

All the best, Konstantinos

---

<div class="post-metadata">

**Author:** ![Yasmine](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/yasmine/32/12868_2.png) [@Yasmine](https://forum.rasa.com/u/Yasmine)\
**Post date:** [February 3, 2021, 6:07pm UTC](https://forum.rasa.com/t/empty-string-for-intent-classification/36602/7 "2021-02-03T18:07:19Z")

</div>

Hey Konstantinos,

Thank you for your reply.

Maybe some hyperparameters tuning could be a good solution. Also, I found this post which could be helpful: [NLU classifies unseen utterances to a random intent with too high confidence](http://forum.rasa.com/t/nlu-classifies-unseen-utterances-to-a-random-intent-with-too-high-confidence/30920/2)

---

<div class="post-metadata">

**Author:** ![kmegalokonomos](https://avatars.discourse-cdn.com/v4/letter/k/f14d63/32.png) [@kmegalokonomos](https://forum.rasa.com/u/kmegalokonomos)\
**Post date:** [February 4, 2021, 8:42pm UTC](https://forum.rasa.com/t/empty-string-for-intent-classification/36602/8 "2021-02-04T20:42:13Z")

</div>

Yep, saw this as well, interesting!
