ExactSearcher
- class lightning_ir.retrieve.base.searcher.ExactSearcher(index_dir: Path | str, search_config: SearchConfig, module: BiEncoderModule, use_gpu: bool = True)[source]
Bases:
SearcherSearcher that retrieves documents using exact matching of query embeddings.
Methods
search(output)Search for documents based on the output of the bi-encoder model.
Attributes
Get the document token indices for scoring.
- property doc_token_idcs: Tensor
Get the document token indices for scoring.
- Returns:
The document token indices.
- Return type:
torch.Tensor
- search(output: BiEncoderOutput) Tuple[PackedTensor, List[List[str]]][source]
Search for documents based on the output of the bi-encoder model.
- Parameters:
output (BiEncoderOutput) – The output from the bi-encoder model containing query and document embeddings.
- Returns:
The top-k scores and corresponding document IDs.
- Return type:
Tuple[PackedTensor, List[List[str]]]