SearchResult#
- class scikitplot.corpus.SearchResult(doc, score, match_mode, backend=None, index_generation=None)[source]#
A single search result.
- Parameters:
- docCorpusDocument
The matched document.
- scorefloat
Relevance score (higher is better). Scale depends on match mode:
STRICT: 1.0 if match, 0.0 otherwise
KEYWORD: Jaccard similarity [0, 1] or BM25 score
SEMANTIC: cosine similarity [-1, 1]
HYBRID: reciprocal rank fusion score
- match_modestr
The mode that produced this result.
- backendstr or None
Name of the dense ANN backend that produced this result (SEMANTIC/HYBRID), or
Nonefor STRICT/KEYWORD. Provenance only: excluded from equality and hashing.- index_generationint or None
The
SimilarityIndexbuild generation that produced this result. Increments on everySimilarityIndex.build, so a caller can detect results computed against a since-rebuilt index. Provenance only: excluded from equality and hashing.
- Parameters:
Notes
Developer note:
backendandindex_generationdescribe how the result was produced, not what it is, so they usecompare=False— two results for the same document/score/mode remain equal regardless of provenance. Embedding-model identity is out of scope here (it travels with the document embeddings; see the embedding-cache identity contract).