Skip to content

Commit

Permalink
Fix OSS-413: Proper intents in interactive training
Browse files Browse the repository at this point in the history
In OSS-413 a user reports that since Rasa 3.1 the interactive
training dialogue suggests malformed/shortened intent names, e.g.:

- a
- b
- c

This is due to a bug in the parsing of intent names which assumes that
every intent is a dictionary (which it is ONLY when a property such as
`use_entities` is set).

While OSS-413 states that this is solely cosmetic it is an actual bug
that caused severe problems that cost several hours to debug:
When using the regex matcher it is checked whether the parsed intent
is in the domain or not. When it is not, it will fail and attempt to
revert the user utterance. The user utterance is then written to the
tracker but `SlotSet` events are not repeated - therefore any form
validator will fail for inexplicable reasons.

This also means that there is a bug in the `_correct_wrong_nlu` for
not copying enough or re-starting the `ActionExtractSlots` action which
is not addressed here.
  • Loading branch information
ottonemo committed Aug 9, 2023
1 parent 491a392 commit 0e1c0f0
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion rasa/core/training/interactive.py
Original file line number Diff line number Diff line change
Expand Up @@ -1477,7 +1477,11 @@ async def record_messages(

domain_intents = domain.get("intents", []) if domain is not None else []

intents = [next(iter(i)) for i in domain_intents]
intents = [
next(iter(i)) if isinstance(i, dict) # intent property
else i # plain intent name
for i in domain_intents
]

num_messages = 0

Expand Down

0 comments on commit 0e1c0f0

Please sign in to comment.