# Customize OOV\_token in CountVectorsFeaturizer?

**URL:** <https://forum.rasa.com/t/customize-oov-token-in-countvectorsfeaturizer/19663>\
**Category:** Rasa Open Source\
**Created:** [October 11, 2019, 5:13pm UTC](https://forum.rasa.com/t/customize-oov-token-in-countvectorsfeaturizer/19663 "2019-10-11T17:13:44Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![piyush29programmer](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/piyush29programmer/32/4050_2.png) [@piyush29programmer](https://forum.rasa.com/u/piyush29programmer)\
**Post date:** [October 11, 2019, 5:13pm UTC](https://forum.rasa.com/t/customize-oov-token-in-countvectorsfeaturizer/19663/1 "2019-10-11T17:13:45Z")

</div>

Hi,

As per rasa documentation for OOV\_token

> the training is performed on limited vocabulary data, it cannot be guaranteed that during prediction an algorithm will not encounter an unknown word (a word that was not seen during training). In order to teach an algorithm on how to treat unknown words, some words in training data can be substituted by the generic word `OOV_token` . In this case, during prediction, all unknown words will be treated as this generic word `OOV_token` .

I have a similar situation where the user asked the wrong intention question(Not related to which bot is made for) for which bot recognize the trained intent.

example

Food restaurant bot. Negative scenario

```
NLU is trained for - Tell me about any nearby Indian restaurant?
Answer - The nearest Indian restaurant is at church street and 2km from your location.

User - Tell me more about any nearby Indian community centers? (this is out of scope question but have similar words.)

Bot reply - The nearest Indian restaurant is at church street and 2km from your location.

```

We try to add this question to outofscope but like this, there can be many scenarios where user can ask outofscope question which has similar intent in the trained model.

After going through OOV\_token it might be useful if i add community center in OOV\_token and as outofscope intent then if the user asks the same question then it will fall back in outofscope . But the issue is the same **how many keywords** should i add ???

Is there any option where i can add a list of words and when rasa nlu finds an untrained word then if looks in the list, if doesn’t exist then choose 2 fallback policy or didn’t pick the trained intent.???

---

<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:** [October 17, 2019, 1:36pm UTC](https://forum.rasa.com/t/customize-oov-token-in-countvectorsfeaturizer/19663/2 "2019-10-17T13:36:50Z")

</div>

@piyush29programmer you can also add sentence examples with the `oov` token directly to your training data. Then you don’t need to list keywords.

So you could have e.g. “Tell me more about any nearby Indian oov oov?”
