[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"similar-abisee--pointer-generator":3,"tool-abisee--pointer-generator":64},[4,17,25,39,48,56],{"id":5,"name":6,"github_repo":7,"description_zh":8,"stars":9,"difficulty_score":10,"last_commit_at":11,"category_tags":12,"status":16},1381,"everything-claude-code","affaan-m\u002Feverything-claude-code","everything-claude-code 是一套专为 AI 编程助手（如 Claude Code、Codex、Cursor 等）打造的高性能优化系统。它不仅仅是一组配置文件，而是一个经过长期实战打磨的完整框架，旨在解决 AI 代理在实际开发中面临的效率低下、记忆丢失、安全隐患及缺乏持续学习能力等核心痛点。\n\n通过引入技能模块化、直觉增强、记忆持久化机制以及内置的安全扫描功能，everything-claude-code 能显著提升 AI 在复杂任务中的表现，帮助开发者构建更稳定、更智能的生产级 AI 代理。其独特的“研究优先”开发理念和针对 Token 消耗的优化策略，使得模型响应更快、成本更低，同时有效防御潜在的攻击向量。\n\n这套工具特别适合软件开发者、AI 研究人员以及希望深度定制 AI 工作流的技术团队使用。无论您是在构建大型代码库，还是需要 AI 协助进行安全审计与自动化测试，everything-claude-code 都能提供强大的底层支持。作为一个曾荣获 Anthropic 黑客大奖的开源项目，它融合了多语言支持与丰富的实战钩子（hooks），让 AI 真正成长为懂上",138956,2,"2026-04-05T11:33:21",[13,14,15],"开发框架","Agent","语言模型","ready",{"id":18,"name":19,"github_repo":20,"description_zh":21,"stars":22,"difficulty_score":10,"last_commit_at":23,"category_tags":24,"status":16},3704,"NextChat","ChatGPTNextWeb\u002FNextChat","NextChat 是一款轻量且极速的 AI 助手，旨在为用户提供流畅、跨平台的大模型交互体验。它完美解决了用户在多设备间切换时难以保持对话连续性，以及面对众多 AI 模型不知如何统一管理的痛点。无论是日常办公、学习辅助还是创意激发，NextChat 都能让用户随时随地通过网页、iOS、Android、Windows、MacOS 或 Linux 端无缝接入智能服务。\n\n这款工具非常适合普通用户、学生、职场人士以及需要私有化部署的企业团队使用。对于开发者而言，它也提供了便捷的自托管方案，支持一键部署到 Vercel 或 Zeabur 等平台。\n\nNextChat 的核心亮点在于其广泛的模型兼容性，原生支持 Claude、DeepSeek、GPT-4 及 Gemini Pro 等主流大模型，让用户在一个界面即可自由切换不同 AI 能力。此外，它还率先支持 MCP（Model Context Protocol）协议，增强了上下文处理能力。针对企业用户，NextChat 提供专业版解决方案，具备品牌定制、细粒度权限控制、内部知识库整合及安全审计等功能，满足公司对数据隐私和个性化管理的高标准要求。",87618,"2026-04-05T07:20:52",[13,15],{"id":26,"name":27,"github_repo":28,"description_zh":29,"stars":30,"difficulty_score":10,"last_commit_at":31,"category_tags":32,"status":16},2268,"ML-For-Beginners","microsoft\u002FML-For-Beginners","ML-For-Beginners 是由微软推出的一套系统化机器学习入门课程，旨在帮助零基础用户轻松掌握经典机器学习知识。这套课程将学习路径规划为 12 周，包含 26 节精炼课程和 52 道配套测验，内容涵盖从基础概念到实际应用的完整流程，有效解决了初学者面对庞大知识体系时无从下手、缺乏结构化指导的痛点。\n\n无论是希望转型的开发者、需要补充算法背景的研究人员，还是对人工智能充满好奇的普通爱好者，都能从中受益。课程不仅提供了清晰的理论讲解，还强调动手实践，让用户在循序渐进中建立扎实的技能基础。其独特的亮点在于强大的多语言支持，通过自动化机制提供了包括简体中文在内的 50 多种语言版本，极大地降低了全球不同背景用户的学习门槛。此外，项目采用开源协作模式，社区活跃且内容持续更新，确保学习者能获取前沿且准确的技术资讯。如果你正寻找一条清晰、友好且专业的机器学习入门之路，ML-For-Beginners 将是理想的起点。",84991,"2026-04-05T10:45:23",[33,34,35,36,14,37,15,13,38],"图像","数据工具","视频","插件","其他","音频",{"id":40,"name":41,"github_repo":42,"description_zh":43,"stars":44,"difficulty_score":45,"last_commit_at":46,"category_tags":47,"status":16},3128,"ragflow","infiniflow\u002Fragflow","RAGFlow 是一款领先的开源检索增强生成（RAG）引擎，旨在为大语言模型构建更精准、可靠的上下文层。它巧妙地将前沿的 RAG 技术与智能体（Agent）能力相结合，不仅支持从各类文档中高效提取知识，还能让模型基于这些知识进行逻辑推理和任务执行。\n\n在大模型应用中，幻觉问题和知识滞后是常见痛点。RAGFlow 通过深度解析复杂文档结构（如表格、图表及混合排版），显著提升了信息检索的准确度，从而有效减少模型“胡编乱造”的现象，确保回答既有据可依又具备时效性。其内置的智能体机制更进一步，使系统不仅能回答问题，还能自主规划步骤解决复杂问题。\n\n这款工具特别适合开发者、企业技术团队以及 AI 研究人员使用。无论是希望快速搭建私有知识库问答系统，还是致力于探索大模型在垂直领域落地的创新者，都能从中受益。RAGFlow 提供了可视化的工作流编排界面和灵活的 API 接口，既降低了非算法背景用户的上手门槛，也满足了专业开发者对系统深度定制的需求。作为基于 Apache 2.0 协议开源的项目，它正成为连接通用大模型与行业专有知识之间的重要桥梁。",77062,3,"2026-04-04T04:44:48",[14,33,13,15,37],{"id":49,"name":50,"github_repo":51,"description_zh":52,"stars":53,"difficulty_score":45,"last_commit_at":54,"category_tags":55,"status":16},519,"PaddleOCR","PaddlePaddle\u002FPaddleOCR","PaddleOCR 是一款基于百度飞桨框架开发的高性能开源光学字符识别工具包。它的核心能力是将图片、PDF 等文档中的文字提取出来，转换成计算机可读取的结构化数据，让机器真正“看懂”图文内容。\n\n面对海量纸质或电子文档，PaddleOCR 解决了人工录入效率低、数字化成本高的问题。尤其在人工智能领域，它扮演着连接图像与大型语言模型（LLM）的桥梁角色，能将视觉信息直接转化为文本输入，助力智能问答、文档分析等应用场景落地。\n\nPaddleOCR 适合开发者、算法研究人员以及有文档自动化需求的普通用户。其技术优势十分明显：不仅支持全球 100 多种语言的识别，还能在 Windows、Linux、macOS 等多个系统上运行，并灵活适配 CPU、GPU、NPU 等各类硬件。作为一个轻量级且社区活跃的开源项目，PaddleOCR 既能满足快速集成的需求，也能支撑前沿的视觉语言研究，是处理文字识别任务的理想选择。",74913,"2026-04-05T10:44:17",[15,33,13,37],{"id":57,"name":58,"github_repo":59,"description_zh":60,"stars":61,"difficulty_score":45,"last_commit_at":62,"category_tags":63,"status":16},2181,"OpenHands","OpenHands\u002FOpenHands","OpenHands 是一个专注于 AI 驱动开发的开源平台，旨在让智能体（Agent）像人类开发者一样理解、编写和调试代码。它解决了传统编程中重复性劳动多、环境配置复杂以及人机协作效率低等痛点，通过自动化流程显著提升开发速度。\n\n无论是希望提升编码效率的软件工程师、探索智能体技术的研究人员，还是需要快速原型验证的技术团队，都能从中受益。OpenHands 提供了灵活多样的使用方式：既可以通过命令行（CLI）或本地图形界面在个人电脑上轻松上手，体验类似 Devin 的流畅交互；也能利用其强大的 Python SDK 自定义智能体逻辑，甚至在云端大规模部署上千个智能体并行工作。\n\n其核心技术亮点在于模块化的软件智能体 SDK，这不仅构成了平台的引擎，还支持高度可组合的开发模式。此外，OpenHands 在 SWE-bench 基准测试中取得了 77.6% 的优异成绩，证明了其解决真实世界软件工程问题的能力。平台还具备完善的企业级功能，支持与 Slack、Jira 等工具集成，并提供细粒度的权限管理，适合从个人开发者到大型企业的各类用户场景。",70612,"2026-04-05T11:12:22",[15,14,13,36],{"id":65,"github_repo":66,"name":67,"description_en":68,"description_zh":69,"ai_summary_zh":69,"readme_en":70,"readme_zh":71,"quickstart_zh":72,"use_case_zh":73,"hero_image_url":74,"owner_login":75,"owner_name":76,"owner_avatar_url":77,"owner_bio":78,"owner_company":79,"owner_location":79,"owner_email":79,"owner_twitter":79,"owner_website":80,"owner_url":81,"languages":82,"stars":87,"forks":88,"last_commit_at":89,"license":90,"difficulty_score":45,"env_os":91,"env_gpu":92,"env_ram":91,"env_deps":93,"category_tags":100,"github_topics":79,"view_count":101,"oss_zip_url":79,"oss_zip_packed_at":79,"status":16,"created_at":102,"updated_at":103,"faqs":104,"releases":134},202,"abisee\u002Fpointer-generator","pointer-generator","Code for the ACL 2017 paper \"Get To The Point: Summarization with Pointer-Generator Networks\"","pointer-generator 是 ACL 2017 论文《Get To The Point: Summarization with Pointer-Generator Networks》的官方代码实现，专注于神经文本摘要任务。它主要解决了传统序列到序列模型在生成摘要时，难以准确处理原文中罕见词或未登录词的问题。通过创新地结合指针网络与生成器，pointer-generator 能够在生成新词的同时直接从源文本复制关键信息，显著提升了摘要的忠实度和可读性。\n\n这款代码适合自然语言处理领域的研究人员和开发者使用，尤其是希望复现经典论文结果或深入探究摘要模型架构的人群。技术亮点在于其指针 - 生成器网络架构及注意力机制的应用。需要注意的是，pointer-generator 基于较旧的 TensorFlow 版本和 Python 2 开发，目前已不再主动维护，但社区提供了适配新环境的分支版本。使用者需自行准备 CNN\u002FDaily Mail 数据集即可开始训练和测试。","*Note: this code is no longer actively maintained. However, feel free to use the Issues section to discuss the code with other users. Some users have updated this code for newer versions of Tensorflow and Python - see information below and Issues section.*\n\n---\n\nThis repository contains code for the ACL 2017 paper *[Get To The Point: Summarization with Pointer-Generator Networks](https:\u002F\u002Farxiv.org\u002Fabs\u002F1704.04368)*. For an intuitive overview of the paper, read the [blog post](http:\u002F\u002Fwww.abigailsee.com\u002F2017\u002F04\u002F16\u002Ftaming-rnns-for-better-summarization.html).\n\n## Looking for test set output?\nThe test set output of the models described in the paper can be found [here](https:\u002F\u002Fdrive.google.com\u002Ffile\u002Fd\u002F0B7pQmm-OfDv7MEtMVU5sOHc5LTg\u002Fview?usp=sharing).\n\n## Looking for pretrained model?\nA pretrained model is available here:\n* [Version for Tensorflow 1.0](https:\u002F\u002Fdrive.google.com\u002Fopen?id=0B7pQmm-OfDv7SHFadHR4RllfR1E)\n* [Version for Tensorflow 1.2.1](https:\u002F\u002Fdrive.google.com\u002Fopen?id=0B7pQmm-OfDv7ZUhHZm9ZWEZidDg)\n\n(The only difference between these two is the naming of some of the variables in the checkpoint. Tensorflow 1.0 uses `lstm_cell\u002Fbiases` and `lstm_cell\u002Fweights` whereas Tensorflow 1.2.1 uses `lstm_cell\u002Fbias` and `lstm_cell\u002Fkernel`).\n\n**Note**: This pretrained model is *not* the exact same model that is reported in the paper. That is, it is the same architecture, trained with the same settings, but resulting from a different training run. Consequently this pretrained model has slightly lower ROUGE scores than those reported in the paper. This is probably due to us slightly overfitting to the randomness in our original experiments (in the original experiments we tried various hyperparameter settings and selected the model that performed best). Repeating the experiment once with the same settings did not perform quite as well. Better results might be obtained from further hyperparameter tuning.\n\n**Why can't you release the trained model reported in the paper?** Due to changes to the code between the original experiments and the time of releasing the code (e.g. TensorFlow version changes, lots of code cleanup), it is not possible to release the original trained model files. \n\n## Looking for CNN \u002F Daily Mail data?\nInstructions are [here](https:\u002F\u002Fgithub.com\u002Fabisee\u002Fcnn-dailymail).\n\n## About this code\nThis code is based on the [TextSum code](https:\u002F\u002Fgithub.com\u002Ftensorflow\u002Fmodels\u002Ftree\u002Fmaster\u002Ftextsum) from Google Brain.\n\nThis code was developed for Tensorflow 0.12, but has been updated to run with Tensorflow 1.0.\nIn particular, the code in attention_decoder.py is based on [tf.contrib.legacy_seq2seq_attention_decoder](https:\u002F\u002Fwww.tensorflow.org\u002Fapi_docs\u002Fpython\u002Ftf\u002Fcontrib\u002Flegacy_seq2seq\u002Fattention_decoder), which is now outdated.\nTensorflow 1.0's [new seq2seq library](https:\u002F\u002Fwww.tensorflow.org\u002Fapi_guides\u002Fpython\u002Fcontrib.seq2seq#Attention) probably provides a way to do this (as well as beam search) more elegantly and efficiently in the future.\n\n**Python 3 version**: This code is in Python 2. If you want a Python 3 version, see [@becxer's fork](https:\u002F\u002Fgithub.com\u002Fbecxer\u002Fpointer-generator\u002F).\n\n## How to run\n\n### Get the dataset\nTo obtain the CNN \u002F Daily Mail dataset, follow the instructions [here](https:\u002F\u002Fgithub.com\u002Fabisee\u002Fcnn-dailymail). Once finished, you should have [chunked](https:\u002F\u002Fgithub.com\u002Fabisee\u002Fcnn-dailymail\u002Fissues\u002F3) datafiles `train_000.bin`, ..., `train_287.bin`, `val_000.bin`, ..., `val_013.bin`, `test_000.bin`, ..., `test_011.bin` (each contains 1000 examples) and a vocabulary file `vocab`.\n\n**Note**: If you did this before 7th May 2017, follow the instructions [here](https:\u002F\u002Fgithub.com\u002Fabisee\u002Fcnn-dailymail\u002Fissues\u002F2) to correct a bug in the process.\n\n### Run training\nTo train your model, run:\n\n```\npython run_summarization.py --mode=train --data_path=\u002Fpath\u002Fto\u002Fchunked\u002Ftrain_* --vocab_path=\u002Fpath\u002Fto\u002Fvocab --log_root=\u002Fpath\u002Fto\u002Fa\u002Flog\u002Fdirectory --exp_name=myexperiment\n```\n\nThis will create a subdirectory of your specified `log_root` called `myexperiment` where all checkpoints and other data will be saved. Then the model will start training using the `train_*.bin` files as training data.\n\n**Warning**: Using default settings as in the above command, both initializing the model and running training iterations will probably be quite slow. To make things faster, try setting the following flags (especially `max_enc_steps` and `max_dec_steps`) to something smaller than the defaults specified in `run_summarization.py`: `hidden_dim`, `emb_dim`, `batch_size`, `max_enc_steps`, `max_dec_steps`, `vocab_size`. \n\n**Increasing sequence length during training**: Note that to obtain the results described in the paper, we increase the values of `max_enc_steps` and `max_dec_steps` in stages throughout training (mostly so we can perform quicker iterations during early stages of training). If you wish to do the same, start with small values of `max_enc_steps` and `max_dec_steps`, then interrupt and restart the job with larger values when you want to increase them.\n\n### Run (concurrent) eval\nYou may want to run a concurrent evaluation job, that runs your model on the validation set and logs the loss. To do this, run:\n\n```\npython run_summarization.py --mode=eval --data_path=\u002Fpath\u002Fto\u002Fchunked\u002Fval_* --vocab_path=\u002Fpath\u002Fto\u002Fvocab --log_root=\u002Fpath\u002Fto\u002Fa\u002Flog\u002Fdirectory --exp_name=myexperiment\n```\n\nNote: you want to run the above command using the same settings you entered for your training job.\n\n**Restoring snapshots**: The eval job saves a snapshot of the model that scored the lowest loss on the validation data so far. You may want to restore one of these \"best models\", e.g. if your training job has overfit, or if the training checkpoint has become corrupted by NaN values. To do this, run your train command plus the `--restore_best_model=1` flag. This will copy the best model in the eval directory to the train directory. Then run the usual train command again.\n\n### Run beam search decoding\nTo run beam search decoding:\n\n```\npython run_summarization.py --mode=decode --data_path=\u002Fpath\u002Fto\u002Fchunked\u002Fval_* --vocab_path=\u002Fpath\u002Fto\u002Fvocab --log_root=\u002Fpath\u002Fto\u002Fa\u002Flog\u002Fdirectory --exp_name=myexperiment\n```\n\nNote: you want to run the above command using the same settings you entered for your training job (plus any decode mode specific flags like `beam_size`).\n\nThis will repeatedly load random examples from your specified datafile and generate a summary using beam search. The results will be printed to screen.\n\n**Visualize your output**: Additionally, the decode job produces a file called `attn_vis_data.json`. This file provides the data necessary for an in-browser visualization tool that allows you to view the attention distributions projected onto the text. To use the visualizer, follow the instructions [here](https:\u002F\u002Fgithub.com\u002Fabisee\u002Fattn_vis).\n\nIf you want to run evaluation on the entire validation or test set and get ROUGE scores, set the flag `single_pass=1`. This will go through the entire dataset in order, writing the generated summaries to file, and then run evaluation using [pyrouge](https:\u002F\u002Fpypi.python.org\u002Fpypi\u002Fpyrouge). (Note this will *not* produce the `attn_vis_data.json` files for the attention visualizer).\n\n### Evaluate with ROUGE\n`decode.py` uses the Python package [`pyrouge`](https:\u002F\u002Fpypi.python.org\u002Fpypi\u002Fpyrouge) to run ROUGE evaluation. `pyrouge` provides an easier-to-use interface for the official Perl ROUGE package, which you must install for `pyrouge` to work. Here are some useful instructions on how to do this:\n* [How to setup Perl ROUGE](http:\u002F\u002Fkavita-ganesan.com\u002Frouge-howto)\n* [More details about plugins for Perl ROUGE](http:\u002F\u002Fwww.summarizerman.com\u002Fpost\u002F42675198985\u002Ffiguring-out-rouge)\n\n**Note:** As of 18th May 2017 the [website](http:\u002F\u002Fberouge.com\u002F) for the official Perl package appears to be down. Unfortunately you need to download a directory called `ROUGE-1.5.5` from there. As an alternative, it seems that you can get that directory from [here](https:\u002F\u002Fgithub.com\u002Fandersjo\u002Fpyrouge) (however, the version of `pyrouge` in that repo appears to be outdated, so best to install `pyrouge` from the [official source](https:\u002F\u002Fpypi.python.org\u002Fpypi\u002Fpyrouge)).\n\n### Tensorboard\nRun Tensorboard from the experiment directory (in the example above, `myexperiment`). You should be able to see data from the train and eval runs. If you select \"embeddings\", you should also see your word embeddings visualized.\n\n### Help, I've got NaNs!\nFor reasons that are [difficult to diagnose](https:\u002F\u002Fgithub.com\u002Fabisee\u002Fpointer-generator\u002Fissues\u002F4), NaNs sometimes occur during training, making the loss=NaN and sometimes also corrupting the model checkpoint with NaN values, making it unusable. Here are some suggestions:\n\n* If training stopped with the `Loss is not finite. Stopping.` exception, you can just try restarting. It may be that the checkpoint is not corrupted.\n* You can check if your checkpoint is corrupted by using the `inspect_checkpoint.py` script. If it says that all values are finite, then your checkpoint is OK and you can try resuming training with it.\n* The training job is set to keep 3 checkpoints at any one time (see the `max_to_keep` variable in `run_summarization.py`). If your newer checkpoint is corrupted, it may be that one of the older ones is not. You can switch to that checkpoint by editing the `checkpoint` file inside the `train` directory.\n* Alternatively, you can restore a \"best model\" from the `eval` directory. See the note **Restoring snapshots** above.\n* If you want to try to diagnose the cause of the NaNs, you can run with the `--debug=1` flag turned on. This will run [Tensorflow Debugger](https:\u002F\u002Fwww.tensorflow.org\u002Fversions\u002Fmaster\u002Fprogrammers_guide\u002Fdebugger), which checks for NaNs and diagnoses their causes during training.\n","*注意：此代码不再积极维护。不过，欢迎使用 Issues (问题区) 部分与其他用户讨论代码。一些用户已更新此代码以适配较新版本的 Tensorflow (深度学习框架) 和 Python (编程语言) - 请参阅以下信息和 Issues 部分。*\n\n---\n\n本仓库包含 ACL 2017 论文 *[Get To The Point: Summarization with Pointer-Generator Networks](https:\u002F\u002Farxiv.org\u002Fabs\u002F1704.04368)* 的代码。如需直观了解该论文，请阅读 [博客文章](http:\u002F\u002Fwww.abigailsee.com\u002F2017\u002F04\u002F16\u002Ftaming-rnns-for-better-summarization.html)。\n\n## 寻找测试集输出？\n论文中描述的模型的 test set (测试集) 输出可以在 [这里](https:\u002F\u002Fdrive.google.com\u002Ffile\u002Fd\u002F0B7pQmm-OfDv7MEtMVU5sOHc5LTg\u002Fview?usp=sharing) 找到。\n\n## 寻找预训练模型？\n一个 pretrained model (预训练模型) 在此可用：\n* [Tensorflow 1.0 版本](https:\u002F\u002Fdrive.google.com\u002Fopen?id=0B7pQmm-OfDv7SHFadHR4RllfR1E)\n* [Tensorflow 1.2.1 版本](https:\u002F\u002Fdrive.google.com\u002Fopen?id=0B7pQmm-OfDv7ZUhHZm9ZWEZidDg)\n\n（这两者之间的唯一区别在于 checkpoint (检查点) 中某些变量的命名。Tensorflow 1.0 使用 `lstm_cell\u002Fbiases` 和 `lstm_cell\u002Fweights`，而 Tensorflow 1.2.1 使用 `lstm_cell\u002Fbias` 和 `lstm_cell\u002Fkernel`）。\n\n**注意**：此 pretrained model (预训练模型) 与论文中报告的模型*不完全相同*。也就是说，它具有相同的 architecture (架构)，使用相同的设置进行训练，但来自不同的训练运行。因此，此 pretrained model (预训练模型) 的 ROUGE (文本评估指标) 评分略低于论文中报告的评分。这可能是由于我们在原始实验中略微 overfit (过拟合) 了随机性（在原始实验中，我们尝试了各种 hyperparameter (超参数) 设置并选择了表现最佳的模型）。使用相同设置重复实验一次的表现不如前者。进一步的 hyperparameter (超参数) 调优可能会获得更好的结果。\n\n**为什么不能发布论文中报告的训练模型？** 由于原始实验和代码发布之间代码发生了变化（例如 TensorFlow 版本更改、大量代码清理），无法发布原始训练模型文件。 \n\n## 寻找 CNN \u002F Daily Mail 数据？\n说明在 [这里](https:\u002F\u002Fgithub.com\u002Fabisee\u002Fcnn-dailymail)。\n\n## 关于此代码\n此代码基于 Google Brain 的 [TextSum 代码](https:\u002F\u002Fgithub.com\u002Ftensorflow\u002Fmodels\u002Ftree\u002Fmaster\u002Ftextsum)。\n\n此代码是为 Tensorflow 0.12 开发的，但已更新为可在 Tensorflow 1.0 上运行。\n特别是，attention_decoder.py 中的代码基于 [tf.contrib.legacy_seq2seq_attention_decoder](https:\u002F\u002Fwww.tensorflow.org\u002Fapi_docs\u002Fpython\u002Ftf\u002Fcontrib\u002Flegacy_seq2seq\u002Fattention_decoder)，该接口现已过时。\nTensorflow 1.0 的 [新 seq2seq (序列到序列模型) 库](https:\u002F\u002Fwww.tensorflow.org\u002Fapi_guides\u002Fpython\u002Fcontrib.seq2seq#Attention) 未来可能会提供一种更优雅和高效的方式来实现此功能（以及 beam search (束搜索)）。\n\n**Python 3 版本**：此代码使用 Python 2。如果您想要 Python 3 版本，请参阅 [@becxer 的 fork (代码分支)](https:\u002F\u002Fgithub.com\u002Fbecxer\u002Fpointer-generator\u002F)。\n\n## 如何运行\n\n### 获取 dataset (数据集)\n要获取 CNN \u002F Daily Mail dataset (数据集)，请遵循 [这里](https:\u002F\u002Fgithub.com\u002Fabisee\u002Fcnn-dailymail) 的说明。完成后，您应该拥有 [chunked (分块)](https:\u002F\u002Fgithub.com\u002Fabisee\u002Fcnn-dailymail\u002Fissues\u002F3) 数据文件 `train_000.bin`, ..., `train_287.bin`, `val_000.bin`, ..., `val_013.bin`, `test_000.bin`, ..., `test_011.bin`（每个包含 1000 个示例）和一个 vocabulary (词汇表) 文件 `vocab`。\n\n**注意**：如果您是在 2017 年 5 月 7 日之前完成的，请遵循 [这里](https:\u002F\u002Fgithub.com\u002Fabisee\u002Fcnn-dailymail\u002Fissues\u002F2) 的说明以纠正过程中的一个 bug (错误)。\n\n### 运行训练\n要训练您的模型，运行：\n\n```\npython run_summarization.py --mode=train --data_path=\u002Fpath\u002Fto\u002Fchunked\u002Ftrain_* --vocab_path=\u002Fpath\u002Fto\u002Fvocab --log_root=\u002Fpath\u002Fto\u002Fa\u002Flog\u002Fdirectory --exp_name=myexperiment\n```\n\n这将在您指定的 `log_root` 下创建一个名为 `myexperiment` 的子目录，所有 checkpoints (检查点) 和其他数据将保存在此处。然后模型将开始使用 `train_*.bin` 文件作为训练数据进行训练。\n\n**警告**：使用上述命令中的默认设置，初始化模型和运行 training iterations (训练迭代) 可能都会相当慢。为了加快速度，尝试将以下 flags (标志参数)（尤其是 `max_enc_steps` 和 `max_dec_steps`）设置为比 `run_summarization.py` 中指定的默认值更小的值：`hidden_dim`, `emb_dim`, `batch_size`, `max_enc_steps`, `max_dec_steps`, `vocab_size`。 \n\n**在训练期间增加 sequence length (序列长度)**：请注意，为了获得论文中描述的结果，我们在整个训练过程中分阶段增加 `max_enc_steps` 和 `max_dec_steps` 的值（主要是为了在训练的早期阶段执行更快的迭代）。如果您也想这样做，请从较小的 `max_enc_steps` 和 `max_dec_steps` 值开始，然后在想要增加它们时中断并重新启动任务并使用较大的值。\n\n### 运行（并发）eval (评估)\n您可能希望运行一个并发 evaluation (评估) 任务，该任务在 validation set (验证集) 上运行您的模型并记录 loss (损失)。为此，运行：\n\n```\npython run_summarization.py --mode=eval --data_path=\u002Fpath\u002Fto\u002Fchunked\u002Fval_* --vocab_path=\u002Fpath\u002Fto\u002Fvocab --log_root=\u002Fpath\u002Fto\u002Fa\u002Flog\u002Fdirectory --exp_name=myexperiment\n```\n\n注意：您应该使用与训练任务相同的设置运行上述命令。\n\n**恢复 snapshots (快照)**：评估任务会保存迄今为止在验证数据上获得最低 loss (损失) 的模型 snapshot (快照)。您可能希望恢复这些“最佳模型”中的一个，例如，如果您的训练任务已 overfit (过拟合)，或者如果训练 checkpoint 因 NaN (非数字) 值而损坏。为此，运行您的训练命令并加上 `--restore_best_model=1` flag (标志)。这会将评估目录中的最佳模型复制到训练目录。然后再次运行通常的训练命令。\n\n### 运行束搜索解码 (Beam Search Decoding)\n要运行束搜索解码：\n\n```\npython run_summarization.py --mode=decode --data_path=\u002Fpath\u002Fto\u002Fchunked\u002Fval_* --vocab_path=\u002Fpath\u002Fto\u002Fvocab --log_root=\u002Fpath\u002Fto\u002Fa\u002Flog\u002Fdirectory --exp_name=myexperiment\n```\n\n注意：你需要使用与训练任务相同的设置来运行上述命令（加上任何解码模式特定的标志，如 `beam_size`）。\n\n这将反复从指定的数据文件中加载随机示例，并使用束搜索生成摘要。结果将打印至屏幕。\n\n**可视化你的输出**：此外，解码任务会生成一个名为 `attn_vis_data.json` 的文件。该文件提供了浏览器内可视化工具所需的数据，允许你查看投射到文本上的注意力分布 (attention distributions)。要使用可视化器，请遵循 [此处](https:\u002F\u002Fgithub.com\u002Fabisee\u002Fattn_vis) 的说明。\n\n如果你想在整个验证集或测试集上运行评估并获取 ROUGE 分数，请设置标志 `single_pass=1`。这将按顺序遍历整个数据集，将生成的摘要写入文件，然后使用 [pyrouge](https:\u002F\u002Fpypi.python.org\u002Fpypi\u002Fpyrouge) 运行评估。（注意，这 *不会* 为注意力可视化器生成 `attn_vis_data.json` 文件）。\n\n### 使用 ROUGE 评估\n`decode.py` 使用 Python 包 [`pyrouge`](https:\u002F\u002Fpypi.python.org\u002Fpypi\u002Fpyrouge) 来运行 ROUGE 评估。`pyrouge` 为官方 Perl ROUGE 包提供了更易用的接口，你必须安装该包才能使 `pyrouge` 工作。以下是一些关于如何操作的有用说明：\n* [如何设置 Perl ROUGE](http:\u002F\u002Fkavita-ganesan.com\u002Frouge-howto)\n* [关于 Perl ROUGE 插件的更多详情](http:\u002F\u002Fwww.summarizerman.com\u002Fpost\u002F42675198985\u002Ffiguring-out-rouge)\n\n**注意：** 截至 2017 年 5 月 18 日，官方 Perl 包的 [网站](http:\u002F\u002Fberouge.com\u002F) 似乎已下线。不幸的是，你需要从那里下载一个名为 `ROUGE-1.5.5` 的目录。作为替代方案，似乎你可以从 [此处](https:\u002F\u002Fgithub.com\u002Fandersjo\u002Fpyrouge) 获取该目录（但是，该仓库中的 `pyrouge` 版本似乎已过时，所以最好从 [官方来源](https:\u002F\u002Fpypi.python.org\u002Fpypi\u002Fpyrouge) 安装 `pyrouge`）。\n\n### Tensorboard\n从实验目录运行 Tensorboard（在上面的示例中为 `myexperiment`）。你应该能够看到来自训练和评估运行的数据。如果你选择\"embeddings\"，还应该看到你的词嵌入 (word embeddings) 可视化。\n\n### 帮助，我遇到了 NaNs (非数字)！\n由于 [难以诊断](https:\u002F\u002Fgithub.com\u002Fabisee\u002Fpointer-generator\u002Fissues\u002F4) 的原因，NaNs 有时会在训练期间发生，导致 loss=NaN，有时还会用 NaN 值损坏模型检查点 (model checkpoint)，使其无法使用。以下是一些建议：\n\n* 如果训练因 `Loss is not finite. Stopping.` 异常而停止，你可以尝试重新启动。检查点可能并未损坏。\n* 你可以使用 `inspect_checkpoint.py` 脚本检查你的检查点是否已损坏。如果它显示所有值都是有限的，那么你的检查点是正常的，你可以尝试用它恢复训练。\n* 训练任务设置为任何时候保留 3 个检查点（参见 `run_summarization.py` 中的 `max_to_keep` 变量）。如果你的较新检查点已损坏，可能是较旧的其中一个并未损坏。你可以通过编辑 `train` 目录内的 `checkpoint` 文件切换到该检查点。\n* 或者，你可以从 `eval` 目录恢复一个“最佳模型”。请参阅上方的 **恢复快照 (Restoring snapshots)** 说明。\n* 如果你想尝试诊断 NaNs 的原因，可以开启 `--debug=1` 标志运行。这将运行 [Tensorflow Debugger](https:\u002F\u002Fwww.tensorflow.org\u002Fversions\u002Fmaster\u002Fprogrammers_guide\u002Fdebugger)，它在训练期间检查 NaNs 并诊断其原因。","# pointer-generator 快速上手指南\n\n本项目实现了 ACL 2017 论文 *[Get To The Point: Summarization with Pointer-Generator Networks](https:\u002F\u002Farxiv.org\u002Fabs\u002F1704.04368)* 中的文本摘要模型。\n\n> **注意**：本项目已不再积极维护，原始代码基于 **TensorFlow 1.x** 和 **Python 2**。如需 Python 3 支持，建议使用 [@becxer 的分支](https:\u002F\u002Fgithub.com\u002Fbecxer\u002Fpointer-generator\u002F)。\n\n## 环境准备\n\n*   **操作系统**：Linux \u002F Unix 环境推荐\n*   **Python**：2.7（原始版本）或 3.x（需使用上述 fork 版本）\n*   **TensorFlow**：1.0 - 1.2.1\n    *   预训练模型支持 TF 1.0 和 1.2.1 版本（变量命名略有不同）\n*   **评估依赖**：\n    *   官方 Perl ROUGE 包（需手动下载安装 `ROUGE-1.5.5`）\n    *   Python 接口：`pyrouge`\n\n## 安装步骤\n\n1.  **克隆代码库**\n    ```bash\n    git clone https:\u002F\u002Fgithub.com\u002Fabisee\u002Fpointer-generator.git\n    cd pointer-generator\n    ```\n\n2.  **准备数据集**\n    本项目使用 CNN \u002F Daily Mail 数据集。请按照 [官方指令](https:\u002F\u002Fgithub.com\u002Fabisee\u002Fcnn-dailymail) 处理数据。\n    *   完成后应获得分块数据文件：`train_*.bin`, `val_*.bin`, `test_*.bin`\n    *   词汇表文件：`vocab`\n\n3.  **安装 Python 依赖**\n    ```bash\n    pip install tensorflow==1.2.1\n    pip install pyrouge\n    ```\n    *配置 pyrouge 指向 Perl ROUGE 安装目录：*\n    ```bash\n    python -m pyrouge.test\n    ```\n\n## 基本使用\n\n以下命令假设数据已准备好，日志目录为 `\u002Fpath\u002Fto\u002Fa\u002Flog\u002Fdirectory`。\n\n1.  **训练模型**\n    启动训练，模型检查点将保存在 `log_root\u002Fexp_name` 目录下。\n    ```bash\n    python run_summarization.py --mode=train --data_path=\u002Fpath\u002Fto\u002Fchunked\u002Ftrain_* --vocab_path=\u002Fpath\u002Fto\u002Fvocab --log_root=\u002Fpath\u002Fto\u002Fa\u002Flog\u002Fdirectory --exp_name=myexperiment\n    ```\n    > **提示**：默认设置可能较慢。如需加速，可减小 `hidden_dim`, `batch_size`, `max_enc_steps`, `max_dec_steps` 等参数。\n\n2.  **解码与生成摘要**\n    使用 Beam Search 生成摘要并打印结果。\n    ```bash\n    python run_summarization.py --mode=decode --data_path=\u002Fpath\u002Fto\u002Fchunked\u002Fval_* --vocab_path=\u002Fpath\u002Fto\u002Fvocab --log_root=\u002Fpath\u002Fto\u002Fa\u002Flog\u002Fdirectory --exp_name=myexperiment\n    ```\n    *   生成结果将打印到屏幕。\n    *   如需生成注意力可视化数据，会产出 `attn_vis_data.json` 文件。\n    *   如需在整个验证集\u002F测试集上运行并计算 ROUGE 分数，添加标志 `--single_pass=1`。\n\n3.  **可视化监控**\n    使用 TensorBoard 查看训练损失和词嵌入可视化。\n    ```bash\n    tensorboard --logdir=\u002Fpath\u002Fto\u002Fa\u002Flog\u002Fdirectory\u002Fmyexperiment\n    ```","某新闻聚合平台的 NLP 团队正在构建自动摘要系统，旨在将长篇时政新闻快速压缩为精准的简短导语，以提升用户阅读效率。\n\n### 没有 pointer-generator 时\n- 传统 Seq2Seq 模型遭遇未登录词（OOV）瓶颈，罕见的人名、地名常被强制替换为 `\u003CUNK>` 标记，信息丢失严重。\n- 模型纯粹依靠词汇表生成内容，面对具体数字或专有名词时容易产生“幻觉”，导致事实性错误频发。\n- 摘要往往过于泛化，无法忠实还原原文关键细节，编辑人员需要花费大量时间人工校对修正。\n\n### 使用 pointer-generator 后\n- pointer-generator 引入指针机制，允许模型直接从原文复制未登录词，确保关键实体完整保留。\n- 生成模式与复制模式动态切换，显著降低了数字、日期及专有名词的转录错误，事实准确性大幅提升。\n- 注意力机制与指针网络结合，使摘要更聚焦原文重点，减少了人工校对成本，自动化流程得以顺畅运行。\n\n核心价值在于通过复制机制解决了传统生成式摘要中事实准确性差和未登录词丢失的难题，让机器摘要更可信。","https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fabisee_pointer-generator_b41712ed.png","abisee","Abi See","https:\u002F\u002Foss.gittoolsai.com\u002Favatars\u002Fabisee_69b1cba4.png","DeepMind research scientist. Formerly PhD at Stanford NLP.",null,"http:\u002F\u002Fcs.stanford.edu\u002Fpeople\u002Fabisee\u002F","https:\u002F\u002Fgithub.com\u002Fabisee",[83],{"name":84,"color":85,"percentage":86},"Python","#3572A5",100,2197,804,"2026-04-03T08:11:00","NOASSERTION","未说明","未说明 (基于 TensorFlow 1.0，通常需 CUDA 支持)",{"notes":94,"python":95,"dependencies":96},"代码已不再积极维护。官方代码基于 Python 2，如需 Python 3 请使用第三方 fork。评估功能依赖 Perl ROUGE 包，需单独安装配置。训练过程中可能出现 NaN 错误，建议保留旧检查点或使用调试模式。需自行下载 CNN\u002FDaily Mail 数据集并按要求预处理为 bin 文件。预训练模型可用但与论文报告结果略有差异。","2.7 (官方代码), 3.x (需使用 fork 版本)",[97,98,99],"tensorflow>=1.0","pyrouge","Perl ROUGE",[15],6,"2026-03-27T02:49:30.150509","2026-04-06T05:16:16.595235",[105,110,115,120,125,130],{"id":106,"question_zh":107,"answer_zh":108,"source_url":109},528,"无法复现论文中的模型结果，训练损失异常怎么办？","请确认使用的是带有 pointer generator 和 coverage 的模型而非 baseline。维护者提供了获取最佳指标的文件链接（基于 TF 1.2.0）：https:\u002F\u002F1drv.ms\u002Ff\u002Fs!AizkA_PooBXSlIJO82kT0PZ_IboUrA。如果无法运行 pyrouge，可参考该文件中的配置。","https:\u002F\u002Fgithub.com\u002Fabisee\u002Fpointer-generator\u002Fissues\u002F16",{"id":111,"question_zh":112,"answer_zh":113,"source_url":114},529,"训练时报错 \"TensorArray has size zero, but element shape \u003Cunknown> is not fully defined\" 如何解决？","该错误通常由空文章文本（empty article text）引起。维护者已更新 `batcher.py` 以丢弃包含空文章文本的示例。请拉取最新代码，或手动修改 `batcher.py` 过滤空文本。","https:\u002F\u002Fgithub.com\u002Fabisee\u002Fpointer-generator\u002Fissues\u002F1",{"id":116,"question_zh":117,"answer_zh":118,"source_url":119},530,"运行脚本时报错 \"The 'mode' flag must be one of train\u002Feval\u002Fdecode\" 怎么办？","这是 TensorFlow 版本过旧导致的兼容性问题。建议更新代码以兼容当前 TF 版本（如 TF 1.12）。具体修复方法是将代码中的 `tf.app.flag` 更新为 `tf.flag`。","https:\u002F\u002Fgithub.com\u002Fabisee\u002Fpointer-generator\u002Fissues\u002F91",{"id":121,"question_zh":122,"answer_zh":123,"source_url":124},531,"如何使用预训练模型对新文本数据生成摘要？","需修改 `make_datafiles.py` 去除硬编码以处理新数据（tokenize 和 chunk）。在使用预训练模型 decode 时，若无需计算 ROUGE 指标，可在 `decode.py` 中找到相关函数并注释掉，以避免因缺少参考摘要导致的错误。","https:\u002F\u002Fgithub.com\u002Fabisee\u002Fpointer-generator\u002Fissues\u002F51",{"id":126,"question_zh":127,"answer_zh":128,"source_url":129},532,"哪里可以下载训练好的模型文件用于测试？","README 中已包含 TF1.0 和 TF1.2.1 版本的模型下载链接。请直接查看项目 README 文件获取最新模型资源。","https:\u002F\u002Fgithub.com\u002Fabisee\u002Fpointer-generator\u002Fissues\u002F37",{"id":131,"question_zh":132,"answer_zh":133,"source_url":129},533,"不同 TensorFlow 版本的模型变量名不兼容如何解决？","如果遇到 TF 版本导致的变量命名问题，可以使用此脚本更改 checkpoint 中的变量名：https:\u002F\u002Fgist.github.com\u002Fbatzner\u002F7c24802dd9c5e15870b4b56e22135c96。该脚本非常简单，适用于解决进一步的 Tensorflow 版本命名问题。",[]]