-
Notifications
You must be signed in to change notification settings - Fork 4.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Invalid rule when training when setting a slot of type float #7244
Comments
Same problem with type text |
Thanks for the issue, @koernerfelicia will get back to you about it soon! You may find help in the docs and the forum, too 🤗 |
Did you tried to set the matched_found to influence_conversation: true ? The default value is false, and without this attribute the code below will return the same value '[]' for the 2 values (0 and 1):
|
@davidhsv I hadn't but by default, the
I just tried in any case and I still have the same issue. Did that work for you in the end for your |
Yes, it's working :) I can now differentiate between slot: null, slot: 'text1' and slot: 'text2'. But I still can't differentiate - slot_was_set -slot_name (without any value) And yeah, you are right the default is true for influence_conversation, sorry. Going to debug your problem now. |
Great! Did you change something specific to make it work? I'm wondering if the problem is not somewhere else for me. I have a similar error for a boolean slot with a single rule setting that slot. The following rule is the only rule (and story) that uses
It then gives me the following error:
and my config for this slot:
Thanks for your help :-) |
@koernerfelicia I tried setting the slots to |
I changed the slots.py in the rasa library (not optimal at all hahahahah). I'm making the pull request with the related tests for that issue. |
Eheheh I see! I'll wait for the merge if that works :-) Will work with |
The approach is for the problem here #7253 (comment) I think this one is a different issue. I'm reproducing it too, trying to debug to learn the cause... |
@nbeuchat
|
But I'm still confused about the semantics of this condition in the rules file... And still think it should work with the slot_was_set in the steps. |
Thanks @davidhsv, I wanted to try that but got stuck on another issue. Hopefully I can get to it a bit later In any case, I agree that the syntax is strange (or at least, hard to read). The |
@davidhsv I tried your approach of having the Here is the updated rule I tried:
Note that the @koernerfelicia Thanks for opening up a fix! I'm a bit confused as to why it should fix the problem. In the end, I have two paths, one setting the slot to |
Nice to hear it worked! 😁
I tested disabling the conflict check and it worked too.
Em sex, 13 de nov de 2020 11:58, Nicolas Beuchat <notifications@github.com>
escreveu:
… @davidhsv <https://github.com/davidhsv> I tried your approach of having
the slot_was_set in the condition and it works well!
Here is the updated rule I tried:
- rule: Search with results
condition:
- slot_was_set:
- matches_found: 1
- slot_was_set:
- preferences_filled: true
steps:
- action: action_get_apts_search
- action: action_display_apt_selector
- rule: Search without results
condition:
- slot_was_set:
- matches_found: 0
- slot_was_set:
- preferences_filled: true
steps:
- action: action_get_apts_search
- action: action_no_search_results
Note that the preferences_filled is here because of another bug
<#7265> (at least I have the
impression it's a bug).
@koernerfelicia <https://github.com/koernerfelicia> Thanks for opening up
a fix! I'm a bit confused as to why it should fix the problem. In the end,
I have two paths, one setting the slot to 1, the other to 0 and if I
understood the bug correctly, the 0 is interpreted as not being set at
all? So, in theory, it should still
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#7244 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAAJJGUAWSMBJKXL7QUSUV3SPVCPRANCNFSM4TSDDVVQ>
.
|
@nbeuchat I'm afraid the PR only addresses part of your problem.. I was only able to reproduce part of your error: This was caused because you have two paths, one in which Because it thinks the slot is only being set in the one rule and not the other and that you have failed to say that it is not set in the other, it marks the rules as incomplete. Note that this error would not be raised if, for example you wrote However, I was never able to reproduce the first part of your error message: |
@koernerfelicia thanks for your answer! So, I do have another rule actually which cannot know how to set that slot. The idea was to delegate the slot setting to the other two rules using
From my understanding of the documentation, that shouldn't be a problem no?
I'd love to if you have some time! 😄 |
Unfortunately, that does not work either for me. I have the following rules (these are the only rules):
And I still get the error:
|
@nbeuchat having read through this, it's a very interesting bug and good luck to @koernerfelicia fixing it! I though I'd just add my piece of understanding of the syntax for rules: I think the name Second: By including This being said, @nbeuchat all of your examples make sense to me and are in line with what the docs are saying, so we should definitely fix the issues... |
Shouldn't it be that the slot has a specific value at that point in the story? So, if the slot was set five turns before, it still matches the condition, no? Otherwise, the first name example from the doc would not work I think |
@nbeuchat I think I was a little unclear in my response, let me try and clarify and also get to your questions!
This should be fine. The key thing is if you have the action that sets a slot in one rule, if that same action is in another rule you must either also set the slot or explicitly say that the action does not set the slot (by setting the slot to
Unfortunately this doesn't work for you because you seem to have a different problem. I should have said if you weren't having this different problem this should have fixed it. I think that it has something to do with how the slot values are featurized, but I can't reproduce your error messages with the rules you include here. (see below for some thoughts on this)
One of the things we validate when we validate rules is: This is meant to remind you to include whether the slot is set by the action. By explicitly saying that the action does not set the slot you are acknowledging that you know there are other rules where this action does set the slot, but in this rule it does not. The bug that I adressed occurs as follows: When we validate this aspect of the rules there are two stages: ii. As for your issue -- it is very odd that you get two error messages for two rules. The error messages look like you have a third rule in which The only way I can trigger this is by providing "unparseable" values (so non-floats or 0) to the |
Thanks so much for the detailed explanation @koernerfelicia ! It's a bit clearer now.
What I personally find confusing is: how do you differentiate between not setting a slot and setting a slot to
In my mind, I would have read that as "the slot has been reset to null" by I tried to reproduce the issue I had with the double lines with a simpler case but couldn't. I suppose I had some other rules somewhere that I forgot to remove. One last small comment, it seems that the issue also happens if the |
@nbeuchat while looking into #7265 I found a bug that leads to an slots:
s1:
type: bool
initial_value: false
s2:
type: categorical
values:
- v1
rules:
- rule: my rule
steps:
- intent: i2
- action: action_1
- slot_was_set:
- s2: v1
- action: utter_1 I am not 100% sure that this was the cause of any of your error messages, but I strongly suggest that you try installing Rasa from PR #7235 that fixes this bug and see if it resolves some of your issues. |
Oh, that is very likely the case of the bug with the two error messages then. When I retried this afternoon, I removed every single slot except I didn't have time to install Rasa from the PR #7235 to see if that fixes all the issues. |
Hi @nbeuchat, does this mean we can close this issue? It sounds like between this and the other issue we've managed to resolve the errors/bugs |
Rasa version: 2.0.3
Python version: 3.7.9
Operating system: Ubuntu 18.04
Issue:
I have two rules which start with the same action but have different behaviors depending on the value of the slot that has been set. The slot (
matches_found
) is of typefloat
with a min of 0 and a max of 1. The rules fail to be validated with the following error (full error below):the action 'action_search' in rule 'Search with results' does not set all the slots, that it sets in other rules: 'matches_found'.
If I use a different type of slot (a boolean slot for example), it does not throw an error. Even if I set
matches_found
to the exact same value in both rules, it still fails.Rules
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):
The text was updated successfully, but these errors were encountered: