cheop-byeon/FlagEmbedding

0

stars

1

commits

Python

primary language

Mar 4, 2026

updated

README

Finetuned Embedding and Reranking Models

Overview

This repository finetunes dense retrieval and reranking models on custom datasets using the FlagEmbedding framework.

Background

This work builds upon FlagEmbedding, a comprehensive framework for training and evaluating dense retrievers and rerankers. We currently use the base finetuning setup. The original training scripts also support knowledge distillation via score injection in training data, which is a potential future improvement.

Installation

Quick Installation

For detailed installation instructions, see INSTALLATION.md.

For fine-tuning (recommended):

pip install FlagEmbedding[finetune]
# or
pip install -r requirements-finetune.txt

For inference only:

pip install FlagEmbedding

For fine-tuning + evaluation:

pip install FlagEmbedding[finetune,eval]

For development:

pip install -e .[finetune,eval,dev]
# or
pip install -r requirements-dev.txt

For troubleshooting and alternative installation methods, see INSTALLATION.md and QUICK_START.md.

Quickstart

Using Pre-trained Models

See QUICK_START.md for installation quick reference.

Fine-tuning Models

Datasets

Download data

python download_CodeConvo.py --split train
python download_RFCAlign.py

See FlagEmbedding/DATA_PATH_USAGE.md for full usage and path rules.

Training

Example finetuning scripts:

Models

Trained retrieval models from CodeConvo:

Trained retrieval models from RFCAlign (V: verbose; N: non-verbose; D: decision; R: rationale):

Evaluation

We evaluated the finetuned models using MTEB framework: https://github.com/embeddings-benchmark/mteb

We also provide the wrapper for our customized models here: https://github.com/cheop-byeon/mteb-R2Gen

For evaluation setup and usage, see examples/evaluation.

Documentation

References

Citation

For data, use cases, and models, please refer to:

@article{bian2025automated,
  title={Automated insights into github collaboration dynamics},
  author={Bian, Jie and Arefev, Nikolay and M{\"u}hlh{\"a}user, Max and Welzl, Michael},
  journal={IEEE Access},
  year={2025},
  publisher={IEEE}
}

If you use this library, please cite the original FlagEmbedding work:

@misc{bge_m3,
  title={BGE M3-Embedding: Multi-Lingual, Multi-Functionality, Multi-Granularity Text Embeddings Through Self-Knowledge Distillation},
  author={Chen, Jianlv and Xiao, Shitao and Zhang, Peitian and Luo, Kun and Lian, Defu and Liu, Zheng},
  year={2023},
  eprint={2309.07597},
  archivePrefix={arXiv},
  primaryClass={cs.CL}
}

@misc{llm_embedder,
  title={Retrieve Anything To Augment Large Language Models},
  author={Peitian Zhang and Shitao Xiao and Zheng Liu and Zhicheng Dou and Jian-Yun Nie},
  year={2023},
  eprint={2310.07554},
  archivePrefix={arXiv},
  primaryClass={cs.IR}
}

Contributors

cheop-byeon

1 commits

cheop-byeon/FlagEmbedding

0

stars

1

commits

Python

primary language

Mar 4, 2026

updated

README

Finetuned Embedding and Reranking Models

Overview

This repository finetunes dense retrieval and reranking models on custom datasets using the FlagEmbedding framework.

Background

This work builds upon FlagEmbedding, a comprehensive framework for training and evaluating dense retrievers and rerankers. We currently use the base finetuning setup. The original training scripts also support knowledge distillation via score injection in training data, which is a potential future improvement.

Installation

Quick Installation

For detailed installation instructions, see INSTALLATION.md.

For fine-tuning (recommended):

pip install FlagEmbedding[finetune]
# or
pip install -r requirements-finetune.txt

For inference only:

pip install FlagEmbedding

For fine-tuning + evaluation:

pip install FlagEmbedding[finetune,eval]

For development:

pip install -e .[finetune,eval,dev]
# or
pip install -r requirements-dev.txt

For troubleshooting and alternative installation methods, see INSTALLATION.md and QUICK_START.md.

Quickstart

Using Pre-trained Models

See QUICK_START.md for installation quick reference.

Fine-tuning Models

Datasets

Download data

python download_CodeConvo.py --split train
python download_RFCAlign.py

See FlagEmbedding/DATA_PATH_USAGE.md for full usage and path rules.

Training

Example finetuning scripts:

Models

Trained retrieval models from CodeConvo:

Trained retrieval models from RFCAlign (V: verbose; N: non-verbose; D: decision; R: rationale):

Evaluation

We evaluated the finetuned models using MTEB framework: https://github.com/embeddings-benchmark/mteb

We also provide the wrapper for our customized models here: https://github.com/cheop-byeon/mteb-R2Gen

For evaluation setup and usage, see examples/evaluation.

Documentation

References

Citation

For data, use cases, and models, please refer to:

@article{bian2025automated,
  title={Automated insights into github collaboration dynamics},
  author={Bian, Jie and Arefev, Nikolay and M{\"u}hlh{\"a}user, Max and Welzl, Michael},
  journal={IEEE Access},
  year={2025},
  publisher={IEEE}
}

If you use this library, please cite the original FlagEmbedding work:

@misc{bge_m3,
  title={BGE M3-Embedding: Multi-Lingual, Multi-Functionality, Multi-Granularity Text Embeddings Through Self-Knowledge Distillation},
  author={Chen, Jianlv and Xiao, Shitao and Zhang, Peitian and Luo, Kun and Lian, Defu and Liu, Zheng},
  year={2023},
  eprint={2309.07597},
  archivePrefix={arXiv},
  primaryClass={cs.CL}
}

@misc{llm_embedder,
  title={Retrieve Anything To Augment Large Language Models},
  author={Peitian Zhang and Shitao Xiao and Zheng Liu and Zhicheng Dou and Jian-Yun Nie},
  year={2023},
  eprint={2310.07554},
  archivePrefix={arXiv},
  primaryClass={cs.IR}
}

Contributors

cheop-byeon

1 commits

Languages

Python

100.0%