Skip to content
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

Rasa X changes the order of the form slots mapping #7460

Closed
nbeuchat opened this issue Dec 4, 2020 · 20 comments
Closed

Rasa X changes the order of the form slots mapping #7460

nbeuchat opened this issue Dec 4, 2020 · 20 comments
Labels
area:rasa-oss 🎡 Anything related to the open source Rasa framework area:rasa-x/backend 🎩 All issues focused on the Rasa X backend type:bug 🐛 Inconsistencies or issues which will cause an issue or problem for users or implementors.

Comments

@nbeuchat
Copy link
Contributor

nbeuchat commented Dec 4, 2020

Rasa version: 2.1.1

Rasa SDK version: 2.1.1

Rasa X version: 0.34.0

Python version: 3.7.9

Operating system: Ubuntu

Issue:
When starting Rasa X, the order of the slot mappings defined for forms in the domain file is automatically changed so that they are sorted alphabetically. Given that the order of the mapping changes the order in which the questions are asked by the bot within a form, this should not happen.

Command or request that led to error:

rasa x

Content of domain file (domain.yml) (if relevant):
Before starting Rasa X

forms:
  form_preferences:
    preferences_target_price:
    - intent: ...
    has_pet:
    - intent: ...
    ...

After starting Rasa X

forms:
  form_preferences:
    has_pet:
    - intent: ...
    preferences_target_price:
    - intent: ...
    ...
@nbeuchat nbeuchat added area:rasa-oss 🎡 Anything related to the open source Rasa framework type:bug 🐛 Inconsistencies or issues which will cause an issue or problem for users or implementors. labels Dec 4, 2020
@sara-tagger
Copy link
Collaborator

sara-tagger commented Dec 7, 2020

Thanks for the issue, @wochinge will get back to you about it soon!

You may find help in the docs and the forum, too 🤗

@Ghostvv
Copy link
Contributor

Ghostvv commented Dec 7, 2020

What version are you using? Can you try updating to the latest version? It should be fixed there: #7418

@nbeuchat
Copy link
Contributor Author

nbeuchat commented Dec 7, 2020

@Ghostvv Thanks for your answer! I'm using 2.1.1, hadn't seen 2.1.2 and 2.1.3 were up (I'm monitoring the CHANGELOG file on master but I guess that's not enough for bug fixes)

Will try updating to 2.1.3

@Ghostvv
Copy link
Contributor

Ghostvv commented Dec 7, 2020

oh, sorry, the fix is in rasa OSS, but the new version of rasa x is not released yet

@wochinge
Copy link
Contributor

fixed in Rasa X 0.35

@Gazler
Copy link

Gazler commented Feb 8, 2021

I think I am still experiencing this issue. Before running rasa x, there are no changes to the domain.yml. After running rasa x, the results are reordered to be in alphabetical order.

gazler> git diff domain.yml
gazler> rasa --version
Rasa Version     : 2.2.9
Rasa SDK Version : 2.2.0
Rasa X Version   : 0.35.1
Python Version   : 3.6.9
Operating System : Linux-4.15.0-132-generic-x86_64-with-Ubuntu-18.04-bionic
Python Path      : /home/gazler/.venv/bin/python3
gazler> rasa x &
gazler> git diff domain.yml
diff --git a/rasa-bot/domain.yml b/rasa-bot/domain.yml
index 78e577d..cea7066 100644
--- a/rasa-bot/domain.yml
+++ b/rasa-bot/domain.yml
@@ -101,12 +101,12 @@ forms:
     - type: from_text
     channel_confirm:
     - type: from_text
-    note:
+    mention:
     - type: from_text
     mention_confirm:
     - type: from_text
-    mention:
-    - type: from_text
     mention_list:
     - type: from_text
+    note:
+    - type: from_text
 e2e_actions: []

@Gazler
Copy link

Gazler commented Feb 22, 2021

Just wanted to update to confirm I am still seeing this issue with the following (latest) versions:

Rasa Version     : 2.3.1
Rasa SDK Version : 2.3.1
Rasa X Version   : 0.36.0
Python Version   : 3.6.9

@wochinge
Copy link
Contributor

@Gazler Do you have an example domain which I could use to reproduce? 🙌🏻

@Gazler
Copy link

Gazler commented Mar 1, 2021

@wochinge I created a default project and added the restaurant form, but re-ordered the form fields, so num_people appears before cuisine.

https://github.com/Gazler/rasa_x_form_order

