{"id":13958284,"url":"https://github.com/THUwangcy/ReChorus","last_synced_at":"2025-07-20T23:30:58.682Z","repository":{"id":40954521,"uuid":"263284828","full_name":"THUwangcy/ReChorus","owner":"THUwangcy","description":"“Chorus” of recommendation models: a light and flexible PyTorch framework for Top-K recommendation.","archived":false,"fork":false,"pushed_at":"2024-11-18T05:31:21.000Z","size":57641,"stargazers_count":550,"open_issues_count":6,"forks_count":92,"subscribers_count":14,"default_branch":"master","last_synced_at":"2024-11-18T06:31:02.133Z","etag":null,"topics":["framework","pytorch","ranking","recommendation"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/THUwangcy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":"docs/Supported_Models.md","governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-05-12T08:57:44.000Z","updated_at":"2024-11-18T05:31:25.000Z","dependencies_parsed_at":"2024-06-14T10:03:35.186Z","dependency_job_id":"c378b122-b4a6-4453-88a1-1f62399d8711","html_url":"https://github.com/THUwangcy/ReChorus","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/THUwangcy%2FReChorus","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/THUwangcy%2FReChorus/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/THUwangcy%2FReChorus/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/THUwangcy%2FReChorus/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/THUwangcy","download_url":"https://codeload.github.com/THUwangcy/ReChorus/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":226844953,"owners_count":17691134,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["framework","pytorch","ranking","recommendation"],"created_at":"2024-08-08T13:01:28.595Z","updated_at":"2025-07-20T23:30:58.670Z","avatar_url":"https://github.com/THUwangcy.png","language":"Python","readme":"![logo](./docs/_static/logo2.0.png)\n---\n\n![PyPI - Python Version](https://img.shields.io/badge/pyhton-3.10-blue) \n[![License](https://img.shields.io/badge/License-MIT-blue.svg)](./LICENSE)\n![GitHub repo size](https://img.shields.io/github/repo-size/THUwangcy/ReChorus) \n[![arXiv](https://img.shields.io/badge/arXiv-ReChorus-%23B21B1B)](https://arxiv.org/abs/2405.18058)\n\n\nReChorus2.0 is a modular and task-flexible PyTorch library for recommendation, especially for research purpose. It aims to provide researchers a flexible framework to implement various recommendation tasks, compare different algorithms, and adapt to diverse and highly-customized data inputs. We hope ReChorus2.0 can serve as a more convinient and user-friendly tool for researchers, so as to form a \"Chorus\" of recommendation tasks and algorithms.\n\nThe previous version of ReChorus can be found at [ReChorus1.0](https://github.com/THUwangcy/ReChorus/tree/ReChorus1.0)\n\n## What's New in ReChorus2.0:\n\n- **New Tasks**: Newly supporting the context-aware top-k recommendation and CTR prediction task. Newly supporting the Impression-based re-ranking task.\n- **New Models**: Adding Context-aware Recommenders and Impression-based Re-ranking Models. Listed below.\n- **New dataset format**: Supporting various contextual feature input. Customizing candidate item lists in training and evaluation. Supporting variable length positive and negative samples.\n- **Task Flexible**: Each model can serve for different tasks, and task switching is conveniently achieved by altering *model mode*.\n  \n\nThis framework is especially suitable for researchers to choose or implement desired experimental settings, and compare algorithms under the same setting. The characteristics of our framework can be summarized as follows:\n\n- **Modular**: primary functions modularized into distinct components: runner, model, and reader, facilitating code comprehension and integration of new features.\n  \n- **Swift**: concentrate on your model design ***in a single file*** and implement new models quickly.\n\n- **Efficient**: multi-thread batch preparation, special implementations for the evaluation, and around 90% GPU utilization during training for deep models.\n\n- **Flexible**: implement new readers or runners for different datasets and experimental settings, and each model can be assigned with specific helpers.\n\n## Structure\n\nGenerally, ReChorus decomposes the whole process into three modules:\n\n- [Reader](https://github.com/THUwangcy/ReChorus/tree/master/src/helpers/BaseReader.py): read dataset into DataFrame and append necessary information to each instance\n- [Runner](https://github.com/THUwangcy/ReChorus/tree/master/src/helpers/BaseRunner.py): control the training process and model evaluation, including evaluation metrics.\n- [Model](https://github.com/THUwangcy/ReChorus/tree/master/src/models/BaseModel.py): define how to generate output (predicted labels or ranking scores) and prepare batches.\n\n![logo](./docs/_static/module_new.png)\n\n## Requirements \u0026 Getting Started\nSee in the doc for [Requirements \u0026 Getting Started](https://github.com/THUwangcy/ReChorus/tree/master/docs/Getting_Started.md).\n\n## Tasks \u0026 Settings\n\nThe tasks \u0026 settings are listed below\n\n\u003ctable\u003e\n\u003ctr\u003e\u003cth\u003e Tasks \u003c/th\u003e\u003cth\u003e Runner \u003c/th\u003e\u003cth\u003e Metrics \u003c/th\u003e\u003cth\u003e Loss Functions\u003c/th\u003e\u003cth\u003e Reader \u003c/th\u003e\u003cth\u003e BaseModel \u003c/th\u003e\u003cth\u003e Models\u003c/th\u003e\u003cth\u003e Model Modes \u003c/th\u003e\u003c/tr\u003e\n\u003ctr\u003e\u003ctd rowspan=\"3\"\u003e Top-k Recommendation \u003c/td\u003e\u003ctd rowspan=\"3\"\u003e BaseRunner \u003c/td\u003e\u003ctd rowspan=\"3\"\u003e HitRate NDCG \u003c/td\u003e\u003ctd rowspan=\"3\"\u003e BPR \u003c/td\u003e\u003ctd\u003e BaseReader \u003c/td\u003e\u003ctd\u003e BaseModel.GeneralModel \u003c/td\u003e\u003ctd\u003e general \u003c/td\u003e\u003ctd\u003e '' \u003c/td\u003e\u003c/tr\u003e\n\u003ctr\u003e\u003ctd\u003e SeqReader \u003c/td\u003e\u003ctd\u003e BaseModel.SequentialModel \u003c/td\u003e\u003ctd\u003e sequential \u003c/td\u003e\u003ctd\u003e '' \u003c/td\u003e\u003c/tr\u003e\n\u003ctr\u003e\u003ctd\u003e ContextReader \u003c/td\u003e\u003ctd\u003e BaseContextModel.ContextModel \u003c/td\u003e\u003ctd\u003e context \u003c/td\u003e\u003ctd\u003e 'TopK' \u003c/td\u003e\u003c/tr\u003e\n\u003ctr\u003e\u003ctd\u003e CTR Prediction \u003c/td\u003e\u003ctd\u003e CTRRunner \u003c/td\u003e\u003ctd\u003e AUC Logloss \u003c/td\u003e\u003ctd\u003e BPR, BCE \u003c/td\u003e\u003ctd\u003e ContextReader \u003c/td\u003e\u003ctd\u003e BaseContextModel.ContextCTRModel \u003c/td\u003e\u003ctd\u003e context \u003c/td\u003e\u003ctd\u003e 'CTR' \u003c/td\u003e\u003c/tr\u003e\n\u003ctr\u003e\u003ctd rowspan=\"4\"\u003e Impression-based Ranking \u003c/td\u003e\u003ctd rowspan=\"4\"\u003e ImpressionRunner \u003c/td\u003e\u003ctd rowspan=\"4\"\u003e HitRate NDCG MAP \u003c/td\u003e\u003ctd rowspan=\"4\"\u003e List-level BPR, Listnet loss, Softmax cross entropy loss, Attention rank \u003c/td\u003e\u003ctd\u003e ImpressionReader \u003c/td\u003e\u003ctd\u003e BaseImpressionModel.ImpressionModel \u003c/td\u003e\u003ctd\u003e general \u003c/td\u003e\u003ctd\u003e 'Impression' \u003c/td\u003e\u003c/tr\u003e\n\u003ctr\u003e\u003ctd\u003e ImpressionSeqReader \u003c/td\u003e\u003ctd\u003e BaseImpressionModel.ImpressionSeqModel \u003c/td\u003e\u003ctd\u003e sequential \u003c/td\u003e\u003ctd\u003e 'Impression' \u003c/td\u003e\u003c/tr\u003e\n\u003ctr\u003e\u003ctd\u003e ImpressionReader \u003c/td\u003e\u003ctd\u003e BaseRerankerModel.RerankModel \u003c/td\u003e\u003ctd\u003e reranker \u003c/td\u003e\u003ctd\u003e 'General' \u003c/td\u003e\u003c/tr\u003e\n\u003ctr\u003e\u003ctd\u003e ImpressionSeqReader \u003c/td\u003e\u003ctd\u003e BaseRerankerModel.RerankSeqModel \u003c/td\u003e\u003ctd\u003e reranker \u003c/td\u003e\u003ctd\u003e 'Sequential' \u003c/td\u003e\u003c/tr\u003e\n\u003c/table\u003e\n\n\n## Arguments\nSee in the doc for [Main Arguments](https://github.com/THUwangcy/ReChorus/tree/master/docs/Main_Arguments.md).\n\n## Models\nSee in the doc for [Supported Models](https://github.com/THUwangcy/ReChorus/tree/master/docs/Supported_Models.md).\n\nExperimental results and corresponding configurations are shown in [Demo Script Results](https://github.com/THUwangcy/ReChorus/tree/master/docs/demo_scripts_results/README.md).\n\n\n## Citation\n\n**If you find ReChorus is helpful to your research, please cite either of the following papers. Thanks!**\n\n```\n@inproceedings{li2024rechorus2,\n  title={ReChorus2. 0: A Modular and Task-Flexible Recommendation Library},\n  author={Li, Jiayu and Li, Hanyu and He, Zhiyu and Ma, Weizhi and Sun, Peijie and Zhang, Min and Ma, Shaoping},\n  booktitle={Proceedings of the 18th ACM Conference on Recommender Systems},\n  pages={454--464},\n  year={2024}\n}\n```\n```\n@inproceedings{wang2020make,\n  title={Make it a chorus: knowledge-and time-aware item modeling for sequential recommendation},\n  author={Wang, Chenyang and Zhang, Min and Ma, Weizhi and Liu, Yiqun and Ma, Shaoping},\n  booktitle={Proceedings of the 43rd International ACM SIGIR Conference on Research and Development in Information Retrieval},\n  pages={109--118},\n  year={2020}\n}\n```\n```\n@article{王晨阳2021rechorus,\n  title={ReChorus: 一个综合, 高效, 易扩展的轻量级推荐算法框架},\n  author={王晨阳 and 任一 and 马为之 and 张敏 and 刘奕群 and 马少平},\n  journal={软件学报},\n  volume={33},\n  number={4},\n  pages={0--0},\n  year={2021}\n}\n```\n\nThis is also our public implementation for the following papers (codes and datasets to reproduce the results can be found at corresponding branch):\n\n\n- *Chenyang Wang, Min Zhang, Weizhi Ma, Yiqun Liu, and Shaoping Ma. [Make It a Chorus: Knowledge- and Time-aware Item Modeling for Sequential Recommendation](http://www.thuir.cn/group/~mzhang/publications/SIGIR2020Wangcy.pdf). In SIGIR'20.*\n\n```bash\ngit clone -b SIGIR20 https://github.com/THUwangcy/ReChorus.git\n```\n\n- *Chenyang Wang, Weizhi Ma, Min Zhang, Chong Chen, Yiqun Liu, and Shaoping Ma. [Towards Dynamic User Intention: Temporal Evolutionary Effects of Item Relations in Sequential Recommendation](https://chenchongthu.github.io/files/TOIS-KDA-wcy.pdf). In TOIS'21.*\n\n```bash\ngit clone -b TOIS21 https://github.com/THUwangcy/ReChorus.git\n```\n\n- *Chenyang Wang, Weizhi Ma, Chong, Chen, Min Zhang, Yiqun Liu, and Shaoping Ma. [Sequential Recommendation with Multiple Contrast Signals](https://dl.acm.org/doi/pdf/10.1145/3522673). In TOIS'22.*\n\n```bash\ngit clone -b TOIS22 https://github.com/THUwangcy/ReChorus.git\n```\n\n- *Chenyang Wang, Zhefan Wang, Yankai Liu, Yang Ge, Weizhi Ma, Min Zhang, Yiqun Liu, Junlan Feng, Chao Deng, and Shaoping Ma. [Target Interest Distillation for Multi-Interest Recommendation](). In CIKM'22.*\n\n```bash\ngit clone -b CIKM22 https://github.com/THUwangcy/ReChorus.git\n```\n\n## Contact\n\n**ReChorus 1.0**: Chenyang Wang (THUwangcy@gmail.com)\n\n**ReChorus 2.0**: Jiayu Li (lijiayu997@gmail.com), Hanyu Li (l-hy12@outlook.com)\n\n\u003c!-- MARKDOWN LINKS \u0026 IMAGES --\u003e\n\n\u003c!-- https://www.markdownguide.org/basic-syntax/#reference-style-links --\u003e\n\n[contributors-shield]: https://img.shields.io/github/contributors/othneildrew/Best-README-Template.svg?style=flat-square\n[contributors-url]: https://github.com/othneildrew/Best-README-Template/graphs/contributors\n[forks-shield]: https://img.shields.io/github/forks/othneildrew/Best-README-Template.svg?style=flat-square\n[forks-url]: https://github.com/othneildrew/Best-README-Template/network/members\n[stars-shield]: https://img.shields.io/github/stars/othneildrew/Best-README-Template.svg?style=flat-square\n[stars-url]: https://github.com/othneildrew/Best-README-Template/stargazers\n[issues-shield]: https://img.shields.io/github/issues/othneildrew/Best-README-Template.svg?style=flat-square\n[issues-url]: https://github.com/othneildrew/Best-README-Template/issues\n[license-shield]: https://img.shields.io/github/license/othneildrew/Best-README-Template.svg?style=flat-square\n[license-url]: https://github.com/othneildrew/Best-README-Template/blob/master/LICENSE.txt\n[linkedin-shield]: https://img.shields.io/badge/-LinkedIn-black.svg?style=flat-square\u0026logo=linkedin\u0026colorB=555\n[linkedin-url]: https://linkedin.com/in/othneildrew\n[product-screenshot]: images/screenshot.png\n","funding_links":[],"categories":["推荐系统算法库与列表"],"sub_categories":["网络服务_其他"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FTHUwangcy%2FReChorus","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FTHUwangcy%2FReChorus","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FTHUwangcy%2FReChorus/lists"}