본문으로 건너뛰기
Skillpedia
분석 및 스프레드시트5.8k · #14678

building-gold-corpus

하는 일

이 스킬은 골드 표준 주석 프로젝트를 설정합니다. 골드 표준은 모델을 측정하는 데 쓰는, 사람이 라벨을 붙인 테스트 예제 세트입니다. 라벨, 가이드라인, 주석 도구 설정, 그리고 학습(train), 개발(dev), 테스트(test) 분할을 다룹니다. 모델을 제대로 측정해야 하는 팀을 위한 스킬입니다.

사용하는 경우

  • ✓임상 NER 또는 비식별화 모델을 측정할 테스트 예제가 필요할 때.
  • ✓주석 작업을 시작하면서 라벨 세트와 가이드라인이 필요할 때.
  • ✓저장소에 커밋하고 CI에서 확인할 수 있는 작은 합성 테스트 세트를 원할 때.

스킬 링크

https://github.com/maziyarpanahi/openmed/blob/master/skills/building-gold-corpus/SKILL.md

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/maziyarpanahi/openmed/blob/master/skills/building-gold-corpus/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“비식별화 모델을 측정하기 위해 라벨 세트, 가이드라인, 테스트 분할이 있는 주석 프로젝트를 설정하도록 도와주세요.”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

에이전트는 라벨 스키마와 가이드라인을 정의하고, 주석 도구 형식을 설정한 뒤, 서로 겹치지 않는 학습, 개발, 테스트 분할을 만듭니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.

Building a Gold Corpus

You can't evaluate what you can't measure against. This skill scaffolds a gold-standard annotation project whose output drops straight into the OpenMed eval harness as fixtures. The hard rule: anything committed to the repo is synthetic. Licensed clinical corpora (i2b2, n2c2, MIMIC) are DUA-gated — use them at eval time from the user's own copy, never check them in.

When to use this skill

  • You need eval fixtures for benchmarking-clinical-ner or evaluating-with-leakage-gates and have none.
  • You're standing up an annotation effort: schema, guidelines, tool config.
  • You need disciplined train/dev/test splits with no leakage between them.
  • You want a small synthetic golden set you can commit and gate on in CI.

The OpenMed fixture shape (your target output)

Annotations must serialize to character-offset spans the harness understands:

{
  "fixtures": [
    {
      "id": "synthetic-0001",
      "language": "en",
      "text": "Ms. Jane Roe (MRN 0000000) seen 2099-01-02 for type 2 diabetes.",
      "gold_spans": [
        {"start": 4,  "end": 12, "label": "PERSON"},
        {"start": 18, "end": 25, "label": "ID_NUM"},
        {"start": 32, "end": 42, "label": "DATE"},
        {"start": 47, "end": 62, "label": "DISEASE"}
      ]
    }
  ]
}

openmed.eval.harness.load_fixtures accepts a top-level list or a {"fixtures": [...]} mapping. Offsets are character indices into text; labels are OpenMed-canonical.

Quick start — scaffold the project

eval/
  gold/
    guidelines.md            # annotation manual + edge-case decisions
    label_schema.json        # canonical labels + definitions + examples
    synthetic/               # COMMITTED synthetic fixtures (CI-gateable)
      train.json
      dev.json
      test.json
  external/                  # GITIGNORED: licensed DUA corpora, eval-only
    .gitignore               # *  (never commit i2b2/n2c2/MIMIC)

Verify your synthetic fixtures load and validate spans before you trust them:

from openmed.eval.harness import load_fixtures

fixtures = load_fixtures("eval/gold/synthetic/test.json")
print(len(fixtures), "fixtures;", sum(len(f.gold_spans) for f in fixtures), "spans")
# load_fixtures normalizes spans against source text and rejects duplicate ids.

Workflow

  1. Define the label schema. Reuse OpenMed canonical labels (PERSON, DATE, ID_NUM, EMAIL, PHONE, DISEASE, DRUG, ...). Each label gets a one-line definition, in/out examples, and a boundary rule (include titles? trailing punctuation?).
  2. Write annotation guidelines. The manual is the contract: span boundaries, nested/overlapping policy, ambiguous cases, and a decision log appended as real cases force calls. Vague guidelines → low agreement → unusable gold.
  3. Generate synthetic source text. Compose realistic clinical narratives with fabricated identifiers (Faker-style names, impossible dates like 2099-, all-zero MRNs). Never paste real notes into committed data.
  4. Configure the tool. BRAT uses annotation.conf (entity types) producing .ann standoff; Label Studio uses a labeling-config XML producing JSON. Map either back to the fixture shape above.
  5. Double-annotate and measure agreement. Have ≥2 annotators on an overlap set; compute span-level inter-annotator agreement (F1 or Cohen's κ). Adjudicate disagreements and fold the resolutions into the decision log.
  6. Split with discipline. Partition by document/patient, not by sentence, so no patient appears in two splits. Freeze test; never tune on it.
  7. Validate and commit. Run load_fixtures; confirm spans align and ids are unique. Commit only the synthetic splits.

Hand-off to / from OpenMed

  • To benchmarking-clinical-ner: dev/test fixtures feed run_suite and error_report for the NER scorecard.
  • To evaluating-with-leakage-gates and gating-deid-leakage: the synthetic held-out set is exactly what the release gates and the CI gate run against.
  • To building-with-openmed: synthetic notes can be generated by running surrogate replacement through openmed.deidentify(method="replace").
  • Pairs with auditing-subgroup-fairness: tag each gold span with a group in metadata so fairness_report can slice by demographic surrogate.

Edge cases & gotchas

  • Committed = synthetic. No exceptions. Real PHI in the repo is a breach even if the repo is private. G
자주 묻는 질문

실제 환자 기록을 커밋해도 되나요?

아니요. 저장소에 커밋하는 것은 모두 합성 데이터로 유지하며, 라이선스가 있는 임상 코퍼스는 사용자가 가진 자체 사본에서만 사용합니다.

주석은 어떤 형식으로 저장되나요?

평가 도구가 읽을 수 있는 문자 오프셋 구간으로 저장됩니다.

분할을 왜 따로 두나요?

분리된 분할은 학습과 테스트 사이의 누출을 막아 점수를 정직하게 유지합니다.

상세 정보

작성자의 원본 설명

Scaffold a synthetic gold-standard annotation project for evaluating OpenMed NER and de-identification models — label schema, annotation guidelines, BRAT or Label Studio config, and disjoint train/dev/test splits. Use when the user wants to create eval fixtures, set up annotation, define a label set, write guidelines, configure an annotation tool, or build a held-out gold set for the OpenMed eval harness. Trigger on \"gold corpus\", \"annotation project\", \"label schema\", \"annotation guidelines\", \"BRAT\", \"Label Studio\", \"train dev test split\", or \"build eval fixtures\" for OpenMed.

repo: maziyarpanahi/openmed

인기도

GitHub 스타
5.8k
순위
#14678
라이선스
Apache-2.0
업데이트
2026. 11. 2.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