Swedish Lemmatizer (int8 ONNX)
Per-language lemmatizer and UPOS tagger fine-tuned from KB/bert-base-swedish-cased on UD Swedish-Talbanken. Predicts an edit-tree label per token; applying it to the surface word yields the lemma. Dynamic-int8 quantized ONNX (~120 MB).
Accuracy (UD test, dynamic int8, valid-label masking ON)
| Metric | int8 | fp (reference) |
|---|---|---|
| Lemma accuracy | 63.8% | 63.8% |
| UPOS accuracy | 66.71% | N/A |
int8 trades accuracy for size; the fp16/torch model is several points higher (UPOS head is most affected by quantization).
CRITICAL: valid-label masking
Plain argmax over edit-tree labels often picks a label that is structurally invalid for the word (its delete-segment does not match), applying it fails and accuracy collapses. At inference you MUST iterate candidate labels in descending logit order and pick the first whose edit applies to the word (identity is the guaranteed fallback). This is model-internal selection, not a hand-written rule.
Files
model.int8.onnx: inputsinput_ids,attention_mask; outputsupos_logits,lemma_logitsconfig.json,tokenizer.json,tokenizer_config.json,special_tokens_map.jsonid2label.json/label2id.json: edit-tree lemma labelsupos_id2label.json/upos_label2id.json: UPOS labelsedit_trees.json: edit-tree label definitionslexicon.json: fallback {word: lemma} lexicon
- Downloads last month
- 27
Model tree for Jonandrop/kb-lemma-sv
Base model
KB/bert-base-swedish-cased