[SC-9395] Add RAG benchmarking demo notebook#346
Merged
Conversation
rmcmen-vm
reviewed
Apr 3, 2025
Contributor
PR SummaryThis pull request introduces a comprehensive notebook for benchmarking Retrieval-Augmented Generation (RAG) models using the ValidMind library. The notebook demonstrates setting up a RAG pipeline with multiple embedding, retrieval, and generation models, including OpenAI's GPT-3.5 and GPT-4o. It showcases how to initialize models, load datasets, perform data validation, and run various tests to assess model performance. Additionally, the PR enhances visualization in several RAGAS tests by adding titles to histograms and box plots, improving the clarity of the visual output. Test Suggestions
|
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.
Internal Notes for Reviewers
Added titles to RAGAS metrics because when using comparison tests, figures without titles displayed "None" in the title updated by the comparison logic.
External Release Notes
Added a new notebook
rag_benchmarking_demo.ipynbto demonstrate benchmarking of the RAG RFP use case by comparing multiple configurations at each stage of the pipeline. It evaluates two embedding models (OpenAI'stext-embedding-3-smallandtext-embedding-3-large), two retrieval models with differentkparameters (5 and 10), and two LLM generators (gpt-3.5-turboandgpt-4o), creating a total of four complete RAG pipelines. The notebook runs the same tests included inrag_documentation_demo.ipynbsuch as RAGAS metrics (Context Precision, Faithfulness, Answer Correctness), generation quality metrics (ROUGE, BLEU, BERT Score), and bias/toxicity evaluations on all configurations.