-
Notifications
You must be signed in to change notification settings - Fork 668
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
Context Recall returning NaN when using GPT-4 models #798
Comments
Hey, can you please share some data points that I can use to reproduce the issue? |
from ragas.metrics import ( amnesty_qa = load_dataset("explodinggradients/amnesty_qa", "english_v2") gpt4 = ChatOpenAI(model_name="gpt-4-0125-preview") result = evaluate( result df.head(10) Running this code from your website I am getting 9/10 values of NaN for context recall: |
I would like to add it works better with the gpt-4 simple model and works almost perfectly with the gpt-3.5 models. But I need to run the evaluation with the gpt4 models. |
Hi, I think this is still relevant. Context Precision and context recall return Nan for Gpt-4o models |
[x] I have checked the documentation and related resources and couldn't resolve my bug.
Describe the bug
When using any gpt-4 model as an evaluator, the context recall metric returns an NaN result and the following warning for almost every single question:
WARNING:ragas.metrics._context_recall:Invalid JSON response. Expected dictionary with key 'Attributed'
I have tried this with my own dataset, as well as following the instructions in https://docs.ragas.io/en/stable/getstarted/evaluation.html simply changing the evaluator to any of the GPT-4 models (gpt-4-0125-preview, gpt-4-1106-preview and gpt-4). From the 10 questions in the testset, I got on average 9 NaN results for that metric. The other metrics work correctly.
Ragas version: 0.1.5
Python version: 3.10
Code to Reproduce
Follow the code in https://docs.ragas.io/en/stable/getstarted/evaluation.html simply changing the evaluator to any of the GPT-4 models (gpt-4-0125-preview, gpt-4-1106-preview and gpt-4).
Error trace
WARNING:ragas.metrics._context_recall:Invalid JSON response. Expected dictionary with key 'Attributed'
The text was updated successfully, but these errors were encountered: