-
Notifications
You must be signed in to change notification settings - Fork 824
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: make general purpose metrics more general (#1666)
## Metrics Converted - [x] Aspect Critic - [x] Simple Criteria - [x] Rubric Based - both Instance and Domain specific a few different examples ### Aspect Critic ```py from ragas.metrics import AspectCritic from ragas.dataset_schema import SingleTurnSample only_response = SingleTurnSample( response="The Eiffel Tower is located in Paris." ) grammar_critic = AspectCritic( name="grammar", definition="Is the response grammatically correct?", llm=evaluator_llm ) await grammar_critic.single_turn_ascore(only_response) ``` with reference ```py answer_correctness_critic = AspectCritic( name="answer_correctness", definition="Is the response and reference answer are the same?", llm=evaluator_llm ) # data row sample = SingleTurnSample( user_input="Where is the Eiffel Tower located?", response="The Eiffel Tower is located in Paris.", reference="London" ) await answer_correctness_critic.single_turn_ascore(sample) ``` **Note:** this only works for multi-turn metrics for now
- Loading branch information
Showing
27 changed files
with
1,173 additions
and
1,582 deletions.
There are no files selected for viewing
This file contains 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 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 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 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 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 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 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 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 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
Oops, something went wrong.