Anonymizer-v3 / README.md
QomSSLab's picture
Upload README.md with huggingface_hub
8e670e1 verified
|
Raw
History Blame Contribute Delete
1.6 kB
metadata
language: fa
pipeline_tag: token-classification
library_name: transformers

QomSSLab/Anonymizer-v3

This repository hosts an XLM-RoBERTa token-classification head trained.

Usage

from transformers import AutoTokenizer, AutoModelForTokenClassification, pipeline

model_id = "QomSSLab/Anonymizer-v3"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForTokenClassification.from_pretrained(model_id)
tagger = pipeline("token-classification", model=model, tokenizer=tokenizer, aggregation_strategy="simple")

text = "مثال از یک ورودی فارسی"
for entity in tagger(text):
    print(entity)

Labels

  • ACOUNT
  • ADDRESS
  • AMOUNT
  • DATE
  • DOCUMENT_ID
  • ID
  • JOB
  • O
  • ORG
  • ORG_BRANCH
  • PERSON
  • PHONEـNUMBER
  • PLATEـNUMBER

Metrics

Validation Metrics

  • Precision: 0.9336
  • Recall: 0.9508
  • F1: 0.9421
  • Accuracy: 0.9923

Per-label Breakdown

Label Precision Recall F1 Support
ACOUNT 1.0000 0.4750 0.6441 40
ADDRESS 0.9987 0.9993 0.9990 1519
AMOUNT 0.9941 1.0000 0.9970 168
DATE 0.9836 0.9938 0.9887 484
DOCUMENT_ID 0.9660 0.9906 0.9781 1378
ID 0.9427 1.0000 0.9705 181
JOB 1.0000 0.4286 0.6000 35
O 0.9960 0.9982 0.9971 16164
ORG 0.7961 0.9213 0.8542 89
ORG_BRANCH 0.9911 0.9321 0.9607 839
PERSON 0.9924 0.9931 0.9928 1454
PHONEـNUMBER 1.0000 0.9417 0.9700 206
PLATEـNUMBER 1.0000 1.0000 1.0000 0