-
Notifications
You must be signed in to change notification settings - Fork 6
246 update evaluation docs #247
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
dkkdark
wants to merge
3
commits into
main
Choose a base branch
from
246-update-documentation
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,13 +1,123 @@ | ||
| Evaluation | ||
| ========== | ||
|
|
||
| The evaluation of a conversational recommender system (CRS) is performed by first generating dialogues between the CRS and the user simulator, then computing evaluation measures on these synthetic dialogues. | ||
| The evaluation scripts are located in the directory `scripts/evaluation`. | ||
| UserSimCRS evaluates conversational recommender systems (CRSs) on exported dialogues. The evaluation pipeline loads dialogues from a JSON file, computes one or more metrics, and stores the results as JSON together with the resolved configuration. | ||
|
|
||
| Currently, we provide the following evaluation scripts: | ||
| A default evaluation configuration is provided in `config/default/config_evaluation.yaml`. | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nit: Move this to the end of the |
||
|
|
||
| * **Dialogue quality evaluation**: Evaluates the dialogue quality with regards to five aspects: recommendation relevance, communication style, fluency, conversational flow, and overall satisfaction. The scores for each aspect are obtained from a large language model (LLM) hosted on a Ollama server. | ||
| * **Satisfaction evaluation**: Evaluates the user satisfaction using a pre-trained model from DialogueKit. | ||
| * **Utility evaluation**: Evaluates dialogues based on user-centric utility metrics: success rate, successful recommendation round ratio, and reward-per-dialogue-length. | ||
|
|
||
| Please refer to the documentation of each script for more details on how to run them. | ||
| Usage | ||
| ----- | ||
|
|
||
| Run evaluation with: | ||
|
|
||
| .. code-block:: shell | ||
|
|
||
| python -m usersimcrs.run_evaluation -c <path_to_config.yaml> | ||
|
|
||
|
|
||
| Some parameters can also be overridden from the command line, for example: | ||
|
|
||
| .. code-block:: shell | ||
|
|
||
| python -m usersimcrs.run_evaluation \ | ||
| -c config/default/config_evaluation.yaml \ | ||
| --dialogues data/datasets/moviebot/annotated_dialogues.json \ | ||
| --metrics satisfaction success_rate \ | ||
| --output data/evaluation/results.json | ||
|
|
||
|
dkkdark marked this conversation as resolved.
|
||
|
|
||
| Configuration | ||
| ------------- | ||
|
|
||
| The evaluation configuration is defined in a YAML file. The main parameters are: | ||
|
|
||
| * `dialogues`: Path to the dialogues JSON file. | ||
| * `metrics`: List of metrics to compute. | ||
| * `output`: Path to the JSON file where evaluation results will be saved. | ||
| * `quality_aspects`: Quality aspects to evaluate when `quality` is included in `metrics`. | ||
| * `quality_llm_interface`: LLM interface configuration used by the quality metric. | ||
| * `user_nlu_config`: Configuration file used to instantiate the user-side NLU for utility metrics. | ||
| * `agent_nlu_config`: Configuration file used to instantiate the agent-side NLU for utility metrics. | ||
|
dkkdark marked this conversation as resolved.
Outdated
|
||
| * `recommendation_intent_labels`: Intent labels that mark recommendation turns. | ||
| * `accept_intent_labels`: Intent labels that mark acceptance. | ||
| * `reject_intent_labels`: Intent labels that mark rejection. | ||
|
|
||
|
|
||
| The following metrics are currently supported: | ||
|
|
||
| * `quality` | ||
| * `satisfaction` | ||
| * `success_rate` | ||
| * `successful_recommendation_round_ratio` | ||
| * `reward_per_dialogue_length` | ||
|
|
||
|
|
||
| Metric Overview | ||
|
dkkdark marked this conversation as resolved.
|
||
| --------------- | ||
|
|
||
| Quality | ||
| """"""" | ||
|
|
||
| The quality metric uses an LLM to score each dialogue aspect separately. The supported aspects are defined by ``QualityRubrics``: | ||
|
|
||
| * `REC_RELEVANCE` | ||
| * `COM_STYLE` | ||
| * `FLUENCY` | ||
| * `CONV_FLOW` | ||
| * `OVERALL_SAT` | ||
|
dkkdark marked this conversation as resolved.
Outdated
|
||
|
|
||
|
|
||
| When `quality` is requested, the configuration must include `quality_llm_interface`. | ||
|
|
||
|
|
||
| Satisfaction | ||
| """""""""""" | ||
|
|
||
| The satisfaction metric uses the pre-trained DialogueKit satisfaction classifier and returns one score per dialogue. | ||
|
|
||
|
|
||
| Utility Metrics | ||
|
dkkdark marked this conversation as resolved.
Outdated
|
||
| """"""""""""""" | ||
|
|
||
| The utility metrics are: | ||
|
|
||
| * **Success rate**: Returns `1.0` if at least one recommendation was accepted in the dialogue, otherwise `0.0`. | ||
| * **Successful recommendation round ratio**: Returns the ratio of accepted recommendation rounds to all recommendation rounds in the dialogue. | ||
| * **Reward per dialogue length**: Returns the number of accepted recommendations divided by the total number of utterances in the dialogue. | ||
|
|
||
|
|
||
| If the input dialogues are not already annotated, UserSimCRS annotates them in place using the NLU components loaded from `user_nlu_config` and `agent_nlu_config`. | ||
|
dkkdark marked this conversation as resolved.
Outdated
|
||
|
|
||
| When any utility metric is requested, the following configuration fields are required: | ||
|
|
||
| * `user_nlu_config` | ||
| * `agent_nlu_config` | ||
| * `recommendation_intent_labels` | ||
| * `accept_intent_labels` | ||
| * `reject_intent_labels` | ||
|
|
||
|
|
||
| Output | ||
| ------ | ||
|
|
||
| The evaluation script writes two files: | ||
|
|
||
| * The JSON result file specified by `output`. | ||
| * A companion metadata file with the suffix `.meta.yaml`, containing the resolved configuration. | ||
|
|
||
|
|
||
| The result JSON contains: | ||
|
|
||
| * `dialogues_path`: Path to the evaluated dialogues. | ||
| * `metrics_requested`: List of requested metrics. | ||
| * `metrics`: Metric results. | ||
|
|
||
|
|
||
| For `satisfaction` and all utility metrics, each metric entry contains: | ||
|
|
||
| * `per_dialogue`: Mapping from conversation ID to score. | ||
| * `summary_by_agent`: Aggregate statistics per agent (`count`, `min`, `max`, `mean`, `stdev`). | ||
|
|
||
|
|
||
| For `quality`, the output is grouped by aspect. Each aspect contains its own `per_dialogue` scores and `summary_by_agent` statistics. | ||
|
dkkdark marked this conversation as resolved.
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.