Repository navigation
Conversation
…shing calc_recall averaged an empty list (NaN) for an empty dict, and evaluate_dicts only checked the first list element for being a dict. Return 0 for no keys and require every list element to be a dict.
This branch has not been deployed
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes #418
Problem
With a dict gold answer,
question_scorerraised instead of returning a score:{}makescalc_recallaverage an empty list. The NaN reaches the alignment step, which raisesValueError: matrix contains invalid numeric entries.[{"sender": "USPS", ...}, "maybe FedEx"]passes thetype(pred[0]) == dictcheck inevaluate_dicts, then.getis called on the string and raisesAttributeError.Change
calc_recallreturns 0 when there is nothing to compare.evaluate_dictsrequires every element of a list prediction to be a dict, and scores 0 otherwise, as it already did when the first element was not a dict.Testing
Ran the real
question_scorerwith the dict gold from the dev set in a Docker sandbox with numpy and scipy, on main at27a90ce815098f43414e93491e06907af468e45b.{}raisesValueError, the mixed list raisesAttributeError, the matching answer scores 1.0.{}scores 0.0, the mixed list scores 0, the matching answer still scores 1.0.tests/assistantbench/test_evaluation.pyneeds gymnasium and the full browsergym install, so I did not run it.