Skillpedia
الأمان5.8k · #14688

deidentify-a-dataset

ما الذي تفعله

تزيل هذه المهارة البيانات الشخصية من أعمدة النص الحر في ملف بيانات محلي، مثل CSV، وتكتب نسخة منقّحة منفصلة. وهي موجهة للمحللين الذين يجب أن يشاركوا البيانات السريرية أو يحللوها بأمان.

متى تستخدمها

  • ✓عندما تحتاج إلى تجهيز مجموعة بيانات سريرية بصيغة CSV أو JSONL أو Parquet للتحليل أو المشاركة.
  • ✓عندما لا تحتوي إلا أعمدة نص حر معينة في مجموعة البيانات على بيانات مرضى.
  • ✓عندما تحتاج إلى ملخص لمقدار ما تم حجبه، دون أن ترى القيم نفسها.

رابط المهارة

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

انسخه والصقه في الذكاء الاصطناعي الذي تستخدمه (Claude أو ChatGPT أو Cursor) واطلب منه اتباع التعليمات.

طريقة الاستخدام

أسهل طريقة: انسخ الرسالة والصقها في الذكاء الاصطناعي الذي تستخدمه. سيقرأ المهارة وينفّذ تعليماتها.

رسالة جاهزة للصق

استخدم هذه المهارة لمساعدتي: https://github.com/maziyarpanahi/openmed/blob/master/skills/deidentify-a-dataset/SKILL.md اقرأ ملف SKILL.md في هذا الرابط ونفّذ تعليماته لمهمتي.
تريد أن يجد الذكاء الاصطناعي مهارات مثل هذه بنفسه؟ثبّت خادم Skillpedia MCP المجاني: سطر واحد، ويبحث في 15,000+ مهارة قبل كل مهمة.ثبّته في دقيقة واحدة →

مثال على ما تطلبه من الذكاء الاصطناعي

“أزل المعلومات من عمود الملاحظات في ملف CSV الخاص بالمرضى، واحفظ ملفًا جديدًا دون تغيير الملف الأصلي.”

5 مهارات جديدة كل أسبوع. قراءة في دقيقة واحدة.

كيف تعمل

يتحقق وكيلك من نوع الملف والأعمدة النصية الحرة التي سميتها، ويكتب البيانات المنقّحة في ملف جديد، ويبلّغ فقط بالأعداد والنسب الإجمالية.

المحتوى التقني (ملف 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
آخر تحديث
2‏/11‏/2026

هل هذه المهارة مفيدة؟

0

سجّل الدخول للتصويت.

التعليقات

  • …

المزيد من المهارات من هذا المستودع

مهارات مشابهة