Something new!

Hi @community ,

My question is completely out of the RASA scope but i would really appreciate the help from community to solve this. My questions are as follows

  • What is [abcd] on [xyz]?
  • what is [abcd]?

Here [abcd] is a must entity but [xyz] is optional

  • what is [xyz] on [abcd] ?
  • what is [xyz]?

Here [xyz] is a must entity but [abcd] is optional

All these questions are mapped to a single entity define_term to reduce miss-classification but answer to above pair of questions are different

So if i get a question like

Bot i would like to know about [abcd] on [xyz]?

NLU would return both [abcd , xyz] but how can we a differentiate which one is mandatory and which is optional.

As a human i can understand here abcd is must and xyz is optional but from an ML point of view how can i solve this ??

Any suggestions would be really appreciated

I’m not sure i understand your problem completely but regarding your examples, isn’t the first entity always the mandatory one ? It doesn’t matter if it’s abcd or xyz right ? As long as it’s at the first position in the question: ‘What is [first] on [second]’ and your bot recognize those correctly, then we know which one is mandatory and which one is not. Sorry if i didn’t understand your question correctly.

Well that is correct for most of the time Just take this example

  • Tell me about the V8 engine for Lamborghini ?
  • Tell me about Lamborghini with V8 engine ?

-> Answer to first question will be on V8 Engine

-> Answer to second question will be on Lamborghini cars?

I hope this is clear

May be you can use regx here [abcd] anything[xyz]. May be.

I see, because it’s from one intent (i assume) so that makes it hard to decide which subject it should response with. If you have a list of specific cars and engines, then i think you can extract the first entity, check to see if it’s a car or an engine, then answer correspondingly. Although that doesn’t seem very smart, i admit.

Although a great idea it is a bit hard coded right?

What i was think about is using something like POS tagger or Parsing tree to identify such patterns to find mandatory and optional entities in a query

I guess @Rasa should need to come up with a multi entity mapping for each entity like

  • Tell me about the [V8](engine_type + mandatory) engine for [Lamborghini](car + optional) ?
  • Tell me about [Lamborghini](car + mandatory) with [V8](engine_type + optional) engine ?

I don’t know if it is possible but would be a good feature i guess

Regex requires a bit more custom coding but will try that option for sure.

Well, i don’t think the problem is about knowing the entity is mandatory or not. We already know the first entity is always the mandatory. The problem is we need to check which type of mandatory entity it is (car or engine) in order to response correctly. So the bot only need to know that the entity is car or engine and that’s good enough. I guess this is more of a logic problem than nlp problem. Or can you train it to recognize both of them regardless of the position ? Although that will be hard, i think.

EDIT: Nevermind, i understand your idea now. I was completely off, sorry about that haha :smile:

First of all sorry for the late response.

Finally someone understand what i was trying to convenience :sweat_smile:.Anyway i have used some custom logic to solve my issue.

Thank you @fuih for your help :slight_smile:

1 Like