smart-rank-model
v1.0.1
Published
Convenient interface for utilizing various ranking models via API and locally.
Maintainers
Readme
@smart-rank-model
Convenient interface for utilizing various ranking models via API and locally.
Features
- Supports multiple ranking models
- Flexible adapter system for different model implementations
- GPU acceleration support (when available)
- Easy-to-use API for document ranking
Configuration
The SmartRankModel constructor accepts two parameters:
env: The environment object containing adapter configurationsopts: Model configuration options
Model Options
model_key: Identifier for the model in themodels.jsonfileadapter: The adapter to use for this modeluse_gpu: Boolean to enable/disable GPU acceleration (auto-detected if not specified)gpu_batch_size: Batch size for GPU processing (default: 10)
Adapters
Adapters should be implemented and added to the env.opts.smart_rank_adapters object. Each adapter should implement the following methods:
constructor(model): Initialize the adapterload(): Load the modelrank(query, documents): Rank the documents based on the query
License
MIT License. See LICENSE file for details.
