本文へスキップ
Skillpedia
機械学習5.8k · #14719

pick-a-pii-model

できること

このスキルは、端末上で動く、テキストの中の個人情報を見つけるモデルを選ぶ方法をエージェントに教えます。保存されたモデルの一覧を使うので、選択はオフラインでも行えます。

使う場面

  • ✓ノートパソコン、Apple SiliconのMac、スマートフォンで動く個人データの検出器が必要なチームがあるとき。
  • ✓プロジェクトに特定の言語のテキストがあり、その言語に合う既定のプライバシーモデルが必要なとき。
  • ✓プライバシーモデルを出荷する前に、直接の識別子を最初に捉えられるかを確かめる必要があるとき。

スキルのリンク

https://github.com/maziyarpanahi/openmed/blob/master/skills/pick-a-pii-model/SKILL.md

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

使い方

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

貼り付け用メッセージ

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

AIへの頼み方の例

“Mac上で英語の医療ノートにある人名を見つけるには、どのオフラインのモデルを使うべきですか?”

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

仕組み

エージェントは同梱のモデル一覧を読み、言語、ファイル形式、サイズで絞ります。既定のモデルを優先し、出荷前にベンチマークを行うよう勧めます。

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

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

Pick an on-device PII model

Use the committed registry to build an offline shortlist. Treat the language default as the safety baseline, but never treat model size or format as proof of recall.

Procedure

  1. Identify the input language and script before choosing a model.
  2. Choose the runtime: pytorch for local CPU/GPU and mobile export sources, mlx-fp or mlx-8bit for Apple Silicon.
  3. Read get_default_pii_model(language) as the baseline.
  4. Filter get_pii_models_by_language(language) by runtime and device budget.
  5. Prefer the baseline when it fits; otherwise select a compatible candidate.
  6. Benchmark the candidate on direct identifiers, critical leakage, scripts, and the target quantization before shipping.

Runnable offline shortlist

This snippet reads only the bundled manifest; it does not download weights.

from openmed import get_default_pii_model, get_pii_models_by_language

LANGUAGE = "en"
TARGET_FORMAT = "mlx-fp"  # Use "pytorch" for CPU or as an export source.
MAX_PARAMETERS_M = 150

baseline_id = get_default_pii_model(LANGUAGE)
models = get_pii_models_by_language(LANGUAGE)

shortlist = [
    (key, info)
    for key, info in models.items()
    if TARGET_FORMAT in info.formats
    and info.size_mb is not None
    and info.size_mb <= MAX_PARAMETERS_M
]
shortlist.sort(
    key=lambda item: (
        item[1].model_id != baseline_id,
        item[1].size_mb,
        item[0],
    )
)

if not shortlist:
    raise RuntimeError("No compatible PII model fits the requested budget")

registry_key, selected = shortlist[0]
print(
    {
        "registry_key": registry_key,
        "model_id": selected.model_id,
        "format": TARGET_FORMAT,
        "parameters_m": selected.size_mb,
        "recommended_confidence": selected.recommended_confidence,
        "is_language_default": selected.model_id == baseline_id,
    }
)
print("Benchmark this candidate against the language default before release.")

For Android, Core ML, ONNX, or browser deployment, select a compatible pytorch source and use the target export workflow. Re-run PII recall after conversion or quantization.

Selection rules

  • Reject an unsupported language instead of silently falling back to English.
  • Prefer audited script coverage over a model's name or marketing description.
  • Treat parameter count as a rough capacity signal, not download size, latency, peak memory, or quality.
  • Measure latency and peak memory on the real target device.
  • Fail closed when conversion or quantization drops direct-identifier recall or introduces residual critical leakage.
  • Cache approved weights locally and set offline mode for steady-state use.

Repository example

Read the PII model comparison example for registry inspection and model-by-model inference.

よくある質問

モデルをダウンロードしますか?

いいえ。候補の一覧は、同梱のリストだけを読み、モデルの重みはダウンロードしません。

小さいモデルは常に安全ですか?

いいえ。モデルのサイズや形式は、個人情報をよく見つけることを証明しないと、スキルは説明しています。

どの形式に対応していますか?

CPUとGPU用のPyTorch形式と、Apple Silicon用のMLX形式に触れています。

詳細

作者による元の説明

Select an on-device OpenMed PII model from the committed registry by language, runtime format, and size budget, then require recall validation before deployment. Use when an agent must choose a local PII detector for CPU, Apple Silicon, or a mobile export without relying on live model discovery.

repo: maziyarpanahi/openmed

人気

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

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

0

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

コメント

  • …

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

似ているスキル