-
Notifications
You must be signed in to change notification settings - Fork 817
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
The context_precision_score
always returns 0 when using Bedrock with Claude instant.
#288
Comments
Hi @Pauldevillers, this is a dominant issue with different prompts in the framework. As the first step in tackling this, we are going to change the prompts so that the output follows specific structure like json and can be verified easily. Thanks for bringing this to our notice, you can expect a fix very soon :) |
I support this @Pauldevillers. Using
So I get 0 in all examples. Thanks for looking into it @shahules786 |
Hello @shahules786 , I just summited a PR to tackle this issue: #289 |
Thank you @Pauldevillers :) |
The same happens for vertex text bison |
same issue here |
Now i am getting NaN |
this is tricky because this is both a bug and only a long term problem. I think we can start off with having prompts for Bedrock and Vertext AI maybe @shahules786 . |
I am also getting same error while using claude v2 via Bedrock. |
Hi @kishoreiitd can you share the ragas version? This should be fixed with #364 |
Thanks @shahules786 This has been fixed. I was using version 0.0.21, however I was trying it before this #364. |
addressed with #364 |
Describe the bug
The context_precision_score always returns 0 when using Bedrock with Claude instant.
I loaded Amazon Bedrock documentation with OpenSearch as a vector store, and I am performing evaluation using Ragas.
The context_precision_score splits each chunk retrieved from vector search and uses a prompt to verify if the information in the given context is useful in answering the question. The LLM should answer with a yes/no answer.
The problem is that the LLM does not answer only yes or no but also includes its thinking process, as shown below:
The issue lies in the context_precision.py file, specifically in the following line:
This line checks if "Yes" is present in each response within the grouped_responses list. In the example above, the response outputs 0 even though we can see the answer contains "yes."
I have four items inside my grouped_responses, and the error occurs because there is no exact match with the condition int("Yes" in resp). The condition looks for a strict "Yes" in the response, leading to the problem.
Python version and packages
Ragas version: Python 3.9.6
Python version: ragas==0.0.19
Options to Resolve the Error:
Please provide guidance on implementing one of the suggested options to resolve the error.
Code to Reproduce
Expected behavior
context_precision_score: not 0 value
Additional context
Here are my four elements inside `grouped_responses``:
The text was updated successfully, but these errors were encountered: