Skip to content
Agentmart
Submit a tool

bioc-fulltext-fetch

给定 PMID/PMCID 取结构化全文(NLM BioC XML/JSON)。封装 BioC PubMed(标题+摘要)和 BioC PMC OA(开放获取全文)端点,输出按章节切分的段落、表格上下文、RAG 友好 chunk,适合大批量入向量库。Fetches structured fulltext from…

Skill by EthanYoQ

IndexedMIT★ 11
Write a review

Chalk Labs

Need help deploying bioc-fulltext-fetch?

Chalk Labs sets up agents like this inside real teams: connected to your tools, tested on your data, with a human in the loop where it matters.

Book a call

Install

Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.

npx agentmarket install skill/ethanyoq-bioc-fulltext-fetch

Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.

Get the weekly diff

The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.

We use your email only for this newsletter. Privacy

About

给定 PMID/PMCID 取结构化全文(NLM BioC XML/JSON)。封装 BioC PubMed(标题+摘要)和 BioC PMC OA(开放获取全文)端点,输出按章节切分的段落、表格上下文、RAG 友好 chunk,适合大批量入向量库。Fetches structured fulltext from NLM BioC API for PMID/PMCID, outputs section-segmented paragraphs and RAG-ready chunks. 触发词:全文抽取 / BioC / RAG 入库 / 文献全文 / PMC 开放获取 / structured fulltext / 段落抽取 / 表格抽取 / chunking / fulltext to vector store / paragraph extraction.

Use cases: backend, ml

No reviews yet. Installed it? Reviews come from verified installers only. How reviews work

Permissions

What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.

Tools
No tools found
Secrets
None asked for
Install scripts
None found

Network hosts it talks to 1

  • codeload.github.com · found in install command

Files it touches

  • ~/.claude/skills/bioc-fulltext-fetch

What's inside

Skill name
bioc-fulltext-fetch
Description
给定 PMID/PMCID 取结构化全文(NLM BioC XML/JSON)。封装 BioC PubMed(标题+摘要)和 BioC PMC OA(开放获取全文)端点,输出按章节切分的段落、表格上下文、RAG 友好 chunk,适合大批量入向量库。Fetches structured fulltext from NLM BioC API for PMID/PMCID, outputs section-segmented paragraphs and RAG-ready chunks. 触发词:全文抽取 / BioC / RAG 入库 / 文献全文 / PMC 开放获取 / structured fulltext / 段落抽取 / 表格抽取 / chunking / fulltext to vector store / paragraph extraction.
License
MIT
Instructions
201 lines in SKILL.md · view on GitHub

Files (4)

  • SKILL.md
  • bioc-format-spec.md · references/
  • chunking-strategies.md · references/
  • rag-integration.md · references/

SKILL.md (first lines)

# BioC Fulltext Fetch

封装 NLM BioC API,把 PubMed / PMC 文献转成 RAG 友好的结构化全文 chunk。**只做全文抽取与切片,不做检索、不做实体标注、不做向量化。**

## 1. 何时使用

触发场景:
- "把这批 PMID 的全文取下来准备入 ChromaDB / 我有 PMCID 列表要按章节切分做 RAG"
- "提取 Methods 章节段落 / 找出表格周围的语义文本"
- "Build vector index from PMC open access papers"
- "PMC1234567 的全文段落 + 章节标签"
- "把 100 篇血液 IFI PMID 入向量库"

不要使用本 skill:
- 用户只要标题/摘要纯文本 → 用 `pubmed-eutils` efetch
- 用户要做语义检索找文献 → 用 `pubmed-search` / `europepmc-search`
- 用户要实体标注(基因/疾病/化合物)→ 用 `pubtator-entity-search`(可在本 skill 输出之上叠加,不替代)
- 用户要做证据等级评分 → 用 `medical-evidence-grading`(其内部会调用本 skill 抽 Methods 段落)

## 2. 跨 skill 协作(显式)

| 上游 / 下游 skill | 协作方式 |
|------------------|----------|
| `pubmed-eutils.elink_pubmed_to_pmc()` | **上游**,把 PMID 列表转换成 PMCID 列表,喂给本 skill |
| `europepmc-search.get_full_text_links()` | **替代源**,当 PMC OA 不可用时回退到 Europe PMC 的开放获取链接 |
| `pubtator-entity-search` | **后置叠加**,在本 skill 产的 chunk 上做实体标注,不替代本 skill |
| `medical-evidence-grading` | **下游**,调 `extract_paragraphs` 取 Methods 段落做 sample size / study design 检测 |

典型 pipeline:
```
europepmc-search ──► PMID list ──► pubmed-eutils.elink ──► PMCID list
                                                              │
                                                              ▼
                                            bioc-fulltext-fetch (本 skill)
                                                              │
                                                              ├─► [可选] pubtator-entity-search 实体叠加
                                                              ├─► [可选] medical-evidence-grading 证据评分
                                                              └─► LangChain / LlamaIndex 入库
```

## 3. 两个 BioC 端点

| 端点 | 输入 | 覆盖 | 内容 |
|------|------|------|------|
| **BioC PubMed** | PMID | 全 PubMed (~37M) | 标题 + 摘要 + MeSH(结构化) |
| **BioC PMC OA** | PMCID | PMC 开放获取子集(~10M,约占 PMC 25%) | 全文章节、段落、表格、图注 |

