Is there a better way to group similar intents?

Hi there! I’m trying to get my bot to differentiate between different types of joke requests as well as perform other functions. However, even though the top recognized intent is correct, the confidence is very low.

It is worth noting that i am only using rasa NLU

Here’s my dataset for jokes:

nlu:

  • intent: jokes_general examples: |

    • jokes
    • tell me a joke
    • i want to hear something funny
    • give me some humor
  • intent: jokes_programming examples: |

    • tell me programming jokes
    • programmer humor
    • coding joke
  • intent: jokes_pun examples: |

    • tell me a pun
    • i want terrible jokes
    • puns
  • intent: jokes_dark examples: |

    • black humor
    • gallows humor
    • dark jokes
  • intent: jokes_spooky examples: |

    • spoopy jokes
    • halloween humor
  • intent: jokes_christmas examples: |

    • christmas jokes
    • holiday humor
  • intent: jokes_dad examples: |

    • dad jokes
    • dad humor
    • tell me something corny

When i parse the sentence “give dad jokes” through the model, i get this intent ranking.

is there a better way to handle this?

Not sure how much it can help for confidence, but this would be a better way to do it:

intent: jokes/general
  examples: |
  - jokes
  - tell me a joke
  - i want to hear something funny
  - give me some humor

intent: jokes/programming
  examples: |
  - tell me programming jokes
  - programmer humor
  - coding joke

intent: jokes/pun
  examples: |
  - tell me a pun
  - i want terrible jokes
  - puns
intent: jokes/dark
  examples: |
  - black humor
  - gallows humor
  - dark jokes
intent: jokes/spooky
  examples: |
  - spoopy jokes
  - halloween humor
intent: jokes/christmas
  examples: |
  - christmas jokes
  - holiday humor
intent: jokes/dad
  examples: |
  - dad jokes
  - dad humor
  - tell me something corny

Then in your rules just do:

- rule: Tell joke
  steps:
  - intent: joke
  - action: tell_joke
1 Like

I appreciate the response, but unfortunately, as I’m only using the nlu component, this does not seem to work for me, as it only detects the intent “jokes” and not the subintents. I don’t use any of the rules files :frowning:

1 Like

One way of handling this is to have a single intent as “jokes” and then use the extracted entities to perform different actions.

2 Likes

This worked surprisingly well for me, thank you so much!!!