Module astrapy.data.cursors.reranked_result

Classes

class RerankedResult (document: TRAW, scores: dict[str, float | int | None])
Expand source code
@dataclass
class RerankedResult(Generic[TRAW]):
    """
    A single result coming `find_and_rerank` command, i.e. an item from DB with scores.

    Attributes:
        document: a document/row as returned by `find_and_rerank` API command.
        scores: a dictionary of score labels to score float values, such as
            `{"$rerank": 0.87, "$vector" : 0.65, "$lexical" : 0.91}`.
    """

    document: TRAW
    scores: dict[str, float | int | None]

A single result coming find_and_rerank command, i.e. an item from DB with scores.

Attributes

document
a document/row as returned by find_and_rerank API command.
scores
a dictionary of score labels to score float values, such as {"$rerank": 0.87, "$vector" : 0.65, "$lexical" : 0.91}.

Ancestors

  • typing.Generic

Instance variables

var document : ~TRAW

The type of the None singleton.

var scores : dict[str, float | int | None]

The type of the None singleton.