{"id":20298554,"url":"https://github.com/jingyibysutsoftware/ecrs_web","last_synced_at":"2025-07-16T07:42:01.596Z","repository":{"id":154108564,"uuid":"489604347","full_name":"JingyibySUTsoftware/ECRS_Web","owner":"JingyibySUTsoftware","description":"基于深度学习的商品推荐系统，高性能，可承受高并发，可跨平台","archived":false,"fork":false,"pushed_at":"2023-05-05T06:48:01.000Z","size":6154,"stargazers_count":60,"open_issues_count":3,"forks_count":7,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-24T15:06:58.763Z","etag":null,"topics":["deep-learning","deepfm","dssm","flask","gevent","grpc","layui","layuimini","milvus","nginx","paddlepaddle","paddleserving","python3","recommendation-system","redis"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/JingyibySUTsoftware.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":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2022-05-07T07:36:28.000Z","updated_at":"2025-06-18T14:21:02.000Z","dependencies_parsed_at":null,"dependency_job_id":"9841115c-09ed-4b45-abdb-bc46f77bc295","html_url":"https://github.com/JingyibySUTsoftware/ECRS_Web","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/JingyibySUTsoftware/ECRS_Web","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JingyibySUTsoftware%2FECRS_Web","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JingyibySUTsoftware%2FECRS_Web/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JingyibySUTsoftware%2FECRS_Web/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JingyibySUTsoftware%2FECRS_Web/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JingyibySUTsoftware","download_url":"https://codeload.github.com/JingyibySUTsoftware/ECRS_Web/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JingyibySUTsoftware%2FECRS_Web/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265492975,"owners_count":23776153,"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":["deep-learning","deepfm","dssm","flask","gevent","grpc","layui","layuimini","milvus","nginx","paddlepaddle","paddleserving","python3","recommendation-system","redis"],"created_at":"2024-11-14T16:10:14.702Z","updated_at":"2025-07-16T07:42:01.554Z","avatar_url":"https://github.com/JingyibySUTsoftware.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 基于深度学习的商品推荐系统\n\n### 项目简介\n#### 技术栈\n\u003e项目用到的技术如下：\n\u003e语言：`Python3` `Java`\n\u003e\n\u003eWeb端：`Layui`,`Flask`,`Nginx`,`Gevent`，`Flask_Cache`\n\u003e\n\u003e模型训练： `PaddleRec` , `PaddlePaddle` \n\u003e\n\u003e深度学习模型:`DSSM`, `DeepFM`\n\u003e\n\u003e向量召回：`milvus`\n\u003e\n\u003e数据存储： `Redis` \n\u003e\n\u003e模型推理： `PaddleServing\n\u003e`\n\u003e模块通信：`gRPC`,`protobuf`\n\n#### 快速开始\n##### 项目部署依赖\nPython3、PaddlePaddle2.2.2、PaddleServing、milvus1.0、redis、nginx、Gevent\n\nPaddlePaddle安装参考 ：[PaddlePaddle飞桨安装](https://www.paddlepaddle.org.cn/install/quick?docurl=/documentation/docs/zh/develop/install/pip/windows-pip.html)\n\nMilvus的安装请参考：[Milvus安装](https://blog.csdn.net/weixin_44524687/article/details/125191687?csdn_share_tail=%7B%22type%22:%22blog%22,%22rType%22:%22article%22,%22rId%22:%22125191687%22,%22source%22:%22weixin_44524687%22%7D\u0026ctrtid=w3I8z)\n\nMilvus的python驱动和PaddleServing安装\n```shell\npython3 -m pip install redis pymilvus==1.0.1 paddle_serving_app==0.3.1\n```\ngevent模块安装\n```shell\npip install gevent\n```\nFlask_Cache模块安装\n```shell\npip install Flask-Cache\n```\n##### 项目启动\n当你安装以上依赖后，保证Redis和Milvus处于运行状态\n\n1.向Redis中存储用户和商品数据\n```shell\npython to_redis.py\n```\n2.向Milvus中存储商品向量数据\n```shell\npython to_milvus.py\n```\n3.启动用户服务\n```shell\npython um.py\n```\n4.启动内容服务\n```shell\npython cm.py\n```\n5.启动召回服务\n```shell\npython recall.py\n```\n6.启动排序服务\n```shell\npython rank.py\n```\n7.启动应用服务\n```shell\npython as.py\n```\n8.启动Web应用\n```shell\npython controller.py\n\npython controller2.py\n```\n\n到这里就可以使用系统了，在浏览器访问 `http://localhost:5000`和`http://localhost:5001`即可体验使用\n如果还需要进行负载均衡可以运行Nginx，该项目中的Nginx配置内容请参考[Nginx配置](https://blog.csdn.net/weixin_44524687/article/details/125210575)\n如果您配置了Nginx，则在浏览器中访问 `http://loclhost:5158`使用本系统\n\n#### 跨平台功能说明\n本项目中内置了一个跨平台演示Demo在`ECRS_jav_demo`文件夹下，直接运行该文件夹下`Client.java`文件，即可体验使用Java访问python编写的推荐服务模块，如果需要定制访问其他服务请参考[跨平台访问](https://blog.csdn.net/weixin_44524687/article/details/124614018)\n\n#### 系统架构及推荐流程\n系统架构\n![在这里插入图片描述](https://img-blog.csdnimg.cn/873403086dbb4f3795844f7661ffe376.png)\n系统工作流程\n![在这里插入图片描述](https://img-blog.csdnimg.cn/b449665335644d5a84ed2b2938fceef6.png)\n推荐功能流程图\n![在这里插入图片描述](https://img-blog.csdnimg.cn/59e7fa6c55ef412cbbbdc71c3ea33f65.png)\n\n\n\n\n(1)登录。\n系统的默认起始页，所有用户第一次访问系统时，都将访问该页面，同时该页面还承担着请求流量承载的功能。\n(2)用户服务/商品服务。\n将实验用的数据集进行拆分，用户数据和商品数据各一份，数据经过解析保存到非关系型数据库 Redis 中，外部传入用户和商品的唯一id 作为 key 到 Redis 中查找对应的 value 并以二进制流的形式将结果返回到相应的模块。\n(3)召回服务。\n召回服务主要有三个任务，当系统中有新用户使用时，上述的用户信息库中无法查询该用户的信息。系统可以利用原有的用户信息训练的模型拟合新增用户，新用户会通过这个用户模型得到该用户的特征向量；为了完成召回任务，需要提前将所有商品信息通过商品模型转换成商品特征向量并导入 Milvus 中，同理， 当有新商品上架时，需要预执行上述步骤以便新商品可以及时地被推荐；最后把用户向量和商品向量在Milvus 中做向量近似搜索，返回只包含商品id信息的候选集列表。 \n(4)排序服务。\n召回阶段得到的候选集商品 id 列表通过商品服务查询商品的详细信息，然后与用户向量结合作为排序服务的输入，排序模型通过打分把所有候 选待推荐的商品按分数从高到低排序，最后返回这个含有详细商品信息的推荐列表。\n(5)接口服务。\n后台每个功能模块通过gRPC框架划分为微服务模块，每个服务拥有独立的通信端口channel，开发者可以根据需要向指定的模块的channel发送请求参数，模块接受到参数处理后返回结果。\n\n\n![在这里插入图片描述](https://img-blog.csdnimg.cn/eac9c45de18c423b815ebdc65a3e22dc.png)\n\n\n\n\n\n\n\n\n\n\n#### 结果演示示例（仅展示部分功能页面）\n您也可以查看系统的演示视频[Bilibili在线演示](https://www.bilibili.com/video/BV1GZ4y1t7bL/)\n![在这里插入图片描述](https://img-blog.csdnimg.cn/069fc076288648d1ba9825d65163dbc2.png)\n![在这里插入图片描述](https://img-blog.csdnimg.cn/59b9e50247234ea48b9d2b192994ca33.png)\n\n![在这里插入图片描述](https://img-blog.csdnimg.cn/fcfbc59585f14126b38ec714cac55f45.png)\n![在这里插入图片描述](https://img-blog.csdnimg.cn/ae476035cbf34e848053be9079e84615.png)\n\n![在这里插入图片描述](https://img-blog.csdnimg.cn/1589d28707824e84b59e0bcaa32c5b17.png)\n![在这里插入图片描述](https://img-blog.csdnimg.cn/336442387e7447cfa53cd1bf07ed0695.png)\n![在这里插入图片描述](https://img-blog.csdnimg.cn/c3a2fdcd251a40dcbefe5c1daf4810fe.png)\n![在这里插入图片描述](https://img-blog.csdnimg.cn/25d89dc344ed4c518e8192559242e1d0.png)\n\n\n#### 模型和数据文件\n受限于文件大小，本项目并未上传模型和数据文件。\n如需要请到以下链接获取\n模型：链接：https://pan.baidu.com/s/1qZoFnWGLWkzrUKLHbE_c6g  提取码：t2bb \n数据：https://aistudio.baidu.com/aistudio/datasetdetail/6458\n\n在训练本项目的模型文件时，做了二分类和逻辑回归两种实验条件下的训练，模型最终在测试集上的结果如下：\n\n二分类\n|模型|\tTotal|\tCorrect|\tACC|\tAUC|\n|--|--|--|--|--|\n|DSSM(user)|\t1373344|\t857725|\t0.62455|\t0.7312|\n|DSSM(item)|\t1373344|\t857725|\t0.62455|\t0.7306|\n|DeepFM|\t1373344|\t858895|\t0.6254\t|0.73428|\n\n逻辑回归\n|模型\t|Total|\tCorrect|\tACC|\tMAE|\n|--|--|--|--|--|\n|DSSM(user)|\t1373344|\t797789|\t0.58090|\t2.57662|\n|DSSM(item)\t|1373344\t|798387\t|0.58134|\t2.56567|\n|DeepFM\t|1373344\t|765238\t|0.55720\t|2.43759|\n\nDSSM模型的ACC最高提升了7.5%，DeepFM模型的ACC最高提升了12.24%。\n\n如果您需要训练自己的模型文件，可以参考[官方项目](https://aistudio.baidu.com/aistudio/projectdetail/1481839)或[我的项目](https://aistudio.baidu.com/aistudio/projectdetail/3370104)自己训练获取模型或者完成一个新的推荐系统，或者私信我获取本项目缺少的模型和对应的数据文件\n\n#### 致谢\n\u003e项目遵守[Apache License 2.0](http://www.apache.org/licenses/)协议，将代码更改的部分已作说明非常感谢[PaddleRec](https://github.com/PaddlePaddle/PaddleRec)的demo，本项目大部分是基于该项目部分改动得到的。\n感谢[京东2019用户对品类下店铺的购买预测竞赛数据集](https://jdata.jd.com/html/detail.html?id=8)\n感谢[PaddleServing](https://github.com/PaddlePaddle/Serving)、[Redis](https://github.com/Redis)、[milvus](https://github.com/milvus-io/milvus)对项目部署的支持；\n感谢[Protobuf](https://github.com/protocolbuffers/protobuf)和[gRPC](https://github.com/grpc/grpc)，实现了本项目的服务模块分布式部署和通信。\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjingyibysutsoftware%2Fecrs_web","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjingyibysutsoftware%2Fecrs_web","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjingyibysutsoftware%2Fecrs_web/lists"}