maadgrom commited on
Commit
7e9ddd9
·
verified ·
1 Parent(s): 0cecd81

Upload folder using huggingface_hub

Browse files
README.md CHANGED
@@ -30,13 +30,13 @@ model-index:
30
  type: AmazonScience/massive
31
  metrics:
32
  - type: f1
33
- value: 0.8535
34
  name: Token F1 (fp32)
35
  - type: f1
36
- value: 0.7392
37
  name: Token F1 (q8, shipped)
38
  - type: accuracy
39
- value: 0.9550
40
  name: Accuracy (fp32)
41
  ---
42
 
@@ -46,7 +46,7 @@ Compact token-classification model that extracts scheduling/task slots from shor
46
  English notes — **participants**, **datetimes**, **priorities**, and
47
  **recurrences** — and runs fully client-side via [Transformers.js](https://huggingface.co/docs/transformers.js).
48
 
49
- The shipped artifact is an **INT8-quantized ONNX** bundle (~13 MB) intended for
50
  in-browser WASM inference, not a PyTorch checkpoint.
51
 
52
  ## Model details
@@ -54,13 +54,13 @@ in-browser WASM inference, not a PyTorch checkpoint.
54
  | | |
55
  |---|---|
56
  | Base model | [`microsoft/xtremedistil-l6-h256-uncased`](https://huggingface.co/microsoft/xtremedistil-l6-h256-uncased) (MIT) |
57
- | Architecture | `BertForTokenClassification` — 6 layers, hidden size 256, 8 heads, intermediate 1024, vocab 30522, max positions 512 (~13M params) |
58
  | Task | Token classification (BIO slot tagging) |
59
  | Schema version | `slot-labels-v0.3.0` |
60
- | Model version | 0.1.0 |
61
  | Languages | English |
62
  | Runtime | Transformers.js v4, WASM device, dtype `q8` |
63
- | Bundle size | 13.32 MB |
64
  | `transformers` (training) | 4.57.6 |
65
  | License | CC BY 4.0 |
66
 
@@ -69,9 +69,13 @@ in-browser WASM inference, not a PyTorch checkpoint.
69
  `O`, `B-PARTICIPANT`, `I-PARTICIPANT`, `B-PRIORITY`, `I-PRIORITY`,
70
  `B-DATETIME`, `I-DATETIME`, `B-RECURRENCE`, `I-RECURRENCE`
71
 
72
- A bundled `transitions.json` carries empirical BIO transition log-probabilities
73
- (Laplace-smoothed, invalid transitions hard-zeroed) for optional Viterbi-style
74
- decoding on top of the raw token logits.
 
 
 
 
75
 
76
  ## Intended use
77
 
@@ -112,31 +116,46 @@ Transformers.js expects when loading from the Hub.
112
  deduplicated against originals.
113
  - **Hyperparameters:** 10 epochs with early stopping (patience 2, restore best
114
  by F1), batch size 64, learning rate 5e-5, cosine schedule, warmup ratio 0.1,
115
- weight decay 0.01, label smoothing 0.1, max sequence length 128, seed 42.
116
- - **Quantization:** dynamic, per-channel `QInt8`, applied to `MatMul` and
117
- `Gather` ops via ONNX Runtime.
 
 
 
 
 
 
 
 
 
 
 
 
118
 
119
  ## Evaluation
120
 
121
- Token-level metrics (seqeval) on the held-out test split (n ≈ 559).
122
- **The q8 column reflects the artifact actually shipped in this repo.**
 
123
 
124
  | Metric | fp32 | q8 (shipped) |
125
  |---|---|---|
126
- | Accuracy | 0.9550 | 0.9050 |
127
- | Precision | 0.8283 | 0.8718 |
128
- | Recall | 0.8802 | 0.6416 |
129
- | **F1** | **0.8535** | **0.7392** |
130
- | DATETIME F1 | 0.8191 | 0.6724 |
131
- | PARTICIPANT F1 | 0.9208 | 0.8943 |
132
- | PRIORITY F1 | 0.7979 | 0.6316 |
133
- | RECURRENCE F1 | 0.8981 | 0.7093 |
134
 
135
  ## Limitations and bias
136
 
137
- - **Quantization cost:** INT8 quantization raises precision slightly but cuts
138
- recall substantially (0.88 → 0.64; F1 0.85 → 0.74). The model misses more
139
- true spans than the fp32 model; tune downstream thresholds accordingly.
 
 
140
  - **Domain:** trained on short calendar/task-style English notes plus synthetic
141
  data; expect degradation on long-form text, other domains, or other languages.
142
  - **Synthetic data:** part of the training distribution is generated, so phrasing
 
30
  type: AmazonScience/massive
31
  metrics:
32
  - type: f1
33
+ value: 0.8498
34
  name: Token F1 (fp32)
35
  - type: f1
36
+ value: 0.8278
37
  name: Token F1 (q8, shipped)
38
  - type: accuracy
39
+ value: 0.9545
40
  name: Accuracy (fp32)
41
  ---
42
 
 
46
  English notes — **participants**, **datetimes**, **priorities**, and
47
  **recurrences** — and runs fully client-side via [Transformers.js](https://huggingface.co/docs/transformers.js).
48
 
49
+ The shipped artifact is an **INT8-quantized ONNX** bundle (~7.6 MB) intended for
50
  in-browser WASM inference, not a PyTorch checkpoint.
51
 
52
  ## Model details
 
54
  | | |
55
  |---|---|
56
  | Base model | [`microsoft/xtremedistil-l6-h256-uncased`](https://huggingface.co/microsoft/xtremedistil-l6-h256-uncased) (MIT) |
57
+ | Architecture | `BertForTokenClassification` — 6 layers, hidden size 256, 8 heads, intermediate 1024, vocab 9567 (pruned from 30522), max positions 512 (~7.6M params) |
58
  | Task | Token classification (BIO slot tagging) |
59
  | Schema version | `slot-labels-v0.3.0` |
60
+ | Model version | 0.2.0 |
61
  | Languages | English |
62
  | Runtime | Transformers.js v4, WASM device, dtype `q8` |
63
+ | Bundle size | 7.56 MB |
64
  | `transformers` (training) | 4.57.6 |
65
  | License | CC BY 4.0 |
66
 
 
69
  `O`, `B-PARTICIPANT`, `I-PARTICIPANT`, `B-PRIORITY`, `I-PRIORITY`,
70
  `B-DATETIME`, `I-DATETIME`, `B-RECURRENCE`, `I-RECURRENCE`
71
 
72
+ A bundled `transitions.json` carries a BIO-constraint transition matrix
73
+ (0 for allowed transitions, a large negative penalty for invalid `I-`
74
+ continuations) for constrained Viterbi decoding on top of the raw token
75
+ logits. The bundled JS loader applies it automatically. The matrix is
76
+ deliberately constraint-only: empirical bigram priors double-count label
77
+ frequency already present in the emissions and were measured to cost ~7 F1
78
+ points of recall on the quantized model.
79
 
80
  ## Intended use
81
 
 
116
  deduplicated against originals.
117
  - **Hyperparameters:** 10 epochs with early stopping (patience 2, restore best
118
  by F1), batch size 64, learning rate 5e-5, cosine schedule, warmup ratio 0.1,
119
+ weight decay 0.01, label smoothing 0.05, max sequence length 128, seed 42.
120
+ - **Distillation:** the shipped student is knowledge-distilled from a
121
+ `bert-base-uncased` teacher fine-tuned on the same data (teacher eval F1
122
+ ~0.90); loss = 0.5·CE(gold) + 0.5·T²·KL(teacher‖student), T=2.
123
+ - **Vocab pruning:** wordpiece vocab pruned 30522 → 9567 (pieces observed in
124
+ domain data, fixtures, regression texts, plus a wikitext-103 frequency
125
+ sweep; all single-char and digit pieces retained). Pruned tokenizer emits
126
+ token-identical output on the full test set, so metrics are unchanged.
127
+ - **Quantization:** dynamic, per-channel `QInt8` with `reduce_range`, applied
128
+ to `MatMul` and `Gather` ops via ONNX Runtime. Static QDQ quantization was
129
+ evaluated (MinMax/Entropy/Percentile calibration) and consistently lost
130
+ 8-12 F1 points on this model size; dynamic + `reduce_range` won the matrix.
131
+ Weight-only QAT (straight-through fake-quant fine-tune) was also evaluated
132
+ and rejected: it landed below the post-training baseline (0.823 vs 0.828)
133
+ because it cannot model ORT's runtime dynamic activation quantization.
134
 
135
  ## Evaluation
136
 
137
+ Token-level metrics (seqeval) on the held-out test split (n ≈ 559). fp32 is
138
+ argmax-decoded; q8 uses the constrained-Viterbi decode that ships in the JS
139
+ loader. **The q8 column reflects the artifact actually shipped in this repo.**
140
 
141
  | Metric | fp32 | q8 (shipped) |
142
  |---|---|---|
143
+ | Accuracy | 0.9545 | 0.9444 |
144
+ | Precision | 0.8235 | 0.7925 |
145
+ | Recall | 0.8777 | 0.8662 |
146
+ | **F1** | **0.8498** | **0.8278** |
147
+ | DATETIME F1 | 0.8175 | 0.7925 |
148
+ | PARTICIPANT F1 | 0.9355 | 0.9331 |
149
+ | PRIORITY F1 | 0.7526 | 0.6735 |
150
+ | RECURRENCE F1 | 0.8649 | 0.8651 |
151
 
152
  ## Limitations and bias
153
 
154
+ - **Quantization cost:** with dynamic per-channel INT8 (`reduce_range`) and
155
+ constrained-Viterbi decoding the gap to fp32 is ~2 F1 points
156
+ (0.850 → 0.828). Decoding with plain argmax instead of the bundled
157
+ transitions costs a further ~2 points; empirical-prior Viterbi costs ~7.
158
+ PRIORITY is the most quantization-sensitive entity (0.75 → 0.67).
159
  - **Domain:** trained on short calendar/task-style English notes plus synthetic
160
  data; expect degradation on long-form text, other domains, or other languages.
161
  - **Synthetic data:** part of the training distribution is generated, so phrasing
config.json CHANGED
@@ -43,5 +43,5 @@
43
  "transformers_version": "4.57.6",
44
  "type_vocab_size": 2,
45
  "use_cache": true,
46
- "vocab_size": 30522
47
  }
 
43
  "transformers_version": "4.57.6",
44
  "type_vocab_size": 2,
45
  "use_cache": true,
46
+ "vocab_size": 9567
47
  }
manifest.json CHANGED
@@ -1,18 +1,18 @@
1
  {
2
  "base_model": "microsoft/xtremedistil-l6-h256-uncased",
3
- "bundle_size_mb": 13.325,
4
- "created_at": "2026-05-17T10:39:56.428239+00:00",
5
  "files": {
6
- "README.md": "e2d57051221c694b32de2b4152770940ea68dfeae6339581eaa6b6bfa710ae00",
7
- "config.json": "a42323a8b73212169370a0265018350775bc8556e795c3e3348293ce877f0c26",
8
- "onnx/model_quantized.onnx": "0b9edd8df5baa28b4a6e4e7b07c796234ab2e19280e38eb7e1705d09462f143f",
9
  "special_tokens_map.json": "b6d346be366a7d1d48332dbc9fdf3bf8960b5d879522b7799ddba59e76237ee3",
10
- "tokenizer.json": "79ea220416a57ca8acdf069d71875d5d2ddadef66021aeb6c120a7c546c04344",
11
- "tokenizer_config.json": "e711904cac23112776b678356ccf702cf934babaa01125f698ac43bf9ad38e73",
12
- "transitions.json": "ac4f0e2f0ca4dbad13ab41301354ae72dd19500299034c66fda701dcd4f8c920",
13
- "vocab.txt": "07eced375cec144d27c900241f3e339478dec958f92fddbc551f295c992038a3"
14
  },
15
- "model_version": "0.1.0",
16
  "quantization": {
17
  "method": "dynamic",
18
  "op_types_to_quantize": [
@@ -20,20 +20,21 @@
20
  "Gather"
21
  ],
22
  "per_channel": true,
 
23
  "weight_type": "QInt8"
24
  },
25
  "quantized_source": "model_quantized.onnx",
26
  "quantized_test_metrics": {
27
- "DATETIME_f1": 0.6723507917174177,
28
- "PARTICIPANT_f1": 0.8943089430894308,
29
- "PRIORITY_f1": 0.631578947368421,
30
- "RECURRENCE_f1": 0.7093023255813952,
31
- "accuracy": 0.9049765258215963,
32
- "f1": 0.7391569945021381,
33
  "n_examples": 559,
34
- "precision": 0.8717579250720461,
35
  "quantization_method": "dynamic",
36
- "recall": 0.6415694591728526
37
  },
38
  "runtime": {
39
  "device": "wasm",
@@ -46,17 +47,17 @@
46
  "base_model": "microsoft/xtremedistil-l6-h256-uncased",
47
  "epoch": 10.0,
48
  "seed": 42,
49
- "test_DATETIME_f1": 0.8190854870775347,
50
- "test_PARTICIPANT_f1": 0.920754716981132,
51
- "test_PRIORITY_f1": 0.7979274611398963,
52
- "test_RECURRENCE_f1": 0.8981481481481483,
53
- "test_accuracy": 0.9550178377539941,
54
- "test_f1": 0.853470437017995,
55
- "test_loss": 0.6731534600257874,
56
- "test_precision": 0.8283433133732535,
57
- "test_recall": 0.88016967126193,
58
- "test_runtime": 1.0824,
59
- "test_samples_per_second": 516.459,
60
- "test_steps_per_second": 8.315
61
  }
62
  }
 
1
  {
2
  "base_model": "microsoft/xtremedistil-l6-h256-uncased",
3
+ "bundle_size_mb": 7.563,
4
+ "created_at": "2026-07-14T21:10:23.841146+00:00",
5
  "files": {
6
+ "README.md": "ede592ed1d31ed2ac4bb9e4dd78247026dbe9ac6691f16edef06ccb5e9c68e85",
7
+ "config.json": "1c3b19026d0699e9e2ba067ad4a94b05ca830548e6217d7199eedf89d2a1cdaf",
8
+ "onnx/model_quantized.onnx": "46eaf7964c3e1be1f5a2815a05292169afc3b829c12941992ff987c993b8017c",
9
  "special_tokens_map.json": "b6d346be366a7d1d48332dbc9fdf3bf8960b5d879522b7799ddba59e76237ee3",
10
+ "tokenizer.json": "77a17fa0eea64945b48183089517d6bd139f681792994f50fa3de9a7128f8693",
11
+ "tokenizer_config.json": "728f339446eb36034b456e80933b31713923bd4885a0d79893b699bd3ef48467",
12
+ "transitions.json": "9dd9aa03bfc8f48b21a7a721575222c160be335da3bacd6a2ffe3aa84559f9d4",
13
+ "vocab.txt": "4acb268433bb4d9ee9e7721bc6d91251604d0bee0571a4d776024844528ce5da"
14
  },
15
+ "model_version": "0.2.0",
16
  "quantization": {
17
  "method": "dynamic",
18
  "op_types_to_quantize": [
 
20
  "Gather"
21
  ],
22
  "per_channel": true,
23
+ "reduce_range": true,
24
  "weight_type": "QInt8"
25
  },
26
  "quantized_source": "model_quantized.onnx",
27
  "quantized_test_metrics": {
28
+ "DATETIME_f1": 0.7925270403146509,
29
+ "PARTICIPANT_f1": 0.9330855018587361,
30
+ "PRIORITY_f1": 0.673469387755102,
31
+ "RECURRENCE_f1": 0.8650793650793651,
32
+ "accuracy": 0.9443720930232559,
33
+ "f1": 0.8277583624563155,
34
  "n_examples": 559,
35
+ "precision": 0.7925430210325047,
36
  "quantization_method": "dynamic",
37
+ "recall": 0.8662486938349008
38
  },
39
  "runtime": {
40
  "device": "wasm",
 
47
  "base_model": "microsoft/xtremedistil-l6-h256-uncased",
48
  "epoch": 10.0,
49
  "seed": 42,
50
+ "test_DATETIME_f1": 0.817533129459735,
51
+ "test_PARTICIPANT_f1": 0.9355432780847146,
52
+ "test_PRIORITY_f1": 0.752577319587629,
53
+ "test_RECURRENCE_f1": 0.8648648648648649,
54
+ "test_accuracy": 0.9544685433010306,
55
+ "test_f1": 0.8497723823975721,
56
+ "test_loss": 0.510116457939148,
57
+ "test_precision": 0.8235294117647058,
58
+ "test_recall": 0.877742946708464,
59
+ "test_runtime": 0.671,
60
+ "test_samples_per_second": 833.031,
61
+ "test_steps_per_second": 13.412
62
  }
63
  }
onnx/model_quantized.onnx CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:0b9edd8df5baa28b4a6e4e7b07c796234ab2e19280e38eb7e1705d09462f143f
3
- size 13018836
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:46eaf7964c3e1be1f5a2815a05292169afc3b829c12941992ff987c993b8017c
3
+ size 7654355
tokenizer.json CHANGED
The diff for this file is too large to render. See raw diff
 
tokenizer_config.json CHANGED
@@ -8,7 +8,7 @@
8
  "single_word": false,
9
  "special": true
10
  },
11
- "100": {
12
  "content": "[UNK]",
13
  "lstrip": false,
14
  "normalized": false,
@@ -16,7 +16,7 @@
16
  "single_word": false,
17
  "special": true
18
  },
19
- "101": {
20
  "content": "[CLS]",
21
  "lstrip": false,
22
  "normalized": false,
@@ -24,7 +24,7 @@
24
  "single_word": false,
25
  "special": true
26
  },
27
- "102": {
28
  "content": "[SEP]",
29
  "lstrip": false,
30
  "normalized": false,
@@ -32,7 +32,7 @@
32
  "single_word": false,
33
  "special": true
34
  },
35
- "103": {
36
  "content": "[MASK]",
37
  "lstrip": false,
38
  "normalized": false,
 
8
  "single_word": false,
9
  "special": true
10
  },
11
+ "2": {
12
  "content": "[UNK]",
13
  "lstrip": false,
14
  "normalized": false,
 
16
  "single_word": false,
17
  "special": true
18
  },
19
+ "3": {
20
  "content": "[CLS]",
21
  "lstrip": false,
22
  "normalized": false,
 
24
  "single_word": false,
25
  "special": true
26
  },
27
+ "4": {
28
  "content": "[SEP]",
29
  "lstrip": false,
30
  "normalized": false,
 
32
  "single_word": false,
33
  "special": true
34
  },
35
+ "5": {
36
  "content": "[MASK]",
37
  "lstrip": false,
38
  "normalized": false,
transitions.json CHANGED
@@ -12,103 +12,103 @@
12
  ],
13
  "log_transitions": [
14
  [
15
- -0.21329336044444958,
16
- -2.395360318337538,
17
- -37.78172024711259,
18
- -5.113746528770403,
19
- -37.78172024711259,
20
- -2.4165778278557335,
21
- -37.78172024711259,
22
- -5.167092509475696,
23
- -37.78172024711259
24
  ],
25
  [
26
- -1.9565559334666265,
27
- -7.683403681052827,
28
- -1.293163013988475,
29
- -1.5653064830124768,
30
- -35.31442479698237,
31
- -1.4200054184622015,
32
- -35.31442479698237,
33
- -2.016976992941391,
34
- -35.31442479698237
35
  ],
36
  [
37
- -0.7998719529095837,
38
- -4.688285092698433,
39
- -1.770514360614312,
40
- -2.2173646848853252,
41
- -34.1110656778552,
42
- -1.9261676703261035,
43
- -34.1110656778552,
44
- -2.1493112216403105,
45
- -34.1110656778552
46
  ],
47
  [
48
- -2.5018849863224055,
49
- -6.792344427469811,
50
- -34.423365543399356,
51
- -6.792344427469811,
52
- -0.4122218905710442,
53
- -2.249049645200796,
54
- -34.423365543399356,
55
- -1.9095425048844321,
56
- -34.423365543399356
57
  ],
58
  [
59
- -2.1546649629174146,
60
- -6.799055862057797,
61
- -34.43007697798734,
62
- -6.799055862057797,
63
- -0.8432184925939632,
64
- -1.6229061294849618,
65
- -34.43007697798734,
66
- -1.3697102331043514,
67
- -34.43007697798734
68
  ],
69
  [
70
- -1.7336909992051686,
71
- -7.0015491582681655,
72
- -35.73118256286516,
73
- -6.490723534502308,
74
- -35.73118256286516,
75
- -4.544813385447166,
76
- -0.21370417595891933,
77
- -5.902936869600278,
78
- -35.73118256286516
79
  ],
80
  [
81
- -1.570300746704473,
82
- -8.211482916444066,
83
- -35.84250403237361,
84
- -3.8676774945913692,
85
- -35.84250403237361,
86
- -4.260239197863619,
87
- -0.3115875933053358,
88
- -3.71167324611479,
89
- -35.84250403237361
90
  ],
91
  [
92
- -2.4161263407420552,
93
- -6.846943139584381,
94
- -34.477964255513925,
95
- -5.460648778465241,
96
- -34.477964255513925,
97
- -2.5984478975360075,
98
- -34.477964255513925,
99
- -6.846943139584381,
100
- -0.18636798974569402
101
  ],
102
  [
103
- -2.919795707464039,
104
- -7.301822342136933,
105
- -34.93284345806648,
106
- -4.257299904414462,
107
- -34.93284345806648,
108
- -1.1684242991412823,
109
- -34.93284345806648,
110
- -7.301822342136933,
111
- -0.4785362197822449
112
  ]
113
  ]
114
  }
 
