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

Add RAGAS evaluation metrics #504

Closed
wants to merge 19 commits into from
Closed

Conversation

kcortinas
Copy link
Collaborator

@kcortinas kcortinas commented Apr 23, 2024

closes #317

This PR integrates RAGAS open source evaluation framework for RAG pipelines. The new added metrics offer support for both end-to-end and component-wise RAG evaluation:

  • End-to-end evaluation: answer correctness, answer semantic similarity.
  • Component-wise evaluation: retrieval metrics (context precision, context relevancy, context recall, context entity recall), generation metrics (faithfulness, answer relevancy).

This PR also fixes:

  • Experiment name input when calling generate_metrics
  • Missing params when calling query_and_eval_single_line

image

image

@kcortinas kcortinas marked this pull request as draft April 23, 2024 07:46
@kcortinas kcortinas self-assigned this Apr 23, 2024
@kcortinas kcortinas marked this pull request as ready for review April 23, 2024 10:04
Copy link
Member

@martinpeck martinpeck left a comment

Choose a reason for hiding this comment

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

This looks good to me.

I would rather @ritesh-modi give you a final approval, but from my point of view this should be approved and merged.

@martinpeck
Copy link
Member

What was the reason for the force-push?

@kcortinas
Copy link
Collaborator Author

What was the reason for the force-push?

@martinpeck The branch became outdated so rebased and pushed with --force-with-lease to avoid overwriting

@guybartal guybartal self-assigned this May 16, 2024
azure_deployment=azure_configs["embedding_deployment"],
model=azure_configs["embedding_name"],
)
ragas_azure_embeddings = LangchainEmbeddingsWrapper(azure_embeddings)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can it be done without using LangchainLLMWrapper and LangchainEMbeddingsWrapper?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

No. Since RAGAS can be used with different LLM models these wrappers help the RAGAS library implement a common interface used by the metrics. We could of course create our own implementation of the wrappers, but it would require duplicating a lot of existing logic and continuous monitoring of the RAGAS library for compatibility issues. Is there a specific reason why we would want not to import them?

Copy link
Collaborator

Choose a reason for hiding this comment

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

This needs to be evaluated because of new security guidance

Copy link
Collaborator

Choose a reason for hiding this comment

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

@ritesh-modi , we have many LangChain dependencies already which we need to resolve with priority,
I think we should open a new separate issue to address this across and not block this PR to prerelease branch.
WDYT?

.github/workflows/config.json Show resolved Hide resolved
@kcortinas kcortinas changed the base branch from development to prerelease May 17, 2024 09:52
Copy link
Collaborator

@guybartal guybartal left a comment

Choose a reason for hiding this comment

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

LGTM, if all comments are resolved, lets merge this to prerelease branch

@kcortinas
Copy link
Collaborator Author

As discussed, closing this PR per security guidance

@kcortinas kcortinas closed this May 22, 2024
@kcortinas kcortinas deleted the karina/add-ragas-metrics branch May 22, 2024 08:19
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.

Add missing metrics and align existing from Ragas library
5 participants