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

fix: improve context relevancy metric #7964

Merged
merged 22 commits into from
Jul 22, 2024

Conversation

davidsbatista
Copy link
Contributor

@davidsbatista davidsbatista commented Jul 2, 2024

Related Issues

Proposed Changes:

The ContextRelevanceEvaluator now returns a list of relevant sentences for each context, instead of all the sentences in a context. Also, a score of 1 is now returned if a relevant sentence is found, and 0 otherwise.

How did you test it?

  • unit tests, integration tests, manual verification and end2end tests

Notes for the reviewer

  • Check the details of the discussion in #78 to better understand the context of this change.

Checklist

@github-actions github-actions bot added topic:tests type:documentation Improvements on the docs labels Jul 2, 2024
@coveralls
Copy link
Collaborator

coveralls commented Jul 2, 2024

Pull Request Test Coverage Report for Build 9761382356

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.001%) to 89.969%

Totals Coverage Status
Change from base Build 9758508178: 0.001%
Covered Lines: 6745
Relevant Lines: 7497

💛 - Coveralls

@coveralls
Copy link
Collaborator

coveralls commented Jul 2, 2024

Pull Request Test Coverage Report for Build 9763512100

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.003%) to 89.971%

Totals Coverage Status
Change from base Build 9758508178: 0.003%
Covered Lines: 6746
Relevant Lines: 7498

💛 - Coveralls

@coveralls
Copy link
Collaborator

coveralls commented Jul 2, 2024

Pull Request Test Coverage Report for Build 9763863648

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.003%) to 89.971%

Totals Coverage Status
Change from base Build 9758508178: 0.003%
Covered Lines: 6746
Relevant Lines: 7498

💛 - Coveralls

@davidsbatista davidsbatista changed the title Improve context relevancy metric fix: improve context relevancy metric Jul 2, 2024
@davidsbatista davidsbatista marked this pull request as ready for review July 2, 2024 16:24
@davidsbatista davidsbatista requested a review from a team as a code owner July 2, 2024 16:24
@davidsbatista davidsbatista requested review from Amnah199 and julian-risch and removed request for a team and Amnah199 July 2, 2024 16:24
@davidsbatista davidsbatista requested a review from a team as a code owner July 2, 2024 16:29
@davidsbatista davidsbatista requested review from dfokina and removed request for a team July 2, 2024 16:29
@coveralls
Copy link
Collaborator

coveralls commented Jul 2, 2024

Pull Request Test Coverage Report for Build 9764606380

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.003%) to 89.971%

Totals Coverage Status
Change from base Build 9758508178: 0.003%
Covered Lines: 6746
Relevant Lines: 7498

💛 - Coveralls

@davidsbatista davidsbatista added topic:eval 2.x Related to Haystack v2.0 labels Jul 2, 2024
@coveralls
Copy link
Collaborator

coveralls commented Jul 2, 2024

Pull Request Test Coverage Report for Build 9764679440

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.003%) to 89.971%

Totals Coverage Status
Change from base Build 9758508178: 0.003%
Covered Lines: 6746
Relevant Lines: 7498

💛 - Coveralls

@coveralls
Copy link
Collaborator

coveralls commented Jul 4, 2024

Pull Request Test Coverage Report for Build 9796828476

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 16 unchanged lines in 2 files lost coverage.
  • Overall coverage increased (+0.04%) to 90.003%

Files with Coverage Reduction New Missed Lines %
components/routers/conditional_router.py 2 97.4%
components/converters/azure.py 14 89.55%
Totals Coverage Status
Change from base Build 9758508178: 0.04%
Covered Lines: 6770
Relevant Lines: 7522

💛 - Coveralls

@coveralls
Copy link
Collaborator

coveralls commented Jul 5, 2024

Pull Request Test Coverage Report for Build 9807039259

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 17 unchanged lines in 3 files lost coverage.
  • Overall coverage increased (+0.04%) to 90.005%

Files with Coverage Reduction New Missed Lines %
components/builders/answer_builder.py 1 98.28%
components/routers/conditional_router.py 2 97.4%
components/converters/azure.py 14 89.55%
Totals Coverage Status
Change from base Build 9758508178: 0.04%
Covered Lines: 6772
Relevant Lines: 7524

💛 - Coveralls

@coveralls
Copy link
Collaborator

coveralls commented Jul 5, 2024

Pull Request Test Coverage Report for Build 9807972372

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 17 unchanged lines in 3 files lost coverage.
  • Overall coverage increased (+0.04%) to 90.004%

Files with Coverage Reduction New Missed Lines %
components/builders/answer_builder.py 1 98.28%
components/routers/conditional_router.py 2 97.4%
components/converters/azure.py 14 89.55%
Totals Coverage Status
Change from base Build 9758508178: 0.04%
Covered Lines: 6771
Relevant Lines: 7523

💛 - Coveralls

@davidsbatista
Copy link
Contributor Author

NOTE: blocked until the 2.4 release

@shadeMe shadeMe marked this pull request as draft July 8, 2024 08:33
@shadeMe shadeMe added this to the 2.4.0 milestone Jul 8, 2024
@julian-risch julian-risch removed their request for review July 10, 2024 16:51
@coveralls
Copy link
Collaborator

coveralls commented Jul 11, 2024

Pull Request Test Coverage Report for Build 10041187329

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.003%) to 90.122%

Totals Coverage Status
Change from base Build 10005172669: -0.003%
Covered Lines: 6861
Relevant Lines: 7613

💛 - Coveralls

@davidsbatista davidsbatista marked this pull request as ready for review July 19, 2024 11:13
haystack/components/evaluators/context_relevance.py Outdated Show resolved Hide resolved
haystack/components/evaluators/context_relevance.py Outdated Show resolved Hide resolved
haystack/components/evaluators/context_relevance.py Outdated Show resolved Hide resolved
haystack/components/evaluators/context_relevance.py Outdated Show resolved Hide resolved
@davidsbatista
Copy link
Contributor Author

@shadeMe thanks for the feedback - I've updated the PR

@shadeMe
Copy link
Collaborator

shadeMe commented Jul 22, 2024

Let's wait for @anakin87's review before merging.

@anakin87 anakin87 self-requested a review July 22, 2024 11:34
Copy link
Member

@anakin87 anakin87 left a comment

Choose a reason for hiding this comment

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

Feel free to merge once the following line is updated

"outputs" must be a dictionary with "statements" and "statement_scores".

@davidsbatista davidsbatista merged commit 0c9dc00 into main Jul 22, 2024
17 checks passed
@davidsbatista davidsbatista deleted the improve-context-relevancy-metric branch July 22, 2024 13:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.x Related to Haystack v2.0 breaking change topic:eval topic:tests type:documentation Improvements on the docs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants