本文へスキップ
Skillpedia
セキュリティ5.8k · #14688

deidentify-a-dataset

できること

このスキルは、ローカルのデータファイル、たとえばCSVの自由記述の列から個人情報を取り除き、伏せ字にした別のコピーを書き出します。臨床データを安全に共有、分析する必要があるアナリスト向けです。

使う場面

  • ✓臨床のCSV、JSONL、Parquetのデータセットを、分析や共有の前に準備するとき。
  • ✓データセットのうち、一部の自由記述の列にだけ患者の情報があるとき。
  • ✓値を見ずに、どれだけ伏せられたかの要約がほしいとき。

スキルのリンク

https://github.com/maziyarpanahi/openmed/blob/master/skills/deidentify-a-dataset/SKILL.md

コピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。

使い方

いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。

貼り付け用メッセージ

このスキルを使って手伝ってください:https://github.com/maziyarpanahi/openmed/blob/master/skills/deidentify-a-dataset/SKILL.md このリンクのSKILL.mdファイルを読んで、私の作業でその指示に従ってください。
こういうスキルを、AIが自分で見つけてくれたら?無料のSkillpedia MCPをインストール。1行で、作業の前に15,000+のスキルから探してくれます。1分でインストール →

AIへの頼み方の例

“この患者のCSVにあるノートの列を伏せ字にして、新しいファイルに保存してください。元のファイルは変更しないでください。”

毎週5つの新しいスキル。1分で読めます。

仕組み

エージェントは、ファイルの種類と指定された自由記述の列を確認し、伏せ字にしたデータを新しいファイルに書き出します。報告するのは集計の件数と割合だけです。

技術的な内容(元のSKILL.md)

作者による元のテキスト(英語)をGitHubからそのまま表示しています。

De-identify a dataset

Keep the source local, name the free-text columns explicitly, and write to a different destination. Never infer columns or print source and redacted cell values.

Procedure

  1. Confirm that the input is CSV, JSONL/NDJSON, or Parquet.
  2. Confirm which columns contain free text. Do not scan or log values to guess.
  3. Choose a policy and language. Prefer strict_no_leak when recall is the governing safety requirement.
  4. Write to a new path; never overwrite the input.
  5. Inspect only result.summary, which contains aggregate counts and rates.
  6. Validate recall and residual leakage on representative synthetic or approved evaluation fixtures before releasing the output.

Runnable synthetic example

Install the model runtime first with python -m pip install "openmed[hf]".

import csv
from pathlib import Path

from openmed import redact_dataset

source = Path("synthetic-notes.csv")
destination = Path("synthetic-notes.redacted.csv")

with source.open("w", newline="", encoding="utf-8") as handle:
    writer = csv.DictWriter(handle, fieldnames=["record_id", "note"])
    writer.writeheader()
    writer.writerows(
        [
            {
                "record_id": "SYNTH-001",
                "note": (
                    "Taylor Example called 212-555-0198 about a "
                    "metformin refill."
                ),
            },
            {
                "record_id": "SYNTH-002",
                "note": (
                    "Send the synthetic follow-up to "
                    "demo.patient@example.test."
                ),
            },
        ]
    )

result = redact_dataset(
    source,
    text_columns=["note"],
    output_path=destination,
    policy="strict_no_leak",
    lang="en",
)

print(result.output_path)
print(result.summary.to_dict())  # Aggregate counts only; no cell contents.

Use the equivalent CLI for an existing dataset:

openmed redact-dataset notes.csv \
  --text-columns note,comment \
  --policy strict_no_leak \
  --output notes.redacted.csv

Safety checks

  • Keep model inference and files on infrastructure the user controls.
  • Do not print input rows, detected entity surfaces, reversible mappings, or exception payloads that may contain source text.
  • Keep source and output paths separate and access-controlled.
  • Treat the aggregate summary as evidence, not as proof of compliance.
  • Never commit real clinical data or restricted evaluation corpora.

Repository example

Read and run the offline dataset walkthrough when you need a bundled synthetic fixture and first-run download controls.

よくある質問

元のファイルを上書きしますか?

いいえ。新しいパスに書き出し、入力は変更しません。

確認する列を推測しますか?

いいえ。自由記述の列はあなたが指定します。スキルは値から推測しません。

どのファイル形式に対応していますか?

CSV、JSONL、NDJSON、Parquetのファイルに対応しています。

詳細

作者による元の説明

De-identify selected free-text columns in a local CSV, JSONL, or Parquet dataset with OpenMed and produce a separate redacted dataset plus a PHI-free aggregate summary. Use when an agent must prepare a clinical dataset for analysis or sharing without overwriting the source or exposing cell values in logs.

repo: maziyarpanahi/openmed

人気

GitHubのスター
5.8k
ランキング
#14688
ライセンス
Apache-2.0
更新日
2026/11/2

このスキルは役に立ちますか?

0

ログイン して投票しましょう。

コメント

  • …

このリポジトリの他のスキル

似ているスキル