rasa.core.evaluation.marker_stats
compute_statistics
Computes some statistics over the given numbers.
MarkerStatistics Objects
Computes some statistics on marker extraction results.
(1) Number of sessions where markers apply:
For each marker, we compute the total number (as well as the percentage) of sessions in which a marker applies at least once. Moreover, we output the total number of sessions that were parsed.
(2) Number of user turns preceding relevant events - per sessions:
For each marker, we consider all relevant events where that marker applies. Everytime a marker applies, we check how many user turns precede that event. We collect all these numbers and compute basic statistics (e.g. count and mean) on them.
This means, per session, we compute how often a marker applies and how many user turns precede a relevant marker application on average, in that session.
(3) Number of user turns preceding relevant events - over all sessions:
Here, for each marker, we consider all relevant events where a marker applies in any of the sessions. Then, we again calculate basic statistics over the respective number of user turns that precede each of these events.
This means, we compute how many events the marker applies in total and we compute an estimate of the expected number of user turns preceding that precede an (relevant) event where a marker applies.
__init__
Creates a new marker statistics object.
process
Processes the meta data that was extracted from a single session.
Internally, this method ..
- computes some statistics for the given meta data and saves it for later
- keeps track of the total number of sessions processed and the collects all metadata to be able to compute meta data over all
Arguments:
sender_id
- an id that, together with thesession_idx
identifies the session from which the markers where extractedsession_idx
- an index that, together with thesender_id
identifies the session from which the markers where extractedmeta_data_on_relevant_events_per_marker
- marker extraction results, i.e. a dictionary mapping marker names to the meta data describing relevant events for those markers
overall_statistic_to_csv
Exports the overall statistics (over all processes sessions) to a csv file.
Arguments:
path
- path to where the csv file should be written.overwrite
- set toTrue
to enable overwriting an existing file
per_session_statistics_to_csv
Exports the resulting statistics to a csv file.
Arguments:
path
- path to where the csv file should be written.overwrite
- set toTrue
to enable overwriting an existing file