Views
No views yet
This is a redistribution mirror ofbardsai/eu-pii-anonimization-multilang.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-multilang is a token classification model for detecting personally identifiable information (PII) and other regulated or high-sensitivity entities in multilingual text.B-/I- labeling)config.json (id2label and label2id).1from transformers import AutoTokenizer, AutoModelForTokenClassification
2import torch
3
4model_name = "wjarka/eu-pii-anonimization-multilang"
5
6tokenizer = AutoTokenizer.from_pretrained(model_name)
7model = AutoModelForTokenClassification.from_pretrained(model_name)
8
9text = "John Smith, passport AB123456, phone +48 123 456 789"
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)model.safetensors — model weightsconfig.json — model config and label mappingtokenizer.json, tokenizer_config.json — tokenizer assetstraining_args.bin — training metadataonnx/model.onnx — exported ONNX model (fp32)onnx/model_quantized.onnx — INT8 quantized ONNX model