nextrec 0.4.7__tar.gz → 0.4.8__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (159) hide show
  1. {nextrec-0.4.7 → nextrec-0.4.8}/PKG-INFO +7 -6
  2. {nextrec-0.4.7 → nextrec-0.4.8}/README.md +4 -4
  3. {nextrec-0.4.7 → nextrec-0.4.8}/README_en.md +3 -3
  4. {nextrec-0.4.7 → nextrec-0.4.8}/docs/rtd/conf.py +1 -1
  5. nextrec-0.4.8/nextrec/__version__.py +1 -0
  6. {nextrec-0.4.7 → nextrec-0.4.8}/nextrec/basic/model.py +26 -11
  7. {nextrec-0.4.7 → nextrec-0.4.8}/nextrec/cli.py +27 -1
  8. nextrec-0.4.8/nextrec/utils/cli_utils.py +58 -0
  9. {nextrec-0.4.7 → nextrec-0.4.8}/nextrec/utils/config.py +5 -4
  10. {nextrec-0.4.7 → nextrec-0.4.8}/pyproject.toml +3 -2
  11. {nextrec-0.4.7 → nextrec-0.4.8}/test/test_base_model_regularization.py +0 -1
  12. nextrec-0.4.7/nextrec/__version__.py +0 -1
  13. {nextrec-0.4.7 → nextrec-0.4.8}/.github/workflows/publish.yml +0 -0
  14. {nextrec-0.4.7 → nextrec-0.4.8}/.github/workflows/tests.yml +0 -0
  15. {nextrec-0.4.7 → nextrec-0.4.8}/.gitignore +0 -0
  16. {nextrec-0.4.7 → nextrec-0.4.8}/.readthedocs.yaml +0 -0
  17. {nextrec-0.4.7 → nextrec-0.4.8}/CODE_OF_CONDUCT.md +0 -0
  18. {nextrec-0.4.7 → nextrec-0.4.8}/CONTRIBUTING.md +0 -0
  19. {nextrec-0.4.7 → nextrec-0.4.8}/LICENSE +0 -0
  20. {nextrec-0.4.7 → nextrec-0.4.8}/MANIFEST.in +0 -0
  21. {nextrec-0.4.7 → nextrec-0.4.8}/assets/Feature Configuration.png +0 -0
  22. {nextrec-0.4.7 → nextrec-0.4.8}/assets/Model Parameters.png +0 -0
  23. {nextrec-0.4.7 → nextrec-0.4.8}/assets/Training Configuration.png +0 -0
  24. {nextrec-0.4.7 → nextrec-0.4.8}/assets/Training logs.png +0 -0
  25. {nextrec-0.4.7 → nextrec-0.4.8}/assets/logo.png +0 -0
  26. {nextrec-0.4.7 → nextrec-0.4.8}/assets/mmoe_tutorial.png +0 -0
  27. {nextrec-0.4.7 → nextrec-0.4.8}/assets/nextrec_diagram.png +0 -0
  28. {nextrec-0.4.7 → nextrec-0.4.8}/assets/test data.png +0 -0
  29. {nextrec-0.4.7 → nextrec-0.4.8}/dataset/ctcvr_task.csv +0 -0
  30. {nextrec-0.4.7 → nextrec-0.4.8}/dataset/ecommerce_task.csv +0 -0
  31. {nextrec-0.4.7 → nextrec-0.4.8}/dataset/match_task.csv +0 -0
  32. {nextrec-0.4.7 → nextrec-0.4.8}/dataset/movielens_100k.csv +0 -0
  33. {nextrec-0.4.7 → nextrec-0.4.8}/dataset/multitask_task.csv +0 -0
  34. {nextrec-0.4.7 → nextrec-0.4.8}/dataset/ranking_task.csv +0 -0
  35. {nextrec-0.4.7 → nextrec-0.4.8}/docs/en/Getting started guide.md +0 -0
  36. {nextrec-0.4.7 → nextrec-0.4.8}/docs/rtd/Makefile +0 -0
  37. {nextrec-0.4.7 → nextrec-0.4.8}/docs/rtd/index.md +0 -0
  38. {nextrec-0.4.7 → nextrec-0.4.8}/docs/rtd/make.bat +0 -0
  39. {nextrec-0.4.7 → nextrec-0.4.8}/docs/rtd/modules.rst +0 -0
  40. {nextrec-0.4.7 → nextrec-0.4.8}/docs/rtd/nextrec.basic.rst +0 -0
  41. {nextrec-0.4.7 → nextrec-0.4.8}/docs/rtd/nextrec.data.rst +0 -0
  42. {nextrec-0.4.7 → nextrec-0.4.8}/docs/rtd/nextrec.loss.rst +0 -0
  43. {nextrec-0.4.7 → nextrec-0.4.8}/docs/rtd/nextrec.rst +0 -0
  44. {nextrec-0.4.7 → nextrec-0.4.8}/docs/rtd/nextrec.utils.rst +0 -0
  45. {nextrec-0.4.7 → nextrec-0.4.8}/docs/rtd/requirements.txt +0 -0
  46. {nextrec-0.4.7 → nextrec-0.4.8}/docs/zh//345/277/253/351/200/237/344/270/212/346/211/213.md" +0 -0
  47. {nextrec-0.4.7 → nextrec-0.4.8}/nextrec/__init__.py +0 -0
  48. {nextrec-0.4.7 → nextrec-0.4.8}/nextrec/basic/__init__.py +0 -0
  49. {nextrec-0.4.7 → nextrec-0.4.8}/nextrec/basic/activation.py +0 -0
  50. {nextrec-0.4.7 → nextrec-0.4.8}/nextrec/basic/callback.py +0 -0
  51. {nextrec-0.4.7 → nextrec-0.4.8}/nextrec/basic/features.py +0 -0
  52. {nextrec-0.4.7 → nextrec-0.4.8}/nextrec/basic/layers.py +0 -0
  53. {nextrec-0.4.7 → nextrec-0.4.8}/nextrec/basic/loggers.py +0 -0
  54. {nextrec-0.4.7 → nextrec-0.4.8}/nextrec/basic/metrics.py +0 -0
  55. {nextrec-0.4.7 → nextrec-0.4.8}/nextrec/basic/session.py +0 -0
  56. {nextrec-0.4.7 → nextrec-0.4.8}/nextrec/data/__init__.py +0 -0
  57. {nextrec-0.4.7 → nextrec-0.4.8}/nextrec/data/batch_utils.py +0 -0
  58. {nextrec-0.4.7 → nextrec-0.4.8}/nextrec/data/data_processing.py +0 -0
  59. {nextrec-0.4.7 → nextrec-0.4.8}/nextrec/data/data_utils.py +0 -0
  60. {nextrec-0.4.7 → nextrec-0.4.8}/nextrec/data/dataloader.py +0 -0
  61. {nextrec-0.4.7 → nextrec-0.4.8}/nextrec/data/preprocessor.py +0 -0
  62. {nextrec-0.4.7 → nextrec-0.4.8}/nextrec/loss/__init__.py +0 -0
  63. {nextrec-0.4.7 → nextrec-0.4.8}/nextrec/loss/listwise.py +0 -0
  64. {nextrec-0.4.7 → nextrec-0.4.8}/nextrec/loss/loss_utils.py +0 -0
  65. {nextrec-0.4.7 → nextrec-0.4.8}/nextrec/loss/pairwise.py +0 -0
  66. {nextrec-0.4.7 → nextrec-0.4.8}/nextrec/loss/pointwise.py +0 -0
  67. {nextrec-0.4.7 → nextrec-0.4.8}/nextrec/models/generative/__init__.py +0 -0
  68. {nextrec-0.4.7 → nextrec-0.4.8}/nextrec/models/generative/hstu.py +0 -0
  69. {nextrec-0.4.7 → nextrec-0.4.8}/nextrec/models/generative/rqvae.py +0 -0
  70. {nextrec-0.4.7 → nextrec-0.4.8}/nextrec/models/generative/tiger.py +0 -0
  71. {nextrec-0.4.7 → nextrec-0.4.8}/nextrec/models/match/__init__.py +0 -0
  72. {nextrec-0.4.7 → nextrec-0.4.8}/nextrec/models/match/dssm.py +0 -0
  73. {nextrec-0.4.7 → nextrec-0.4.8}/nextrec/models/match/dssm_v2.py +0 -0
  74. {nextrec-0.4.7 → nextrec-0.4.8}/nextrec/models/match/mind.py +0 -0
  75. {nextrec-0.4.7 → nextrec-0.4.8}/nextrec/models/match/sdm.py +0 -0
  76. {nextrec-0.4.7 → nextrec-0.4.8}/nextrec/models/match/youtube_dnn.py +0 -0
  77. {nextrec-0.4.7 → nextrec-0.4.8}/nextrec/models/multi_task/__init__.py +0 -0
  78. {nextrec-0.4.7 → nextrec-0.4.8}/nextrec/models/multi_task/esmm.py +0 -0
  79. {nextrec-0.4.7 → nextrec-0.4.8}/nextrec/models/multi_task/mmoe.py +0 -0
  80. {nextrec-0.4.7 → nextrec-0.4.8}/nextrec/models/multi_task/ple.py +0 -0
  81. {nextrec-0.4.7 → nextrec-0.4.8}/nextrec/models/multi_task/poso.py +0 -0
  82. {nextrec-0.4.7 → nextrec-0.4.8}/nextrec/models/multi_task/share_bottom.py +0 -0
  83. {nextrec-0.4.7 → nextrec-0.4.8}/nextrec/models/ranking/__init__.py +0 -0
  84. {nextrec-0.4.7 → nextrec-0.4.8}/nextrec/models/ranking/afm.py +0 -0
  85. {nextrec-0.4.7 → nextrec-0.4.8}/nextrec/models/ranking/autoint.py +0 -0
  86. {nextrec-0.4.7 → nextrec-0.4.8}/nextrec/models/ranking/dcn.py +0 -0
  87. {nextrec-0.4.7 → nextrec-0.4.8}/nextrec/models/ranking/dcn_v2.py +0 -0
  88. {nextrec-0.4.7 → nextrec-0.4.8}/nextrec/models/ranking/deepfm.py +0 -0
  89. {nextrec-0.4.7 → nextrec-0.4.8}/nextrec/models/ranking/dien.py +0 -0
  90. {nextrec-0.4.7 → nextrec-0.4.8}/nextrec/models/ranking/din.py +0 -0
  91. {nextrec-0.4.7 → nextrec-0.4.8}/nextrec/models/ranking/fibinet.py +0 -0
  92. {nextrec-0.4.7 → nextrec-0.4.8}/nextrec/models/ranking/fm.py +0 -0
  93. {nextrec-0.4.7 → nextrec-0.4.8}/nextrec/models/ranking/masknet.py +0 -0
  94. {nextrec-0.4.7 → nextrec-0.4.8}/nextrec/models/ranking/pnn.py +0 -0
  95. {nextrec-0.4.7 → nextrec-0.4.8}/nextrec/models/ranking/widedeep.py +0 -0
  96. {nextrec-0.4.7 → nextrec-0.4.8}/nextrec/models/ranking/xdeepfm.py +0 -0
  97. {nextrec-0.4.7 → nextrec-0.4.8}/nextrec/utils/__init__.py +0 -0
  98. {nextrec-0.4.7 → nextrec-0.4.8}/nextrec/utils/device.py +0 -0
  99. {nextrec-0.4.7 → nextrec-0.4.8}/nextrec/utils/distributed.py +0 -0
  100. {nextrec-0.4.7 → nextrec-0.4.8}/nextrec/utils/embedding.py +0 -0
  101. {nextrec-0.4.7 → nextrec-0.4.8}/nextrec/utils/feature.py +0 -0
  102. {nextrec-0.4.7 → nextrec-0.4.8}/nextrec/utils/file.py +0 -0
  103. {nextrec-0.4.7 → nextrec-0.4.8}/nextrec/utils/initializer.py +0 -0
  104. {nextrec-0.4.7 → nextrec-0.4.8}/nextrec/utils/model.py +0 -0
  105. {nextrec-0.4.7 → nextrec-0.4.8}/nextrec/utils/optimizer.py +0 -0
  106. {nextrec-0.4.7 → nextrec-0.4.8}/nextrec/utils/synthetic_data.py +0 -0
  107. {nextrec-0.4.7 → nextrec-0.4.8}/nextrec/utils/tensor.py +0 -0
  108. {nextrec-0.4.7 → nextrec-0.4.8}/nextrec_cli_preset/NextRec-CLI.md +0 -0
  109. {nextrec-0.4.7 → nextrec-0.4.8}/nextrec_cli_preset/NextRec-CLI_zh.md +0 -0
  110. {nextrec-0.4.7 → nextrec-0.4.8}/nextrec_cli_preset/feature_config.yaml +0 -0
  111. {nextrec-0.4.7 → nextrec-0.4.8}/nextrec_cli_preset/model_configs/afm.yaml +0 -0
  112. {nextrec-0.4.7 → nextrec-0.4.8}/nextrec_cli_preset/model_configs/autoint.yaml +0 -0
  113. {nextrec-0.4.7 → nextrec-0.4.8}/nextrec_cli_preset/model_configs/dcn.yaml +0 -0
  114. {nextrec-0.4.7 → nextrec-0.4.8}/nextrec_cli_preset/model_configs/deepfm.yaml +0 -0
  115. {nextrec-0.4.7 → nextrec-0.4.8}/nextrec_cli_preset/model_configs/din.yaml +0 -0
  116. {nextrec-0.4.7 → nextrec-0.4.8}/nextrec_cli_preset/model_configs/esmm.yaml +0 -0
  117. {nextrec-0.4.7 → nextrec-0.4.8}/nextrec_cli_preset/model_configs/fibinet.yaml +0 -0
  118. {nextrec-0.4.7 → nextrec-0.4.8}/nextrec_cli_preset/model_configs/fm.yaml +0 -0
  119. {nextrec-0.4.7 → nextrec-0.4.8}/nextrec_cli_preset/model_configs/masknet.yaml +0 -0
  120. {nextrec-0.4.7 → nextrec-0.4.8}/nextrec_cli_preset/model_configs/mmoe.yaml +0 -0
  121. {nextrec-0.4.7 → nextrec-0.4.8}/nextrec_cli_preset/model_configs/ple.yaml +0 -0
  122. {nextrec-0.4.7 → nextrec-0.4.8}/nextrec_cli_preset/model_configs/pnn.yaml +0 -0
  123. {nextrec-0.4.7 → nextrec-0.4.8}/nextrec_cli_preset/model_configs/poso.yaml +0 -0
  124. {nextrec-0.4.7 → nextrec-0.4.8}/nextrec_cli_preset/model_configs/share_bottom.yaml +0 -0
  125. {nextrec-0.4.7 → nextrec-0.4.8}/nextrec_cli_preset/model_configs/widedeep.yaml +0 -0
  126. {nextrec-0.4.7 → nextrec-0.4.8}/nextrec_cli_preset/model_configs/xdeepfm.yaml +0 -0
  127. {nextrec-0.4.7 → nextrec-0.4.8}/nextrec_cli_preset/predict_config.yaml +0 -0
  128. {nextrec-0.4.7 → nextrec-0.4.8}/nextrec_cli_preset/train_config.yaml +0 -0
  129. {nextrec-0.4.7 → nextrec-0.4.8}/pytest.ini +0 -0
  130. {nextrec-0.4.7 → nextrec-0.4.8}/requirements.txt +0 -0
  131. {nextrec-0.4.7 → nextrec-0.4.8}/scripts/format_code.py +0 -0
  132. {nextrec-0.4.7 → nextrec-0.4.8}/test/__init__.py +0 -0
  133. {nextrec-0.4.7 → nextrec-0.4.8}/test/conftest.py +0 -0
  134. {nextrec-0.4.7 → nextrec-0.4.8}/test/run_tests.py +0 -0
  135. {nextrec-0.4.7 → nextrec-0.4.8}/test/test_generative_models.py +0 -0
  136. {nextrec-0.4.7 → nextrec-0.4.8}/test/test_layers.py +0 -0
  137. {nextrec-0.4.7 → nextrec-0.4.8}/test/test_losses.py +0 -0
  138. {nextrec-0.4.7 → nextrec-0.4.8}/test/test_match_models.py +0 -0
  139. {nextrec-0.4.7 → nextrec-0.4.8}/test/test_multitask_models.py +0 -0
  140. {nextrec-0.4.7 → nextrec-0.4.8}/test/test_preprocessor.py +0 -0
  141. {nextrec-0.4.7 → nextrec-0.4.8}/test/test_ranking_models.py +0 -0
  142. {nextrec-0.4.7 → nextrec-0.4.8}/test/test_utils.py +0 -0
  143. {nextrec-0.4.7 → nextrec-0.4.8}/test_requirements.txt +0 -0
  144. {nextrec-0.4.7 → nextrec-0.4.8}/tutorials/distributed/example_distributed_training.py +0 -0
  145. {nextrec-0.4.7 → nextrec-0.4.8}/tutorials/distributed/example_distributed_training_large_dataset.py +0 -0
  146. {nextrec-0.4.7 → nextrec-0.4.8}/tutorials/example_match_dssm.py +0 -0
  147. {nextrec-0.4.7 → nextrec-0.4.8}/tutorials/example_multitask.py +0 -0
  148. {nextrec-0.4.7 → nextrec-0.4.8}/tutorials/example_ranking_din.py +0 -0
  149. {nextrec-0.4.7 → nextrec-0.4.8}/tutorials/movielen_match_dssm.py +0 -0
  150. {nextrec-0.4.7 → nextrec-0.4.8}/tutorials/movielen_ranking_deepfm.py +0 -0
  151. {nextrec-0.4.7 → nextrec-0.4.8}/tutorials/notebooks/en/Build semantic ID with RQ-VAE.ipynb +0 -0
  152. {nextrec-0.4.7 → nextrec-0.4.8}/tutorials/notebooks/en/Hands on dataprocessor.ipynb +0 -0
  153. {nextrec-0.4.7 → nextrec-0.4.8}/tutorials/notebooks/en/Hands on nextrec.ipynb +0 -0
  154. {nextrec-0.4.7 → nextrec-0.4.8}/tutorials/notebooks/zh//344/275/277/347/224/250RQ-VAE/346/236/204/345/273/272/350/257/255/344/271/211ID.ipynb" +0 -0
  155. {nextrec-0.4.7 → nextrec-0.4.8}/tutorials/notebooks/zh//345/246/202/344/275/225/344/275/277/347/224/250DataProcessor/350/277/233/350/241/214/351/242/204/345/244/204/347/220/206.ipynb" +0 -0
  156. {nextrec-0.4.7 → nextrec-0.4.8}/tutorials/notebooks/zh//345/277/253/351/200/237/345/205/245/351/227/250nextrec.ipynb" +0 -0
  157. {nextrec-0.4.7 → nextrec-0.4.8}/tutorials/run_all_match_models.py +0 -0
  158. {nextrec-0.4.7 → nextrec-0.4.8}/tutorials/run_all_multitask_models.py +0 -0
  159. {nextrec-0.4.7 → nextrec-0.4.8}/tutorials/run_all_ranking_models.py +0 -0
