用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/brycewang-stanford/Auto-Empirical-Research-Skills --skill bioc-pmc-api命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
基于 SOC 职业分类
正在显示 SKILL.md
| name | bioc-pmc-api |
| description | Access PMC Open Access articles in BioC format for text mining |
| metadata | {"openclaw":{"emoji":"🧬","category":"literature","subcategory":"fulltext","keywords":["bioc","pmc","text mining","biomedical nlp","full text","pubmed central"],"source":"https://www.ncbi.nlm.nih.gov/research/bionlp/APIs/BioC-PMC/"}} |
The BioC API provides full-text articles from PubMed Central (PMC) in the BioC format — a simplified XML/JSON structure designed specifically for biomedical text mining. Unlike the standard PMC OAI service (which returns JATS XML), BioC pre-segments text into passages with offset annotations, making it ideal for NLP pipelines, named entity recognition, relation extraction, and other text mining tasks. Free, no authentication required.
https://www.ncbi.nlm.nih.gov/research/bionlp/RESTful/pmcoa.cgi/BioC_json/{PMCID}/unicode
# JSON format (recommended for programmatic use)
curl "https://www.ncbi.nlm.nih.gov/research/bionlp/RESTful/pmcoa.cgi/BioC_json/PMC6267067/unicode"
# XML format
curl "https://www.ncbi.nlm.nih.gov/research/bionlp/RESTful/pmcoa.cgi/BioC_xml/PMC6267067/unicode"
# ASCII encoding (strips non-ASCII characters)
curl "https://www.ncbi.nlm.nih.gov/research/bionlp/RESTful/pmcoa.cgi/BioC_json/PMC6267067/ascii"
# Convert PMID to PMCID first, then query
curl "https://www.ncbi.nlm.nih.gov/pmc/utils/idconv/v1.0/?ids=29346600&format=json"
# Returns: {"records": [{"pmid": "29346600", "pmcid": "PMC6267067", ...}]}
{
"source": "PMC",
"date": "2024-01-15",
"key": "collection.key",
"documents": [
{
"id": "PMC6267067",
"passages": [
{
"infons": {
"section_type": "TITLE",
"type": "title"
},
"offset": 0,
"text": "Article Title Here"
},
{
"infons": {
"section_type": "ABSTRACT",
"type": "abstract"
Key fields:
passages[].infons.section_type: TITLE, ABSTRACT, INTRO, METHODS, RESULTS, DISCUSS, CONCL, REF, FIG, TABLEpassages[].offset: Character offset from document startpassages[].text: Plain text content of the passageimport requests
import json
def get_bioc_article(pmcid: str, fmt: str = "json") -> dict:
"""Fetch a PMC article in BioC format."""
url = f"https://www.ncbi.nlm.nih.gov/research/bionlp/RESTful/pmcoa.cgi/BioC_{fmt}/{pmcid}/unicode"
resp = requests.get(url, timeout=30)
resp.raise_for_status()
return resp.json() if fmt == "json" else resp.text
def extract_sections(bioc_doc: dict) -> dict:
"""Extract text organized by section type."""
sections = {}
for doc in bioc_doc.get("documents", []):
for passage in doc.get("passages", []):
section = passage.get("infons", {}).get("section_type", "OTHER")
text = passage.get("text", "")
sections.setdefault(section, []).append(text)
return {k: "\n".join(v) for k, v in sections.items()}
# Example: fetch and parse
article = get_bioc_article("PMC6267067")
sections = extract_sections(article)
print(f"Title: {sections.get('TITLE', 'N/A')}")
print()
()
tool=your_tool_name&email=your@email.com to requests for priority queueWhen using this API in publications, cite:
Comeau DC, Wei CH, Islamaj Dogan R, Lu Z. PMC text mining subset in BioC: about 3 million full text articles and growing. Bioinformatics, btz070, 2019.