-
Notifications
You must be signed in to change notification settings - Fork 315
QA eval pipeline for retrieval #1754
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
Open
KyleZheng1284
wants to merge
17
commits into
NVIDIA:main
Choose a base branch
from
KyleZheng1284:feature/qa-harness-fullpage-pipeline
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
de0a769
QA eval pipeline with full-page markdown and multi-tier scoring
16a9b9e
removed stale ref
3c6e13d
fixing ci/cd issues
bc70c40
style: black formatting for QA harness files
d176f39
update readme
9262c63
migrate eval framework to graph pipeline and also added new changes w…
ea42498
add support for multi run sweep w/ support for multiple different mod…
d0b491c
updated eval sweep to correct model name
d5e0f7a
add scripts for running retrieval_bench
05658e3
priortize bo767 as dataset in retrieval bench in readme
6ba0390
refactor scripts
8049693
add agentic retrieval example
f768a91
refactor and consolidate into retriever cli
3cb1178
update to support only plural + remove cli entry point for retrievalb…
65162f8
bug fixes
c80dfa3
remove case
4ae6848
restored singular column names for test
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,77 @@ | ||
| # SPDX-FileCopyrightText: Copyright (c) 2024-25, NVIDIA CORPORATION & AFFILIATES. | ||
| # All rights reserved. | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| """QA evaluation framework for nemo_retriever. | ||
|
|
||
| Provides pluggable retrieval, generation, judging, and orchestration | ||
| components for measuring LLM answer quality given retrieved context. | ||
|
|
||
| The ``EvalOperator`` base class bridges ``graph.AbstractOperator`` into the | ||
| evaluation domain, enabling ``>>`` chaining, ``Graph.execute()``, and | ||
| executor compatibility for all evaluation operators. | ||
|
|
||
| Types, scoring, and ``EvalOperator`` are always available. | ||
| Modules that depend on ``litellm`` (generators, judges, generation, | ||
| judging, orchestrator, config) are lazy-loaded so that lightweight | ||
| consumers can use scoring without installing the ``[eval]`` extra:: | ||
|
|
||
| pip install nemo-retriever[eval] | ||
| """ | ||
|
|
||
| from nemo_retriever.evaluation.eval_operator import EvalOperator | ||
| from nemo_retriever.evaluation.scoring import score_dataframe | ||
| from nemo_retriever.evaluation.types import ( | ||
| AnswerJudge, | ||
| GenerationResult, | ||
| JudgeResult, | ||
| LLMClient, | ||
| RetrievalResult, | ||
| RetrieverStrategy, | ||
| ) | ||
|
|
||
| _LAZY_IMPORTS = { | ||
| "QAGenerationOperator": "nemo_retriever.evaluation.generation", | ||
| "JudgingOperator": "nemo_retriever.evaluation.judging", | ||
| "ScoringOperator": "nemo_retriever.evaluation.scoring_operator", | ||
| "RetrievalLoaderOperator": "nemo_retriever.evaluation.retrieval_loader", | ||
| "LiteLLMClient": "nemo_retriever.evaluation.generators", | ||
| "LLMJudge": "nemo_retriever.evaluation.judges", | ||
| "QAEvalPipeline": "nemo_retriever.evaluation.orchestrator", | ||
| "load_eval_config": "nemo_retriever.evaluation.config", | ||
| "build_eval_chain": "nemo_retriever.evaluation.config", | ||
| "build_eval_pipeline": "nemo_retriever.evaluation.config", | ||
| "run_eval_sweep": "nemo_retriever.evaluation.runner", | ||
| } | ||
|
|
||
|
|
||
| def __getattr__(name: str): | ||
| if name in _LAZY_IMPORTS: | ||
| import importlib | ||
|
|
||
| module = importlib.import_module(_LAZY_IMPORTS[name]) | ||
| return getattr(module, name) | ||
| raise AttributeError(f"module {__name__!r} has no attribute {name!r}") | ||
|
|
||
|
|
||
| __all__ = [ | ||
| "AnswerJudge", | ||
| "EvalOperator", | ||
| "GenerationResult", | ||
| "JudgeResult", | ||
| "JudgingOperator", | ||
| "LLMClient", | ||
| "LLMJudge", | ||
| "LiteLLMClient", | ||
| "QAEvalPipeline", | ||
| "QAGenerationOperator", | ||
| "RetrievalLoaderOperator", | ||
| "RetrievalResult", | ||
| "RetrieverStrategy", | ||
| "ScoringOperator", | ||
| "build_eval_chain", | ||
| "build_eval_pipeline", | ||
| "load_eval_config", | ||
| "run_eval_sweep", | ||
| "score_dataframe", | ||
| ] |
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this mean, if we dont do pip install nemo-retriever[eval] we wont be able to use the LLM generator or judge operators? I don't think that is what we want.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This concern is mainly due to the fact that we want to use llm generator or judge operators outside of the pure eval scope for now right?
I can look into refactoring that later alongside this issue (#1769) but the only need for it now seems to be in the evals