Instructions to use yonigo/deberta-v3-base-pii-en with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use yonigo/deberta-v3-base-pii-en with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("token-classification", model="yonigo/deberta-v3-base-pii-en")# Load model directly from transformers import AutoTokenizer, AutoModelForTokenClassification tokenizer = AutoTokenizer.from_pretrained("yonigo/deberta-v3-base-pii-en") model = AutoModelForTokenClassification.from_pretrained("yonigo/deberta-v3-base-pii-en", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Adding ONNX file of this model
Browse filesBeep boop I am the [ONNX export bot 🤖🏎️](https://huggingface.co/spaces/onnx/export). On behalf of [Lyreck](https://huggingface.co/Lyreck), I would like to add to this repository the model converted to ONNX.
What is ONNX? It stands for "Open Neural Network Exchange", and is the most commonly used open standard for machine learning interoperability. You can find out more at [onnx.ai](https://onnx.ai/)!
The exported ONNX model can be then be consumed by various backends as TensorRT or TVM, or simply be used in a few lines with 🤗 Optimum through ONNX Runtime, check out how [here](https://huggingface.co/docs/optimum/main/en/onnxruntime/usage_guides/models)!
- README.md +5 -4
- onnx/config.json +154 -0
- onnx/model.onnx +3 -0
- onnx/special_tokens_map.json +51 -0
- onnx/tokenizer.json +0 -0
- onnx/tokenizer_config.json +59 -0
README.md
CHANGED
|
@@ -3,20 +3,21 @@ license: mit
|
|
| 3 |
base_model: microsoft/deberta-v3-base
|
| 4 |
tags:
|
| 5 |
- generated_from_trainer
|
|
|
|
| 6 |
metrics:
|
| 7 |
- precision
|
| 8 |
- recall
|
| 9 |
- f1
|
| 10 |
- accuracy
|
| 11 |
-
model-index:
|
| 12 |
-
- name: deberta-v3-base-pii-en
|
| 13 |
-
results: []
|
| 14 |
pipeline_tag: token-classification
|
| 15 |
widget:
|
| 16 |
-
|
| 17 |
inference:
|
| 18 |
parameters:
|
| 19 |
aggregation_strategy: first
|
|
|
|
|
|
|
|
|
|
| 20 |
---
|
| 21 |
|
| 22 |
<!-- This model card has been generated automatically according to the information the Trainer had access to. You
|
|
|
|
| 3 |
base_model: microsoft/deberta-v3-base
|
| 4 |
tags:
|
| 5 |
- generated_from_trainer
|
| 6 |
+
- onnx
|
| 7 |
metrics:
|
| 8 |
- precision
|
| 9 |
- recall
|
| 10 |
- f1
|
| 11 |
- accuracy
|
|
|
|
|
|
|
|
|
|
| 12 |
pipeline_tag: token-classification
|
| 13 |
widget:
|
| 14 |
+
- text: My name is Yoni Go and I live in Israel. My phone number is 054-1234567
|
| 15 |
inference:
|
| 16 |
parameters:
|
| 17 |
aggregation_strategy: first
|
| 18 |
+
model-index:
|
| 19 |
+
- name: deberta-v3-base-pii-en
|
| 20 |
+
results: []
|
| 21 |
---
|
| 22 |
|
| 23 |
<!-- This model card has been generated automatically according to the information the Trainer had access to. You
|
onnx/config.json
ADDED
|
@@ -0,0 +1,154 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"_attn_implementation_autoset": true,
|
| 3 |
+
"architectures": [
|
| 4 |
+
"DebertaV2ForTokenClassification"
|
| 5 |
+
],
|
| 6 |
+
"attention_probs_dropout_prob": 0.1,
|
| 7 |
+
"hidden_act": "gelu",
|
| 8 |
+
"hidden_dropout_prob": 0.1,
|
| 9 |
+
"hidden_size": 768,
|
| 10 |
+
"id2label": {
|
| 11 |
+
"0": "I-BOD",
|
| 12 |
+
"1": "I-BUILDING",
|
| 13 |
+
"2": "I-CARDISSUER",
|
| 14 |
+
"3": "I-CITY",
|
| 15 |
+
"4": "I-COUNTRY",
|
| 16 |
+
"5": "I-DATE",
|
| 17 |
+
"6": "I-DRIVERLICENSE",
|
| 18 |
+
"7": "I-EMAIL",
|
| 19 |
+
"8": "I-GEOCOORD",
|
| 20 |
+
"9": "I-GIVENNAME1",
|
| 21 |
+
"10": "I-GIVENNAME2",
|
| 22 |
+
"11": "I-IDCARD",
|
| 23 |
+
"12": "I-IP",
|
| 24 |
+
"13": "I-LASTNAME1",
|
| 25 |
+
"14": "I-LASTNAME2",
|
| 26 |
+
"15": "I-LASTNAME3",
|
| 27 |
+
"16": "I-PASS",
|
| 28 |
+
"17": "I-PASSPORT",
|
| 29 |
+
"18": "I-POSTCODE",
|
| 30 |
+
"19": "I-SECADDRESS",
|
| 31 |
+
"20": "I-SEX",
|
| 32 |
+
"21": "I-SOCIALNUMBER",
|
| 33 |
+
"22": "I-STATE",
|
| 34 |
+
"23": "I-STREET",
|
| 35 |
+
"24": "I-TEL",
|
| 36 |
+
"25": "I-TIME",
|
| 37 |
+
"26": "I-TITLE",
|
| 38 |
+
"27": "I-USERNAME",
|
| 39 |
+
"28": "B-BOD",
|
| 40 |
+
"29": "B-BUILDING",
|
| 41 |
+
"30": "B-CARDISSUER",
|
| 42 |
+
"31": "B-CITY",
|
| 43 |
+
"32": "B-COUNTRY",
|
| 44 |
+
"33": "B-DATE",
|
| 45 |
+
"34": "B-DRIVERLICENSE",
|
| 46 |
+
"35": "B-EMAIL",
|
| 47 |
+
"36": "B-GEOCOORD",
|
| 48 |
+
"37": "B-GIVENNAME1",
|
| 49 |
+
"38": "B-GIVENNAME2",
|
| 50 |
+
"39": "B-IDCARD",
|
| 51 |
+
"40": "B-IP",
|
| 52 |
+
"41": "B-LASTNAME1",
|
| 53 |
+
"42": "B-LASTNAME2",
|
| 54 |
+
"43": "B-LASTNAME3",
|
| 55 |
+
"44": "B-PASS",
|
| 56 |
+
"45": "B-PASSPORT",
|
| 57 |
+
"46": "B-POSTCODE",
|
| 58 |
+
"47": "B-SECADDRESS",
|
| 59 |
+
"48": "B-SEX",
|
| 60 |
+
"49": "B-SOCIALNUMBER",
|
| 61 |
+
"50": "B-STATE",
|
| 62 |
+
"51": "B-STREET",
|
| 63 |
+
"52": "B-TEL",
|
| 64 |
+
"53": "B-TIME",
|
| 65 |
+
"54": "B-TITLE",
|
| 66 |
+
"55": "B-USERNAME",
|
| 67 |
+
"56": "O"
|
| 68 |
+
},
|
| 69 |
+
"initializer_range": 0.02,
|
| 70 |
+
"intermediate_size": 3072,
|
| 71 |
+
"label2id": {
|
| 72 |
+
"LABEL_0": 0,
|
| 73 |
+
"LABEL_1": 1,
|
| 74 |
+
"LABEL_10": 10,
|
| 75 |
+
"LABEL_11": 11,
|
| 76 |
+
"LABEL_12": 12,
|
| 77 |
+
"LABEL_13": 13,
|
| 78 |
+
"LABEL_14": 14,
|
| 79 |
+
"LABEL_15": 15,
|
| 80 |
+
"LABEL_16": 16,
|
| 81 |
+
"LABEL_17": 17,
|
| 82 |
+
"LABEL_18": 18,
|
| 83 |
+
"LABEL_19": 19,
|
| 84 |
+
"LABEL_2": 2,
|
| 85 |
+
"LABEL_20": 20,
|
| 86 |
+
"LABEL_21": 21,
|
| 87 |
+
"LABEL_22": 22,
|
| 88 |
+
"LABEL_23": 23,
|
| 89 |
+
"LABEL_24": 24,
|
| 90 |
+
"LABEL_25": 25,
|
| 91 |
+
"LABEL_26": 26,
|
| 92 |
+
"LABEL_27": 27,
|
| 93 |
+
"LABEL_28": 28,
|
| 94 |
+
"LABEL_29": 29,
|
| 95 |
+
"LABEL_3": 3,
|
| 96 |
+
"LABEL_30": 30,
|
| 97 |
+
"LABEL_31": 31,
|
| 98 |
+
"LABEL_32": 32,
|
| 99 |
+
"LABEL_33": 33,
|
| 100 |
+
"LABEL_34": 34,
|
| 101 |
+
"LABEL_35": 35,
|
| 102 |
+
"LABEL_36": 36,
|
| 103 |
+
"LABEL_37": 37,
|
| 104 |
+
"LABEL_38": 38,
|
| 105 |
+
"LABEL_39": 39,
|
| 106 |
+
"LABEL_4": 4,
|
| 107 |
+
"LABEL_40": 40,
|
| 108 |
+
"LABEL_41": 41,
|
| 109 |
+
"LABEL_42": 42,
|
| 110 |
+
"LABEL_43": 43,
|
| 111 |
+
"LABEL_44": 44,
|
| 112 |
+
"LABEL_45": 45,
|
| 113 |
+
"LABEL_46": 46,
|
| 114 |
+
"LABEL_47": 47,
|
| 115 |
+
"LABEL_48": 48,
|
| 116 |
+
"LABEL_49": 49,
|
| 117 |
+
"LABEL_5": 5,
|
| 118 |
+
"LABEL_50": 50,
|
| 119 |
+
"LABEL_51": 51,
|
| 120 |
+
"LABEL_52": 52,
|
| 121 |
+
"LABEL_53": 53,
|
| 122 |
+
"LABEL_54": 54,
|
| 123 |
+
"LABEL_55": 55,
|
| 124 |
+
"LABEL_56": 56,
|
| 125 |
+
"LABEL_6": 6,
|
| 126 |
+
"LABEL_7": 7,
|
| 127 |
+
"LABEL_8": 8,
|
| 128 |
+
"LABEL_9": 9
|
| 129 |
+
},
|
| 130 |
+
"layer_norm_eps": 1e-07,
|
| 131 |
+
"legacy": true,
|
| 132 |
+
"max_position_embeddings": 512,
|
| 133 |
+
"max_relative_positions": -1,
|
| 134 |
+
"model_type": "deberta-v2",
|
| 135 |
+
"norm_rel_ebd": "layer_norm",
|
| 136 |
+
"num_attention_heads": 12,
|
| 137 |
+
"num_hidden_layers": 12,
|
| 138 |
+
"pad_token_id": 0,
|
| 139 |
+
"pooler_dropout": 0,
|
| 140 |
+
"pooler_hidden_act": "gelu",
|
| 141 |
+
"pooler_hidden_size": 768,
|
| 142 |
+
"pos_att_type": [
|
| 143 |
+
"p2c",
|
| 144 |
+
"c2p"
|
| 145 |
+
],
|
| 146 |
+
"position_biased_input": false,
|
| 147 |
+
"position_buckets": 256,
|
| 148 |
+
"relative_attention": true,
|
| 149 |
+
"share_att_key": true,
|
| 150 |
+
"torch_dtype": "float32",
|
| 151 |
+
"transformers_version": "4.51.3",
|
| 152 |
+
"type_vocab_size": 0,
|
| 153 |
+
"vocab_size": 128100
|
| 154 |
+
}
|
onnx/model.onnx
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:82336676280627fde50c3443f2635f7f1cd3640f5be68acfa9ba4d20dc400caf
|
| 3 |
+
size 736377054
|
onnx/special_tokens_map.json
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"bos_token": {
|
| 3 |
+
"content": "[CLS]",
|
| 4 |
+
"lstrip": false,
|
| 5 |
+
"normalized": false,
|
| 6 |
+
"rstrip": false,
|
| 7 |
+
"single_word": false
|
| 8 |
+
},
|
| 9 |
+
"cls_token": {
|
| 10 |
+
"content": "[CLS]",
|
| 11 |
+
"lstrip": false,
|
| 12 |
+
"normalized": false,
|
| 13 |
+
"rstrip": false,
|
| 14 |
+
"single_word": false
|
| 15 |
+
},
|
| 16 |
+
"eos_token": {
|
| 17 |
+
"content": "[SEP]",
|
| 18 |
+
"lstrip": false,
|
| 19 |
+
"normalized": false,
|
| 20 |
+
"rstrip": false,
|
| 21 |
+
"single_word": false
|
| 22 |
+
},
|
| 23 |
+
"mask_token": {
|
| 24 |
+
"content": "[MASK]",
|
| 25 |
+
"lstrip": false,
|
| 26 |
+
"normalized": false,
|
| 27 |
+
"rstrip": false,
|
| 28 |
+
"single_word": false
|
| 29 |
+
},
|
| 30 |
+
"pad_token": {
|
| 31 |
+
"content": "[PAD]",
|
| 32 |
+
"lstrip": false,
|
| 33 |
+
"normalized": false,
|
| 34 |
+
"rstrip": false,
|
| 35 |
+
"single_word": false
|
| 36 |
+
},
|
| 37 |
+
"sep_token": {
|
| 38 |
+
"content": "[SEP]",
|
| 39 |
+
"lstrip": false,
|
| 40 |
+
"normalized": false,
|
| 41 |
+
"rstrip": false,
|
| 42 |
+
"single_word": false
|
| 43 |
+
},
|
| 44 |
+
"unk_token": {
|
| 45 |
+
"content": "[UNK]",
|
| 46 |
+
"lstrip": false,
|
| 47 |
+
"normalized": true,
|
| 48 |
+
"rstrip": false,
|
| 49 |
+
"single_word": false
|
| 50 |
+
}
|
| 51 |
+
}
|
onnx/tokenizer.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
onnx/tokenizer_config.json
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"added_tokens_decoder": {
|
| 3 |
+
"0": {
|
| 4 |
+
"content": "[PAD]",
|
| 5 |
+
"lstrip": false,
|
| 6 |
+
"normalized": false,
|
| 7 |
+
"rstrip": false,
|
| 8 |
+
"single_word": false,
|
| 9 |
+
"special": true
|
| 10 |
+
},
|
| 11 |
+
"1": {
|
| 12 |
+
"content": "[CLS]",
|
| 13 |
+
"lstrip": false,
|
| 14 |
+
"normalized": false,
|
| 15 |
+
"rstrip": false,
|
| 16 |
+
"single_word": false,
|
| 17 |
+
"special": true
|
| 18 |
+
},
|
| 19 |
+
"2": {
|
| 20 |
+
"content": "[SEP]",
|
| 21 |
+
"lstrip": false,
|
| 22 |
+
"normalized": false,
|
| 23 |
+
"rstrip": false,
|
| 24 |
+
"single_word": false,
|
| 25 |
+
"special": true
|
| 26 |
+
},
|
| 27 |
+
"3": {
|
| 28 |
+
"content": "[UNK]",
|
| 29 |
+
"lstrip": false,
|
| 30 |
+
"normalized": true,
|
| 31 |
+
"rstrip": false,
|
| 32 |
+
"single_word": false,
|
| 33 |
+
"special": true
|
| 34 |
+
},
|
| 35 |
+
"128000": {
|
| 36 |
+
"content": "[MASK]",
|
| 37 |
+
"lstrip": false,
|
| 38 |
+
"normalized": false,
|
| 39 |
+
"rstrip": false,
|
| 40 |
+
"single_word": false,
|
| 41 |
+
"special": true
|
| 42 |
+
}
|
| 43 |
+
},
|
| 44 |
+
"bos_token": "[CLS]",
|
| 45 |
+
"clean_up_tokenization_spaces": true,
|
| 46 |
+
"cls_token": "[CLS]",
|
| 47 |
+
"do_lower_case": false,
|
| 48 |
+
"eos_token": "[SEP]",
|
| 49 |
+
"extra_special_tokens": {},
|
| 50 |
+
"mask_token": "[MASK]",
|
| 51 |
+
"model_max_length": 1000000000000000019884624838656,
|
| 52 |
+
"pad_token": "[PAD]",
|
| 53 |
+
"sep_token": "[SEP]",
|
| 54 |
+
"sp_model_kwargs": {},
|
| 55 |
+
"split_by_punct": false,
|
| 56 |
+
"tokenizer_class": "DebertaV2Tokenizer",
|
| 57 |
+
"unk_token": "[UNK]",
|
| 58 |
+
"vocab_type": "spm"
|
| 59 |
+
}
|