rasa/core/test.py
async def test(stories: Text,
               agent: 'Agent',
               max_stories: Optional[int] = None,
               out_directory: Optional[Text] = None,
               fail_on_prediction_errors: bool = False,
               use_e2e: bool = False):
    """Run the evaluation of the stories, optionally plot the results."""
    from rasa_nlu.test import get_evaluation_metrics

    completed_trackers = await _generate_trackers(stories, agent,
                                                  max_stories, use_e2e)

    story_evaluation, _ = collect_story_predictions(completed_trackers, agent,
                                                    fail_on_prediction_errors,
                                                    use_e2e)

    evaluation_store = story_evaluation.evaluation_store

    with warnings.catch_warnings():
        from sklearn.exceptions import UndefinedMetricWarning

        warnings.simplefilter("ignore", UndefinedMetricWarning)
        report, precision, f1, accuracy = get_evaluation_metrics(
            evaluation_store.serialise_targets(),
            evaluation_store.serialise_predictions()
        )

    if out_directory:
        plot_story_evaluation(evaluation_store.action_targets,
                              evaluation_store.action_predictions,
                              report, precision, f1, accuracy,
                              story_evaluation.in_training_data_fraction,
                              out_directory)

    log_failed_stories(story_evaluation.failed_stories, out_directory)

    return {
        "report": report,
        "precision": precision,
        "f1": f1,
        "accuracy": accuracy,
        "actions": story_evaluation.action_list,
        "in_training_data_fraction":
            story_evaluation.in_training_data_fraction,
        "is_end_to_end_evaluation": use_e2e
    }
Run the evaluation of the stories, optionally plot the results.
Run the evaluation of the stories, optionally plot the results.
Run the evaluation of the stories optionally plot the results .
async def test(stories: Text,
               agent: 'Agent',
               max_stories: Optional[int] = None,
               out_directory: Optional[Text] = None,
               fail_on_prediction_errors: bool = False,
               use_e2e: bool = False):
    from rasa_nlu.test import get_evaluation_metrics
    completed_trackers = await _generate_trackers(stories, agent,
                                                  max_stories, use_e2e)
    story_evaluation, _ = collect_story_predictions(completed_trackers, agent,
                                                    fail_on_prediction_errors,
                                                    use_e2e)
    evaluation_store = story_evaluation.evaluation_store
    with warnings.catch_warnings():
        from sklearn.exceptions import UndefinedMetricWarning
        warnings.simplefilter("ignore", UndefinedMetricWarning)
        report, precision, f1, accuracy = get_evaluation_metrics(
            evaluation_store.serialise_targets(),
            evaluation_store.serialise_predictions()
        )
    if out_directory:
        plot_story_evaluation(evaluation_store.action_targets,
                              evaluation_store.action_predictions,
                              report, precision, f1, accuracy,
                              story_evaluation.in_training_data_fraction,
                              out_directory)
    log_failed_stories(story_evaluation.failed_stories, out_directory)
    return {
        "report": report,
        "precision": precision,
        "f1": f1,
        "accuracy": accuracy,
        "actions": story_evaluation.action_list,
        "in_training_data_fraction":
            story_evaluation.in_training_data_fraction,
        "is_end_to_end_evaluation": use_e2e
    }
async def test ( stories : Text , agent : 'Agent' , max_stories : Optional [ int ] = None , out_directory : Optional [ Text ] = None , fail_on_prediction_errors : bool = False , use_e2e : bool = False ) : from rasa_nlu . test import get_evaluation_metrics completed_trackers = await _generate_trackers ( stories , agent , max_stories , use_e2e ) story_evaluation , _ = collect_story_predictions ( completed_trackers , agent , fail_on_prediction_errors , use_e2e ) evaluation_store = story_evaluation . evaluation_store with warnings . catch_warnings ( ) : from sklearn . exceptions import UndefinedMetricWarning warnings . simplefilter ( "ignore" , UndefinedMetricWarning ) report , precision , f1 , accuracy = get_evaluation_metrics ( evaluation_store . serialise_targets ( ) , evaluation_store . serialise_predictions ( ) ) if out_directory : plot_story_evaluation ( evaluation_store . action_targets , evaluation_store . action_predictions , report , precision , f1 , accuracy , story_evaluation . in_training_data_fraction , out_directory ) log_failed_stories ( story_evaluation . failed_stories , out_directory ) return { "report" : report , "precision" : precision , "f1" : f1 , "accuracy" : accuracy , "actions" : story_evaluation . action_list , "in_training_data_fraction" : story_evaluation . in_training_data_fraction , "is_end_to_end_evaluation" : use_e2e }
Run the evaluation of the stories, optionally plot the results.
Run the evaluation of the stories optionally plot the results .
"""Run the evaluation of the stories, optionally plot the results."""
stories
Text
agent
'Agent'
max_stories
Optional[int]
out_directory
Optional[Text]
fail_on_prediction_errors
bool
use_e2e
bool