12
  ],
13
  "log_transitions": [
14
  [
15
+ 0.0,
16
+ 0.0,
17
+ -10000.0,
18
+ 0.0,
19
+ -10000.0,
20
+ 0.0,
21
+ -10000.0,
22
+ 0.0,
23
+ -10000.0
24
  ],
25
  [
26
+ 0.0,
27
+ 0.0,
28
+ 0.0,
29
+ 0.0,
30
+ -10000.0,
31
+ 0.0,
32
+ -10000.0,
33
+ 0.0,
34
+ -10000.0
35
  ],
36
  [
37
+ 0.0,
38
+ 0.0,
39
+ 0.0,
40
+ 0.0,
41
+ -10000.0,
42
+ 0.0,
43
+ -10000.0,
44
+ 0.0,
45
+ -10000.0
46
  ],
47
  [
48
+ 0.0,
49
+ 0.0,
50
+ -10000.0,
51
+ 0.0,
52
+ 0.0,
53
+ 0.0,
54
+ -10000.0,
55
+ 0.0,
56
+ -10000.0
57
  ],
58
  [
59
+ 0.0,
60
+ 0.0,
61
+ -10000.0,
62
+ 0.0,
63
+ 0.0,
64
+ 0.0,
65
+ -10000.0,
66
+ 0.0,
67
+ -10000.0
68
  ],
69
  [
70
+ 0.0,
71
+ 0.0,
72
+ -10000.0,
73
+ 0.0,
74
+ -10000.0,
75
+ 0.0,
76
+ 0.0,
77
+ 0.0,
78
+ -10000.0
79
  ],
80
  [
81
+ 0.0,
82
+ 0.0,
83
+ -10000.0,
84
+ 0.0,
85
+ -10000.0,
86
+ 0.0,
87
+ 0.0,
88
+ 0.0,
89
+ -10000.0
90
  ],
91
  [
92
+ 0.0,
93
+ 0.0,
94
+ -10000.0,
95
+ 0.0,
96
+ -10000.0,
97
+ 0.0,
98
+ -10000.0,
99
+ 0.0,
100
+ 0.0
101
  ],
102
  [
103
+ 0.0,
104
+ 0.0,
105
+ -10000.0,
106
+ 0.0,
107
+ -10000.0,
108
+ 0.0,
109
+ -10000.0,
110
+ 0.0,
111
+ 0.0
112
  ]
113
  ]
114
  }
vocab.txt CHANGED
The diff for this file is too large to render. See raw diff