Skip to content

MultipleNegativesRankingLoss issue #3581

@yfdjchvlgv

Description

@yfdjchvlgv

When I want to use MultipleNegativesRankingLoss, my dataset consists of a query with one positive example and multiple negative examples, but the number of negative examples can range from 0 to 5. When I try to format it as (anchor, positive, negative_1, …, negative_n), it seems necessary to structure it as (anchor, positive, [negative_1, …, negative_n]). Additionally, the list of negative examples must contain more than two negative examples for proper training. The same dataset can train an embedding model, but when training a reranking model, it throws an IndexError: The shape of the mask [2, 4] at index 0 does not match the shape of the indexed tensor [4, 2] at index 0.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions