Saltar al contenido
ModelVerificadoExterno
Descargar

Pczarnik Herbert Ner Polish Pii

Fine-tuned pczarnik/herbert-base-ner for detecting personal data (PII) in Polish text.

TipoCheckpointModelo basepczarnik/herbert-base-nerVersiónRevision 26cc980Publicador@ArkadiuszPawlakCcalidad

Fuente del modelo

Tipo
Checkpoint
Tamaño del archivo
119–473 MB
Modelo base
pczarnik/herbert-base-ner
Versión
vRevision 26cc980
Actualizado
3 oct 2026
Descargas
23
Fuente
Hugging Face

Descripción de la fuente

HerBERT NER — Polish PII (ONNX)

Fine-tuned pczarnik/herbert-base-ner for detecting personal data (PII) in Polish text.

Detects: PERSON, ADDRESS (including full address with city, e.g. ul. Lipowej 7 w Krakowie).

Intended use: Polish web forms — browser-side inference via @xenova/transformers + ONNX Runtime Web (WASM), no backend required.

Training data

4 813 training samples (train/dev/test split):

  • KPWr filtered (3 113 samples) — clarin-pl/kpwr-ner Polish press corpus; LOC-only (geographic) and schematic form-label samples removed.
  • LLM-synthetic (1 700 train samples) — generated with GPT-4o-mini and claude-haiku-4-5, covering ADDRESS with city suffix (w Mieście), PERSON in email context, and mixed cases.

Fine-tuned for 8 epochs with early stopping (patience=3), best checkpoint selected by eval F1 (seqeval, micro-averaged over B-PER/I-PER/B-LOC/I-LOC).

Evaluation (kpwr_final_test.json, 615 samples, character-level IoU >= 0.5)

LabelF1PrecRecallTPFPFN
PERSON0.9220.8850.9624255517
ADDRESS0.9440.9030.990102111

ADDRESS recall 0.990 — the model captures full addresses including city names.

Label mapping

The model outputs 5 BIO classes:

Model labelMeaning for this use case
B-PER / I-PERPERSON
B-LOC / I-LOCADDRESS
Onot PII

Files

FileFormatNotes
model.onnxFP32highest quality
model_quantized.onnxINT8recommended for browser
onnx/model_quantized.onnxINT8alias for Transformers.js dtype:"q8"
config.jsonJSONlabel mapping, model config
tokenizer.jsonJSONHerBERT tokenizer

Usage

Python (Transformers)

from transformers import pipeline

ner = pipeline(
    "token-classification",
    model="ArkadiuszPawlak/pczarnik-herbert-ner-polish-pii",
    aggregation_strategy="simple",
)
result = ner("Jan Kowalski mieszka przy ul. Marszałkowskiej 1, 00-001 Warszawa.")
# [{"entity_group": "PER", "word": "Jan Kowalski", ...},
#  {"entity_group": "LOC", "word": "ul. Marszałkowskiej 1, 00-001 Warszawa", ...}]

Browser (@xenova/transformers + ONNX Runtime Web)

import { pipeline } from "@xenova/transformers";

const ner = await pipeline(
    "token-classification",
    "ArkadiuszPawlak/pczarnik-herbert-ner-polish-pii",
    { aggregation_strategy: "simple" }
);

const LABEL_MAP = { PER: "PERSON", LOC: "ADDRESS" };

const raw = await ner("Jan Kowalski mieszka przy ul. Marszałkowskiej 1 w Krakowie.");
const entities = raw
    .filter(e => e.entity_group in LABEL_MAP)
    .map(e => ({ label: LABEL_MAP[e.entity_group], text: e.word, score: e.score }));
console.log(entities);
// [{ label: "PERSON", text: "Jan Kowalski", score: 0.99 },
//  { label: "ADDRESS", text: "ul. Marszałkowskiej 1 w Krakowie", score: 0.97 }]

Fuentes

1 fuente
Hugging FacePrincipalVersión 26cc98018d73ae0c815b8274612f42b6002191e7
huggingface.co/ArkadiuszPawlak/pczarnik-herbert-ner-polish-pii/tree/26cc98018d73ae0c815b8274612f42b6002191e7

Verificado 3 oct

Artefactos del modelo

3 artefactos

model_quantized.onnx

onnx · 119 MB · SHA-256 b06c6c833802…fb2e · Hugging Face

Descargar

model.onnx

onnx · 473 MB · SHA-256 97b44c7442d0…230e · Hugging Face

Descargar

onnx/model_quantized.onnx

onnx · 119 MB · SHA-256 b06c6c833802…fb2e · Hugging Face

Descargar

Extractos de fuentes

3 extractos

--- language: pl license: cc-by-4.0 tags: - token-classification - ner - pii - polish - onnx - bert base_model: pczarnik/herbert-base-ner datasets: - clarin-pl/kpwr-ner --- # HerBERT NER — Polish PII (ONNX) Fine-tuned [`pczarnik/herbert-base-ner`](https://huggingface.co/pczarnik/herbert-base-ner) for detecting personal data (PII) in Polish text. Detects: **PERSON**, **ADDRESS** (including full address with city, e.g. *ul. Lipowej 7 w Krakowie*). Intended use: Polish web forms — browser-side inference via [`@xenova/transformers`](https://github.com/xenova/transformers.js) + ONNX Runtime Web (WASM), no backend required. ## Training data 4 813 training samples (train/dev/test split): - **KPWr filtered** (3 113 samples) — [clarin-pl/kpwr-ner](https://huggingface.co/datasets/clarin-pl/kpwr-ner) Polish press corpus; LOC-only (geographic) and schematic form-label samples removed. - **LLM-synthetic** (1 700 train samples) — generated with GPT-4o-mini and claude-haiku-4-5, covering ADDRESS with city suffix (*w Mieście*), PERSON in email context, and mixed cases. Fine-tuned for 8 epochs with early stopping (patience=3), best checkpoint selected by **eval F1** (seqeval, micro-averaged over B-PER/I-PER/B-LOC/I-LOC). ## Evaluation (`kpwr_final_test.json`, 615 samples, character-level IoU >= 0.5) | Label | F1 | Prec | Recall | TP | FP | FN | |---------|------:|------:|-------:|-----:|-----:|-----:| | PERSON | 0.922 | 0.885 | 0.962 | 425 | 55 | 17 | | ADDRESS | 0.944 | 0.903 | 0.990 | 102 | 11 | 1 | ADDRESS recall 0.990 — the model captures full addresses including city names. ## Label mapping The model outputs 5 BIO classes: | Model label | Meaning for this use case | |-------------|--------------------------| | `B-PER` / `I-PER` | PERSON | | `B-LOC` / `I-LOC` | ADDRESS | | `O` | not PII | ## Files | File | Format | Notes | |------|--------|-------| | `model.onnx` | FP32 | highest quality | | `model_quantized.onnx` | INT8 | **recommended for browser** | | `onnx/model_quantized.onnx` | INT8 | alias for Transformers.js `dtype:"q8"` | | `config.json` | JSON | label mapping, model config | | `tokenizer.json` | JSON | HerBERT tokenizer | ## Usage ### Python (Transformers) ```python from transformers import pipeline ner = pipeline( "token-classification", model="ArkadiuszPawlak/pczarnik-herbert-ner-polish-pii", aggregation_strategy="simple", ) result...

Source context: 23 downloads · 0 likes · Pipeline token-classification · Repo ArkadiuszPawlak/pczarnik-herbert-ner-polish-pii

Source context: 84 downloads · 0 likes · Pipeline token-classification · Repo ArkadiuszPawlak/pczarnik-herbert-ner-polish-pii