Skip to content

Commit

Permalink
Merge pull request #45 from sbintuitions/fix/reranking_tensor
Browse files Browse the repository at this point in the history
[Fix] rerankingでのformat不具合
  • Loading branch information
lsz05 authored Jul 30, 2024
2 parents fe590c1 + 624ceeb commit 161d40a
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/jmteb/evaluators/reranking/evaluator.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,9 +135,11 @@ def _compute_metrics(
reranked_docs_list = []
for i, item in enumerate(query_dataset):
query_embedding = to_tensor(query_embeddings[i], device=device)
doc_embedding = to_tensor(
torch.stack([doc_embeddings[doc_indices[retrieved_doc]] for retrieved_doc in item.retrieved_docs]),
device=device,
doc_embedding = torch.stack(
[
Tensor(doc_embeddings[doc_indices[retrieved_doc]]).to(device=device)
for retrieved_doc in item.retrieved_docs
]
)
similarity = dist_func(query_embedding, doc_embedding)

Expand Down

0 comments on commit 161d40a

Please sign in to comment.