jina.drivers.rankยถ

class jina.drivers.rank.BaseRankDriver(executor=None, method='score', *args, **kwargs)[source]ยถ

Bases: jina.drivers.BaseExecutableDriver

Drivers inherited from this Driver will bind rank() by default

Initialize a BaseExecutableDriver

Parameters
  • executor (Optional[str]) โ€“ the name of the sub-executor, only necessary when jina.executors.compound.CompoundExecutor is used

  • method (str) โ€“ the function name of the executor that the driver feeds to

class jina.drivers.rank.Matches2DocRankDriver(reverse=False, traversal_paths=('m', ), *args, **kwargs)[source]ยถ

Bases: jina.drivers.rank.BaseRankDriver

This driver is intended to only resort the given matches on the 0 level granularity for a document. It gets the scores from a Ranking Executor, which does only change the scores of matches. Afterwards, the Matches2DocRankDriver resorts all matches for a document. Input-Output

Input:
document: {granularity: 0, adjacency: k}
    |- matches: {granularity: 0, adjacency: k+1}
Output:
document: {granularity: 0, adjacency: k}
    |- matches: {granularity: 0, adjacency: k+1} (Sorted according to scores from Ranker Executor)

Initialize a BaseExecutableDriver

Parameters