Closed samscudder closed 4 years ago
the problem might be a mismatch between your stories and button payloads. In your stories you have
## show_profile_vip
* show_profile
- slot{"profile" : "vip"}
- utter_slot_vip
but your button payloads look lik /show_profile{"profile": "vip"}
. I see you have the slots there in the stories, but in your button payload you are setting the slot via an entity (entities are also used to predict the next action).
can you try changing your domain to:
intents:
- show_profile:
use_entities: []
see https://rasa.com/docs/rasa/core/domains/#ignoring-entities-for-certain-intents
Learned something new there, but.... this throws an error when I try and train it:
properties.setdefault("use_entities", True)
AttributeError: 'NoneType' object has no attribute 'setdefault'
domain.py line 211 in 1.4.6 and line 256 in 1.6.0
I also tried
ignore_entities:
- profile
With the same result. I also tried setting an initial_value.
@samscudder can you post the full traceback for the 'NoneType' object has no attribute 'setdefault'
error? also can you post the yaml for how you defined the intent itself? looks like you may not have put the ignore_entities
under the show_profile
intent?
Here's what happens when I add use_entities: []
to the intent in domain.yml
$ rasa train --force
Traceback (most recent call last):
File "/home/user/anaconda3/envs/ChatAna/bin/rasa", line 8, in <module>
sys.exit(main())
File "/home/user/anaconda3/envs/ChatAna/lib/python3.6/site-packages/rasa/__main__.py", line 76, in main
cmdline_arguments.func(cmdline_arguments)
File "/home/user/anaconda3/envs/ChatAna/lib/python3.6/site-packages/rasa/cli/train.py", line 76, in train
kwargs=extract_additional_arguments(args),
File "/home/user/anaconda3/envs/ChatAna/lib/python3.6/site-packages/rasa/train.py", line 45, in train
kwargs=kwargs,
File "uvloop/loop.pyx", line 1456, in uvloop.loop.Loop.run_until_complete
File "/home/user/anaconda3/envs/ChatAna/lib/python3.6/site-packages/rasa/train.py", line 83, in train_async
domain = await file_importer.get_domain()
File "/home/user/anaconda3/envs/ChatAna/lib/python3.6/site-packages/rasa/importers/importer.py", line 242, in get_domain
domains = await asyncio.gather(*domains)
File "/home/user/anaconda3/envs/ChatAna/lib/python3.6/site-packages/rasa/importers/rasa.py", line 65, in get_domain
domain = Domain.load(self._domain_path)
File "/home/user/anaconda3/envs/ChatAna/lib/python3.6/site-packages/rasa/core/domain.py", line 70, in load
other = cls.from_path(path)
File "/home/user/anaconda3/envs/ChatAna/lib/python3.6/site-packages/rasa/core/domain.py", line 80, in from_path
domain = cls.from_file(path)
File "/home/user/anaconda3/envs/ChatAna/lib/python3.6/site-packages/rasa/core/domain.py", line 93, in from_file
return cls.from_yaml(rasa.utils.io.read_file(path))
File "/home/user/anaconda3/envs/ChatAna/lib/python3.6/site-packages/rasa/core/domain.py", line 103, in from_yaml
return cls.from_dict(data)
File "/home/user/anaconda3/envs/ChatAna/lib/python3.6/site-packages/rasa/core/domain.py", line 119, in from_dict
**additional_arguments,
File "/home/user/anaconda3/envs/ChatAna/lib/python3.6/site-packages/rasa/core/domain.py", line 282, in __init__
self.intent_properties = self.collect_intent_properties(intents)
File "/home/user/anaconda3/envs/ChatAna/lib/python3.6/site-packages/rasa/core/domain.py", line 211, in collect_intent_properties
properties.setdefault("use_entities", True)
AttributeError: 'NoneType' object has no attribute 'setdefault'
Here's what happens when I add use_entities: [] to the intent in domain.yml
Can you post the whole relevant section please
It's what @amn41 suggested... Adding use_entities: [] to the intent definition in domain.yml.
intents:
- greet
- goodbye
- affirm
- deny
- mood_great
- mood_unhappy
- bot_challenge
- define_slots
- show_profile:
use_entitites: []
actions:
- utter_greet
- utter_cheer_up
- utter_did_that_help
- utter_happy
- utter_goodbye
- utter_iamabot
- utter_default
- utter_slot_vip
- utter_slot_standard
- utter_slot_anonimous
- utter_slot_none
- utter_setslot
entities:
- profile
slots:
profile:
type: categorical
values:
- vip
- standard
- anonimous
templates:
utter_greet:
- text: "Hi! How are you feeling today?"
utter_cheer_up:
- text: "Here is something to cheer you up:"
image: "https://i.imgur.com/nGF1K8f.jpg"
utter_did_that_help:
- text: "Did that help you?"
utter_happy:
- text: "Great, carry on!"
utter_goodbye:
- text: "Bye"
utter_iamabot:
- text: "I am a bot, powered by Rasa."
utter_default:
- text: "Fallback... Didn't understand."
utter_setslot:
- text: Selecione Perfil
buttons:
- title: vip
payload: '/show_profile{"profile" : "vip"}'
- title: standard
payload: '/show_profile{"profile" : "standard"}'
- title: anonimous
payload: '/show_profile{"profile" : "anonimous"}'
utter_slot_vip:
- text: I'm VIP
utter_slot_standard:
- text: I'm standard
utter_slot_anonimous:
- text: I'm anonimous
utter_slot_none:
- text: "No profile set"
Thanks for posting your code copy, as i expected, this is a YAML formatting issue. add 2 spaces before use_entities:
like in his example:
intents:
- greet
- goodbye
- affirm
- deny
- mood_great
- mood_unhappy
- bot_challenge
- define_slots
- show_profile:
use_entitites: []
You can check the difference using https://onlineyamltools.com/convert-yaml-to-json:
Also right now you have use_entitities
instead of use_entities
, I just noticed
Closing as this should have fixed the issue, feel free to reopen if you still are having issues.
Rasa version: 1.4.6
Rasa SDK version (if used & relevant):
Rasa X version (if used & relevant):
Python version: 3.6.9 (anaconda)
Operating system (windows, osx, ...): RHEL 7 (CentOS)
Issue: If you try and set a slot with the same value that's already in the slot, the results are unpredictable. Sometime I get a fallback action, sometimes I get a different value or no value in the slot, even though the debug information shows the slot contains the right value.
I have an intent where I display 3 buttons for the tester to choose the profile he wants to test. The bot responds differently depending on the profile set. The show_profile intent is called by the buttons like this (for the three buttons):
Just /show_profile will show me the currently set profile. This was made based on a blank "rasa init"
If I set the same profile twice in a row, I get unpredictable results. Here's a sample conversation (debug version below):
Error (including full traceback):
Command or request that led to error:
Content of configuration file (config.yml) (if relevant):
Content of domain file (domain.yml) (if relevant):
Content of nlu file (nlu.md):
Content of stories file (stories.md):