arthrod commited on
Commit
bc6a9e4
·
verified ·
1 Parent(s): 4f0a479

Card: full provenance, checkpoint table, training recipe and recorded metrics; add training_log_history.parquet (flattened trainer_state log_history)

Browse files

Rewrote the model card from repo files (configs, trainer_state, logs, git history) and arthrod/gliner_eval_folder results. No weights or configs changed.

Files changed (2) hide show
  1. README.md +202 -23
  2. training_log_history.parquet +3 -0
README.md CHANGED
@@ -1,50 +1,229 @@
1
  ---
2
- library_name: gliner
3
- base_model: microsoft/deberta-v3-base
 
4
  license: apache-2.0
 
 
 
 
5
  tags:
6
  - gliner
7
- - token-classification
8
  - ner
9
  - pii
10
- - ptbr
 
 
 
 
 
 
11
  ---
12
 
13
- # c5k-deberta_base-token_level-1-2
14
 
15
- > **Superseded.** This is an early checkpoint, kept because it has a DOI. For current pt-BR PII
16
- > detection use [arthrod/gliner-mmbert-small-ptbr-pii-full-3x-v1](https://huggingface.co/arthrod/gliner-mmbert-small-ptbr-pii-full-3x-v1)
 
17
  > or the OpenAI Privacy Filter fine-tune [arthrod/gliner-opf-ptbr-pii-v1](https://huggingface.co/arthrod/gliner-opf-ptbr-pii-v1);
18
  > results for both are in [arthrod/gliner-opf-ptbr-pii-bench-v1](https://huggingface.co/datasets/arthrod/gliner-opf-ptbr-pii-bench-v1).
19
 
20
- Token-level GLiNER checkpoint fine-tuned for
21
- Brazilian Portuguese PII detection. Base model: **microsoft/deberta-v3-base**
22
- (~NoneM params).
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
23
 
24
- ## Intended use
 
 
25
 
26
- Brazilian Portuguese PII detection in legal, medical, and
27
- administrative text. Supports any GLiNER-compatible label set
28
- (CPF, RG, email, phone, person name, address, etc.).
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
29
 
30
  ## Limitations
31
 
32
- - Trained primarily on Portuguese text; English/Spanish performance
33
- is not guaranteed.
34
- - Span boundaries depend on tokenization at inference time; take spans from the
35
- model's character offsets and never reconstruct raw text from tokens.
36
- - No benchmark results are published for this checkpoint.
 
37
 
 
 
 
 
38
 
39
  ## Citation
40
 
41
  ```bibtex
42
- @misc{arthrod_gliner_ptbr_pii,
43
  author = {arthrod},
44
- title = {GLiNER Portuguese PII checkpoints},
45
  year = {2026},
 
46
  url = {https://huggingface.co/arthrod/c5k-deberta_base-token_level-1-2}
47
  }
48
- ```
49
 
50
- <!-- auto-generated:2026-04-18 sha=8d8df9d7c52c -->
 
 
 
 
 
 
 
1
  ---
2
+ language:
3
+ - pt
4
+ - en
5
  license: apache-2.0
6
+ library_name: gliner
7
+ pipeline_tag: token-classification
8
+ base_model: urchade/gliner_multi_pii-v1
9
+ base_model_relation: finetune
10
  tags:
11
  - gliner
 
12
  - ner
13
  - pii
14
+ - mdeberta-v3
15
+ - span-level
16
+ - markerV0
17
+ - domain-adaptation
18
+ - spam
19
+ - legacy
20
+ - experiment-log
21
  ---
22
 
23
+ # c5k-deberta_base-token_level-1-2 (legacy: `urchade/gliner_multi_pii-v1` continued on PII-in-spam)
24
 
25
+ > **Superseded.** This is an early checkpoint, kept because it has a DOI
26
+ > ([10.57967/hf/8514](https://doi.org/10.57967/hf/8514)). For current pt-BR PII detection use
27
+ > [arthrod/gliner-mmbert-small-ptbr-pii-full-3x-v1](https://huggingface.co/arthrod/gliner-mmbert-small-ptbr-pii-full-3x-v1)
28
  > or the OpenAI Privacy Filter fine-tune [arthrod/gliner-opf-ptbr-pii-v1](https://huggingface.co/arthrod/gliner-opf-ptbr-pii-v1);
29
  > results for both are in [arthrod/gliner-opf-ptbr-pii-bench-v1](https://huggingface.co/datasets/arthrod/gliner-opf-ptbr-pii-bench-v1).
30
 
31
+ **TL;DR.** This run was launched as `b-gliner-pii-token-multipii-v1-spam-v1` (24 Feb 2026). The repo was
32
+ first published as `arthrod/gliner-pii-token-multipii-v1-spam-v1`, and that URL still redirects here. It is a
33
+ "domain adaptation for PII-in-spam" that continued
34
+ [`urchade/gliner_multi_pii-v1`](https://huggingface.co/urchade/gliner_multi_pii-v1) on the in-house dataset
35
+ `arthrod/gliner-flex-pii-ready-v5` (1,111,948 train / 526,449 eval examples) on one GPU. It was **interrupted
36
+ at step 6,500 of 12,000**, about 0.19 epoch. Eval loss fell steadily from 48.9 (step 500) to 25.1 (step 6,500).
37
+ The root weights are checkpoint-6500, the best and last checkpoint.
38
+
39
+ **The name is wrong on two counts:**
40
+
41
+ 1. **The encoder is mDeBERTa-v3-base, not DeBERTa-v3-base.** The YAML asked for `microsoft/deberta-v3-base`,
42
+ but the run loaded the pretrained `urchade/gliner_multi_pii-v1` (encoder `microsoft/mdeberta-v3-base`,
43
+ vocab 250,105). The training log prints `encoder_config … vocab_size: 250105` and
44
+ `model_name: 'microsoft/mdeberta-v3-base'`. The 1.16 GB weight files have the same size as the mDeBERTa run in
45
+ [c3750-mdeberta_base-vanilla-1-2](https://huggingface.co/arthrod/c3750-mdeberta_base-vanilla-1-2).
46
+ 2. **The model is span-level (`markerV0`), not `token_level`.** The log prints `Model class: UniEncoderSpanGLiNER`,
47
+ `span_mode: 'markerV0'`, `model_type: 'gliner_uni_encoder_span'`. The YAML overrides applied were only
48
+ `max_types 25→100`, `max_neg_type_ratio 3→2`, `dropout 0.4→0.25`.
49
+
50
+ > **Do not load the repo root with GLiNER.** The root `gliner_config.json` was hand-written on 2026-02-24
51
+ > (commits "Create/Update gliner_config.json"). It describes a token-level DeBERTa-v3-base model that does not
52
+ > match the root `pytorch_model.bin`. The Feb-2026 sweep in
53
+ > [arthrod/gliner_eval_folder](https://huggingface.co/datasets/arthrod/gliner_eval_folder) (`EVAL_REPORT.md`)
54
+ > excluded this repo for "50 garbage preds, all scores ~0.50". That fits a config/weights mismatch. Load
55
+ > `checkpoint-6500/` instead: it holds the same weights (identical LFS sha256) with the correct span-level
56
+ > mDeBERTa config.
57
+
58
+ `c5k` and `1-2` in the repo name are not explained anywhere in the repo.
59
+
60
+ ## Related repos
61
+
62
+ | Repo | Type | Role |
63
+ |---|---|---|
64
+ | [arthrod/gliner-mmbert-small-ptbr-pii-full-3x-v1](https://huggingface.co/arthrod/gliner-mmbert-small-ptbr-pii-full-3x-v1) | model | **Current recommended** PT-BR PII GLiNER (mmBERT-small) |
65
+ | [arthrod/gliner-opf-ptbr-pii-v1](https://huggingface.co/arthrod/gliner-opf-ptbr-pii-v1) | model | OpenAI Privacy Filter fine-tune for PT-BR PII (current suite) |
66
+ | [arthrod/gliner-ettin-68m-ptbr-pii-full-3x-v1](https://huggingface.co/arthrod/gliner-ettin-68m-ptbr-pii-full-3x-v1) · [-top50k-v1](https://huggingface.co/arthrod/gliner-ettin-68m-ptbr-pii-top50k-v1) · [ettin-32m](https://huggingface.co/arthrod/gliner-ettin-32m-ptbr-pii-full-3x-v1) | model | Current-suite Ettin GLiNER models |
67
+ | [arthrod/gliner-opf-ptbr-pii-bench-v1](https://huggingface.co/datasets/arthrod/gliner-opf-ptbr-pii-bench-v1) | dataset | Benchmark of the current suite |
68
+ | [arthrod/gliner_review_comparison](https://huggingface.co/datasets/arthrod/gliner_review_comparison) | dataset | Side-by-side review of GLiNER outputs |
69
+ | [arthrod/gliner-opf-ptbr-pii-demo](https://huggingface.co/spaces/arthrod/gliner-opf-ptbr-pii-demo) | space | Interactive demo of the current suite |
70
+ | [arthrod/gliner_eval_folder](https://huggingface.co/datasets/arthrod/gliner_eval_folder) | dataset | Feb-2026 sweep: GLiNER models x 9 eval sets (source of the only task metrics for these legacy repos) |
71
+ | [arthrod/attempt_vanilla](https://huggingface.co/arthrod/attempt_vanilla) | model | Experiment log (24 Feb 2026) of the runs behind `v1-deberta_large-…` and `v1-deberta_small-…` |
72
+ | [arthrod/c3750-mdeberta_base-vanilla-1-2](https://huggingface.co/arthrod/c3750-mdeberta_base-vanilla-1-2) | model | Legacy (Aug 2025): mDeBERTa-v3-base span (markerV0) GLiNER, 15 checkpoints |
73
+ | [arthrod/c5k-deberta_base-token_level-1-2](https://huggingface.co/arthrod/c5k-deberta_base-token_level-1-2) | model | Legacy (Feb 2026): `urchade/gliner_multi_pii-v1` continued on a PII-in-spam corpus, 13 checkpoints |
74
+ | [arthrod/v0-ettin68m-token_level-0-3](https://huggingface.co/arthrod/v0-ettin68m-token_level-0-3) | model | Legacy (Feb 2026): LoRA fine-tune of `knowledgator/gliner-pii-small-v1.0` (Ettin-68M), 25 checkpoints |
75
+ | [arthrod/v1-deberta_large-token_level-1-7](https://huggingface.co/arthrod/v1-deberta_large-token_level-1-7) | model | Legacy (Feb 2026): `knowledgator/gliner-pii-large-v1.0` fine-tuned 8k steps, has eval metrics |
76
+ | [arthrod/v1-deberta_small-token_level-0-6](https://huggingface.co/arthrod/v1-deberta_small-token_level-0-6) | model | Legacy (Feb 2026): failed from-scratch DeBERTa-v3-small run (loss stuck at 0) |
77
+
78
+ ## Quick start
79
+
80
+ Download only the checkpoint you need. A bare `GLiNER.from_pretrained(repo)` reads the wrong root config and may
81
+ pull the whole ~48 GB snapshot. GLiNER 0.2.25 has no `subfolder` argument:
82
+
83
+ ```python
84
+ from huggingface_hub import snapshot_download
85
+ from gliner import GLiNER
86
+
87
+ repo = "arthrod/c5k-deberta_base-token_level-1-2"
88
+ path = snapshot_download(
89
+ repo,
90
+ allow_patterns=["checkpoint-6500/*"],
91
+ ignore_patterns=["*optimizer*", "*rng_state*", "*scheduler*"],
92
+ )
93
+ model = GLiNER.from_pretrained(f"{path}/checkpoint-6500") # span-level mDeBERTa config, same weights as root
94
+
95
+ text = "Ganhe R$ 5.000 agora! Ligue para (11) 98765-4321 ou escreva para promo@exemplo.com.br"
96
+ labels = ["phone number", "email address", "person"]
97
+ for ent in model.predict_entities(text, labels, threshold=0.5):
98
+ print(ent["text"], "->", ent["label"], round(ent["score"], 3))
99
+ ```
100
+
101
+ This snippet was not run against these weights for this card. Training used `transformers` 5.1.0
102
+ (`checkpoint-*/gliner_config.json`).
103
+
104
+ ## Files and checkpoint layout
105
+
106
+ | Path | What it is |
107
+ |---|---|
108
+ | `pytorch_model.bin` | Root weights, the same LFS sha256 as `checkpoint-6500/pytorch_model.bin` (1.16 GB). |
109
+ | `gliner_config.json` (root) | **Wrong for these weights.** Hand-written token-level / DeBERTa-v3-base config (`model_type: gliner_uni_encoder_token`). Kept unchanged. See the warning above. |
110
+ | `tokenizer.json`, `tokenizer_config.json` | mDeBERTa SentencePiece tokenizer (`DebertaV2Tokenizer`, `extra_id_*` tokens). |
111
+ | `onnx/model.onnx` | ONNX export (opset 19, added 2026-03-19, 1.15 GB). Which config it was exported with is not recorded. Verify its outputs before use. |
112
+ | `config.yaml` | Resolved training YAML (run, model, data, training, LoRA [disabled], environment). |
113
+ | `summary_20260224T084509Z.txt`, `validation_20260224T084509Z.log` | Config-validation summary and the start-up log of the run: data sizes, model class, parameter count, the full trainer kwargs. |
114
+ | `training_args.bin` | Pickled `gliner.training.trainer.TrainingArguments` (contains no token: `hub_token: None`). |
115
+ | `checkpoint-<step>/` (13 dirs, every 500 steps) | Full Trainer checkpoints: weights (1.16 GB), `optimizer.pt` (2.31 GB), RNG/scheduler state, `trainer_state.json`, correct GLiNER config, tokenizer. About 3.48 GB each. All 13 `gliner_config.json` files are identical. |
116
+ | `training_log_history.parquet` | Every log entry of `checkpoint-6500/trainer_state.json` as a flat table (added by this card update). |
117
+
118
+ ### Checkpoints
119
 
120
+ Eval loss is from `checkpoint-6500/trainer_state.json`; eval ran on all 526,449 eval examples (about 15–16 min each).
121
+ "Mean train loss" is the mean of the logged train loss (every 10 steps) over the 500 steps before the checkpoint.
122
+ Focal loss with `sum` reduction.
123
 
124
+ | Checkpoint | Epoch | Eval loss | Mean train loss (prev. 500 steps) |
125
+ |---|---:|---:|---:|
126
+ | checkpoint-500 | 0.014 | 48.91 | 54.09 |
127
+ | checkpoint-1000 | 0.029 | 39.05 | 17.64 |
128
+ | checkpoint-1500 | 0.043 | 33.72 | 14.96 |
129
+ | checkpoint-2000 | 0.058 | 31.95 | 13.52 |
130
+ | checkpoint-2500 | 0.072 | 30.82 | 13.43 |
131
+ | checkpoint-3000 | 0.086 | 29.10 | 12.58 |
132
+ | checkpoint-3500 | 0.101 | 30.37 | 12.76 |
133
+ | checkpoint-4000 | 0.115 | 27.71 | 11.61 |
134
+ | checkpoint-4500 | 0.130 | 27.65 | 10.55 |
135
+ | checkpoint-5000 | 0.144 | 27.11 | 11.45 |
136
+ | checkpoint-5500 | 0.158 | 26.94 | 10.70 |
137
+ | checkpoint-6000 | 0.173 | 25.97 | 10.84 |
138
+ | **checkpoint-6500 (= root)** | 0.187 | **25.08** | 11.28 |
139
+
140
+ **Best checkpoint:** checkpoint-6500, which is the lowest eval loss and also the last one. Eval loss was still
141
+ falling when the run was interrupted. Every intermediate step was also pushed as its own commit
142
+ ("Training in progress, step N"), so older weights can be recovered from the git history as well as from the
143
+ `checkpoint-*` folders.
144
+
145
+ ## Training data
146
+
147
+ - Train: `arthrod/gliner-flex-pii-ready-v5`, split `train`, **1,111,948** examples (from `validation_*.log`).
148
+ - Eval: same dataset, split `eval`, **526,449** examples.
149
+ - That dataset is **private**, so its language mix and label set cannot be checked from here. The run's stated goal is
150
+ "Domain adaptation for PII-in-spam" (`config.yaml`, tags `pii, spam, gliner, token_level, domain-adapt, multipii-v1`).
151
+ - An earlier version of this card listed `arthrod/pii-gliner-evals` (private) as the intended holdout and
152
+ `nvidia/gliner-PII` as the intended baseline. No result was ever filled in.
153
+
154
+ ## Training recipe
155
+
156
+ From `config.yaml`, `validation_20260224T084509Z.log` and `training_args.bin` (inspected without unpickling):
157
+
158
+ - Start: `urchade/gliner_multi_pii-v1` (`UniEncoderSpanGLiNER`, mDeBERTa-v3-base, `markerV0`, `max_width 12`,
159
+ `hidden_size 512`, 1 RNN layer, `max_len 384`). 288,949,504 parameters, all trainable (no LoRA).
160
+ - Overrides: `max_types 100`, `max_neg_type_ratio 2`, `dropout 0.25`.
161
+ - Optimizer AdamW (torch); LR encoder 8e-6, LR others 4e-5; weight decay 0.01 / 0.01; cosine schedule, 5% warmup;
162
+ `max_steps 12000`; batch 32 (eval 64); grad clip 1.0; bf16; seed 42.
163
+ - Loss: focal `alpha 0.75`, `gamma 2.0`, `sum` reduction, negatives ratio 2.0, no masking.
164
+ - Eval/save every 500 steps, `save_total_limit 20`; W&B project `gliner-pii`; flash-attention 2 requested.
165
+ - Interrupted at step 6,500/12,000 on 2026-02-24 ("Training interrupted at step 6500/12000" commit).
166
+
167
+ ## Evaluation
168
+
169
+ - The only recorded metric is eval loss (table above).
170
+ - [arthrod/gliner_eval_folder](https://huggingface.co/datasets/arthrod/gliner_eval_folder) `EVAL_REPORT.md`
171
+ (Feb 2026) triaged this repo out of the benchmark: "Noisy predictions … 50 garbage preds, all scores ~0.50
172
+ (embedding resize issue)". That triage loaded the repo root, which has the wrong config (see top). No
173
+ benchmark has been run on `checkpoint-6500/` with its correct config.
174
+
175
+ ### `training_log_history.parquet`
176
+
177
+ | Column | Type | Description |
178
+ |---|---|---|
179
+ | `kind` | string | `train` (logged every 10 steps) or `eval` |
180
+ | `step` | int64 | Global optimizer step |
181
+ | `epoch` | float64 | Fractional epoch |
182
+ | `loss` | float64 | Train loss; null on eval rows |
183
+ | `grad_norm` | float64 | Gradient norm; null on eval rows |
184
+ | `learning_rate` | float64 | LR; null on eval rows |
185
+ | `eval_loss` | float64 | Eval loss; null on train rows |
186
+ | `eval_runtime` | float64 | Eval wall time (s) |
187
+ | `eval_samples_per_second` | float64 | Eval throughput |
188
+
189
+ 663 rows (650 train + 13 eval). Examples:
190
+
191
+ ```json
192
+ [
193
+ {"kind": "train", "step": 6500, "epoch": 0.187, "loss": 14.2946, "grad_norm": 50.52, "learning_rate": 1.890e-05, "eval_loss": null, "eval_runtime": null, "eval_samples_per_second": null},
194
+ {"kind": "eval", "step": 6500, "epoch": 0.187, "loss": null, "grad_norm": null, "learning_rate": null, "eval_loss": 25.083, "eval_runtime": 964.85, "eval_samples_per_second": 545.628}
195
+ ]
196
+ ```
197
 
198
  ## Limitations
199
 
200
+ - No F1/precision/recall has ever been computed for a correctly loaded checkpoint.
201
+ - Root `gliner_config.json` does not match the root weights (see top). The repo name repeats the same two errors
202
+ (encoder and span mode).
203
+ - Only 0.19 epoch of an interrupted schedule (the LR was still at 1.9e-5 for the "others" group when it stopped).
204
+ - Training data is private and was built for spam-domain PII. Behaviour on legal/medical PT-BR text is unknown.
205
+ - Span-level with `max_width 12`: entities longer than 12 words cannot be predicted.
206
 
207
+ ## License
208
+
209
+ Apache-2.0, as declared on this repo, matching the parent `urchade/gliner_multi_pii-v1` (Apache-2.0). The
210
+ `microsoft/mdeberta-v3-base` encoder is MIT.
211
 
212
  ## Citation
213
 
214
  ```bibtex
215
+ @misc{arthrod_c5k_multipii_spam,
216
  author = {arthrod},
217
+ title = {c5k-deberta_base-token_level-1-2 (gliner-pii-token-multipii-v1-spam-v1): GLiNER multi-PII continued on PII-in-spam},
218
  year = {2026},
219
+ doi = {10.57967/hf/8514},
220
  url = {https://huggingface.co/arthrod/c5k-deberta_base-token_level-1-2}
221
  }
 
222
 
223
+ @inproceedings{zaratiana2024gliner,
224
+ title = {GLiNER: Generalist Model for Named Entity Recognition using Bidirectional Transformer},
225
+ author = {Zaratiana, Urchade and Tomeh, Nadi and Holat, Pierre and Charnois, Thierry},
226
+ booktitle = {NAACL},
227
+ year = {2024}
228
+ }
229
+ ```
training_log_history.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:3e65c6e7dfd00c4bd438a3428220ca3c01acdb7329d9a38285b1a9c2b097af80
3
+ size 18814