← all repositories
allegro/allRank

A PyTorch toolkit that actually ranks things, unlike your npm dependencies

allRank bundles nine loss functions and click-model simulation into a single config-driven framework for neural learning-to-rank experiments.

allRank
Velocity · 7d
+0.4
★ / day
Trend
steady
star history

What it does

allRank trains neural models to order items by relevance—search results, recommendations, anything with a ranked list. It runs on PyTorch and handles the full pipeline: data loading, model training, and evaluation via NDCG or MRR. A built-in click model also lets you simulate user behavior on synthetic data, which is handy when real click logs are scarce or messy.

The interesting bit

The framework treats ranking losses as interchangeable plugins. Drop a new loss function into the losses package, name it in a JSON config, and it wires in automatically—no subclassing gymnastics or registry boilerplate. This sounds minor until you’ve tried grafting a custom LambdaLoss variant into three different codebases.

Key highlights

  • Nine built-in losses including ListNet, LambdaRank, and NeuralNDCG (the differentiable-sorting one from the 2021 paper)
  • Scoring via fully connected nets or Transformer-style self-attention
  • Click-model simulation generates synthetic training data from trained models
  • Single config.json controls model, data paths, loss, metrics, and hyperparameters
  • Dockerized example with dummy data; GPU/CPU builds selectable via build-arg
  • Google Cloud Storage support for data and results

Caveats

  • Docker required for the quickstart; no bare-metal example path is shown
  • Training data must follow the MSLR-WEB30K convention (train.txt naming), which isn’t configurable
  • GPU and CPU torch binaries are mutually exclusive images, not runtime-detected

Verdict

Worth a look if you’re doing research or production prototyping in neural LTR and want to iterate on loss functions without rewriting scaffolding. Skip it if you need a managed end-to-end serving stack—this stops at trained model weights.

heatdrop uses Google Analytics to see which pages get read — nothing else. Your call. How we handle data.