Skip to content

TopKretriever similarity calculation #29

@Jerry-723

Description

@Jerry-723

res = self.model.encode(raw_text, show_progress_bar=False)

When using faiss for candidate example selection, the vector inner product distance is the closest. Why not use cosine similarity? The embedding is not normalized, and the calculation results using the inner product will be affected by the vector modulus. Should it be modified to:

res = self.model.encode(raw_text, show_progress_bar=False, normalize_embeddings=True)

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