Instructions to use QomSSLab/Anonymizer-v3 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use QomSSLab/Anonymizer-v3 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("token-classification", model="QomSSLab/Anonymizer-v3")# Load model directly from transformers import AutoTokenizer, AutoModelForTokenClassification tokenizer = AutoTokenizer.from_pretrained("QomSSLab/Anonymizer-v3") model = AutoModelForTokenClassification.from_pretrained("QomSSLab/Anonymizer-v3", device_map="auto") - Notebooks
- Google Colab
- Kaggle
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
ACOUNTADDRESSAMOUNTDATEDOCUMENT_IDIDJOBOORGORG_BRANCHPERSONPHONEـNUMBERPLATEـ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 |
- Downloads last month
- 22