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

[Bug]: Potential Index Mismatch in Rerank Model Results for bge-reranker-v2-m3 #2575

Closed
1 task done
1006076811 opened this issue Sep 25, 2024 · 0 comments
Closed
1 task done
Assignees
Labels
bug Something isn't working

Comments

@1006076811
Copy link

Is there an existing issue for the same bug?

  • I have checked the existing issues.

Branch name

main

Commit ID

last

Other environment information

No response

Actual behavior

t seems there may be a logical issue in the rerank model when calling the bge-reranker-v2-m3 model. Specifically, the result includes an index field that marks the pre-sorted index of the items. However, in the similarity function, the code directly returns the following array:

np.array([d["relevance_score"] for d in res["results"]])

This array appears to have lost the index information, which can lead to a mismatch between the relevance scores and the original indexes. I'm unsure if I misunderstood something, but it seems like a bug, as the scores and the indexes do not align correctly.

Expected behavior

The relevance scores returned should maintain a proper mapping to their corresponding pre-sorted indexes.

Steps to reproduce

Call the bge-reranker-v2-m3 model using the rerank feature.

Observe that the index field is included in the results but not preserved when returning the relevance scores.

Check for the mismatch between the scores and their corresponding indexes.

Additional information

image

@1006076811 1006076811 added the bug Something isn't working label Sep 25, 2024
KevinHuSh pushed a commit that referenced this issue Sep 26, 2024
### What problem does this PR solve?

Fix: renrank_model and pdf_parser bugs | Update: session API
#2575
#2559
### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
- [x] Refactoring

---------

Co-authored-by: liuhua <[email protected]>
Halfknow pushed a commit to Halfknow/ragflow that referenced this issue Nov 11, 2024
…low#2601)

### What problem does this PR solve?

Fix: renrank_model and pdf_parser bugs | Update: session API
infiniflow#2575
infiniflow#2559
### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
- [x] Refactoring

---------

Co-authored-by: liuhua <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants