Rerankers registry
Register and instantiate reranker implementations used by the package.
This module defines a lightweight registry for available reranker components, including their human-readable names, implementation classes, and default initialization arguments. It also provides a helper function to construct reranker instances by name with optional runtime overrides.
The registry centralizes reranker configuration so that rerankers can be referenced declaratively from task configurations, CLI options, or other factory-based workflows.
RerankerRegistryEntry
dataclass
Store the specification required to instantiate a reranker.
Instances of this dataclass define a registry entry for a reranker, including its public name, the reranker class to instantiate, and the default keyword arguments used during construction.
Source code in aatm\registries\rerankers.py
name
instance-attribute
Unique registry name used to identify the reranker.
reranker_class
instance-attribute
Reranker class or constructor used to create the reranker instance.
kwargs
instance-attribute
Default keyword arguments passed when instantiating the reranker.
load_reranker(name, **kwargs)
Load and instantiate a reranker from the registry.
This function looks up a reranker specification by name, copies its default keyword arguments, applies any user-provided overrides, and returns a new reranker instance.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
Registry name of the reranker to instantiate. |
required |
**kwargs
|
Any
|
Keyword arguments that override or extend the default constructor arguments stored in the registry entry. |
{}
|
Returns:
| Type | Description |
|---|---|
BaseReranker
|
A newly instantiated reranker corresponding to the requested registry entry. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If no reranker with the given name exists in the registry. |
TypeError
|
If the provided arguments are invalid for the reranker constructor. |