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

Minimize requirements for user data for OPEA ragas #136

Merged
merged 10 commits into from
Sep 24, 2024

Conversation

adkakne
Copy link
Contributor

@adkakne adkakne commented Sep 20, 2024

Description

Purpose of this PR to minimize requirements on user data and improve flexibility and coverage of use-cases.

Prior to this PR, we required all 4 fields (question, answer, ground truth and contexts). But, this PR ensures we only require minimum input fields for a given list of metrics. E.g., "faithfulness" does not require ground _truth field, so it will not be asked from the user.

This PR grabs list of required fields for each metric from ragas and sets their union as the final required fields for a given list of metrics. We use this final list of required fields to be present in input data.

Issues

n/a.

Type of change

List the type of change like below. Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)

Dependencies

None.

Tests

This PR was tested for OpenAI (ragas uses GPT-4o by default) and HF endpoint (Llama 3.1 70b on Gaudi2 machine).

@adkakne adkakne changed the title Minimizing requirements for user data Minimizing requirements for user data for OPEAR ragas Sep 20, 2024
@adkakne adkakne changed the title Minimizing requirements for user data for OPEAR ragas Minimize requirements for user data for OPEAR ragas Sep 20, 2024
@adkakne adkakne changed the title Minimize requirements for user data for OPEAR ragas Minimize requirements for user data for OPEA ragas Sep 20, 2024
@adkakne
Copy link
Contributor Author

adkakne commented Sep 20, 2024

Hi @XinyuYe-Intel, the error is - "AttributeError: 'AnswerRelevancy' object has no attribute '_required_columns'". But, latest version of ragas has _required_columns for AnswerRelevancy metric as found here - https://github.com/explodinggradients/ragas/blob/main/src/ragas/metrics/_answer_relevance.py#L111.

The testing environment uses ragas 0.1.16 but latest version is 0.1.20. Ragas continually adds and deletes metrics. So, should we pull latest version of ragas for the testing environment? Please share your insights. Thank you.

Copy link
Collaborator

@minmin-intel minmin-intel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Please make sure the unit test pass.

@lkk12014402
Copy link
Collaborator

LGTM. please make sure the ut https://github.com/opea-project/GenAIEval/blob/main/tests/test_ragas.py pass. you can test the ut locally.

@adkakne
Copy link
Contributor Author

adkakne commented Sep 24, 2024

Thank you for reviewing. The issue was coming from older versions of ragas. I added support for them and now the code passes all checks. Thanks!

@XinyuYe-Intel XinyuYe-Intel merged commit f1593ea into opea-project:main Sep 24, 2024
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants