Added mode as an argument to Evals class to enable binary evals#119
Closed
mturk24 wants to merge 2 commits into
Closed
Added mode as an argument to Evals class to enable binary evals#119mturk24 wants to merge 2 commits into
mturk24 wants to merge 2 commits into
Conversation
jwmueller
reviewed
Sep 26, 2025
| query_identifier=eval_config.get(_TLM_EVAL_QUERY_IDENTIFIER_KEY), | ||
| context_identifier=eval_config.get(_TLM_EVAL_CONTEXT_IDENTIFIER_KEY), | ||
| response_identifier=eval_config.get(_TLM_EVAL_RESPONSE_IDENTIFIER_KEY), | ||
| mode=eval_config.get("mode") or "numeric", # Default to numeric if not specified |
Member
There was a problem hiding this comment.
why do we want this or numeric part? isnt the mode always specified for our default built-in Evals?
I think we should make sure the default built-in Evals are always specifying the mode
jwmueller
reviewed
Sep 26, 2025
| Leave this value as None (the default) if this Eval doesn't consider the response. | ||
| mode (str, optional): The evaluation mode, either "numeric" (default) or "binary". | ||
| - "numeric": For evaluations that naturally have a continuous score range (e.g., helpfulness, coherence). | ||
| - "binary": For yes/no evaluations (e.g., does response mention a company, is query appropriate). |
Member
There was a problem hiding this comment.
Suggested change
| - "binary": For yes/no evaluations (e.g., does response mention a company, is query appropriate). | |
| - "binary": For yes/no evaluations (e.g., does response mention a particular company or not). |
jwmueller
reviewed
Sep 26, 2025
Comment on lines
+868
to
+869
| Both modes return numeric scores in the 0-1 range. For binary evaluations detecting issues, | ||
| low scores typically correspond to "Yes" (issue detected) and high scores to "No" (issue not detected). |
Member
There was a problem hiding this comment.
Suggested change
| Both modes return numeric scores in the 0-1 range. For binary evaluations detecting issues, | |
| low scores typically correspond to "Yes" (issue detected) and high scores to "No" (issue not detected). | |
| Both modes return numeric scores in the 0-1 range. | |
| For numeric evaluations, your `criteria` should define what good vs. bad looks like (low evaluation scores will correspond to cases deemed bad). | |
| For binary evaluations, your `criteria` should be a Yes/No question (low evaluation scores will correspond to "Yes" cases, so phrase your question such that the likelihood of "Yes" matches the likelihood of the particular problem you wish to detect). |
jwmueller
reviewed
Sep 26, 2025
| @@ -123,6 +123,7 @@ def __init__( | |||
| query_identifier=eval_config.get(_TLM_EVAL_QUERY_IDENTIFIER_KEY), | |||
Member
There was a problem hiding this comment.
since youre using "numeric" and "binary" many places, those should be defined variables in constants.py:
_NUMERIC_STR = "numeric"
_BINARY_STR = "binary"
and then you should use those variables throughout
jwmueller
reviewed
Sep 26, 2025
| query_identifier=eval_config.get("query_identifier"), | ||
| context_identifier=eval_config.get("context_identifier"), | ||
| response_identifier=eval_config.get("response_identifier"), | ||
| mode=eval_config.get("mode") or "numeric", |
Member
There was a problem hiding this comment.
same as my comment at the top, why do we have fallback mode for the default built-in Evals? The default built-in Evals should not be allowed to have mode unspecified.
Member
|
replaced by #130 |
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.
PR to add "mode" to Eval class in "cleanlab-tlm". This allows us to specify whether an Eval is Binary or Numeric.
This PR serves as an API design spec