+
Skip to content

Conversation

akarshgupta7
Copy link
Contributor

No description provided.

Copy link
Contributor

@baitsguy baitsguy left a comment

Choose a reason for hiding this comment

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

Couple small refactoring requests

if not result.result:
console.print("[yellow] No query execution result available, skipping..", style="italic")
# Evaluate string metrics
if not query.expected:
Copy link
Contributor

Choose a reason for hiding this comment

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

this function is large enough now that it might make sense to separate the specific metric types into separate methods (doc_retrieval metrics, generated_answer metrics)

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 have made these changes.

response=result.result,
reference=query.expected,
)
scores = asyncio.run(
Copy link
Contributor

Choose a reason for hiding this comment

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

do we really need to make compute_string_metrics an async method? Can we just have it be sync and have it wait for processing within?

This is adding a little complexity and I'm unsure why

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 looked into this as well for a long time. Ragas method to get score is async because of which we have to do this. Do you have any suggestions?

Copy link
Contributor

Choose a reason for hiding this comment

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

You can do a variant off https://chatgpt.com/share/67466a08-1488-8007-b4fa-2d2538c74071

Basically do the waiting for async completion inside the compute_string_metrics method

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There will be no waiting as such because do_eval runs one sample at a time. Ragas people have made it an async function to handle large workloads.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Regardless I have made the changes.

Copy link
Contributor

Choose a reason for hiding this comment

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

Right I just mean in terms of function APIs

metrics.doc_retrieval_precision = len(retrieved_doc_set & expected_doc_set) / len(retrieved_doc_set)
return metrics

def get_string_metrics(
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: generated_answer_metrics

@akarshgupta7 akarshgupta7 merged commit 796e3a9 into main Nov 27, 2024
13 of 14 checks passed
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.

2 participants

点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载