Skip to content
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

Added cookbook for ragas integration #70

Merged
merged 4 commits into from
Apr 23, 2024

Conversation

AnushreeBannadabhavi
Copy link
Contributor

@AnushreeBannadabhavi AnushreeBannadabhavi commented Mar 22, 2024

A cookbook showcasing the Haystack-Ragas integration. Fixes the issue Cookbook for Ragas

Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@AnushreeBannadabhavi
Copy link
Contributor Author

Hi @TuanaCelik! Would love your feedback on my PR. It fixes #52.

@TuanaCelik TuanaCelik self-requested a review April 8, 2024 14:53
@TuanaCelik TuanaCelik self-assigned this Apr 8, 2024
@vblagoje vblagoje self-assigned this Apr 10, 2024
@@ -0,0 +1,5272 @@
{
Copy link
Member

@vblagoje vblagoje Apr 10, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line #2.    

Missing os import here


Reply via ReviewNB

@@ -0,0 +1,5272 @@
{
Copy link
Member

@vblagoje vblagoje Apr 10, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line #2.    

nitpick: Let's do pip install as other notebooks, one liner with ! i.e.

!pip install "pydantic<1.10.10", datasets>=2.6.1", haystack-ai, ragas-haystack


Reply via ReviewNB

@@ -0,0 +1,5272 @@
{
Copy link
Member

@vblagoje vblagoje Apr 10, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a short note here that we are using SQUAD here for convenience and tutorial purposes and that users will likely eval their domain specific datasets.

Also note what are the annotation requirements needed in a dataset, i.e which datasets fields are what you described further below with "Now that we have the questions, generated answers, contexts and the ground truths, we can begin our pipeline evaluation and compute all the supported metrics."

It is prudent to notify users of these requirements before they proceed further.


Reply via ReviewNB

@@ -0,0 +1,5272 @@
{
Copy link
Member

@vblagoje vblagoje Apr 10, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line #24.    os.environ["OPENAI_API_KEY"] = getpass("Enter OpenAI API key:")

No need to do this again, you've already completed intake of the OPENAI_API_KEY above. So either here or there, either is fine, but not both.


Reply via ReviewNB

@@ -0,0 +1,5272 @@
{
Copy link
Member

@vblagoje vblagoje Apr 10, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's have a nice metric definition like you do in other sections :-)

Context Utilization is....


Reply via ReviewNB

@@ -0,0 +1,5272 @@
{
Copy link
Member

@vblagoje vblagoje Apr 10, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line #8.            "strictness": 2

What's strictness?


Reply via ReviewNB

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated the metric description with the definition

@@ -0,0 +1,5272 @@
{
Copy link
Member

@vblagoje vblagoje Apr 10, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nitpick: definition


Reply via ReviewNB

@@ -0,0 +1,5272 @@
{
Copy link
Member

@vblagoje vblagoje Apr 10, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nitpick definition


Reply via ReviewNB

@@ -0,0 +1,5272 @@
{
Copy link
Member

@vblagoje vblagoje Apr 10, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nitpick: definition


Reply via ReviewNB

@@ -0,0 +1,5272 @@
{
Copy link
Member

@vblagoje vblagoje Apr 10, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not do all at once - for example all metrics that don't require ground truth or need common fields?


Reply via ReviewNB

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not entirely clear on your question. Could you provide more details?

I included this section to demonstrate the computation of multiple metrics using a single pipeline object.

@vblagoje vblagoje self-requested a review April 10, 2024 08:57
Copy link
Member

@vblagoje vblagoje left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@AnushreeBannadabhavi thanks a lot for this effort and apologies for delayed review. Although there are some minor request for changes this is already a solid work and an amazing contribution. Let's polish up some of the details and integrate this one 🚀

@vblagoje
Copy link
Member

@AnushreeBannadabhavi as we are, unfortunately, time bound for the integration of this PR would you please make these updates until tomorrow (12.4.24)? If not, I'll make them myself and we'll integrate this PR. Let us know.

@AnushreeBannadabhavi
Copy link
Contributor Author

AnushreeBannadabhavi commented Apr 11, 2024

Hi @vblagoje! Thank you for your review. I was busy yesterday and hence I wasn't able to address review comments.
I'll make the updates by tomorrow.

@vblagoje
Copy link
Member

Awesome, thank you @AnushreeBannadabhavi

@AnushreeBannadabhavi
Copy link
Contributor Author

AnushreeBannadabhavi commented Apr 12, 2024

Hi @vblagoje! I've updated the notebook and addressed all your review comments except the last one (multiple evaluator components). I can take a look at that quickly once I hear back from you.

@vblagoje
Copy link
Member

Thanks a lot @AnushreeBannadabhavi for a quick turnaround! @TuanaCelik the notebook, looks ok to me. I'll let you have the final word and integrate

@vblagoje
Copy link
Member

@davidsbatista this one is very similar to DeepEval, would you please also have a look?

@davidsbatista
Copy link
Contributor

@vblagoje LGTM, approved.

I was confused because all the "changes" in the review were still "open" - I think it's better to hit the button "mark as solved" if it's already solved.

@vblagoje vblagoje merged commit a76cb8b into deepset-ai:main Apr 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cookbook for Ragas
4 participants