feat: Evaluation Module Prototype#172
Open
frayle-ons wants to merge 5 commits into
Open
Conversation
…lder and init file
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.
✨ Summary
These changes add a new evaluation module that can quantitatively evaluate the performance of
VectorStoresagainst a user-provided ground truth dataset using package-provided classification metrics.The current implementation views the evaluation as a 'multi-class-single-label' problem, with each evaluation metric assessing only the top candidate result output from the VectorStore search method. Additional metrics could be considered such as 'hit@k' where we assess if the correct label is in the top K results of a VectorStore search, to give users more options on how to evaluate VectorStores.
The main entry point for the new code; the evaluation function, importable from the Evaluation module, has several parameters:
['qid', 'text', 'label'], where text is the query, and label is the ground truth correct label,The evaluation function performs several actions:
vectorstorewith the provided eval data queries.vectorstoresearch results using provided ground truth labelsvectorstoresoutput_fileargument is provided with a valid .csv string.Final thought:
📜 Changes Introduced
✅ Checklist
Passes all pre-commit checks.
🔍 How to Test
The tester should obtain some data that has queries and gold standard labels for a give vectorstore, loading the queries into a pandas dataframe with
['qid', 'text', 'label']columns. All columns should be loaded with string types.Next they should instantiate the corresponding VectorStore(s) they wish to evaluate against the ground truth dataset.
Passing these items are arguments to the new evaluate function as in the code below, and specifying a list of metric names, the user can run the script to see the evaluation function,
Additionally test the functionality that allows users to pass callable to the
vectorstoresargument of the eval function. To do this the user could write a zero-arg function that returns an instantiatedvectorstoreobject and pass the function pointer as an argument (not the call the to function). See below for the normal process of instantiation versus the samevectorstorewrapped as a callable.Finally try out some edge cases such as:
classification_suitestring to the metrics, which triggers all current metrics to run