Overview
Model Types
Model type is auto-detected from the ONNX input shape — no manual configuration needed.
Feature Vector
The reranker uses 19 features extracted from each candidate:MLP v3 Feature Transforms
For MLP models withfeature_schema == "mlp_v3", the reranker automatically applies transforms at inference time:
- Drops
original_rankfeature (index 14) to prevent ranking leakage - Computes cross-features as configured in the stats file
Usage
Basic Usage
With SpellCheckerBuilder
Stats File Format
The JSON stats file contains normalization parameters for MLP models:Training
Reranker models are trained offline using the training pipeline:- Generate training data (
training/reranker_data.py): Extracts feature vectors from benchmark examples - Train model (
training/reranker_trainer.py): Trains MLP and exports to ONNX with quantization - Evaluate: Compare MRR and Top-1 accuracy against the baseline ranker
Performance
- Latency: ~0.5ms per candidate batch (ONNX optimized)
- Memory: ~2-5MB model size (quantized)
- Dependencies: Requires
onnxruntime(pip install myspellchecker[ai])
See Also
- Suggestion Ranking — Rule-based ranking pipeline
- Suggestion Strategy — Candidate generation
- Semantic Algorithm — MLM inference
- Training Guide — Model training pipeline