Custom NLU component for length of input string

I am using the Rasa NLU for intent classification and it’s working well. But I need to add another intent that depends on the length of the input string (or rather, the number of words excluding stopwords. I’m hoping use spacy) and some metadata.

I guess what I need is a custom nlu component but I couldn’t figure out how to do it. Is there an example or something for doing that which I can see to understand it?

Hi @ju-sh!

Checkout this blog.

That looks like something that will lead me to a solution. Thanks!

There’s also an experiment with custom components here. It’s super experimental but you might find some inspiration there.

1 Like

The blog post describes how to create a custom component for entity recognition. Any idea how the intent recognition part can be influenced?

Thanks for the link. It certainly gives more to go on. How do we set the intent for an input message?

Is it by using message.set() as in here?

Is the DENSE_FEATURE_NAMES used to set the intent? I couldn’t find more info on that constant.