Token Classification
MLX
English
openmed
roberta
apple-silicon
pii
de-identification
medical
clinical
Run this model with HF Jobs
Run OpenMed/OpenMed-PII-SuperMedical-Base-125M-v1-mlx on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs to fine-tune https://huggingface.co/OpenMed/OpenMed-PII-SuperMedical-Base-125M-v1-mlx. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/OpenMed/OpenMed-PII-SuperMedical-Base-125M-v1-mlx on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Instructions to use OpenMed/OpenMed-PII-SuperMedical-Base-125M-v1-mlx with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use OpenMed/OpenMed-PII-SuperMedical-Base-125M-v1-mlx with MLX:
# Download the model from the Hub pip install huggingface_hub[hf_xet] hf download OpenMed/OpenMed-PII-SuperMedical-Base-125M-v1-mlx --local-dir OpenMed-PII-SuperMedical-Base-125M-v1-mlx
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- LM Studio
- Atomic Chat
Upload MLX packaging for OpenMed-PII-SuperMedical-Base-125M-v1-mlx
Browse filesFiles changed (4)
- README.mdAdded+105
- config.jsonAdded+256
- id2label.jsonAdded+108
- weights.safetensorsAdded+3
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105---license: apache-2.0base_model: OpenMed/OpenMed-PII-SuperMedical-Base-125M-v1pipeline_tag: token-classificationlibrary_name: openmedtags: - openmed - mlx - apple-silicon - token-classification - pii - de-identification - medical - clinical---
# OpenMed-PII-SuperMedical-Base-125M-v1 for OpenMed MLX
This repository contains a **private MLX packaging** of [`OpenMed/OpenMed-PII-SuperMedical-Base-125M-v1`](https://huggingface.co/OpenMed/OpenMed-PII-SuperMedical-Base-125M-v1) for Apple Silicon inference with [**OpenMed**](https://github.com/maziyarpanahi/openmed).
[OpenMed](https://github.com/maziyarpanahi/openmed) is the main product experience:
- Install the Python package with `pip install openmed`- Enable Apple Silicon acceleration with `pip install "openmed[mlx]"`- Run the same OpenMed API you already use, now backed by MLX on macOS- For Apple apps, use **OpenMedKit** from the same GitHub repository with a CoreML bundle
This MLX repo is meant to pair with:
- OpenMed GitHub: [https://github.com/maziyarpanahi/openmed](https://github.com/maziyarpanahi/openmed)- OpenMed website: [https://openmed.life](https://openmed.life)- Source checkpoint: [`OpenMed/OpenMed-PII-SuperMedical-Base-125M-v1`](https://huggingface.co/OpenMed/OpenMed-PII-SuperMedical-Base-125M-v1)
## Quick Start
### Python
```bashpip install openmedpip install "openmed[mlx]"```
```pythonfrom openmed import analyze_textfrom openmed.core.config import OpenMedConfig
result = analyze_text( "Patient John Doe, DOB 1990-05-15, SSN 123-45-6789", model_name="OpenMed/OpenMed-PII-SuperMedical-Base-125M-v1", config=OpenMedConfig(backend="mlx"),)
for entity in result.entities: print(entity.label, entity.text, round(entity.confidence, 4))```
You can use the source model ID directly through OpenMed, or download this private MLX packaging from [`OpenMed/OpenMed-PII-SuperMedical-Base-125M-v1-mlx`](https://huggingface.co/OpenMed/OpenMed-PII-SuperMedical-Base-125M-v1-mlx) for a preconverted path.
### Swift
Use Swift with **OpenMedKit**, not with MLX weight files directly.
1. Open Xcode and go to **File > Add Package Dependencies...**2. Paste the OpenMed repository URL: `https://github.com/maziyarpanahi/openmed`3. Choose the package product **OpenMedKit** from the repository.4. Add a compatible CoreML model bundle plus `id2label.json` to your app target.
After that, import OpenMedKit in Swift:
```swiftimport OpenMedKit```
Then load your bundled CoreML model and label map:
```swiftimport Foundationimport OpenMedKit
let modelFolder = Bundle.main.resourceURL!let modelURL = modelFolder.appendingPathComponent("OpenMedPII.mlmodelc")let labelsURL = modelFolder.appendingPathComponent("id2label.json")
let openmed = try OpenMed( modelURL: modelURL, id2labelURL: labelsURL)```
This private MLX artifact remains the right choice for:
- Python services on Apple Silicon- local MLX inference on macOS- private preconverted packaging on the Hub
If a given architecture or environment cannot be exported cleanly as `safetensors`, OpenMed falls back to `weights.npz` so the model remains usable.
## Credits
- Base checkpoint: [`OpenMed/OpenMed-PII-SuperMedical-Base-125M-v1`](https://huggingface.co/OpenMed/OpenMed-PII-SuperMedical-Base-125M-v1)- OpenMed GitHub: [https://github.com/maziyarpanahi/openmed](https://github.com/maziyarpanahi/openmed)- OpenMed website: [https://openmed.life](https://openmed.life)- MLX packaging and runtime support: [**OpenMed**](https://github.com/maziyarpanahi/openmed)- Swift runtime for Apple apps: **OpenMedKit** from the OpenMed repository123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256{ "transformers_version": "5.5.0", "architectures": [ "RobertaForTokenClassification" ], "output_hidden_states": false, "return_dict": true, "dtype": "float32", "chunk_size_feed_forward": 0, "is_encoder_decoder": false, "id2label": { "0": "O", "1": "B-account_number", "2": "B-age", "3": "B-api_key", "4": "B-bank_routing_number", "5": "B-biometric_identifier", "6": "B-blood_type", "7": "B-certificate_license_number", "8": "B-city", "9": "B-company_name", "10": "B-coordinate", "11": "B-country", "12": "B-county", "13": "B-credit_debit_card", "14": "B-customer_id", "15": "B-cvv", "16": "B-date", "17": "B-date_of_birth", "18": "B-date_time", "19": "B-device_identifier", "20": "B-education_level", "21": "B-email", "22": "B-employee_id", "23": "B-employment_status", "24": "B-fax_number", "25": "B-first_name", "26": "B-gender", "27": "B-health_plan_beneficiary_number", "28": "B-http_cookie", "29": "B-ipv4", "30": "B-ipv6", "31": "B-language", "32": "B-last_name", "33": "B-license_plate", "34": "B-mac_address", "35": "B-medical_record_number", "36": "B-occupation", "37": "B-password", "38": "B-phone_number", "39": "B-pin", "40": "B-political_view", "41": "B-postcode", "42": "B-race_ethnicity", "43": "B-religious_belief", "44": "B-sexuality", "45": "B-ssn", "46": "B-state", "47": "B-street_address", "48": "B-swift_bic", "49": "B-tax_id", "50": "B-time", "51": "B-unique_id", "52": "B-url", "53": "B-user_name", "54": "B-vehicle_identifier", "55": "I-account_number", "56": "I-api_key", "57": "I-biometric_identifier", "58": "I-blood_type", "59": "I-certificate_license_number", "60": "I-city", "61": "I-company_name", "62": "I-coordinate", "63": "I-country", "64": "I-county", "65": "I-credit_debit_card", "66": "I-customer_id", "67": "I-date", "68": "I-date_of_birth", "69": "I-date_time", "70": "I-device_identifier", "71": "I-education_level", "72": "I-email", "73": "I-employee_id", "74": "I-employment_status", "75": "I-fax_number", "76": "I-first_name", "77": "I-gender", "78": "I-health_plan_beneficiary_number", "79": "I-http_cookie", "80": "I-ipv4", "81": "I-ipv6", "82": "I-language", "83": "I-last_name", "84": "I-license_plate", "85": "I-mac_address", "86": "I-medical_record_number", "87": "I-occupation", "88": "I-password", "89": "I-phone_number", "90": "I-pin", "91": "I-political_view", "92": "I-postcode", "93": "I-race_ethnicity", "94": "I-religious_belief", "95": "I-sexuality", "96": "I-ssn", "97": "I-state", "98": "I-street_address", "99": "I-swift_bic", "100": "I-tax_id", "101": "I-time", "102": "I-unique_id", "103": "I-url", "104": "I-user_name", "105": "I-vehicle_identifier" }, "label2id": { "B-account_number": 1, "B-age": 2, "B-api_key": 3, "B-bank_routing_number": 4, "B-biometric_identifier": 5, "B-blood_type": 6, "B-certificate_license_number": 7, "B-city": 8, "B-company_name": 9, "B-coordinate": 10, "B-country": 11, "B-county": 12, "B-credit_debit_card": 13, "B-customer_id": 14, "B-cvv": 15, "B-date": 16, "B-date_of_birth": 17, "B-date_time": 18, "B-device_identifier": 19, "B-education_level": 20, "B-email": 21, "B-employee_id": 22, "B-employment_status": 23, "B-fax_number": 24, "B-first_name": 25, "B-gender": 26, "B-health_plan_beneficiary_number": 27, "B-http_cookie": 28, "B-ipv4": 29, "B-ipv6": 30, "B-language": 31, "B-last_name": 32, "B-license_plate": 33, "B-mac_address": 34, "B-medical_record_number": 35, "B-occupation": 36, "B-password": 37, "B-phone_number": 38, "B-pin": 39, "B-political_view": 40, "B-postcode": 41, "B-race_ethnicity": 42, "B-religious_belief": 43, "B-sexuality": 44, "B-ssn": 45, "B-state": 46, "B-street_address": 47, "B-swift_bic": 48, "B-tax_id": 49, "B-time": 50, "B-unique_id": 51, "B-url": 52, "B-user_name": 53, "B-vehicle_identifier": 54, "I-account_number": 55, "I-api_key": 56, "I-biometric_identifier": 57, "I-blood_type": 58, "I-certificate_license_number": 59, "I-city": 60, "I-company_name": 61, "I-coordinate": 62, "I-country": 63, "I-county": 64, "I-credit_debit_card": 65, "I-customer_id": 66, "I-date": 67, "I-date_of_birth": 68, "I-date_time": 69, "I-device_identifier": 70, "I-education_level": 71, "I-email": 72, "I-employee_id": 73, "I-employment_status": 74, "I-fax_number": 75, "I-first_name": 76, "I-gender": 77, "I-health_plan_beneficiary_number": 78, "I-http_cookie": 79, "I-ipv4": 80, "I-ipv6": 81, "I-language": 82, "I-last_name": 83, "I-license_plate": 84, "I-mac_address": 85, "I-medical_record_number": 86, "I-occupation": 87, "I-password": 88, "I-phone_number": 89, "I-pin": 90, "I-political_view": 91, "I-postcode": 92, "I-race_ethnicity": 93, "I-religious_belief": 94, "I-sexuality": 95, "I-ssn": 96, "I-state": 97, "I-street_address": 98, "I-swift_bic": 99, "I-tax_id": 100, "I-time": 101, "I-unique_id": 102, "I-url": 103, "I-user_name": 104, "I-vehicle_identifier": 105, "O": 0 }, "problem_type": null, "vocab_size": 50265, "hidden_size": 768, "num_hidden_layers": 12, "num_attention_heads": 12, "intermediate_size": 3072, "hidden_act": "gelu", "hidden_dropout_prob": 0.1, "attention_probs_dropout_prob": 0.1, "max_position_embeddings": 514, "type_vocab_size": 1, "initializer_range": 0.02, "layer_norm_eps": 1e-05, "pad_token_id": 1, "bos_token_id": 0, "eos_token_id": 2, "use_cache": true, "classifier_dropout": null, "is_decoder": false, "add_cross_attention": false, "tie_word_embeddings": true, "_name_or_path": "OpenMed/OpenMed-PII-SuperMedical-Base-125M-v1", "model_type": "roberta", "position_embedding_type": "absolute", "output_attentions": false, "_mlx_position_offset": 2, "_mlx_model_type": "bert", "num_labels": 106, "_mlx_weights_format": "safetensors"}123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108{ "0": "O", "1": "B-account_number", "2": "B-age", "3": "B-api_key", "4": "B-bank_routing_number", "5": "B-biometric_identifier", "6": "B-blood_type", "7": "B-certificate_license_number", "8": "B-city", "9": "B-company_name", "10": "B-coordinate", "11": "B-country", "12": "B-county", "13": "B-credit_debit_card", "14": "B-customer_id", "15": "B-cvv", "16": "B-date", "17": "B-date_of_birth", "18": "B-date_time", "19": "B-device_identifier", "20": "B-education_level", "21": "B-email", "22": "B-employee_id", "23": "B-employment_status", "24": "B-fax_number", "25": "B-first_name", "26": "B-gender", "27": "B-health_plan_beneficiary_number", "28": "B-http_cookie", "29": "B-ipv4", "30": "B-ipv6", "31": "B-language", "32": "B-last_name", "33": "B-license_plate", "34": "B-mac_address", "35": "B-medical_record_number", "36": "B-occupation", "37": "B-password", "38": "B-phone_number", "39": "B-pin", "40": "B-political_view", "41": "B-postcode", "42": "B-race_ethnicity", "43": "B-religious_belief", "44": "B-sexuality", "45": "B-ssn", "46": "B-state", "47": "B-street_address", "48": "B-swift_bic", "49": "B-tax_id", "50": "B-time", "51": "B-unique_id", "52": "B-url", "53": "B-user_name", "54": "B-vehicle_identifier", "55": "I-account_number", "56": "I-api_key", "57": "I-biometric_identifier", "58": "I-blood_type", "59": "I-certificate_license_number", "60": "I-city", "61": "I-company_name", "62": "I-coordinate", "63": "I-country", "64": "I-county", "65": "I-credit_debit_card", "66": "I-customer_id", "67": "I-date", "68": "I-date_of_birth", "69": "I-date_time", "70": "I-device_identifier", "71": "I-education_level", "72": "I-email", "73": "I-employee_id", "74": "I-employment_status", "75": "I-fax_number", "76": "I-first_name", "77": "I-gender", "78": "I-health_plan_beneficiary_number", "79": "I-http_cookie", "80": "I-ipv4", "81": "I-ipv6", "82": "I-language", "83": "I-last_name", "84": "I-license_plate", "85": "I-mac_address", "86": "I-medical_record_number", "87": "I-occupation", "88": "I-password", "89": "I-phone_number", "90": "I-pin", "91": "I-political_view", "92": "I-postcode", "93": "I-race_ethnicity", "94": "I-religious_belief", "95": "I-sexuality", "96": "I-ssn", "97": "I-state", "98": "I-street_address", "99": "I-swift_bic", "100": "I-tax_id", "101": "I-time", "102": "I-unique_id", "103": "I-url", "104": "I-user_name", "105": "I-vehicle_identifier"}123version https://git-lfs.github.com/spec/v1oid sha256:40960dd37e81743d08742d8a91c996f903df43047470d622551d422320efdd8bsize 496567329README.mdAdded+105
config.jsonAdded+256
id2label.jsonAdded+108
weights.safetensorsAdded+3