openvino_genai.TextRerankPipeline#

class openvino_genai.TextRerankPipeline#

Bases: pybind11_object

Text rerank pipeline

__init__(self: openvino_genai.py_openvino_genai.TextRerankPipeline, models_path: os.PathLike | str | bytes, device: str, config: openvino_genai.py_openvino_genai.TextRerankPipeline.Config | None = None, **kwargs) None#

Constructs a pipeline from xml/bin files, tokenizer and configuration in the same dir models_path (os.PathLike): Path to the directory containing model xml/bin files and tokenizer device (str): Device to run the model on (e.g., CPU, GPU). config: (TextRerankPipeline.Config): Optional pipeline configuration kwargs: Plugin and/or config properties

Methods

__delattr__(name, /)

Implement delattr(self, name).

__dir__()

Default dir() implementation.

__eq__(value, /)

Return self==value.

__format__(format_spec, /)

Default object formatter.

__ge__(value, /)

Return self>=value.

__getattribute__(name, /)

Return getattr(self, name).

__getstate__()

Helper for pickle.

__gt__(value, /)

Return self>value.

__hash__()

Return hash(self).

__init__(self, models_path, device[, config])

Constructs a pipeline from xml/bin files, tokenizer and configuration in the same dir models_path (os.PathLike): Path to the directory containing model xml/bin files and tokenizer device (str): Device to run the model on (e.g., CPU, GPU).

__init_subclass__

This method is called when a class is subclassed.

__le__(value, /)

Return self<=value.

__lt__(value, /)

Return self<value.

__ne__(value, /)

Return self!=value.

__new__(**kwargs)

__reduce__()

Helper for pickle.

__reduce_ex__(protocol, /)

Helper for pickle.

__repr__()

Return repr(self).

__setattr__(name, value, /)

Implement setattr(self, name, value).

__sizeof__()

Size of object in memory, in bytes.

__str__()

Return str(self).

__subclasshook__

Abstract classes can override this to customize issubclass().

_pybind11_conduit_v1_

rerank(self, query, texts)

Reranks a vector of texts based on the query.

start_rerank_async(self, query, texts)

Asynchronously reranks a vector of texts based on the query.

wait_rerank(self)

Waits for reranked texts.

Attributes

__annotations__

class Config#

Bases: pybind11_object

Structure to keep TextRerankPipeline configuration parameters. Attributes:

top_n (int, optional):

Number of documents to return sorted by score.

max_length (int, optional):

Maximum length of tokens passed to the embedding model.

__annotations__ = {}#
__class__#

alias of pybind11_type

__delattr__(name, /)#

Implement delattr(self, name).

__dir__()#

Default dir() implementation.

__eq__(value, /)#

Return self==value.

__format__(format_spec, /)#

Default object formatter.

Return str(self) if format_spec is empty. Raise TypeError otherwise.

__ge__(value, /)#

Return self>=value.

__getattribute__(name, /)#

Return getattr(self, name).

__getstate__()#

Helper for pickle.

__gt__(value, /)#

Return self>value.

__hash__()#

Return hash(self).

__init__(*args, **kwargs)#

Overloaded function.

  1. __init__(self: openvino_genai.py_openvino_genai.TextRerankPipeline.Config) -> None

  2. __init__(self: openvino_genai.py_openvino_genai.TextRerankPipeline.Config, **kwargs) -> None

__init_subclass__()#

This method is called when a class is subclassed.

The default implementation does nothing. It may be overridden to extend subclasses.

__le__(value, /)#

Return self<=value.

__lt__(value, /)#

Return self<value.

__ne__(value, /)#

Return self!=value.

__new__(**kwargs)#
__reduce__()#

Helper for pickle.

__reduce_ex__(protocol, /)#

Helper for pickle.

__repr__()#

Return repr(self).

__setattr__(name, value, /)#

Implement setattr(self, name, value).

__sizeof__()#

Size of object in memory, in bytes.

__str__()#

Return str(self).

__subclasshook__()#

Abstract classes can override this to customize issubclass().

This is invoked early on by abc.ABCMeta.__subclasscheck__(). It should return True, False or NotImplemented. If it returns NotImplemented, the normal algorithm is used. Otherwise, it overrides the normal algorithm (and the outcome is cached).

_pybind11_conduit_v1_()#
property max_length#
property top_n#
__annotations__ = {}#
__class__#

alias of pybind11_type

__delattr__(name, /)#

Implement delattr(self, name).

__dir__()#

Default dir() implementation.

__eq__(value, /)#

Return self==value.

__format__(format_spec, /)#

Default object formatter.

Return str(self) if format_spec is empty. Raise TypeError otherwise.

__ge__(value, /)#

Return self>=value.

__getattribute__(name, /)#

Return getattr(self, name).

__getstate__()#

Helper for pickle.

__gt__(value, /)#

Return self>value.

__hash__()#

Return hash(self).

__init__(self: openvino_genai.py_openvino_genai.TextRerankPipeline, models_path: os.PathLike | str | bytes, device: str, config: openvino_genai.py_openvino_genai.TextRerankPipeline.Config | None = None, **kwargs) None#

Constructs a pipeline from xml/bin files, tokenizer and configuration in the same dir models_path (os.PathLike): Path to the directory containing model xml/bin files and tokenizer device (str): Device to run the model on (e.g., CPU, GPU). config: (TextRerankPipeline.Config): Optional pipeline configuration kwargs: Plugin and/or config properties

__init_subclass__()#

This method is called when a class is subclassed.

The default implementation does nothing. It may be overridden to extend subclasses.

__le__(value, /)#

Return self<=value.

__lt__(value, /)#

Return self<value.

__ne__(value, /)#

Return self!=value.

__new__(**kwargs)#
__reduce__()#

Helper for pickle.

__reduce_ex__(protocol, /)#

Helper for pickle.

__repr__()#

Return repr(self).

__setattr__(name, value, /)#

Implement setattr(self, name, value).

__sizeof__()#

Size of object in memory, in bytes.

__str__()#

Return str(self).

__subclasshook__()#

Abstract classes can override this to customize issubclass().

This is invoked early on by abc.ABCMeta.__subclasscheck__(). It should return True, False or NotImplemented. If it returns NotImplemented, the normal algorithm is used. Otherwise, it overrides the normal algorithm (and the outcome is cached).

_pybind11_conduit_v1_()#
rerank(self: openvino_genai.py_openvino_genai.TextRerankPipeline, query: str, texts: collections.abc.Sequence[str]) list[tuple[int, float]]#

Reranks a vector of texts based on the query.

start_rerank_async(self: openvino_genai.py_openvino_genai.TextRerankPipeline, query: str, texts: collections.abc.Sequence[str]) None#

Asynchronously reranks a vector of texts based on the query.

wait_rerank(self: openvino_genai.py_openvino_genai.TextRerankPipeline) list[tuple[int, float]]#

Waits for reranked texts.