Skip to content
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

Inconsistency in the Value of EVALMODE_TO_COLUMNS[EvaluationMode.ca] #1215

Closed
jucgonzalezes opened this issue Aug 23, 2024 · 1 comment · Fixed by #1216
Closed

Inconsistency in the Value of EVALMODE_TO_COLUMNS[EvaluationMode.ca] #1215

jucgonzalezes opened this issue Aug 23, 2024 · 1 comment · Fixed by #1216
Labels
bug Something isn't working

Comments

@jucgonzalezes
Copy link
Contributor

Hi,

It seems there might be an inconsistency in the value of the dictionary EVALMODE_TO_COLUMNS[EvaluationMode.ca] within src/ragas/validation.py. Currently, the value is set to ["context", "summary"]

EVALMODE_TO_COLUMNS = {
EvaluationMode.qac: ["question", "answer", "contexts"],
EvaluationMode.qa: ["question", "answer"],
EvaluationMode.qc: ["question", "contexts"],
EvaluationMode.gc: ["ground_truth", "contexts"],
EvaluationMode.ga: ["ground_truth", "answer"],
EvaluationMode.qga: ["question", "ground_truth", "answer"],
EvaluationMode.qcg: ["question", "contexts", "ground_truth"],
EvaluationMode.ca: ["contexts", "summary"],
}

but I believe it should be ["context", "answer"] as in src/ragas/metrics/base.py:get_required_columns():

def get_required_columns(
eval_mod: EvaluationMode, ignore_columns: t.Optional[t.List[str]] = None
) -> t.List[str]:
if eval_mod == EvaluationMode.qac:
keys = ["question", "answer", "contexts"]
elif eval_mod == EvaluationMode.qa:
keys = ["question", "answer"]
elif eval_mod == EvaluationMode.qc:
keys = ["question", "contexts"]
elif eval_mod == EvaluationMode.gc:
keys = ["contexts", "ground_truth"]
elif eval_mod == EvaluationMode.ga:
keys = ["answer", "ground_truth"]
elif eval_mod == EvaluationMode.qga:
keys = ["question", "contexts", "answer", "ground_truth"]
elif eval_mod == EvaluationMode.qcg:
keys = ["question", "contexts", "ground_truth"]
elif eval_mod == EvaluationMode.ca:
keys = ["contexts", "answer"]
ignore_columns = ignore_columns or []
return [k for k in keys if k not in ignore_columns]

Is this the expected behavior? If not, could you please take look into it?

Thanks!

Best regards,
Juan

@jucgonzalezes jucgonzalezes changed the title Inconsistency in EVALMODE_TO_COLUMNS[EvaluationMode.ca] Value Inconsistency in the Value of EVALMODE_TO_COLUMNS[EvaluationMode.ca] Aug 23, 2024
Copy link

dosubot bot commented Aug 23, 2024

Hey @jucgonzalezes!

I'm here to help you out with any bugs, questions, or contributions you have in mind. Let's tackle this together!

The value of EVALMODE_TO_COLUMNS[EvaluationMode.ca] in src/ragas/validation.py should indeed be ["contexts", "answer"] as indicated in the get_required_columns() function from src/ragas/metrics/base.py [1][2]. The current value ["contexts", "summary"] appears to be incorrect and should be updated to maintain consistency across the codebase.

To continue talking to Dosu, mention @dosu.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
1 participant