Chuyển đến nội dung
Skillpedia
Học máy5.8k · #14719

pick-a-pii-model

Skill này làm gì

Skill này dạy agent cách chọn mô hình tìm thông tin cá nhân trong văn bản và chạy trên thiết bị cục bộ. Nó dùng một danh sách mô hình đã lưu sẵn, nên việc chọn hoạt động ngoại tuyến.

Khi nào nên dùng

  • ✓Khi một nhóm cần bộ phát hiện dữ liệu cá nhân chạy được trên laptop, Mac Apple Silicon hoặc điện thoại.
  • ✓Khi dự án có văn bản bằng một ngôn ngữ cụ thể và cần mô hình bảo mật mặc định phù hợp cho ngôn ngữ đó.
  • ✓Khi người dùng sắp đưa một mô hình bảo mật vào sử dụng và cần kiểm tra nó bắt được định danh trực tiếp trước.

Liên kết skill

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

Sao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.

Cách dùng

Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.

Tin nhắn có sẵn để dán

Hãy dùng skill này để giúp tôi: https://github.com/maziyarpanahi/openmed/blob/master/skills/pick-a-pii-model/SKILL.md Đọc tệp SKILL.md tại liên kết đó và làm theo hướng dẫn cho việc của tôi.
Bạn muốn AI tự tìm những skill như thế này?Cài MCP Skillpedia miễn phí: chỉ một dòng, và AI sẽ tìm trong 15.000+ skill trước mỗi việc.Cài đặt trong 1 phút →

Ví dụ cách nhờ AI

“Tôi nên dùng mô hình ngoại tuyến nào để tìm tên người trong ghi chú y khoa tiếng Anh của mình trên máy Mac?”

5 skill mới mỗi tuần. Đọc chỉ 1 phút.

Cách hoạt động

Agent đọc danh sách mô hình đi kèm và lọc theo ngôn ngữ, định dạng tệp và kích thước. Nó ưu tiên mô hình mặc định và khuyên chạy benchmark trước khi đưa vào sử dụng.

Nội dung kỹ thuật (SKILL.md gốc)

Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.

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.

Câu hỏi thường gặp

Nó có tải mô hình không?

Không. Danh sách rút gọn chỉ đọc danh sách đi kèm và không tải trọng số mô hình.

Mô hình nhỏ hơn có luôn an toàn hơn không?

Không. Skill nói kích thước hoặc định dạng mô hình không chứng minh nó tìm thông tin cá nhân tốt.

Nó xử lý những định dạng nào?

Nó nhắc đến PyTorch cho CPU và GPU, và định dạng MLX cho Apple Silicon.

Chi tiết

Mô tả gốc của tác giả

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

Độ phổ biến

Sao GitHub
5.8k
Vị trí xếp hạng
#14719
Giấy phép
Apache-2.0
Cập nhật
2/11/2026

Skill này có hữu ích không?

0

Đăng nhập để bình chọn.

Bình luận

  • …

Thêm skill từ kho mã này

Skill tương tự