@@ -1,12 +1,13 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: nextrec
3
- Version: 0.4.7
3
+ Version: 0.4.8
4
4
  Summary: A comprehensive recommendation library with match, ranking, and multi-task learning models
5
5
  Project-URL: Homepage, https://github.com/zerolovesea/NextRec
6
6
  Project-URL: Repository, https://github.com/zerolovesea/NextRec
7
7
  Project-URL: Documentation, https://github.com/zerolovesea/NextRec/blob/main/README.md
8
8
  Project-URL: Issues, https://github.com/zerolovesea/NextRec/issues
9
- Author-email: zerolovesea <zyaztec@gmail.com>
9
+ Author: Yang Zhou
10
+ Author-email: zyaztec@gmail.com
10
11
  License-File: LICENSE
11
12
  Keywords: ctr,deep-learning,match,pytorch,ranking,recommendation
12
13
  Classifier: Development Status :: 3 - Alpha
@@ -65,7 +66,7 @@ Description-Content-Type: text/markdown
65
66
  ![Python](https://img.shields.io/badge/Python-3.10+-blue.svg)
66
67
  ![PyTorch](https://img.shields.io/badge/PyTorch-1.10+-ee4c2c.svg)
67
68
  ![License](https://img.shields.io/badge/License-Apache%202.0-green.svg)
68
- ![Version](https://img.shields.io/badge/Version-0.4.7-orange.svg)
69
+ ![Version](https://img.shields.io/badge/Version-0.4.8-orange.svg)
69
70
 
70
71
  中文文档 | [English Version](README_en.md)
71
72
 
@@ -98,7 +99,7 @@ NextRec是一个基于PyTorch的现代推荐系统框架,旨在为研究工程
98
99
 
99
100
  ## NextRec近期进展
100
101
 
101
- - **12/12/2025** 在v0.4.7中加入了[RQ-VAE](/nextrec/models/generative/rqvae.py)模块。配套的[数据集](/dataset/ecommerce_task.csv)和[代码](tutorials/notebooks/zh/使用RQ-VAE构建语义ID.ipynby)已经同步在仓库中
102
+ - **12/12/2025** 在v0.4.8中加入了[RQ-VAE](/nextrec/models/generative/rqvae.py)模块。配套的[数据集](/dataset/ecommerce_task.csv)和[代码](tutorials/notebooks/zh/使用RQ-VAE构建语义ID.ipynby)已经同步在仓库中
102
103
  - **07/12/2025** 发布了NextRec CLI命令行工具,它允许用户根据配置文件进行一键训练和推理,我们提供了相关的[教程](/nextrec_cli_preset/NextRec-CLI_zh.md)和[教学代码](/nextrec_cli_preset)
103
104
  - **03/12/2025** NextRec获得了100颗🌟!感谢大家的支持
104
105
  - **06/12/2025** 在v0.4.1中支持了单机多卡的分布式DDP训练,并且提供了配套的[代码](tutorials/distributed)
@@ -240,11 +241,11 @@ nextrec --mode=train --train_config=path/to/train_config.yaml
240
241
  nextrec --mode=predict --predict_config=path/to/predict_config.yaml
241
242
  ```
242
243
 
243
- > 截止当前版本0.4.7,NextRec CLI支持单机训练,分布式训练相关功能尚在开发中。
244
+ > 截止当前版本0.4.8,NextRec CLI支持单机训练,分布式训练相关功能尚在开发中。
244
245
 
245
246
  ## 兼容平台
246
247
 
247
- 当前最新版本为0.4.7,所有模型和测试代码均已在以下平台通过验证,如果开发者在使用中遇到兼容问题,请在issue区提出错误报告及系统版本:
248
+ 当前最新版本为0.4.8,所有模型和测试代码均已在以下平台通过验证,如果开发者在使用中遇到兼容问题,请在issue区提出错误报告及系统版本:
248
249
 
249
250
  | 平台 | 配置 |
250
251
  |------|------|
@@ -7,7 +7,7 @@
7
7
  ![Python](https://img.shields.io/badge/Python-3.10+-blue.svg)
8
8
  ![PyTorch](https://img.shields.io/badge/PyTorch-1.10+-ee4c2c.svg)
9
9
  ![License](https://img.shields.io/badge/License-Apache%202.0-green.svg)
10
- ![Version](https://img.shields.io/badge/Version-0.4.7-orange.svg)
10
+ ![Version](https://img.shields.io/badge/Version-0.4.8-orange.svg)
11
11
 
12
12
  中文文档 | [English Version](README_en.md)
13
13
 
@@ -40,7 +40,7 @@ NextRec是一个基于PyTorch的现代推荐系统框架,旨在为研究工程
40
40
 
41
41
  ## NextRec近期进展
42
42
 
43
- - **12/12/2025** 在v0.4.7中加入了[RQ-VAE](/nextrec/models/generative/rqvae.py)模块。配套的[数据集](/dataset/ecommerce_task.csv)和[代码](tutorials/notebooks/zh/使用RQ-VAE构建语义ID.ipynby)已经同步在仓库中
43
+ - **12/12/2025** 在v0.4.8中加入了[RQ-VAE](/nextrec/models/generative/rqvae.py)模块。配套的[数据集](/dataset/ecommerce_task.csv)和[代码](tutorials/notebooks/zh/使用RQ-VAE构建语义ID.ipynby)已经同步在仓库中
44
44
  - **07/12/2025** 发布了NextRec CLI命令行工具,它允许用户根据配置文件进行一键训练和推理,我们提供了相关的[教程](/nextrec_cli_preset/NextRec-CLI_zh.md)和[教学代码](/nextrec_cli_preset)
45
45
  - **03/12/2025** NextRec获得了100颗🌟!感谢大家的支持
46
46
  - **06/12/2025** 在v0.4.1中支持了单机多卡的分布式DDP训练,并且提供了配套的[代码](tutorials/distributed)
@@ -182,11 +182,11 @@ nextrec --mode=train --train_config=path/to/train_config.yaml
182
182
  nextrec --mode=predict --predict_config=path/to/predict_config.yaml
183
183
  ```
184
184
 
185
- > 截止当前版本0.4.7,NextRec CLI支持单机训练,分布式训练相关功能尚在开发中。
185
+ > 截止当前版本0.4.8,NextRec CLI支持单机训练,分布式训练相关功能尚在开发中。
186
186
 
187
187
  ## 兼容平台
188
188
 
189
- 当前最新版本为0.4.7,所有模型和测试代码均已在以下平台通过验证,如果开发者在使用中遇到兼容问题,请在issue区提出错误报告及系统版本:
189
+ 当前最新版本为0.4.8,所有模型和测试代码均已在以下平台通过验证,如果开发者在使用中遇到兼容问题,请在issue区提出错误报告及系统版本:
190
190
 
191
191
  | 平台 | 配置 |
192
192
  |------|------|
@@ -7,7 +7,7 @@
7
7
  ![Python](https://img.shields.io/badge/Python-3.10+-blue.svg)
8
8
  ![PyTorch](https://img.shields.io/badge/PyTorch-1.10+-ee4c2c.svg)
9
9
  ![License](https://img.shields.io/badge/License-Apache%202.0-green.svg)
10
- ![Version](https://img.shields.io/badge/Version-0.4.7-orange.svg)
10
+ ![Version](https://img.shields.io/badge/Version-0.4.8-orange.svg)
11
11
 
12
12
  English | [中文文档](README.md)
13
13
 
@@ -186,11 +186,11 @@ nextrec --mode=train --train_config=path/to/train_config.yaml
186
186
  nextrec --mode=predict --predict_config=path/to/predict_config.yaml
187
187
  ```
188
188
 
189
- > As of version 0.4.7, NextRec CLI supports single-machine training; distributed training features are currently under development.
189
+ > As of version 0.4.8, NextRec CLI supports single-machine training; distributed training features are currently under development.
190
190
 
191
191
  ## Platform Compatibility
192
192
 
193
- The current version is 0.4.7. All models and test code have been validated on the following platforms. If you encounter compatibility issues, please report them in the issue tracker with your system version:
193
+ The current version is 0.4.8. All models and test code have been validated on the following platforms. If you encounter compatibility issues, please report them in the issue tracker with your system version:
194
194
 
195
195
  | Platform | Configuration |
196
196
  |----------|---------------|
@@ -11,7 +11,7 @@ sys.path.insert(0, str(PROJECT_ROOT / "nextrec"))
11
11
  project = "NextRec"
12
12
  copyright = "2025, Yang Zhou"
13
13
  author = "Yang Zhou"
14
- release = "0.4.7"
14
+ release = "0.4.8"
15
15
 
16
16
  extensions = [
17
17
  "myst_parser",
@@ -0,0 +1 @@
1
+ __version__ = "0.4.8"
@@ -55,7 +55,6 @@ from nextrec.loss import (
55
55
  SampledSoftmaxLoss,
56
56
  TripletLoss,
57
57
  get_loss_fn,
58
- get_loss_kwargs,
59
58
  )
60
59
  from nextrec.utils.tensor import to_tensor
61
60
  from nextrec.utils.device import configure_device
@@ -185,7 +184,9 @@ class BaseModel(FeatureSet, nn.Module):
185
184
  embedding_params: list[torch.Tensor] = []
186
185
  if embed_dict is not None:
187
186
  embedding_params.extend(
188
- embed.weight for embed in embed_dict.values() if hasattr(embed, "weight")
187
+ embed.weight
188
+ for embed in embed_dict.values()
189
+ if hasattr(embed, "weight")
189
190
  )
190
191
  else:
191
192
  weight = getattr(embedding_layer, "weight", None)
@@ -739,8 +740,16 @@ class BaseModel(FeatureSet, nn.Module):
739
740
  else:
740
741
  train_loader = train_data
741
742
  else:
742
- result = self.prepare_data_loader(train_data, batch_size=batch_size, shuffle=shuffle, num_workers=num_workers, return_dataset=True)
743
- assert isinstance(result, tuple), "Expected tuple from prepare_data_loader with return_dataset=True"
743
+ result = self.prepare_data_loader(
744
+ train_data,
745
+ batch_size=batch_size,
746
+ shuffle=shuffle,
747
+ num_workers=num_workers,
748
+ return_dataset=True,
749
+ )
750
+ assert isinstance(
751
+ result, tuple
752
+ ), "Expected tuple from prepare_data_loader with return_dataset=True"
744
753
  loader, dataset = result
745
754
  if (
746
755
  auto_distributed_sampler
@@ -845,7 +854,9 @@ class BaseModel(FeatureSet, nn.Module):
845
854
  train_loader.sampler.set_epoch(epoch)
846
855
  # Type guard: ensure train_loader is DataLoader for train_epoch
847
856
  if not isinstance(train_loader, DataLoader):
848
- raise TypeError(f"Expected DataLoader for training, got {type(train_loader)}")
857
+ raise TypeError(
858
+ f"Expected DataLoader for training, got {type(train_loader)}"
859
+ )
849
860
  train_result = self.train_epoch(train_loader, is_streaming=is_streaming)
850
861
  if isinstance(train_result, tuple): # [avg_loss, metrics_dict]
851
862
  train_loss, train_metrics = train_result
@@ -2085,10 +2096,10 @@ class BaseMatchModel(BaseModel):
2085
2096
  if effective_loss is None:
2086
2097
  effective_loss = default_loss_by_mode[self.training_mode]
2087
2098
  elif isinstance(effective_loss, (str,)):
2088
- if (
2089
- self.training_mode in {"pairwise", "listwise"}
2090
- and effective_loss in {"bce", "binary_crossentropy"}
2091
- ):
2099
+ if self.training_mode in {"pairwise", "listwise"} and effective_loss in {
2100
+ "bce",
2101
+ "binary_crossentropy",
2102
+ }:
2092
2103
  effective_loss = default_loss_by_mode[self.training_mode]
2093
2104
  elif isinstance(effective_loss, list):
2094
2105
  if not effective_loss:
@@ -2115,7 +2126,9 @@ class BaseMatchModel(BaseModel):
2115
2126
  callbacks=callbacks,
2116
2127
  )
2117
2128
 
2118
- def inbatch_logits(self, user_emb: torch.Tensor, item_emb: torch.Tensor) -> torch.Tensor:
2129
+ def inbatch_logits(
2130
+ self, user_emb: torch.Tensor, item_emb: torch.Tensor
2131
+ ) -> torch.Tensor:
2119
2132
  if self.similarity_metric == "dot":
2120
2133
  logits = torch.matmul(user_emb, item_emb.t())
2121
2134
  elif self.similarity_metric == "cosine":
@@ -2216,7 +2229,9 @@ class BaseMatchModel(BaseModel):
2216
2229
 
2217
2230
  eye = torch.eye(batch_size, device=logits.device, dtype=torch.bool)
2218
2231
  pos_logits = logits.diag() # [B]
2219
- neg_logits = logits.masked_select(~eye).view(batch_size, batch_size - 1) # [B, B-1]
2232
+ neg_logits = logits.masked_select(~eye).view(
2233
+ batch_size, batch_size - 1
2234
+ ) # [B, B-1]
2220
2235
 
2221
2236
  loss_fn = self.loss_fn[0] if getattr(self, "loss_fn", None) else None
2222
2237
  if isinstance(loss_fn, SampledSoftmaxLoss):
@@ -14,9 +14,11 @@ Examples:
14
14
  nextrec --mode=predict --predict_config=nextrec_cli_preset/predict_config.yaml
15
15
 
16
16
  Date: create on 06/12/2025
17
+ Checkpoint: edit on 18/12/2025
17
18
  Author: Yang Zhou, zyaztec@gmail.com
18
19
  """
19
20
 
21
+ import sys
20
22
  import argparse
21
23
  import logging
22
24
  import pickle
@@ -44,6 +46,10 @@ from nextrec.utils.file import (
44
46
  read_yaml,
45
47
  resolve_file_paths,
46
48
  )
49
+ from nextrec.utils.cli_utils import (
50
+ get_nextrec_version,
51
+ log_startup_info,
52
+ )
47
53
  from nextrec.basic.loggers import setup_logger
48
54
 
49
55
  logger = logging.getLogger(__name__)
@@ -71,6 +77,9 @@ def train_model(train_config_path: str) -> None:
71
77
  artifact_root = Path(session_cfg.get("artifact_root", "nextrec_logs"))
72
78
  session_dir = artifact_root / session_id
73
79
  setup_logger(session_id=session_id)
80
+ logger.info(
81
+ f"[NextRec CLI] Training start | version={get_nextrec_version()} | session_id={session_id} | artifacts={session_dir.resolve()}"
82
+ )
74
83
 
75
84
  processor_path = session_dir / "processor.pkl"
76
85
  processor_path = Path(processor_path)
@@ -324,6 +333,9 @@ def predict_model(predict_config_path: str) -> None:
324
333
  artifact_root = Path(session_cfg.get("artifact_root", "nextrec_logs"))
325
334
  session_dir = Path(cfg.get("checkpoint_path") or (artifact_root / session_id))
326
335
  setup_logger(session_id=session_id)
336
+ logger.info(
337
+ f"[NextRec CLI] Predict start | version={get_nextrec_version()} | session_id={session_id} | checkpoint={session_dir.resolve()}"
338
+ )
327
339
 
328
340
  processor_path = Path(session_dir / "processor.pkl")
329
341
  if not processor_path.exists():
@@ -454,6 +466,13 @@ def predict_model(predict_config_path: str) -> None:
454
466
 
455
467
  def main() -> None:
456
468
  """Parse CLI arguments and dispatch to train or predict mode."""
469
+
470
+ root = logging.getLogger()
471
+ if not root.handlers:
472
+ handler = logging.StreamHandler(sys.stdout)
473
+ handler.setFormatter(logging.Formatter("%(message)s"))
474
+ root.addHandler(handler)
475
+
457
476
  parser = argparse.ArgumentParser(
458
477
  description="NextRec: Training and Prediction Pipeline",
459
478
  formatter_class=argparse.RawDescriptionHelpFormatter,
@@ -466,25 +485,32 @@ Examples:
466
485
  nextrec --mode=predict --predict_config=configs/predict_config.yaml
467
486
  """,
468
487
  )
488
+
469
489
  parser.add_argument(
470
490
  "--mode",
471
491
  choices=["train", "predict"],
472
- required=True,
473
492
  help="Running mode: train or predict",
474
493
  )
475
494
  parser.add_argument("--train_config", help="Training configuration file path")
476
495
  parser.add_argument("--predict_config", help="Prediction configuration file path")
477
496
  args = parser.parse_args()
478
497
 
498
+ logger.info(get_nextrec_version())
499
+
500
+ if not args.mode:
501
+ parser.error("[NextRec CLI Error] --mode is required (train|predict)")
502
+
479
503
  if args.mode == "train":
480
504
  config_path = args.train_config
481
505
  if not config_path:
482
506
  parser.error("[NextRec CLI Error] train mode requires --train_config")
507
+ log_startup_info(logger, mode="train", config_path=config_path)
483
508
  train_model(config_path)
484
509
  else:
485
510
  config_path = args.predict_config
486
511
  if not config_path:
487
512
  parser.error("[NextRec CLI Error] predict mode requires --predict_config")
513
+ log_startup_info(logger, mode="predict", config_path=config_path)
488
514
  predict_model(config_path)
489
515
 
490
516
 
@@ -0,0 +1,58 @@
1
+ """
2
+ CLI utilities for NextRec.
3
+
4
+ This module provides small helpers used by command-line entrypoints, such as
5
+ printing startup banners and resolving the installed package version.
6
+ """
7
+
8
+ from __future__ import annotations
9
+
10
+ import logging
11
+ import os
12
+ import platform
13
+ import sys
14
+ from datetime import datetime
15
+
16
+
17
+ def get_nextrec_version() -> str:
18
+ """
19
+ Best-effort version resolver for NextRec.
20
+
21
+ Prefer in-repo `nextrec.__version__`, fall back to installed package metadata.
22
+ """
23
+ try:
24
+ from nextrec import __version__ # type: ignore
25
+
26
+ if __version__:
27
+ return str(__version__)
28
+ except Exception:
29
+ pass
30
+
31
+ try:
32
+ from importlib.metadata import version
33
+
34
+ return version("nextrec")
35
+ except Exception:
36
+ return "unknown"
37
+
38
+
39
+ def log_startup_info(
40
+ logger: logging.Logger, *, mode: str, config_path: str | None
41
+ ) -> None:
42
+ """Log a short, user-friendly startup banner."""
43
+ version = get_nextrec_version()
44
+ now = datetime.now().strftime("%Y-%m-%d %H:%M:%S")
45
+
46
+ lines = [
47
+ "NextRec CLI",
48
+ f"- Version: {version}",
49
+ f"- Time: {now}",
50
+ f"- Mode: {mode}",
51
+ f"- Config: {config_path or '(not set)'}",
52
+ f"- Python: {platform.python_version()} ({sys.executable})",
53
+ f"- Platform: {platform.system()} {platform.release()} ({platform.machine()})",
54
+ f"- Workdir: {os.getcwd()}",
55
+ f"- Command: {' '.join(sys.argv)}",
56
+ ]
57
+ for line in lines:
58
+ logger.info(line)
@@ -62,7 +62,7 @@ def select_features(
62
62
 
63
63
 
64
64
  def register_processor_features(
65
- processor: DataProcessor,
65
+ processor: "DataProcessor",
66
66
  feature_cfg: Dict[str, Any],
67
67
  dense_names: List[str],
68
68
  sparse_names: List[str],
@@ -129,6 +129,7 @@ def build_feature_objects(
129
129
  sparse_names: List of sparse feature names
130
130
  sequence_names: List of sequence feature names
131
131
  """
132
+ from nextrec.basic.features import DenseFeature, SparseFeature, SequenceFeature
132
133
 
133
134
  dense_cfg = feature_cfg.get("dense", {}) or {}
134
135
  sparse_cfg = feature_cfg.get("sparse", {}) or {}
@@ -360,9 +361,9 @@ def load_model_class(model_cfg: Dict[str, Any], base_dir: Path) -> type:
360
361
  def build_model_instance(
361
362
  model_cfg: Dict[str, Any],
362
363
  model_cfg_path: Path,
363
- dense_features: List[DenseFeature],
364
- sparse_features: List[SparseFeature],
365
- sequence_features: List[SequenceFeature],
364
+ dense_features: List["DenseFeature"],
365
+ sparse_features: List["SparseFeature"],
366
+ sequence_features: List["SequenceFeature"],
366
367
  target: List[str],
367
368
  device: str,
368
369
  ) -> Any:
@@ -1,11 +1,12 @@
1
1
  [project]
2
2
  name = "nextrec"
3
- version = "0.4.7"
3
+ version = "0.4.8"
4
4
  description = "A comprehensive recommendation library with match, ranking, and multi-task learning models"
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.10"
7
7
  authors = [
8
- { name = "zerolovesea", email = "zyaztec@gmail.com" }
8
+ { name = "Yang Zhou" },
9
+ { email = "zyaztec@gmail.com" }
9
10
  ]
10
11
  keywords = ["recommendation", "deep-learning", "pytorch", "ctr", "ranking", "match"]
11
12
  classifiers = [
@@ -1,4 +1,3 @@
1
- import torch
2
1
  import torch.nn as nn
3
2
 
4
3
  from nextrec.basic.model import BaseModel
@@ -1 +0,0 @@
1
- __version__ = "0.4.7"
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes