Rasa always detect a fixed text as a fixed intent

Hi, I am creating a chatbot. I want my bot to detect a fixed hashtag ‘/close’ as an intent to close the chat. How can I do that? Can I just include it in nlu.yml under intent ‘close’ like: intent: close examples: |

  • /close

I afraid that there are not enough examples for the bot to learn the intent. Please help me. Thanks!!

Hi, which behavior are you looking for?

1.
user: /close             # notice "/" at the beginning of the message
bot: Okay, I will close the chat
2.
user: close
bot: Okay, I will close the chat
--------------------------------
user: please close the chat
bot: Okay, I will close the chat
1 Like

i expect the first one.

In that case, you don’t need training examples for that intent. You can directly include the name of the intent in the domain.

After training when the user says “/close”, the intent is predicted as “close” intent with a confidence of 1.

can u tell me specifically what i need to write in the domain file? Thanks!

domain:

version: "3.x" # put your version here

intents:
  - close

responses:
  utter_close:
    - text: "Okay, I will close the chat"

Example rule (add RulePolicy in config):

rules:
- rule: Close chat when the user wants to close
  steps:
  - intent: close
  - action: utter_close
2 Likes