Views
No views yet
This is a redistribution mirror ofbardsai/eu-pii-anonimization— the Polish-only variant of the bards.ai PII detection model family.All weights, tokenizer, and configuration files are byte-identical to the original release by bards.ai, used here under its Apache-2.0 license.This mirror exists so that downstream applications continue to function if the upstream repository becomes unavailable. All credit for training and evaluating this model belongs to bards.ai — please refer to the original repository when accessible.If you are the original author and would like changes (additional attribution, takedown, etc.), please open a discussion or contactwjarkaon Hugging Face.
bardsai/eu-pii-anonimization is a token classification model for detecting personally identifiable information (PII) and other regulated or high-sensitivity entities in Polish-language text.bardsai/eu-pii-anonimization-multilang and shares the same XLM-RoBERTa-base architecture and 35-entity tagging schema.B-/I- labeling, plus O)config.json (id2label and label2id).1from transformers import AutoTokenizer, AutoModelForTokenClassification
2import torch
3
4model_name = "wjarka/eu-pii-anonimization-pl"
5
6tokenizer = AutoTokenizer.from_pretrained(model_name)
7model = AutoModelForTokenClassification.from_pretrained(model_name)
8
9text = "Jan Kowalski, PESEL 80010112345, ul. Marszałkowska 12, Warszawa."
10inputs = tokenizer(text, return_tensors="pt", truncation=True)
11
12with torch.no_grad():
13 outputs = model(**inputs)
14 predictions = torch.argmax(outputs.logits, dim=-1)
15
16tokens = tokenizer.convert_ids_to_tokens(inputs["input_ids"][0])
17labels = [model.config.id2label[p.item()] for p in predictions[0]]
18
19for token, label in zip(tokens, labels):
20 if label != "O":
21 print(label, token)1import { pipeline } from '@huggingface/transformers';
2
3const ner = await pipeline('token-classification', 'wjarka/eu-pii-anonimization-pl', { dtype: 'q8' });
4const out = await ner('Jan Kowalski, PESEL 80010112345.');
5console.log(out);config.json — model config and label mappingtokenizer.json, tokenizer_config.json — tokenizer assetsonnx/model.onnx — exported ONNX model (fp32, ~1.1 GB)onnx/model_quantized.onnx — INT8 quantized ONNX model (~280 MB)