--- name: huggingface-paper-publisher description: 在 Hugging Face Hub 上发布和管理研究论文。支持创建论文页面、将论文链接到模型/数据集、认领作者身份以及生成基于 markdown 的专业研究文章。 --- # 概述 此技能为 AI 工程师和研究人员提供了在 Hugging Face Hub 上发布、管理和链接研究论文的综合工具。它简化了从论文创建到发布的工作流程,包括与 arXiv 的集成、模型/数据集链接和作者身份管理。 ## 与 HF 生态系统的集成 - **论文页面**:在 Hugging Face Hub 上索引和发现论文 - **arXiv 集成**:从 arXiv ID 自动索引论文 - **模型/数据集链接**:通过元数据将论文连接到相关工件 - **作者身份验证**:认领和验证已发表论文的作者身份 - **研究文章模板**:生成专业、现代的科学论文 # 版本 1.0.0 # 依赖 包含的脚本使用 PEP 723 内联依赖。优先使用 `uv run` 而非手动环境设置。 - huggingface_hub>=0.26.0 - pyyaml>=6.0.3 - requests>=2.32.5 - markdown>=3.5.0 - python-dotenv>=1.2.1 # 核心功能 ## 1. 论文页面管理 - **索引论文**:从 arXiv 将论文添加到 Hugging Face - **认领作者身份**:验证并认领已发表论文的作者身份 - **管理可见性**:控制哪些论文出现在您的个人资料中 - **论文发现**:在 HF 生态系统中查找和探索论文 ## 2. 将论文链接到工件 - **模型卡片**:将论文引用添加到模型元数据 - **数据集卡片**:通过 README 将论文链接到数据集 - **自动标记**:Hub 自动生成 arxiv: 标签 - **引用管理**:维护适当的归属和引用 ## 3. 研究文章创建 - **Markdown 模板**:生成专业的论文格式 - **现代设计**:干净、可读的研究文章布局 - **动态目录**:自动生成目录 - **章节结构**:标准科学论文组织 - **LaTeX 数学**:支持方程式和技术符号 ## 4. 元数据管理 - **YAML 前置事项**:正确的模型/数据集卡片元数据 - **引用跟踪**:在仓库中维护论文引用 - **版本控制**:跟踪论文更新和修订 - **多论文支持**:将多篇论文链接到单个工件 # 使用说明 该技能包含 `scripts/` 目录中的 Python 脚本,用于论文发布操作。 ### 先决条件 - 使用 `uv run` 运行脚本(依赖项从脚本头部解析) - 设置带有写入访问权限令牌的 `HF_TOKEN` 环境变量 > **所有路径都是相对于包含此 SKILL.md 文件的目录。** > 在运行任何脚本之前,首先 `cd` 到该目录或使用完整路径。 ### 方法 1:从 arXiv 索引论文 将论文从 arXiv 添加到 Hugging Face 论文页面。 **基本用法:** ```bash uv run scripts/paper_manager.py index \ --arxiv-id "2301.12345" ``` **检查论文是否存在:** ```bash uv run scripts/paper_manager.py check \ --arxiv-id "2301.12345" ``` **直接 URL 访问:** 您也可以直接访问 `https://huggingface.co/papers/{arxiv-id}` 来索引论文。 ### 方法 2:将论文链接到模型/数据集 使用适当的 YAML 元数据将论文引用添加到模型或数据集 README。 **添加到模型卡片:** ```bash uv run scripts/paper_manager.py link \ --repo-id "username/model-name" \ --repo-type "model" \ --arxiv-id "2301.12345" ``` **添加到数据集卡片:** ```bash uv run scripts/paper_manager.py link \ --repo-id "username/dataset-name" \ --repo-type "dataset" \ --arxiv-id "2301.12345" ``` **添加多篇论文:** ```bash uv run scripts/paper_manager.py link \ --repo-id "username/model-name" \ --repo-type "model" \ --arxiv-ids "2301.12345,2302.67890,2303.11111" ``` **带有自定义引用:** ```bash uv run scripts/paper_manager.py link \ --repo-id "username/model-name" \ --repo-type "model" \ --arxiv-id "2301.12345" \ --citation "$(cat citation.txt)" ``` #### 链接工作原理 当您将 arXiv 论文链接添加到模型或数据集 README 时: 1. Hub 从链接中提取 arXiv ID 2. 自动向仓库添加 `arxiv:` 标签 3. 用户可以点击标签查看论文页面 4. 论文页面显示引用该论文的所有模型/数据集 5. 论文可通过过滤器和搜索发现 ### 方法 3:认领作者身份 验证您在 Hugging Face 上发表的论文的作者身份。 **开始认领流程:** ```bash uv run scripts/paper_manager.py claim \ --arxiv-id "2301.12345" \ --email "your.email@institution.edu" ``` **手动流程:** 1. 导航到您的论文页面:`https://huggingface.co/papers/{arxiv-id}` 2. 在作者列表中找到您的名字 3. 点击您的名字并选择"认领作者身份" 4. 等待管理团队验证 **检查作者身份状态:** ```bash uv run scripts/paper_manager.py check-authorship \ --arxiv-id "2301.12345" ``` ### 方法 4:管理论文可见性 控制哪些已验证的论文出现在您的公共个人资料中。 **列出您的论文:** ```bash uv run scripts/paper_manager.py list-my-papers ``` **切换可见性:** ```bash uv run scripts/paper_manager.py toggle-visibility \ --arxiv-id "2301.12345" \ --show true ``` **在设置中管理:** 导航到您的账户设置 → 论文部分,为每篇论文切换"在个人资料上显示"。 ### 方法 5:创建研究文章 使用现代模板生成基于 markdown 的专业研究论文。 **从模板创建:** ```bash uv run scripts/paper_manager.py create \ --template "standard" \ --title "Your Paper Title" \ --output "paper.md" ``` **可用模板:** - `standard` - 传统科学论文结构 - `modern` - 受 Distill 启发的干净、网络友好格式 - `arxiv` - arXiv 风格格式 - `ml-report` - 机器学习实验报告 **生成完整论文:** ```bash uv run scripts/paper_manager.py create \ --template "modern" \ --title "Fine-Tuning Large Language Models with LoRA" \ --authors "Jane Doe, John Smith" \ --abstract "$(cat abstract.txt)" \ --output "paper.md" ``` **转换为 HTML:** ```bash uv run scripts/paper_manager.py convert \ --input "paper.md" \ --output "paper.html" \ --style "modern" ``` ### 论文模板结构 **标准研究论文章节:** ```markdown --- title: Your Paper Title authors: Jane Doe, John Smith affiliations: University X, Lab Y date: 2025-01-15 arxiv: 2301.12345 tags: [machine-learning, nlp, fine-tuning] --- # Abstract Brief summary of the paper... # 1. Introduction Background and motivation... # 2. Related Work Previous research and context... # 3. Methodology Approach and implementation... # 4. Experiments Setup, datasets, and procedures... # 5. Results Findings and analysis... # 6. Discussion Interpretation and implications... # 7. Conclusion Summary and future work... # References ``` **现代模板功能:** - 动态目录 - 响应式设计,适合网络查看 - 代码语法高亮 - 交互式图表 - 数学方程式渲染(LaTeX) - 引用管理 - 作者所属机构链接 ### 命令参考 **索引论文:** ```bash uv run scripts/paper_manager.py index --arxiv-id "2301.12345" ``` **链接到仓库:** ```bash uv run scripts/paper_manager.py link \ --repo-id "username/repo-name" \ --repo-type "model|dataset|space" \ --arxiv-id "2301.12345" \ [--citation "Full citation text"] \ [--create-pr] ``` **认领作者身份:** ```bash uv run scripts/paper_manager.py claim \ --arxiv-id "2301.12345" \ --email "your.email@edu" ``` **管理可见性:** ```bash uv run scripts/paper_manager.py toggle-visibility \ --arxiv-id "2301.12345" \ --show true|false ``` **创建研究文章:** ```bash uv run scripts/paper_manager.py create \ --template "standard|modern|arxiv|ml-report" \ --title "Paper Title" \ [--authors "Author1, Author2"] \ [--abstract "Abstract text"] \ [--output "filename.md"] ``` **将 Markdown 转换为 HTML:** ```bash uv run scripts/paper_manager.py convert \ --input "paper.md" \ --output "paper.html" \ [--style "modern|classic"] ``` **检查论文状态:** ```bash uv run scripts/paper_manager.py check --arxiv-id "2301.12345" ``` **列出您的论文:** ```bash uv run scripts/paper_manager.py list-my-papers ``` **搜索论文:** ```bash uv run scripts/paper_manager.py search --query "transformer attention" ``` ### YAML 元数据格式 将论文链接到模型或数据集时,需要适当的 YAML 前置事项: **模型卡片示例:** ```yaml --- language: - en license: apache-2.0 tags: - text-generation - transformers - llm library_name: transformers --- # Model Name This model is based on the approach described in [Our Paper](https://arxiv.org/abs/2301.12345). ## Citation ```bibtex @article{doe2023paper, title={Your Paper Title}, author={Doe, Jane and Smith, John}, journal={arXiv preprint arXiv:2301.12345}, year={2023} } ``` ``` **数据集卡片示例:** ```yaml --- language: - en license: cc-by-4.0 task_categories: - text-generation - question-answering size_categories: - 10K