Skip to content

Update RAG metrics#13

Merged
jmsevin merged 7 commits into
mainfrom
update-metrics
May 5, 2025
Merged

Update RAG metrics#13
jmsevin merged 7 commits into
mainfrom
update-metrics

Conversation

@jmsevin
Copy link
Copy Markdown
Collaborator

@jmsevin jmsevin commented May 2, 2025

Description

In order to evaluate future evolutions (choice of new LLM, hybrid search feature in Qdrant...), we needed to update the RAG metrics script.

Why?

Ragas library evolved quite a lot, so we had to update the metrics script to reflect those changes. Moreover, we decided to focus on metrics which don't need groundtruth data, as the way we synthesized them the first time may be not relevant for our current usecase. Finally, we added an option in the script to compute RAG metrics without context (i.e. when the LLM doesn't get resources from WeLearn database).

How?

Five RAG metrics are computed now:

The script is launched through the command line python rag-metrics.py. Three options can be added:

  • --all_corpus to aggregate WeLearn resources by language and provide one context only (per language) to the LLM
  • --reranking to rerank WeLearn resources in order to improve diversity
  • --vanilla to compute RAG metrics without any context (i.e. WeLearn resources) for the LLM

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist:

  • My code follows the code style of this project.
  • My code is tested.
  • I have updated the documentation accordingly.

@jmsevin jmsevin requested review from Copilot and sandragjacinto May 2, 2025 15:34
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR updates the RAG metrics script and related chat service functions to align with the latest library changes and improve error handling.

  • Added try/except blocks and enhanced logging in the chat functions.
  • Updated dependency versions and added new dependencies in pyproject.toml to support evolved libraries.

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.

File Description
src/app/services/abst_chat.py Improved error handling in chat calls and updated model strings.
pyproject.toml Updated dependency versions for ragas and added new dependencies.
Comments suppressed due to low confidence (1)

src/app/services/abst_chat.py:595

  • The print statement in the chat_schema function may be left over from debugging. Consider replacing it with a logging statement or removing it to avoid unintended console output in production.
print(completion)

@jmsevin jmsevin merged commit e5658d1 into main May 5, 2025
3 checks passed
@jmsevin jmsevin deleted the update-metrics branch May 5, 2025 14:38
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.

3 participants