If you run rasa x and then check git diff the form slots should have been reordered.

@wochinge wochinge reopened this Mar 2, 2021
@wochinge wochinge added area:rasa-oss/training-data Issues focused around Rasa training data (stories, NLU, domain, etc.) feature:ux-cli+training-data Feature: Improve user experience with Rasa CLI and training data for developers labels Mar 2, 2021
@Horizon733
Copy link

Horizon733 commented Apr 2, 2021

Hi, I am also getting this issue in 0.37.0. It is making the process very hard because whenever I start rasa x it just messes up the form structure. Also, found out why it is messing up, its reordering form as per slot name. Can you guys make Rasa x not to do this? @wochinge Here are the screenshots before and after starting rasa x.
Version details:

Rasa Version: 2.3.4
Rasa SDK Version: 2.4.0
Rasa X Version: 0.37.0
Python Version: 3.7.5
Operating System: Linux-5.8.0-48-generic-x86_64-with-debian-bullseye-sid

Screenshot from 2021-04-01 16-19-28
Screenshot from 2021-04-01 16-19-41

@TyDunn TyDunn added area:rasa-x/backend 🎩 All issues focused on the Rasa X backend and removed feature:ux-cli+training-data Feature: Improve user experience with Rasa CLI and training data for developers area:rasa-oss/training-data Issues focused around Rasa training data (stories, NLU, domain, etc.) labels May 5, 2021
@saglamutku
Copy link

@Horizon733 Hello,I have same issue and could not solve.Is there any solution?

@BelenSantamaria
Copy link

Hi, I have the same problem, the slots are ordered in alphabetical order in the domain file after running rasa x

Rasa Version: 2.6.2
Rasa SDK Version: 2.6.0
Rasa X Version: 0.40.0
Python Version: 3.8.11

@pmbaumgartner
Copy link

@wochinge any updates here? It seems like a hotfix that turns off the auto-sort that Rasa X does, which overrides the desired user behavior would fix this. I'm not sure why Rasa X would need to sort them alphabetically anyway.

Without a fix, this effectively means using Rasa X breaks the use of forms in a bot entirely if you commit that "updated" domain file. Seems like this should be a high priority given forms are an essential part of a chatbot.

Using Rasa X 0.42.0

@wochinge
Copy link
Contributor

wochinge commented Sep 6, 2021

Thanks for bringing this up @pmbaumgartner ! @TyDunn I think somebody from Enable should take this one. Changing the order of form slots is bad as the bot asks for the slots in a different order (cc @DominikRos ). I think to make this clearer required_slots should actually be a list instead of a dictionary (@ancalita It's already a list in our slot mappings proposal, isn't it?)

@ancalita
Copy link
Member

ancalita commented Sep 6, 2021

It's already a list in our slot mappings proposal, isn't it?

Yup, that's correct, form required_slots is changed to a list in the new proposal.

@Horizon733
Copy link

I think when Rasa x rewrites the yaml file it reorganizes forms with alphabetical order instead of writing it as it is

@Govindaraju777
Copy link

Is this issue fixed?

While training domain.yml changes to alphabetical order:
forms:
incident_reporting_form:
required_slots:
country:
- type: from_text
description:
- type: from_text
emp_id:
- type: from_text
full_name:
- type: from_text
gender:
- type: from_text
incident_date:
- type: from_text
industry_sector:
- type: from_text
local:
- type: from_text

Rasa version details:

Rasa Version : 2.8.2
Minimum Compatible Version: 2.8.0
Rasa SDK Version : 2.8.1
Rasa X Version : 0.39.3
Python Version : 3.8.2
Operating System : macOS-11.5.2-x86_64-i386-64bit

@nbeuchat
Copy link
Contributor Author

@degiz As you have closed this issue, in which version of Rasa X has this been fixed? I checked the changelog (https://rasa.com/docs/rasa-x/changelog/rasa-x-changelog) and cannot see any mention of it being fixed.

@felipemcg
Copy link

Is there a workaround for this in the meantime?

@wochinge
Copy link
Contributor

@DominikRos It would be quick and easy to cherry-pick this and do a micro release with this (sorry, should not have merged to main back then - I assumed we'd do another minor soon 🤦🏻 )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:rasa-oss 🎡 Anything related to the open source Rasa framework area:rasa-x/backend 🎩 All issues focused on the Rasa X backend type:bug 🐛 Inconsistencies or issues which will cause an issue or problem for users or implementors.
Projects
None yet
Development

No branches or pull requests