```
摘要级:  https://www.ncbi.nlm.nih.gov/research/bionlp/RESTful/pubmed.cgi/BioC_json/{PMID}/unicode
全文级:  https://www.ncbi.nlm.nih.gov/research/bionlp/RESTful/pmcoa.cgi/BioC_json/{PMCID}/unicode
```

格式细节、`section_type` 取值、字符 offset 一致性见 [`references/bioc-format-spec.md`](references/bioc-format-spec.md)。

## 4. 推荐工作流

```
PMID list
  │
  ▼
[可选] elink PMID→PMCID  (调 pubmed-eutils)
  │
  ├─ PMCID 存在且 OA ──► fetch_fulltext_bioc(pmcid) ──► extract_paragraphs / extract_tables_context ──► to_rag_chunks
  │
  └─ 不可用/非 OA ─────► fetch_abstract_bioc(pmid) ─────────────────────────────────────────────────► to_rag_chunks
```

## 5. 核心能力(5 个函数 · 跨平台签名)

### 5.1 `fetch_abstract_bioc(pmid: str) -> BioCDocument`

取标题 + 摘要 + MeSH 的 BioC 结构化版本。

```python
doc = fetch_abstract_bioc("39523456")
# doc.passages → [{"infons": {"section_type": "TITLE"}, "text": "..."},
#                 {"infons": {"section_type": "ABSTRACT"}, "text": "..."}]
# doc.infons["mesh"] → ["Leukemia, Myeloid, Acute", "FLT3 Mutation", ...]
```

### 5.2 `fetch_fulltext_bioc(pmcid: str) -> BioCDocument`

取 PMC OA 全文,按章节切分(`section_type` ∈ {TITLE, ABSTRACT, INTRO, METHODS, RESULTS, DISCUSS, CONCL, REF, FIG, TABLE, ...})。

```python
doc = fetch_fulltext_bioc("PMC10234567")
# 不可用时抛 NotOpenAccessError,调用方应回退到 fetch_abstract_bioc
```

### 5.3 `extract_paragraphs(doc: BioCDocument) -> list[Paragraph]`

按 BioC `passage` 提取段落数组,保留 section 标签 + 字符 offset。

```python
paragraphs = extract_paragraphs(doc)
# [{"section_label": "METHODS", "text": "Flow cytometry was performed...",
#   "offset_start": 2890, "offset_end": 3401}, ...]
```

要点:跳过 `REF` / `FIG_LABEL` 纯标签段;合并同 section 内 < 50 字符短 passage;offset 来自 BioC `passage.offset`。

### 5.4 `extract_tables_context(doc: BioCDocument, window: int = 200) -> list[TableContext]`

提取每个表格的上下文(前后 200 字),帮 RAG 给表打语义标签。

```python
tables = extract_tables_context(doc, window=200)
# [{"table_id": "T1", "caption": "Patient baseline characteristics",
#   "before_context": "...", "after_context": "...", "section": "RESULTS"}, ...]
```

表格本体(cell 数据)不解析;只取 caption + 周围文本。

### 5.5 `to_rag_chunks(doc: BioCDocument, chunk_size: int = 512, overlap: int = 50) -> list[Chunk]`

把 BioC 文档切成 RAG 入库 chunk。token 单位、不跨章节、段落优先、可追溯 `chunk_id`。

```python
chunks = to_rag_chunks(doc, chunk_size=512, overlap=50)

From EthanYoQ/Skill-hub, MIT.

More from EthanYoQ/Skill-hub

Compare and alternatives

    Featured in

    Signals

    Stars
    11
    Forks
    4
    Open issues
    0
    Last commit (this folder)
    Sep 19, 2026 (1 month ago)

    From GitHub (fetched Oct 24, 2026).

    Details

    License
    MIT
    First seen
    Oct 24, 2026
    Last checked
    Oct 24, 2026

    More from EthanYoQ

    Done for you

    Rather not set it up yourself?

    Chalk Labs scopes, builds and runs agents for your team: the task audit, the eval harness, the integrations and the weekly ops report. Fixed scope, priced before we start.

    See how we build AI agents →Read the case studies

    Chalk Labs is a two-founder AI and growth studio. We build AI agents, CRMs and MVPs for Web3 and AI companies, and have shipped 50+ product and token launches.

    launches shipped
    50+
    launches shipped
    media placements
    500+
    media placements
    founders on every account
    2
    founders on every account

    Press we've placed: Forbes · CoinDesk · Decrypt · Cointelegraph · The Block

    Rahil Jain, Co-founder, Chalk Labs. Ex-Goldman Sachs engineer. You talk to the person who builds it.

    Get bioc-fulltext-fetch running in your business

    Tell us what you want to automate. A founder replies within one working day with a plan, not a pitch deck.

    Goes to the Chalk Labs founders, not the newsletter. Privacy

    Need help deploying bioc-fulltext-fetch?

    CallGet help
    Cite this page

    bioc-fulltext-fetch skill. Agent Mart. https://agentmart.dev/skills/ethanyoq-bioc-fulltext-fetch (last updated 2026-10-24)