notice
This is documentation for Rasa Documentation v2.x, which is no longer actively maintained.
For up-to-date documentation, see the latest version (3.x).
rasa.core.test
WrongPredictionException Objects
Raised if a wrong prediction is encountered.
WarningPredictedAction Objects
The model predicted the correct action with warning.
__init__
Creates event action_unlikely_intent
predicted as warning.
See the docstring of the parent class for more information.
inline_comment
A comment attached to this event. Used during dumping.
WronglyPredictedAction Objects
The model predicted the wrong action.
Mostly used to mark wrong predictions and be able to dump them as stories.
__init__
Creates event for a successful event execution.
See the docstring of the parent class ActionExecuted
for more information.
inline_comment
A comment attached to this event. Used during dumping.
as_story_string
Returns the story equivalent representation.
__repr__
Returns event as string for debugging.
EvaluationStore Objects
Class storing action, intent and entity predictions and targets.
__init__
Initialize store attributes.
add_to_store
Add items or lists of items to the store.
merge_store
Add the contents of other to self.
check_prediction_target_mismatch
Checks if intent, entity or action predictions don't match expected ones.
serialise
Turn targets and predictions to lists of equal size for sklearn.
EndToEndUserUtterance Objects
End-to-end user utterance.
Mostly used to print the full end-to-end user message in the
failed_test_stories.yml
output file.
as_story_string
Returns the story equivalent representation.
WronglyClassifiedUserUtterance Objects
The NLU model predicted the wrong user utterance.
Mostly used to mark wrong predictions and be able to dump them as stories.
__init__
Set predicted_intent
and predicted_entities
attributes.
inline_comment
A comment attached to this event. Used during dumping.
inline_comment_for_entity
Returns the predicted entity which is then printed as a comment.
as_story_string
Returns text representation of event.
emulate_loop_rejection
Add ActionExecutionRejected
event to the tracker.
During evaluation, we don't run action server, therefore in order to correctly test unhappy paths of the loops, we need to emulate loop rejection.
Arguments:
partial_tracker
- a :class:rasa.core.trackers.DialogueStateTracker
test
Run the evaluation of the stories, optionally plot the results.
Arguments:
stories
- the stories to evaluate onagent
- the agentmax_stories
- maximum number of stories to considerout_directory
- path to directory to results tofail_on_prediction_errors
- boolean indicating whether to fail on prediction errors or note2e
- boolean indicating whether to use end to end evaluation or notdisable_plotting
- boolean indicating whether to disable plotting or notsuccesses
- boolean indicating whether to write down successful predictions or noterrors
- boolean indicating whether to write down incorrect predictions or notwarnings
- boolean indicating whether to write down prediction warnings or not
Returns:
Evaluation summary.
compare_models_in_dir
Evaluates multiple trained models in a directory on a test set.
Arguments:
model_dir
- path to directory that contains the models to evaluatestories_file
- path to the story fileoutput
- output directory to store results touse_conversation_test_files
-True
if conversation test files should be used for testing instead of regular Core story files.
compare_models
Evaluates multiple trained models on a test set.
Arguments:
models
- Paths to model files.stories_file
- path to the story fileoutput
- output directory to store results touse_conversation_test_files
-True
if conversation test files should be used for testing instead of regular Core story files.