{"id":22775194,"url":"https://github.com/viper373/lol-deepwinpredictor","last_synced_at":"2025-03-30T13:14:42.716Z","repository":{"id":231666698,"uuid":"782371678","full_name":"Viper373/LOL-DeepWinPredictor","owner":"Viper373","description":"基于双向双层、引入注意力机制的LSTM对英雄联盟比赛胜率进行预测。","archived":false,"fork":false,"pushed_at":"2025-03-04T21:25:24.000Z","size":8916,"stargazers_count":2,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-30T13:14:37.326Z","etag":null,"topics":["attention-mechanism","crawler-python","deep-learning","flask","lol","lstm","mongodb","prediction","python","rocketmq","spider"],"latest_commit_sha":null,"homepage":"https://lol.viper3.top/predict","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Viper373.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2024-04-05T07:04:50.000Z","updated_at":"2025-03-25T07:25:56.000Z","dependencies_parsed_at":"2024-04-05T08:26:32.724Z","dependency_job_id":"318990cf-68ec-4ced-836e-c5c046779245","html_url":"https://github.com/Viper373/LOL-DeepWinPredictor","commit_stats":null,"previous_names":["viper373/lpldatacrawler","viper373/lol-deepwinpredictor"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Viper373%2FLOL-DeepWinPredictor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Viper373%2FLOL-DeepWinPredictor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Viper373%2FLOL-DeepWinPredictor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Viper373%2FLOL-DeepWinPredictor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Viper373","download_url":"https://codeload.github.com/Viper373/LOL-DeepWinPredictor/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246320198,"owners_count":20758410,"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":["attention-mechanism","crawler-python","deep-learning","flask","lol","lstm","mongodb","prediction","python","rocketmq","spider"],"created_at":"2024-12-11T18:26:20.670Z","updated_at":"2025-03-30T13:14:42.700Z","avatar_url":"https://github.com/Viper373.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# 🎮 基于深度学习的英雄联盟胜率预测\n\n## 📚 项目简介\n- 🌴项目为本人毕业设计\n- 🌱论文题目为《基于深度学习的英雄联盟胜率预测研究》\n- 🌲毕业院校：北京石油化工学院（BIPT） \n- 🌳院系：经济管理学院 \n- 🌾专业：大数据管理与应用 \n- 🌿年级：20级\n- 🌵本项目旨在使用双向LSTM（BiLSTM_Att）结合注意力机制预测英雄联盟比赛的胜率。数据来自LPL赛事和玩加电竞，共计约32900条比赛记录。四大二分类指标均达到95%左右。\n模型基于Pytorch构建，依据双方阵容选择来预测比赛胜率，通过注意力机制来提取关键信息，提高模型的准确性。\n\n## 🚙 在线体验\n- 🚀https://lol.viper3.top/predict\n\n## 🛠 项目结构\n\n```plaintext\n.\n│  app.py                     # Web应用入口\n│  README.md                  # 项目说明文件\n│  requirements.txt           # 项目依赖\n│  venv                       # 虚拟环境\n│  env.py                  # 环境配置\n│\n├─BILSTM_Att                  # 模型相关目录\n│  │  BILSTM_Att.pt           # 训练好的模型文件\n│  │  BILSTM_Att.py           # 模型定义与实现\n│  │  predict.py              # 模型预测\n│  │  predict——producer.py    # RockctMQ生产者\n│  │  predict——consumer.py    # RockctMQ消费者\n│  │  test.py                 # 模型测试\n│  │  test——producer.py       # RockctMQ生产者\n│  │  test——consumer.py       # RockctMQ消费者\n│  │  train.py                # 模型训练\n│\n├─crawling_data               # 数据爬取与处理\n│  │  collecting_data.py      # 数据收集\n│  │  concat_json.py          # JSON数据合并\n│  │  process_data.py         # 数据预处理\n│\n├─data                        # 数据目录\n│  ├─csv\n│  │      lol_rank.csv        # 排名数据\n│  │\n│  └─json\n│          example_data.json  # 示例数据\n│          hero_info.json     # 英雄信息\n│          hero_list.json     # 英雄列表\n│          hero_win_rate.json # 英雄胜率\n│          team_list.json     # 队伍列表\n│\n├─log                        # 日志文件夹\n│      lol.log\n│\n├─static                     # 静态文件\n│  │  lol.ico\n│  │  lpl.ico\n│  │\n│  ├─css\n│  │      style.css          # 页面样式\n│  │      themes_base_jquery-ui.css\n│  │\n│  ├─images\n│  │      avatar.png         # 头像\n│  │      background.jpg     # 背景图片\n│  │      leagueoflegends.webp # 英雄联盟图标\n│  │\n│  ├─js\n│  │      beifen.js          # 前端脚本\n│  │      echarts.min.js\n│  │      fuse.min.js\n│  │      jquery-3.6.0.min.js\n│  │      main.js\n│  │      ui_1.12.1_jquery-ui.js\n│  │\n│  └─saved_model\n│          BILSTM_Att.pt\n│\n└─templates                  # 模板文件目录\n        index.html           # 前端HTML页面\n```\n\n## 🕹 运行环境\n\n确保安装以下依赖：\n- 🌶Python 3.10.7+\n- 🌽Flask\n- 🥕PyTorch\n- 🍅其他依赖请参考 `requirements.txt`\n\n## 🧬 安装依赖（建议使用虚拟环境）\n\n```bash\npython -m venv venv  # 创建虚拟环境\nvenv/Scripts/activate  # 激活虚拟环境\n```\n\n```bash\npip install -r requirements.txt\n```\n\n## 🧲 数据收集与预处理\n\n1. 🍓运行数据收集脚本：\n\n    ```bash\n    python collecting_data.py\n    ```\n\n2. 🍒运行数据合并脚本：\n\n    ```bash\n    python concat_json.py\n    ```\n\n3. 🍑运行数据预处理脚本：\n\n    ```bash\n    python process_data.py\n    ```\n\n## 🧩 训练模型\n\n```bash\npython train.py\n```\n\n## 🎐 进行预测\n\n```bash\npython predict.py\n```\n\n## 🎯 启动Web应用\n\n```bash\npython app.py\n```\n\n打开浏览器访问 `http://127.0.0.1:5000`，使用页面输入队伍信息并预测胜率。\n\n## 🔑 详细文件说明\n\n### `🍍BILSTM_Att.py`\n\n实现了BiLSTM_Att模型和注意力机制，用于训练和预测。主要模块包括：\n- 🍐模型架构定义\n- 🍏前向传播\n- 🍎损失函数和优化器配置\n- 🥭引入注意力机制\n\n### `🍌env.py`\n\n设置了项目所需的环境变量和配置。\n\n### `🍋predict.py`\n\n加载训练好的模型，并对新数据进行预测。\n\n### `🍊test.py`\n\n用于模型测试的脚本。\n\n### `🍉train.py`\n\n包含了训练模型的完整流程，包括数据加载、模型训练和评估。\n\n### `🍈collecting_data.py`\n\n通过爬虫或API收集数据。\n\n### `🍇concat_json.py`\n\n将多个JSON文件合并为一个，以便进行统一的预处理和分析。\n\n### `🥥process_data.py`\n\n进行数据清洗和预处理，包括数据格式转换、归一化等操作。\n\n### `🥝app.py`\n\n使用Flask框架构建的Web应用程序入口，提供前端接口和后台逻辑。\n\n### `🍰index.html`\n\n前端HTML页面，用于用户交互，选择队伍和英雄进行胜率预测。\n\n### `🍧beifen.js`\n\n前端JavaScript代码，实现页面的动态功能，包括自动补全、图表绘制和预测结果展示。\n\n### `🍜style.css`\n\n前端CSS样式表，定义了页面的布局和样式。\n\n## 🍚贡献\n\n欢迎提出问题、建议和贡献代码。请通过GitHub issue进行讨论和提交PR。\n\n## 🍖许可证\n\n本项目采用MIT许可证，详情请参阅 LICENSE 文件。\n\n---\n\n🔋 如有任何问题，请联系项目作者。\n\n`🥗E-mail: 2020311228@bipt.edu.cn`\n\n`🍟WeChat: Viper373`\n\n`🍔QQ: 2483523414`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fviper373%2Flol-deepwinpredictor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fviper373%2Flol-deepwinpredictor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fviper373%2Flol-deepwinpredictor/lists"}