LibRerank

repository·master·Indexed 42 days ago

https://github.com/librerank-community/librerank

A toolkit for implementing and training re-ranking algorithms for multi-stage recommender systems. It supports initial rankers such as DNN and LambdaMART, as well as advanced re-ranking models including PRM, DLCM, GSF, SetRank, miDNN, Seq2Slate, and EGRerank. The library provides tools for accuracy-oriented, diversity-aware, and fairness-aware re-ranking research.

Tokens
1.4K
Snippets
2
Records
8
Agent score
5%

What's inside LibRerank

  1. Explore Diversity-aware Re-ranking research

    master

    Diversity-aware re-ranking aims to prevent redundant results and ensure a broad range of topics or attributes are represented in the top results. Research is categorized by how diversity is integrated:

    Implicit Approaches

    Uses latent representations or decision processes (like Markov Decision Processes) to model novelty and diversity without explicitly defining subtopics.

    Explicit Approaches

    Uses direct mechanisms like subtopic attention, minimax games, or self-attention networks to actively manage and enforce diversity constraints.

  2. Explore Accuracy-oriented Re-ranking research

    master

    Accuracy-oriented re-ranking focuses on improving the precision and relevance of ranked lists. Research in this category is divided into two main methodologies:

    Learning by observed signals

    Focuses on models that learn from existing user interactions and behavioral data (e.g., clicks, purchases).

    Learning by counterfactual signals

    Focuses on models that account for selection bias by learning from what could have happened (counterfactuals), often using reinforcement learning or permutation-invariant models to optimize the entire slate rather than individual items.

  3. Supported Re-ranking Algorithms in LibRerank

    master

    LibRerank implements several state-of-the-art re-ranking algorithms:

    • DLCM: Deep Listwise Context Model.
    • PRM: Personalized Re-ranking Model.
    • GSF: Groupwise Scoring Function.
    • miDNN: Mutual Influence Aware Ranking.
    • SetRank: Permutation-Invariant Ranking Model.
    • Seq2Slate: Sequence-to-sequence model for re-ranking and slate optimization.
    • EGRerank: Evaluator-Generator Reranking (consists of EGR_evaluator and EGR_generator).
  4. Explore Fairness-aware Re-ranking research

    master

    Fairness-aware re-ranking research focuses on mitigating bias in recommendation and ranking systems. Key areas include:

    • Policy Learning: Using policy-gradient training to ensure ranking functions are both fair and unbiased.
    • Representation-based Fairness: Using fairness representations (e.g., in images) to drive diversity and fairness.
    • Cold Start Fairness: Addressing fairness specifically for new items entering the system.
    • Optimization: Efficiently optimizing ranking models (like Plackett-Luce) to balance relevance with fairness constraints.
  5. Install LibRerank from source

    master

    To use LibRerank, you should first install Git LFS to handle large files, then clone the repository and initialize it using the provided make command.

    Prerequisites: Install Git LFS

    sudo apt-get install curl
    curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | sudo bash
    sudo apt-get install git-lfs
    git lfs install

    Installation

    git clone https://github.com/LibRerank-Community/LibRerank.git
    cd LibRerank
    make init
    git clone https://github.com/LibRerank-Community/LibRerank.git
    cd LibRerank
    make init
  6. Arguments for run_ranker.py

    master

    Use run_ranker.py to train initial rankers like DNN or LambdaMART.

    Note: Before training LambdaMART, you must train DNN first to obtain the pre-trained embeddings.

    argumentusage
    --data_dirThe path to the directory where the data is stored
    --save_dirThe path to the directory where the models and logs are stored
    --model_typeThe algorithm of reranker, including DNN and LambdaMART
    --setting_pathThe path to the json config file (e.g., in example/config)
    --data_set_nameThe name of the dataset, such as ad and prm
    --epoch_numThe number of epoch for DNN model
    --batch_sizeBatch size for DNN model
    --lrLearning rate for DNN and lambdaMART
    --l2_regThe coefficient of l2 regularization for DNN model
    --eb_dimThe size of embedding for DNN model
    --tree_numThe number of trees for lambdaMART model
    --tree_typeThe type of tree for lambdaMART model, including lgb and sklearn
  7. Arguments for run_reranker.py

    master

    Use run_reranker.py to train various re-ranking algorithms.

    Note: When using EGRerank (Evaluator-Generator Reranking), you must train the evaluator before the generator. Use --evaluator_path to specify the evaluator model checkpoint.

    argumentusage
    --data_dirThe path to the directory where the data is stored
    --save_dirThe path to the directory where the models and logs are stored
    --setting_pathThe path to the json config file
    --data_set_nameThe name of the dataset, such as ad and prm
    --initial_rankerThe name of initial ranker, including DNN, lambdaMART
    --model_typeThe algorithm, including PRM, DLCM, GSF, SetRank, miDNN, Seq2Slate, EGR_evaluator, EGR_generator
    --epoch_numThe number of epoch
    --batch_sizeBatch size
    --lrLearning rate
    --l2_regThe coefficient of l2 regularization
    --eb_dimThe size of embedding
    --hidden_sizeThe size of hidden unit (e.g., LSTM/GRU)
    --keep_probKeep prob in dropout
    --metric_scopeScope of metrics, e.g., --metric_scope=[1, 3, 5] for MAP@1, 3, 5
    --max_normThe max norm of gradient clip
    --rep_numNumber of repetitions during EGRerank generator training
    --group_sizeThe group size for GSF model
    --c_enrropyThe entropy coefficient in the loss for EGRerank generator
    --evaluator_pathPath to the evaluator model ckpt when training the EGRerank generator