Closed samsucik closed 2 years ago
I should say that I noticed also this line in 3.0 which looks like a fix to an issue that might still be present in 2.8. If this is right, we might want to pack-port that fix as well?
Released in v2.8.23
Thanks for fixing this!
There's a customer-affecting bug in
2.8.x
due to which, when one runsrasa test core
, the trained Core model is also tested on extracting entities from user turns for which the actual user text isn't present, such as this test story:This bug is fixed in 3.0 and we should back-port the fix.
How to reproduce the error
With the latest
2.8.x
, create arasa init
project and add an entity to a training story by addingto the domain, adding
to the NLU examples for intent
greet
, and changing the first training story to:Now,
rasa train
andrasa test core --stories ./data
. You get this error:What's the culprit and how it's fixed in 3.0
The issue is that the Core testing code still expects the trained Core model to be able to extract entities even those even if the corresponding user message is not present, i.e. its
text
isNone
. In Rasa 3.0, there's a fixed version where the Core model is not expected to extract entities if the text of the user message isn't present. It's hard to tell if this fix was put into 3.0 because of a bug report or if it was just Enable engineers who noticed this "imperfection" and improved the code while porting it from 2.8 to 3.0. In any case, this should be back-ported to 2.8 to unblock the customer._Note: This issue does not occur if one trains the Core model only (
rasa train core
). However, this should be considered a matter of luck. Why? It just happens that when you runrasa train core
, the resulting model will end up with a simplerasa.shared.nlu.interpreter.RegexInterpreter
whosefeaturize_message
will returnNone
over here and so the Core model won't be expected to predict the entities for the givenUserUttered
event.rasa train
, on the other hand, produces a properrasa.core.interpreter.RasaNLUInterpreter
which on the above line returns an object likeMessage(data={'text': None}, output_properties={'text'}, time=None, features=)
, which then breaks things further down the line (as per the above-pasted error message) because this message doesn't have any tokens and entity extraction shouldn't be carried out on it._Definition of done