[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M70DD6BCF2P3ZCMRP8ERR5BB":3,"skill-same:01M70DD6BCF2P3ZCMRP8ERR5BB":92},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":23,"publishedAt":44,"linkOnly":45,"markdownContent":46,"markdownBody":47,"frontMatter":48,"refName":59,"commitSha":60,"skillDirectory":61,"forksCount":62,"repositoryHtmlUrl":63,"repositoryHomepageUrl":6,"ownerHtmlUrl":64,"ownerBlogUrl":65,"ownerDescription":66,"updatedAt":67,"install":68,"resources":81},"01M70DD6BCF2P3ZCMRP8ERR5BB","pubtator-entity-search",null,"NLM PubTator3 实体级关系挖掘原子 skill — 在 PubMed 文献里检索\"疾病-药物-基因-化学品-突变-物种-细胞系\"的标注与关系三元组。当用户问\"BTK 与肺曲霉病的关联文献\"、\"BTK 抑制剂(MeSH D000077180)在哪些研究被讨论\"、\"标注这些 PMID 中提到的所有疾病\u002F药物\u002F基因实体\"、\"ibrutinib 的 MeSH\u002FDrugBank ID\"、\"voriconazole 与 CYP2C19 药物-基因相互作用\"、\"BRAF V600E 突变 \u002F rs113488022 检索\"、\"实体共现 \u002F co-mention \u002F 关系挖掘 \u002F 实体规范化 \u002F NER \u002F annotation \u002F entity normalization \u002F disease-gene association \u002F drug-gene interaction \u002F chemical-disease relation\" 时使用。无需 API key,跨平台稳定。**实体级 + 关系级**定位 — 不做综合文献检索(走 pubmed-eutils \u002F europepmc-search)、不做全文段落抽取(走 bioc-fulltext-fetch)、不做证据等级排序(走 medical-evidence-grading)。","EthanYoQ\u002FSkill-hub","EthanYoQ","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F257484394?v=4","01M70C9QKWR1YS0S7V26DNB18H","Ethan","01M70C9QMER047R5ANZZA6KC2P",11,"MIT","https:\u002F\u002Fgithub.com\u002FEthanYoQ\u002FSkill-hub\u002Fblob\u002Fmine\u002Farchives\u002Fuser-installed-skills\u002Fpubtator-entity-search\u002F366b9a940d152650\u002Fpubtator-entity-search\u002FSKILL.md",[18],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000023","Skill与智能体开发","SCENARIO","使用场景",[24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43],"pubtator entity search","entity","search","实体标注","entity normalization","gene","entity-relation","entity-normalization","pubtator3","co","biomedical-entity","pubtator","interaction","pubmed","api","evidence-grading","medical","ner","fetch","mesh","2026-11-10 10:12:30",false,"---\nname: pubtator-entity-search\ndescription: NLM PubTator3 实体级关系挖掘原子 skill — 在 PubMed 文献里检索\"疾病-药物-基因-化学品-突变-物种-细胞系\"的标注与关系三元组。当用户问\"BTK 与肺曲霉病的关联文献\"、\"BTK 抑制剂(MeSH D000077180)在哪些研究被讨论\"、\"标注这些 PMID 中提到的所有疾病\u002F药物\u002F基因实体\"、\"ibrutinib 的 MeSH\u002FDrugBank ID\"、\"voriconazole 与 CYP2C19 药物-基因相互作用\"、\"BRAF V600E 突变 \u002F rs113488022 检索\"、\"实体共现 \u002F co-mention \u002F 关系挖掘 \u002F 实体规范化 \u002F NER \u002F annotation \u002F entity normalization \u002F disease-gene association \u002F drug-gene interaction \u002F chemical-disease relation\" 时使用。无需 API key,跨平台稳定。**实体级 + 关系级**定位 — 不做综合文献检索(走 pubmed-eutils \u002F europepmc-search)、不做全文段落抽取(走 bioc-fulltext-fetch)、不做证据等级排序(走 medical-evidence-grading)。\nkeywords:\n  - pubtator\n  - pubtator3\n  - biomedical-entity\n  - NER\n  - annotation\n  - entity-relation\n  - entity-normalization\n  - co-mention\n  - 实体标注\n  - 疾病基因关联\n  - 药物-基因\n  - 化学品-疾病\n  - 突变检索\n  - mesh\n  - dbsnp\n  - drugbank\nlicense: MIT\n---\n\n# PubTator3 Entity & Relation Search\n\n封装 NLM PubTator3 RESTful API,做**实体级标注 + 关系挖掘**。聚焦\"疾病 — 药物 — 基因 — 化学品 — 突变 — 物种 — 细胞系\"的联动检索。\n\n---\n\n## 1. 何时使用本技能\n\n**适合 (✅ 自动触发)**:\n\n| 用户问题 | 路由 |\n|---|---|\n| \"找 BTK 与肺曲霉病的关联文献\" | ✅ 本技能 (`find_co_mentions`) |\n| \"BTK 抑制剂 (MeSH D000077180) 在哪些研究被讨论\" | ✅ 本技能 (`search_by_entity`) |\n| \"标注这些 PMID 中提到的所有疾病\u002F药物\u002F基因实体\" | ✅ 本技能 (`annotate_pmid`) |\n| \"ibrutinib 在文献中映射到哪个 MeSH\u002FDrugBank\" | ✅ 本技能 (`entity_normalize`) |\n| \"voriconazole 与 CYP2C19 相互作用\" | ✅ 本技能 (`search_by_relation`) |\n| \"BRAF V600E \u002F rs113488022 突变文献\" | ✅ 本技能 (`search_by_entity` concept=variant) |\n\n**不适合 (❌ 路由到其他 skill)**:\n\n| 用户问题 | 路由 |\n|---|---|\n| \"查 PubMed 上近 5 年所有 X 的 RCT\" | ❌ → `pubmed-eutils` + Clinical Queries |\n| \"MeSH 树 \u002F 出版类型 \u002F PubDate 综合检索\" | ❌ → `pubmed-eutils` |\n| \"Europe PMC 综合检索 + 引文\" | ❌ → `europepmc-search` |\n| \"全文段落抽取 \u002F BioC 全文\" | ❌ → `bioc-fulltext-fetch` |\n| \"证据等级 \u002F GRADE \u002F 推荐级别\" | ❌ → `medical-evidence-grading` |\n| \"正在招募的 X 临床试验\" | ❌ → `clinical-trials-v2` |\n\n---\n\n## 2. API 概览 (无需 Key)\n\nBase URL: `https:\u002F\u002Fwww.ncbi.nlm.nih.gov\u002Fresearch\u002Fpubtator3-api\u002F`\n\nPubTator3 是 NLM 开放服务,**无需 API key**,但请遵守速率限制 (≤ 5 req\u002Fs,失败时指数退避)。\n\n| 端点 | 用途 |\n|------|------|\n| `GET \u002Fsearch\u002F?text=\u003Cquery>` | 自由文本 \u002F 实体检索文献 |\n| `GET \u002Fpublications\u002Fexport\u002Fbiocjson?pmids=\u003Ccsv>` | 拉取 PMID 的实体标注 BioC-JSON |\n| `GET \u002Fentity\u002Fautocomplete\u002F?query=\u003Ctext>&concept=\u003Ctype>` | 实体规范化 (text → ID) |\n| `GET \u002Frelations?e1=\u003Cid>&e2=\u003Cid>` | 关系\u002F共现挖掘 |\n\n文档: \u003Chttps:\u002F\u002Fwww.ncbi.nlm.nih.gov\u002Fresearch\u002Fpubtator3-api\u002F>\n\n---\n\n## 3. 5 个原子函数 (跨平台签名)\n\n每个签名命名稳定,可在 Python \u002F TS \u002F Go \u002F Rust 任意语言实现。\n\n### 3.1 `search_by_entity(entity_text, entity_type=None, max_results=50) -> list[PMID]`\n\n```\nGET \u002Fsearch\u002F?text=@\u003CTYPE>_\u003CID>  或  ?text=\u003Cfree text>\n```\n示例: `text=@DISEASE_MESH:D055744` → 返回 `{pmids:[...], score:[...]}`。\n\n### 3.2 `search_by_relation(entity1_id, relation_type, entity2_id) -> list[Relation]`\n\n```\nGET \u002Frelations?e1=\u003Cid1>&e2=\u003Cid2>&type=\u003Crelation>\n```\n关系类型见 `references\u002Frelation-types.md`。返回涉及关系的 PMID + score + 句级证据。\n\n### 3.3 `annotate_pmid(pmid_list) -> list[Annotation]`\n\n```\nGET \u002Fpublications\u002Fexport\u002Fbiocjson?pmids=12345,67890&full=false\n```\n解析 BioC-JSON `documents[].passages[].annotations[]`。一次最多 100 PMID,超出自动分批。\n\n### 3.4 `entity_normalize(free_text, concept=None) -> list[EntityCandidate]`\n\n```\nGET \u002Fentity\u002Fautocomplete\u002F?query=BTK%20inhibitor&concept=chemical\n```\n返回 `[{name, id, type, score}, ...]`,例如 `BTK inhibitor → MESH:D000077180`。\n\n### 3.5 `find_co_mentions(entity1_id, entity2_id, top_n=20, recent_years=None) -> list[CoMention]`\n\n组合 `search` + `annotate` 验证两实体在同一文献被标注。可按近 N 年过滤。\n\n---\n\n## 4. 实体类型 & 关系类型 (Reference)\n\n主文档不嵌入完整定义,按需展开:\n\n- **实体类型** (7 种 + identifier 格式 + 查询前缀): 见 [`references\u002Fentity-types.md`](references\u002Fentity-types.md)\n  - `gene` \u002F `disease` \u002F `chemical` \u002F `variant` \u002F `mutation` \u002F `species` \u002F `cellline`\n- **关系类型** (8 种 + 主-宾语典型组合 + score 阈值): 见 [`references\u002Frelation-types.md`](references\u002Frelation-types.md)\n  - `treat` \u002F `cause` \u002F `inhibit` \u002F `interact_with` \u002F `regulate` \u002F `associate` \u002F `compare` \u002F `co-occur`\n\n---\n\n## 5. 输出格式 (标准 schema)\n\n每条标注:\n\n```python\n{\n    \"pmid\": \"12345\",\n    \"entity_text\": \"BTK\",\n    \"entity_type\": \"Gene\",          # Gene\u002FDisease\u002FChemical\u002FVariant\u002FSpecies\u002FCellLine\n    \"identifier\": \"695\",            # NCBI Gene \u002F MESH \u002F rs# \u002F Taxonomy \u002F CVCL\n    \"section\": \"Title\",             # Title \u002F Abstract\n    \"offset\": 23,                   # passage 内字符级起点\n    \"length\": 3,\n    \"confidence\": 0.95,             # 若 API 返回\n}\n```\n\n每条关系:\n\n```python\n{\n    \"pmid\": \"12345\",\n    \"subject\":   {\"text\": \"ibrutinib\", \"type\": \"Chemical\", \"id\": \"MESH:D000077594\"},\n    \"predicate\": \"inhibits\",\n    \"object\":    {\"text\": \"BTK\",       \"type\": \"Gene\",     \"id\": \"695\"},\n    \"score\": 0.92,\n    \"evidence_sentence\": \"Ibrutinib irreversibly inhibits BTK ...\",\n    \"section\": \"Abstract\",\n}\n```\n\n---\n\n## 6. 典型工作流\n\n### 用例 A — 疾病 + 药物联动\n\n> \"找近 5 年讨论 BTK 抑制剂与侵袭性肺曲霉病关系的文献\"\n\n1. `entity_normalize(\"BTK inhibitor\", \"chemical\")` → `MESH:D000077180`\n2. `entity_normalize(\"invasive pulmonary aspergillosis\", \"disease\")` → `MESH:D055744`\n3. `find_co_mentions(e1, e2, top_n=30, recent_years=5)`\n4. 对返回 PMID 用 `annotate_pmid()` 提取上下文 → 三元组表\n5. 需要证据等级 → 输出喂给 `medical-evidence-grading`\n\n### 用例 B — 批量标注\n\n> \"把这 20 个 PMID 里所有疾病\u002F药物\u002F基因列出来\"\n\n1. `annotate_pmid([...20 PMIDs...])`\n2. 按 `entity_type ∈ {Gene, Disease, Chemical}` 过滤 → 去重计数 → 频次表\n\n### 用例 C — 实体规范化\n\n> \"ibrutinib 的 MeSH 是什么?\"\n\n1. `entity_normalize(\"ibrutinib\", \"chemical\")` → 取首条 hit 的 `id`\n\n### 用例 D — 上下游链接\n\n> 本技能产出 PMID 集合后,可直接喂给:\n- `pubmed-eutils` → 拿元数据 \u002F 出版类型\n- `bioc-fulltext-fetch` → 拿全文段落\n- `medical-evidence-grading` → 实体级证据排序\n\n---\n\n## 7. 失败模式 (≥ 5 条)\n\n| # | 失败模式 | 检测 | 处理 |\n|---|---|---|---|\n| 1 | **实体未识别** — PubTator 不支持的术语 \u002F 拼写 \u002F 罕见同义词 | `autocomplete` 返回空 | 退化用 `pubmed-eutils` 自由文本检索;同时建议规范同义词或换 concept |\n| 2 | **实体规范化多义词** — `BTK` 既是基因 (NCBI 695) 也是缩写 \u002F 化学品 | `autocomplete` 返回多 hit,score 接近 | 让用户确认 concept;必要时用 ID 而非 symbol |\n| 3 | **关系置信度低 (`score \u003C 0.5`)** — 假阳性高 | `\u002Frelations` 返回 score | **过滤丢弃**,不进入证据表;0.5–0.8 区间需人工核句 |\n| 4 | **共现假阳性** — 两实体出现在同一文献但语义无关 (review \u002F 综述堆砌名词) | 句级 evidence 不在同一句 \u002F passage | 至少要求两实体在同一 sentence 才算 co-mention;否则降权 |\n| 5 | **API rate limit (429)** — 过快请求被限流 | HTTP 429 \u002F 503 | 退避 2 → 4 → 8s,最多 5 次;批处理时控制 ≤ 5 RPS |\n| 6 | **PMID 暂未被 PubTator 标注** — 太新 \u002F 待索引 | BioC-JSON 缺 `annotations` | 在结果里标 `status=pending_annotation`,跳过并记录;可走 `bioc-fulltext-fetch` 拿全文再 LLM 标 |\n| 7 | **PMID 不存在** | BioC-JSON 文档为空 | 返回 `status=not_found` |\n| 8 | **方向反转 \u002F 否定语** — 句子含 \"not\", \"fail to\", \"no association\" | `evidence_sentence` 正则或 LLM 判否定 | 标记 `polarity=negative`,从证据表剔除或单列 |\n\n不要静默吞错;每个失败请求记录 `{pmid, endpoint, status_code, message}`。\n\n---\n\n## 8. 实现要点\n\n- 用 `requests` + `tenacity` (Python) \u002F `axios-retry` (TS) 做指数退避\n- `concept` 参数小写: `gene | disease | chemical | variant | species | cellline`\n- BioC-JSON 路径: `documents[*].passages[*].annotations[*].infons.{type,identifier}` + `text` + `locations[0].offset\u002Flength`\n- 一次 `annotate_pmid` 上限 100 PMID (超过自动分批 + 并发上限 ≤ 3)\n- 自由文本 + 实体混合查询: `text=ibrutinib AND @DISEASE_MESH:D055744`\n- 跨平台: 函数签名只用 string \u002F list \u002F dict,不依赖任何特定运行时\n\n---\n\n## 9. 安全 \u002F 合规\n\n- 公共 NLM API,无 PHI\n- **不要把用户上传的非公开文本发给 PubTator3** — 仅用公开 PMID\n- 输出注明 `Source: NLM PubTator3, retrieved \u003Cdate>`\n- PubTator3 标注属机器抽取,**置信度 \u003C 0.8 的关系应人工核对**\n\n---\n\n## 10. 与其他 skill 的协同 (显式互补,无重叠)\n\n| 技能 | 边界 | 协同方向 |\n|---|---|---|\n| **`pubmed-eutils`** | E-utilities — MeSH 树 \u002F 出版类型 \u002F PubDate 综合检索 | **互补**: 本技能给 PMID,`pubmed-eutils` 拿元数据 |\n| **`europepmc-search`** | Europe PMC 广召回 + 引文 + 多源融合 | **互补**: 召回扩展;不重叠 |\n| **`bioc-fulltext-fetch`** | BioC PMC 全文 XML\u002FJSON 段落抽取 | **互补**: PubTator3 标题\u002F摘要,BioC 全文;PubTator3 不替代全文 |\n| **`medical-evidence-grading`** | GRADE \u002F 证据等级 \u002F 推荐级别 (上层) | **上层**: 本技能输出实体三元组,grading 给等级 |\n| **`clinical-trials-v2`** | ClinicalTrials.gov 试验注册 | **不相关**: 走 NCT |\n\n本技能输出的 PMID 集合 \u002F 三元组可直接喂给上述任意下游。\n\n---\n\n## 11. 快速 cheatsheet\n\n```text\n# 1) 文本 → 实体 ID\nGET \u002Fentity\u002Fautocomplete\u002F?query=ibrutinib&concept=chemical\n\n# 2) 实体检索文献\nGET \u002Fsearch\u002F?text=@CHEMICAL_MESH:D000077594\n\n# 3) 关系挖掘\nGET \u002Frelations?e1=MESH:D000077594&e2=695&type=inhibit\n\n# 4) PMID 批量标注\nGET \u002Fpublications\u002Fexport\u002Fbiocjson?pmids=12345,67890\n\n# 5) 共现: search 各拿 PMID 集合 → 求交 → annotate 验证 → 按 score\u002F年份排序\n```\n\n实体类型查询前缀:\n`@GENE_\u003CNCBIid>` · `@DISEASE_MESH:\u003CDid>` · `@CHEMICAL_MESH:\u003CDid>` · `@VARIANT_\u003Crs#>` · `@SPECIES_\u003CTaxId>` · `@CELLLINE_\u003CCVCLid>`\n\n---\n\n**版本**: v1.1 · **维护**: 跟随 NLM PubTator3 API 文档更新 (关注 endpoints 变更与新增 concept)。\n","# PubTator3 Entity & Relation Search\n\n封装 NLM PubTator3 RESTful API,做**实体级标注 + 关系挖掘**。聚焦\"疾病 — 药物 — 基因 — 化学品 — 突变 — 物种 — 细胞系\"的联动检索。\n\n---\n\n## 1. 何时使用本技能\n\n**适合 (✅ 自动触发)**:\n\n| 用户问题 | 路由 |\n|---|---|\n| \"找 BTK 与肺曲霉病的关联文献\" | ✅ 本技能 (`find_co_mentions`) |\n| \"BTK 抑制剂 (MeSH D000077180) 在哪些研究被讨论\" | ✅ 本技能 (`search_by_entity`) |\n| \"标注这些 PMID 中提到的所有疾病\u002F药物\u002F基因实体\" | ✅ 本技能 (`annotate_pmid`) |\n| \"ibrutinib 在文献中映射到哪个 MeSH\u002FDrugBank\" | ✅ 本技能 (`entity_normalize`) |\n| \"voriconazole 与 CYP2C19 相互作用\" | ✅ 本技能 (`search_by_relation`) |\n| \"BRAF V600E \u002F rs113488022 突变文献\" | ✅ 本技能 (`search_by_entity` concept=variant) |\n\n**不适合 (❌ 路由到其他 skill)**:\n\n| 用户问题 | 路由 |\n|---|---|\n| \"查 PubMed 上近 5 年所有 X 的 RCT\" | ❌ → `pubmed-eutils` + Clinical Queries |\n| \"MeSH 树 \u002F 出版类型 \u002F PubDate 综合检索\" | ❌ → `pubmed-eutils` |\n| \"Europe PMC 综合检索 + 引文\" | ❌ → `europepmc-search` |\n| \"全文段落抽取 \u002F BioC 全文\" | ❌ → `bioc-fulltext-fetch` |\n| \"证据等级 \u002F GRADE \u002F 推荐级别\" | ❌ → `medical-evidence-grading` |\n| \"正在招募的 X 临床试验\" | ❌ → `clinical-trials-v2` |\n\n---\n\n## 2. API 概览 (无需 Key)\n\nBase URL: `https:\u002F\u002Fwww.ncbi.nlm.nih.gov\u002Fresearch\u002Fpubtator3-api\u002F`\n\nPubTator3 是 NLM 开放服务,**无需 API key**,但请遵守速率限制 (≤ 5 req\u002Fs,失败时指数退避)。\n\n| 端点 | 用途 |\n|------|------|\n| `GET \u002Fsearch\u002F?text=\u003Cquery>` | 自由文本 \u002F 实体检索文献 |\n| `GET \u002Fpublications\u002Fexport\u002Fbiocjson?pmids=\u003Ccsv>` | 拉取 PMID 的实体标注 BioC-JSON |\n| `GET \u002Fentity\u002Fautocomplete\u002F?query=\u003Ctext>&concept=\u003Ctype>` | 实体规范化 (text → ID) |\n| `GET \u002Frelations?e1=\u003Cid>&e2=\u003Cid>` | 关系\u002F共现挖掘 |\n\n文档: \u003Chttps:\u002F\u002Fwww.ncbi.nlm.nih.gov\u002Fresearch\u002Fpubtator3-api\u002F>\n\n---\n\n## 3. 5 个原子函数 (跨平台签名)\n\n每个签名命名稳定,可在 Python \u002F TS \u002F Go \u002F Rust 任意语言实现。\n\n### 3.1 `search_by_entity(entity_text, entity_type=None, max_results=50) -> list[PMID]`\n\n```\nGET \u002Fsearch\u002F?text=@\u003CTYPE>_\u003CID>  或  ?text=\u003Cfree text>\n```\n示例: `text=@DISEASE_MESH:D055744` → 返回 `{pmids:[...], score:[...]}`。\n\n### 3.2 `search_by_relation(entity1_id, relation_type, entity2_id) -> list[Relation]`\n\n```\nGET \u002Frelations?e1=\u003Cid1>&e2=\u003Cid2>&type=\u003Crelation>\n```\n关系类型见 `references\u002Frelation-types.md`。返回涉及关系的 PMID + score + 句级证据。\n\n### 3.3 `annotate_pmid(pmid_list) -> list[Annotation]`\n\n```\nGET \u002Fpublications\u002Fexport\u002Fbiocjson?pmids=12345,67890&full=false\n```\n解析 BioC-JSON `documents[].passages[].annotations[]`。一次最多 100 PMID,超出自动分批。\n\n### 3.4 `entity_normalize(free_text, concept=None) -> list[EntityCandidate]`\n\n```\nGET \u002Fentity\u002Fautocomplete\u002F?query=BTK%20inhibitor&concept=chemical\n```\n返回 `[{name, id, type, score}, ...]`,例如 `BTK inhibitor → MESH:D000077180`。\n\n### 3.5 `find_co_mentions(entity1_id, entity2_id, top_n=20, recent_years=None) -> list[CoMention]`\n\n组合 `search` + `annotate` 验证两实体在同一文献被标注。可按近 N 年过滤。\n\n---\n\n## 4. 实体类型 & 关系类型 (Reference)\n\n主文档不嵌入完整定义,按需展开:\n\n- **实体类型** (7 种 + identifier 格式 + 查询前缀): 见 [`references\u002Fentity-types.md`](references\u002Fentity-types.md)\n  - `gene` \u002F `disease` \u002F `chemical` \u002F `variant` \u002F `mutation` \u002F `species` \u002F `cellline`\n- **关系类型** (8 种 + 主-宾语典型组合 + score 阈值): 见 [`references\u002Frelation-types.md`](references\u002Frelation-types.md)\n  - `treat` \u002F `cause` \u002F `inhibit` \u002F `interact_with` \u002F `regulate` \u002F `associate` \u002F `compare` \u002F `co-occur`\n\n---\n\n## 5. 输出格式 (标准 schema)\n\n每条标注:\n\n```python\n{\n    \"pmid\": \"12345\",\n    \"entity_text\": \"BTK\",\n    \"entity_type\": \"Gene\",          # Gene\u002FDisease\u002FChemical\u002FVariant\u002FSpecies\u002FCellLine\n    \"identifier\": \"695\",            # NCBI Gene \u002F MESH \u002F rs# \u002F Taxonomy \u002F CVCL\n    \"section\": \"Title\",             # Title \u002F Abstract\n    \"offset\": 23,                   # passage 内字符级起点\n    \"length\": 3,\n    \"confidence\": 0.95,             # 若 API 返回\n}\n```\n\n每条关系:\n\n```python\n{\n    \"pmid\": \"12345\",\n    \"subject\":   {\"text\": \"ibrutinib\", \"type\": \"Chemical\", \"id\": \"MESH:D000077594\"},\n    \"predicate\": \"inhibits\",\n    \"object\":    {\"text\": \"BTK\",       \"type\": \"Gene\",     \"id\": \"695\"},\n    \"score\": 0.92,\n    \"evidence_sentence\": \"Ibrutinib irreversibly inhibits BTK ...\",\n    \"section\": \"Abstract\",\n}\n```\n\n---\n\n## 6. 典型工作流\n\n### 用例 A — 疾病 + 药物联动\n\n> \"找近 5 年讨论 BTK 抑制剂与侵袭性肺曲霉病关系的文献\"\n\n1. `entity_normalize(\"BTK inhibitor\", \"chemical\")` → `MESH:D000077180`\n2. `entity_normalize(\"invasive pulmonary aspergillosis\", \"disease\")` → `MESH:D055744`\n3. `find_co_mentions(e1, e2, top_n=30, recent_years=5)`\n4. 对返回 PMID 用 `annotate_pmid()` 提取上下文 → 三元组表\n5. 需要证据等级 → 输出喂给 `medical-evidence-grading`\n\n### 用例 B — 批量标注\n\n> \"把这 20 个 PMID 里所有疾病\u002F药物\u002F基因列出来\"\n\n1. `annotate_pmid([...20 PMIDs...])`\n2. 按 `entity_type ∈ {Gene, Disease, Chemical}` 过滤 → 去重计数 → 频次表\n\n### 用例 C — 实体规范化\n\n> \"ibrutinib 的 MeSH 是什么?\"\n\n1. `entity_normalize(\"ibrutinib\", \"chemical\")` → 取首条 hit 的 `id`\n\n### 用例 D — 上下游链接\n\n> 本技能产出 PMID 集合后,可直接喂给:\n- `pubmed-eutils` → 拿元数据 \u002F 出版类型\n- `bioc-fulltext-fetch` → 拿全文段落\n- `medical-evidence-grading` → 实体级证据排序\n\n---\n\n## 7. 失败模式 (≥ 5 条)\n\n| # | 失败模式 | 检测 | 处理 |\n|---|---|---|---|\n| 1 | **实体未识别** — PubTator 不支持的术语 \u002F 拼写 \u002F 罕见同义词 | `autocomplete` 返回空 | 退化用 `pubmed-eutils` 自由文本检索;同时建议规范同义词或换 concept |\n| 2 | **实体规范化多义词** — `BTK` 既是基因 (NCBI 695) 也是缩写 \u002F 化学品 | `autocomplete` 返回多 hit,score 接近 | 让用户确认 concept;必要时用 ID 而非 symbol |\n| 3 | **关系置信度低 (`score \u003C 0.5`)** — 假阳性高 | `\u002Frelations` 返回 score | **过滤丢弃**,不进入证据表;0.5–0.8 区间需人工核句 |\n| 4 | **共现假阳性** — 两实体出现在同一文献但语义无关 (review \u002F 综述堆砌名词) | 句级 evidence 不在同一句 \u002F passage | 至少要求两实体在同一 sentence 才算 co-mention;否则降权 |\n| 5 | **API rate limit (429)** — 过快请求被限流 | HTTP 429 \u002F 503 | 退避 2 → 4 → 8s,最多 5 次;批处理时控制 ≤ 5 RPS |\n| 6 | **PMID 暂未被 PubTator 标注** — 太新 \u002F 待索引 | BioC-JSON 缺 `annotations` | 在结果里标 `status=pending_annotation`,跳过并记录;可走 `bioc-fulltext-fetch` 拿全文再 LLM 标 |\n| 7 | **PMID 不存在** | BioC-JSON 文档为空 | 返回 `status=not_found` |\n| 8 | **方向反转 \u002F 否定语** — 句子含 \"not\", \"fail to\", \"no association\" | `evidence_sentence` 正则或 LLM 判否定 | 标记 `polarity=negative`,从证据表剔除或单列 |\n\n不要静默吞错;每个失败请求记录 `{pmid, endpoint, status_code, message}`。\n\n---\n\n## 8. 实现要点\n\n- 用 `requests` + `tenacity` (Python) \u002F `axios-retry` (TS) 做指数退避\n- `concept` 参数小写: `gene | disease | chemical | variant | species | cellline`\n- BioC-JSON 路径: `documents[*].passages[*].annotations[*].infons.{type,identifier}` + `text` + `locations[0].offset\u002Flength`\n- 一次 `annotate_pmid` 上限 100 PMID (超过自动分批 + 并发上限 ≤ 3)\n- 自由文本 + 实体混合查询: `text=ibrutinib AND @DISEASE_MESH:D055744`\n- 跨平台: 函数签名只用 string \u002F list \u002F dict,不依赖任何特定运行时\n\n---\n\n## 9. 安全 \u002F 合规\n\n- 公共 NLM API,无 PHI\n- **不要把用户上传的非公开文本发给 PubTator3** — 仅用公开 PMID\n- 输出注明 `Source: NLM PubTator3, retrieved \u003Cdate>`\n- PubTator3 标注属机器抽取,**置信度 \u003C 0.8 的关系应人工核对**\n\n---\n\n## 10. 与其他 skill 的协同 (显式互补,无重叠)\n\n| 技能 | 边界 | 协同方向 |\n|---|---|---|\n| **`pubmed-eutils`** | E-utilities — MeSH 树 \u002F 出版类型 \u002F PubDate 综合检索 | **互补**: 本技能给 PMID,`pubmed-eutils` 拿元数据 |\n| **`europepmc-search`** | Europe PMC 广召回 + 引文 + 多源融合 | **互补**: 召回扩展;不重叠 |\n| **`bioc-fulltext-fetch`** | BioC PMC 全文 XML\u002FJSON 段落抽取 | **互补**: PubTator3 标题\u002F摘要,BioC 全文;PubTator3 不替代全文 |\n| **`medical-evidence-grading`** | GRADE \u002F 证据等级 \u002F 推荐级别 (上层) | **上层**: 本技能输出实体三元组,grading 给等级 |\n| **`clinical-trials-v2`** | ClinicalTrials.gov 试验注册 | **不相关**: 走 NCT |\n\n本技能输出的 PMID 集合 \u002F 三元组可直接喂给上述任意下游。\n\n---\n\n## 11. 快速 cheatsheet\n\n```text\n# 1) 文本 → 实体 ID\nGET \u002Fentity\u002Fautocomplete\u002F?query=ibrutinib&concept=chemical\n\n# 2) 实体检索文献\nGET \u002Fsearch\u002F?text=@CHEMICAL_MESH:D000077594\n\n# 3) 关系挖掘\nGET \u002Frelations?e1=MESH:D000077594&e2=695&type=inhibit\n\n# 4) PMID 批量标注\nGET \u002Fpublications\u002Fexport\u002Fbiocjson?pmids=12345,67890\n\n# 5) 共现: search 各拿 PMID 集合 → 求交 → annotate 验证 → 按 score\u002F年份排序\n```\n\n实体类型查询前缀:\n`@GENE_\u003CNCBIid>` · `@DISEASE_MESH:\u003CDid>` · `@CHEMICAL_MESH:\u003CDid>` · `@VARIANT_\u003Crs#>` · `@SPECIES_\u003CTaxId>` · `@CELLLINE_\u003CCVCLid>`\n\n---\n\n**版本**: v1.1 · **维护**: 跟随 NLM PubTator3 API 文档更新 (关注 endpoints 变更与新增 concept)。\n",{"name":5,"license":15,"keywords":49,"description":7},[35,32,34,50,51,30,31,52,27,53,54,55,56,43,57,58],"NER","annotation","co-mention","疾病基因关联","药物-基因","化学品-疾病","突变检索","dbsnp","drugbank","mine","1e7390741dffd3d5041fca4ebc056071ee3ba137","archives\u002Fuser-installed-skills\u002Fpubtator-entity-search\u002F366b9a940d152650\u002Fpubtator-entity-search",5,"https:\u002F\u002Fgithub.com\u002FEthanYoQ\u002FSkill-hub","https:\u002F\u002Fgithub.com\u002FEthanYoQ","www.orz.md","Part Marketer, Part AI Explorer.","2026-11-07 14:52:29",{"source":8,"skillName":5,"commands":69,"prompt":79,"zipAvailable":80},[70,73,76],{"tool":71,"command":72},"npx","npx skills add EthanYoQ\u002FSkill-hub --skill pubtator-entity-search",{"tool":74,"command":75},"bunx","bunx skills add EthanYoQ\u002FSkill-hub --skill pubtator-entity-search",{"tool":77,"command":78},"pnpm","pnpm dlx skills add EthanYoQ\u002FSkill-hub --skill pubtator-entity-search","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FEthanYoQ\u002FSkill-hub\u002Fblob\u002Fmine\u002Farchives\u002Fuser-installed-skills\u002Fpubtator-entity-search\u002F366b9a940d152650\u002Fpubtator-entity-search\u002FSKILL.md",true,[82,88],{"path":83,"resourceType":84,"resourceTypeDesc":85,"sizeBytes":86,"sourceHtmlUrl":87},"references\u002Fentity-types.md","REFERENCE","参考文档",4717,"https:\u002F\u002Fgithub.com\u002FEthanYoQ\u002FSkill-hub\u002Fblob\u002Fmine\u002Farchives\u002Fuser-installed-skills\u002Fpubtator-entity-search\u002F366b9a940d152650\u002Fpubtator-entity-search\u002Freferences\u002Fentity-types.md",{"path":89,"resourceType":84,"resourceTypeDesc":85,"sizeBytes":90,"sourceHtmlUrl":91},"references\u002Frelation-types.md",5247,"https:\u002F\u002Fgithub.com\u002FEthanYoQ\u002FSkill-hub\u002Fblob\u002Fmine\u002Farchives\u002Fuser-installed-skills\u002Fpubtator-entity-search\u002F366b9a940d152650\u002Fpubtator-entity-search\u002Freferences\u002Frelation-types.md",[93,120,151,175,193,207],{"skillNo":94,"name":95,"nameZh":6,"description":96,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":97,"categories":98,"keywords":100,"publishedAt":44},"01M713CBDSYARG4PXFXK2R2NNN","xhs-pharma-social-listening","Run evidence-disciplined Xiaohongshu social listening for foreign pharma employee pain points. Use when the user asks to collect and analyze notes\u002Fcomments about pharma companies, aliases, roles, compliance, medical affairs, or AI topics, then produce a cited and scored sampled-insight report. Includes independent-evidence counting, MediaCrawler batch collection, and CAPTCHA\u002F461 fallback to Agent Reach\u002FOpenCLI.","https:\u002F\u002Fgithub.com\u002FEthanYoQ\u002FSkill-hub\u002Fblob\u002Fmine\u002Fskills\u002F10-business-industry\u002Fxhs-pharma-social-listening\u002FSKILL.md",[99],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},[101,102,103,104,40,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119],"social","xhs pharma social listening","social listening","xhs","counting","when","collection","batch","analyze","notes","run","opencli","fallback","captcha","agent reach","evidence","for","collect","produce",{"skillNo":121,"name":122,"nameZh":6,"description":123,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":124,"categories":125,"keywords":132,"publishedAt":44},"01M713C8Q76ZP0WXXBRAFKS6EE","healthcare-phi-compliance","Protected Health Information (PHI) and Personally Identifiable Information (PII) compliance patterns for healthcare applications. Covers data classification, access control, audit trails, encryption, and common leak vectors. Use when code touches PHI or PII in a healthcare system, or when auditing access control, audit trails, or leak vectors.","https:\u002F\u002Fgithub.com\u002FEthanYoQ\u002FSkill-hub\u002Fblob\u002Fmine\u002Fskills\u002F10-business-industry\u002Fhealthcare-phi-compliance\u002FSKILL.md",[126,127],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},{"categoryNo":128,"categoryName":129,"taxonomyType":130,"taxonomyTypeDesc":131},"01JBSEEDCAT000000000000037","律师与法务","PROFESSION","适用职业",[133,134,135,136,137,138,139,140,106,141,142,143,144,145,146,147,117,148,149,150],"healthcare","phi","compliance","healthcare phi compliance","pii","compliance patterns","information","access","encryption","code","common","audit","data","patterns","Access Control","system","applications","Auditing Access Control",{"skillNo":152,"name":153,"nameZh":6,"description":154,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":155,"categories":156,"keywords":158,"publishedAt":44},"01M713C5R2GE43X45T2K75TB76","healthcare-eval-harness","Patient safety evaluation harness for healthcare application deployments. Automated test suites for CDSS accuracy, PHI exposure, clinical workflow integrity, and integration compliance. Blocks deployments on safety failures. Use when a healthcare deployment must be gated on patient-safety tests for CDSS accuracy, PHI exposure, and workflow integrity.","https:\u002F\u002Fgithub.com\u002FEthanYoQ\u002FSkill-hub\u002Fblob\u002Fmine\u002Fskills\u002F10-business-industry\u002Fhealthcare-eval-harness\u002FSKILL.md",[157],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},[133,159,160,161,162,163,164,106,165,166,167,168,134,117,169,170,171,172,173,174],"eval","harness","healthcare eval harness","eval harness","clinical","patient","workflow","Evaluation","Safety","integrity","deployment","accuracy","tests","deployments","use","super",{"skillNo":176,"name":177,"nameZh":6,"description":178,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":179,"categories":180,"keywords":182,"publishedAt":44},"01M713C2J17S91VYR7A8M696VR","healthcare-emr-patterns","EMR\u002FEHR development patterns for healthcare applications. Clinical safety, encounter workflows, prescription generation, clinical decision support integration, and accessibility-first UI for medical data entry. Use when building EMR or EHR features such as encounter workflows, prescription generation, or clinical data entry UI.","https:\u002F\u002Fgithub.com\u002FEthanYoQ\u002FSkill-hub\u002Fblob\u002Fmine\u002Fskills\u002F10-business-industry\u002Fhealthcare-emr-patterns\u002FSKILL.md",[181],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},[133,183,146,184,185,40,163,186,106,187,188,189,167,145,190,191,192,117,149,173],"EMR","healthcare emr patterns","decision","workflows","support","clinical decision support","features","ui","as","development",{"skillNo":194,"name":195,"nameZh":6,"description":196,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":197,"categories":198,"keywords":200,"publishedAt":44},"01M713BZERTXV0N8X6SW9DDVWZ","healthcare-cdss-patterns","Clinical Decision Support System (CDSS) development patterns. Drug interaction checking, dose validation, clinical scoring (NEWS2, qSOFA), alert severity classification, and integration into EMR workflows. Use when building clinical decision support — drug interaction checks, dose validation, clinical scoring, or alert severity.","https:\u002F\u002Fgithub.com\u002FEthanYoQ\u002FSkill-hub\u002Fblob\u002Fmine\u002Fskills\u002F10-business-industry\u002Fhealthcare-cdss-patterns\u002FSKILL.md",[199],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},[133,146,201,185,163,183,186,106,202,36,187,188,203,192,148,204,173,205,174,206],"healthcare cdss patterns","scoring","severity","classification","alert","decision support",{"skillNo":208,"name":209,"nameZh":6,"description":210,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":211,"categories":212,"keywords":214,"publishedAt":44},"01M713BVK3PQR7V4ZKYGMWMXJD","dxy-task-clarify","用户的请求含糊、缺背景、缺资料说明、缺读者或用途时使用。先用少量带选项的追问把任务问清楚，写成任务卡，用户确认后再执行。尤其适用于医生、科研人员和药企各岗位的工作，例如「帮我分析一下这些数据」「帮我准备明天的拜访」「写个总结」「做个 PPT」「回一下这封邮件」「整理一下会议纪要」「整理一下这些文献」「帮我准备下周的讲课」「写个病例汇报」「帮我写个提示词」。用户说「先问我」「帮我理清需求」「我不知道怎么描述」「我不会问 AI」时也使用。用途、资料、读者都已说清的请求，纯翻译，以及写代码、改代码，不使用。","https:\u002F\u002Fgithub.com\u002FEthanYoQ\u002FSkill-hub\u002Fblob\u002Fmine\u002Fskills\u002F10-business-industry\u002Fdxy-task-clarify\u002FSKILL.md",[213],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},[215,216,217,218,219,220,221,222],"clarify","dxy task clarify","task","pptx","整理","翻译","数据","总结"]