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: evaluation pipeline should return all element types #242

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions packages/ragbits-evaluate/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## Unreleased

### Changed

- document search evaluation now returns all Element types, rather than only TextElements (#241).

## 0.5.0 (2024-12-05)

### Changed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

from ragbits.document_search import DocumentSearch
from ragbits.document_search.documents.document import DocumentMeta
from ragbits.document_search.documents.element import TextElement
from ragbits.document_search.documents.sources import HuggingFaceSource
from ragbits.evaluate.pipelines.base import EvaluationPipeline, EvaluationResult

Expand Down Expand Up @@ -50,7 +49,7 @@ async def __call__(self, data: dict) -> DocumentSearchResult:
The evaluation result.
"""
elements = await self.document_search.search(data["question"])
predicted_passages = [element.content for element in elements if isinstance(element, TextElement)]
predicted_passages = [element.text_representation or "" for element in elements]
return DocumentSearchResult(
question=data["question"],
reference_passages=data["passages"],
Expand Down
Loading