Rasa Version : 3.6.4 Minimum Compatible Version: 3.5.0 Rasa SDK Version : 3.6.1 Python Version : 3.10.10 Operating system: Windows 11
I am trying to build a math chatbot using Rasa. Here is my stories file…
version: "3.1"
stories:
- story: Add Numbers path B
steps:
- intent: addition_B
- action: utter_ask_operand1
- intent: inform_number1
entities:
- operand_B1: '5'
- action: utter_ask_operand2
- intent: inform_number2
entities:
- operand_B2: '4'
- action: action_get_info
- action: action_perform_addition_B
- story: Subtaction path B
steps:
- intent: subtraction_B
- action: utter_ask_operand1
- intent: inform_number1
- action: utter_ask_operand2
- intent: inform_number2
- action: action_get_info
- action: action_perform_subtraction_B
- story: Add Numbers path A
steps:
- intent: addition_A
entities:
- operand_A1: '4'
- operand_A2: '5'
- action: action_get_info
- action: action_perform_addition_A
- story: Subtraction path A
steps:
- intent: subtraction_A
entities:
- operand_A1: '8'
- operand_A2: '3'
- action: action_get_info
- action: action_perform_subtraction_A
…and here is my nlu file
version: "3.1"
nlu:
- intent: addition_A
examples: |
- [4](operand_A1) and [5](operand_A2)
- [2](operand_A1) plus [3](operand_A2)
- [2](operand_A1) ಮತ್ತು [4](operand_A2) ಅನ್ನು ಕೂಡಿಸು
- [4](operand_A1) ಕೂಡಿಸು [5](operand_A2)
- [4](operand_A1) plus [4](operand_A2)
- [1](operand_A1) plus [2](operand_A2)
- intent: addition_B
examples: |
- I want to add two numbers
- I want to do addition
- addition
- add
- let me add
- intent: subtraction_A
examples: |
- [4](operand_A1) minus [5](operand_A2)
- [2](operand_A1) subtract [3](operand_A2)
- [2](operand_A1) ಮತ್ತು [4](operand_A2) ಅನ್ನು ಕಳೆ
- [4](operand_A1) ಕಳೆ [5](operand_A2)
- [8](operand_A1) ಇಂದ [4](operand_A2) ಅನ್ನು ಕಳೆ
- [8](operand_A1) ಕಳೆ [4](operand_A2)
- [4](operand_A1) minus [4](operand_A2)
- Subtract [3](operand_A2) from [7](opernd_A2)
- Subtract [1](operand_A2) from [5](opernd_A2)
- intent: subtraction_B
examples: |
- I want to subtract two numbers
- I want to do subtraction
- subtraction
- subtract
- let me subtract
- intent: inform_number1
examples: |
- the first number is [5](operand_B1)
- the first number is [8](operand_B1)
- first is [5](operand_B1)
- [1](operand_B1)
- [2](operand_B1)
- [3](operand_B1)
- [4](operand_B1)
- [5](operand_B1)
- intent: inform_number2
examples: |
- the second number is [4](operand_B2)
- the second number is [6](operand_B2)
- second is [1](operand_B2)
- [6](operand_B2)
- [7](operand_B2)
- [8](operand_B2)
- [9](operand_B2)
Here is my domain file…
version: '3.1'
config:
store_entities_as_slots: true
intents:
- addition_A:
use_entities: true
- addition_B:
use_entities: true
- goodbye:
use_entities: []
- greet
- help:
use_entities: []
- inform_number1
- inform_number2
- query
- subtraction_A:
use_entities: true
- subtraction_B:
use_entities: true
- thanks:
use_entities: []
entities:
- operand_A1
- operand_A2
- operand_B1
- operand_B2
slots:
operand_A1:
type: float
mappings:
- type: from_entity
entity: operand_A1
operand_A2:
type: float
mappings:
- type: from_entity
entity: operand_A2
operand_B1:
type: float
mappings:
- type: from_entity
entity: operand_B1
intent: inform_number1
operand_B2:
type: float
mappings:
- type: from_entity
entity: operand_B2
intent: inform_number2
responses:
utter_greet:
- text: ಹಲೋ! ಸಹಾಯ ಬಾಟ್ ಗೆ ಸ್ವಾಗತ.
utter_goodbye:
- text: ಬೈ ಬೈ! ಸಹಾಯ ಬಾಟ್ ಯು ಹ್ಯಾಪ್ಪಿಯಾಗಿ ಬಳಸಿದ್ದರೆ ನನಗೆ ಖುಷಿಯಾಗುತ್ತದೆ.
utter_thanks:
- text: ಸಹಾಯ ಮಾಡಿದವರಿಗೆ ಧನ್ಯವಾದಗಳು.
utter_help:
- text: ನಿಮ್ಮ ಸಮಸ್ಯೆಯನ್ನು ಬಣ್ಣಿಸಿ, ನಾನು ನಿಮಗೆ ಸಹಾಯ ಮಾಡುತ್ತೇನೆ.
utter_query:
- text: ನೀವು ಏನು ಪ್ರಶ್ನೆ ಕೇಳುತ್ತಿದ್ದೀರಿ?
utter_ask_operand1:
- text: ಮೊದಲ ಸಂಖ್ಯೆ ಏನು
utter_ask_operand2:
- text: ಎರಡನೆಯದು ಸಂಖ್ಯೆ ಏನು
actions:
- utter_ask_operand1
- utter_greet
- utter_ask_operation
- utter_ask_operand2
- action_get_info
- action_perform_addition_A
- action_perform_subtraction_A
- action_perform_addition_B
- action_perform_subtraction_B
- utter_did_that_help
- utter_thank
- utter_goodbye
- utter_iamabot
session_config:
session_expiration_time: 60
carry_over_slots_to_new_session: false
Don’t mind the words other than english. I want to make it in my regional language.
The Add Numbers path A
story is for when the user gives input such as 3 plus 4
, whereas the Add Numbers path B
is where the user tells what operation they want to do and then give the operands one by one.
The Add Numbers path A
story is working fine and the intents are being recognised correctly and it is working as intended. But the story Add Numbers path B
isn’t working properly.
I tried using the bot in interactive mode and saw that the intent inform_number1
was correctly recognised and the slot was filled. but when I give the second number, the bot is recognising it as inform_number1
intent instead of inform_number2
.
Please help me in fixing this issue.
The pipeline and policies i am using are default.
I am fairly new to rasa. So please help me out.
Thanks