pranav0494 commited on
Commit
bd489bc
·
verified ·
1 Parent(s): 5815f46

Add distilled NER student ONNX (fp32 + int8)

Browse files
README.md ADDED
@@ -0,0 +1,52 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: mit
3
+ library_name: onnx
4
+ tags:
5
+ - token-classification
6
+ - ner
7
+ - resume
8
+ - distillation
9
+ base_model: microsoft/deberta-v3-xsmall
10
+ ---
11
+
12
+ # onnx-ner-student
13
+
14
+ DeBERTa-v3-xsmall BIO token classifier distilled from the production **GLiNER2**
15
+ teacher (`fastino/gliner2-base-v1`) for résumé entity extraction. Replaces the
16
+ ~1 GB GLiNER2 runtime in curriculo-ai to fit the t3.medium memory budget.
17
+
18
+ **16 entity types**, each an independent BIO sequence (a token may be B for
19
+ several types at once — e.g. `CI/CD` is both `technical_skill` and `framework`).
20
+
21
+ ## Files
22
+ - `model.onnx` — FP32
23
+ - `model_quantized.onnx` — INT8 dynamic (runtime default)
24
+ - `labels.json` — the 16 type names, index-aligned to the output head
25
+ - tokenizer files (fast/`tokenizers`-loadable, torch-free)
26
+
27
+ ## I/O
28
+ `input_ids`, `attention_mask` `[B, T]` → `logits` `[B, T, 16, 3]`
29
+ (argmax over the last dim → per-type BIO tag `0=O,1=B,2=I`; decode with
30
+ `ner_dataset.decode_spans`).
31
+
32
+ ## Results (held-out test vs teacher, best `ct0.4_lr1e-04_ep6`)
33
+ micro-F1 **0.9173**, precision 0.9123, recall 0.9224.
34
+
35
+ | type | F1 |
36
+ |------|----|
37
+ | award | 0.9787 |
38
+ | certification | 0.896 |
39
+ | degree | 0.8894 |
40
+ | field_of_study | 0.9467 |
41
+ | framework | 0.8747 |
42
+ | industry | 0.9474 |
43
+ | interest | 0.9956 |
44
+ | job_title | 0.9242 |
45
+ | language | 1.0 |
46
+ | location | 0.9408 |
47
+ | organization | 0.9773 |
48
+ | person_name | 0.97 |
49
+ | soft_skill | 0.8229 |
50
+ | technical_skill | 0.8592 |
51
+ | technology | 0.9464 |
52
+ | tool | 0.8613 |
added_tokens.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ {
2
+ "[MASK]": 128000
3
+ }
labels.json ADDED
@@ -0,0 +1 @@
 
 
1
+ ["award", "certification", "degree", "field_of_study", "framework", "industry", "interest", "job_title", "language", "location", "organization", "person_name", "soft_skill", "technical_skill", "technology", "tool"]
metrics.json ADDED
@@ -0,0 +1,64 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "config": {
3
+ "backbone": "microsoft/deberta-v3-xsmall",
4
+ "max_len": 96,
5
+ "batch_size": 32,
6
+ "weight_decay": 0.01,
7
+ "warmup": 0.1,
8
+ "dropout": 0.1,
9
+ "seed": 42,
10
+ "conf_threshold": 0.4,
11
+ "lr": 0.0001,
12
+ "epochs": 6,
13
+ "tag": "ct0.4_lr1e-04_ep6",
14
+ "out_dir": "/home/dev/nada/curriculo-models/ner_student/runs/ct0.4_lr1e-04_ep6"
15
+ },
16
+ "val": {
17
+ "micro_f1": 0.9116,
18
+ "precision": 0.9081,
19
+ "recall": 0.9151,
20
+ "support": 4667,
21
+ "per_type": {
22
+ "award": 0.9778,
23
+ "certification": 0.8,
24
+ "degree": 0.8116,
25
+ "field_of_study": 0.9364,
26
+ "framework": 0.8443,
27
+ "industry": 0.9531,
28
+ "interest": 0.9958,
29
+ "job_title": 0.9325,
30
+ "language": 0.9958,
31
+ "location": 0.927,
32
+ "organization": 0.9816,
33
+ "person_name": 0.9605,
34
+ "soft_skill": 0.7879,
35
+ "technical_skill": 0.8638,
36
+ "technology": 0.9506,
37
+ "tool": 0.8536
38
+ }
39
+ },
40
+ "test": {
41
+ "micro_f1": 0.9173,
42
+ "precision": 0.9123,
43
+ "recall": 0.9224,
44
+ "support": 4666,
45
+ "per_type": {
46
+ "award": 0.9787,
47
+ "certification": 0.896,
48
+ "degree": 0.8894,
49
+ "field_of_study": 0.9467,
50
+ "framework": 0.8747,
51
+ "industry": 0.9474,
52
+ "interest": 0.9956,
53
+ "job_title": 0.9242,
54
+ "language": 1.0,
55
+ "location": 0.9408,
56
+ "organization": 0.9773,
57
+ "person_name": 0.97,
58
+ "soft_skill": 0.8229,
59
+ "technical_skill": 0.8592,
60
+ "technology": 0.9464,
61
+ "tool": 0.8613
62
+ }
63
+ }
64
+ }
model.onnx ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a1ef89a35116ed040a598a054553fdc5d4087d31136dbb1f097b7f5232369cd1
3
+ size 282935436
model_quantized.onnx ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:eb4ed965f3f1fb1b6e07940ffb2d003861fbd409e2ac8f8c2791ca5071186c6a
3
+ size 82256421
special_tokens_map.json ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "bos_token": "[CLS]",
3
+ "cls_token": "[CLS]",
4
+ "eos_token": "[SEP]",
5
+ "mask_token": "[MASK]",
6
+ "pad_token": "[PAD]",
7
+ "sep_token": "[SEP]",
8
+ "unk_token": {
9
+ "content": "[UNK]",
10
+ "lstrip": false,
11
+ "normalized": true,
12
+ "rstrip": false,
13
+ "single_word": false
14
+ }
15
+ }
spm.model ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c679fbf93643d19aab7ee10c0b99e460bdbc02fedf34b92b05af343b4af586fd
3
+ size 2464616
tokenizer.json ADDED
The diff for this file is too large to render. See raw diff
 
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": false,
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
+ }