TorchSparseIndex

class lightning_ir.retrieve.pytorch.sparse_searcher.TorchSparseIndex(index_dir: Path, similarity_function: Literal['dot', 'cosine'], use_gpu: bool = False)[source]

Bases: object

__init__(index_dir: Path, similarity_function: Literal['dot', 'cosine'], use_gpu: bool = False) None[source]

Methods

__init__(index_dir, similarity_function[, ...])

cosine_similarity(x, y)

dot_similarity(x, y)

score(embeddings)

to_gpu()

Attributes

num_embeddings