caikit.interfaces.nlp.data_model.reranker ========================================= .. py:module:: caikit.interfaces.nlp.data_model.reranker Classes ------- .. autoapisummary:: caikit.interfaces.nlp.data_model.reranker.RerankScore caikit.interfaces.nlp.data_model.reranker.RerankScores caikit.interfaces.nlp.data_model.reranker.RerankResult caikit.interfaces.nlp.data_model.reranker.RerankResults Module Contents --------------- .. py:class:: RerankScore Bases: :py:obj:`caikit.core.DataObjectBase` The score for one document (one query) .. py:attribute:: document :type: py_to_proto.dataclass_to_proto.Annotated[Optional[caikit.core.data_model.json_dict.JsonDict], FieldNumber(1)] .. py:attribute:: index :type: py_to_proto.dataclass_to_proto.Annotated[int, FieldNumber(2)] .. py:attribute:: score :type: py_to_proto.dataclass_to_proto.Annotated[float, FieldNumber(3)] .. py:attribute:: text :type: py_to_proto.dataclass_to_proto.Annotated[Optional[str], FieldNumber(4)] .. py:class:: RerankScores Bases: :py:obj:`caikit.core.DataObjectBase` Scores for a query in a rerank task. This is a list of n ReRankScore where n is based on top_n documents and each score indicates the relevance of that document for this query. Results are ordered most-relevant first. .. py:attribute:: query :type: py_to_proto.dataclass_to_proto.Annotated[Optional[str], FieldNumber(1)] .. py:attribute:: scores :type: py_to_proto.dataclass_to_proto.Annotated[List[RerankScore], FieldNumber(2)] .. py:class:: RerankResult Bases: :py:obj:`caikit.core.DataObjectBase` Result for one query in a rerank task. This is a list of n ReRankScore where n is based on top_n documents and each score indicates the relevance of that document for this query. Results are ordered most-relevant first. .. py:attribute:: result :type: py_to_proto.dataclass_to_proto.Annotated[RerankScores, FieldNumber(1)] .. py:attribute:: producer_id :type: py_to_proto.dataclass_to_proto.Annotated[caikit.interfaces.common.data_model.ProducerId, FieldNumber(2)] .. py:attribute:: input_token_count :type: py_to_proto.dataclass_to_proto.Annotated[Optional[int], FieldNumber(3)] .. py:class:: RerankResults Bases: :py:obj:`caikit.core.DataObjectBase` Results list for rerank tasks (supporting multiple queries). For multiple queries, each one has a RerankQueryResult (ranking the documents for that query). .. py:attribute:: results :type: py_to_proto.dataclass_to_proto.Annotated[List[RerankScores], FieldNumber(1)] .. py:attribute:: producer_id :type: py_to_proto.dataclass_to_proto.Annotated[caikit.interfaces.common.data_model.ProducerId, FieldNumber(2)] .. py:attribute:: input_token_count :type: py_to_proto.dataclass_to_proto.Annotated[Optional[int], FieldNumber(3)]