CoolFace
Modelpublic

inesctec/CitiLink-XLMR-Anonymization-pt

sourceHugging Faceotherupdated 6mo agoView on Hugging Face
0likes12downloads
Model Card

XLMR-Base-Council-Anonymizer: Personal Data Identification for Portuguese Municipal Meeting Minutes

This model consists of a fine-tuned XLM-RoBERTa Base for the extraction and identification of sensitive personal data in minutes of Portuguese municipal meetings.

Model Description

The XLMR-BCA the multilingual contextual representations of FacebookAI's XLM-RoBERTa, specifically optimized for the linguistic and formal structure of administrative minutes in Portugal. Unlike generic NER models, this model was trained with Weighted Cross-Entropy Loss to handle class imbalance, allowing for effective detection even in entities with few occurrences.

Key Features

  • 🏛️ Specialized for Municipal Minutes: Fine-tuned on authentic Portuguese council meeting minutes
  • 🛡️ Privacy-Focused NER: Identifies and classifies sensitive entities (PII) to support automatic anonymization processes.
  • ⚙️ Transformer-based Architecture: It uses the power of XLM-RoBERTa to capture the grammatical and formal context of administrative documents.

Model Details

  • Base Model: XLM-RoBERTa Base
  • Architecture: Token Classification (NER) com Weighted Cross-Entropy Loss
  • Parameters: ~270M
  • Max Sequence Length: 512 tokens
  • Fine-tuning Dataset: 120 Portuguese meeting minutes (6 municipalities)
  • Evaluation Metrics: F1-Score, Recall and Precision
  • Training Framework: PyTorch + Transformers + Seqeval

Entity Types

The model recognizes 19 entity types in BIO format (49 labels total):

Entity TypeDescriptionExample
PERSONAL-NAMEProper names of individualsJoão Silva
PERSONAL-ADMINAdministrative identifiers and case/process numbers5597/2023
PERSONAL-POSITIONProfessional roles, political positions, or technical functionsDiretor do Departamento dos Recursos Humanos
PERSONAL-ADDRESSAddresses, street names, and door/plot numbersRua das Flores n.º 10, Avenida Central
PERSONAL-DATEDates of events, decisions, or time periods20/05/2023
PERSONAL-LOCATIONCities, parishes, districts, or geographic locationsFreguesia do Porto
PERSONAL-OTHERGeneric personal information and miscellaneous contact dataReferências de contacto, dados diversos
PERSONAL-INFOBiographical data or sensitive personal information11490753
PERSONAL-COMPANYCompanies or private legal entitiesConstruções & Filho, Lda
PERSONAL-ARTISTICNomes artísticos, pseudónimosPintura
PERSONAL-DEGREEAcademic titles or professional degreesLicenciatura de Psicologia
PERSONAL-TIMEReferences to specific times14:30h
PERSONAL-LICENSELicense plates or registration numbers48-RF-99
PERSONAL-JOBPerson’s profession or occupation.Professor
PERSONAL-VEHICLEVehicle identification and modelsMercedes-Benz Classe S
PERSONAL-FACULTYHigher education institutions or university facultiesFaculdade de Economia da Universidade do Porto
PERSONAL-FAMILYMentions of kinship, family relationships, or heirsMarido

How It Works

The model performs token-level classification, analyzing each word individually based on its linguistic context. Through this analysis, the system identifies patterns to detect sensitive information using the labels mentioned above and assigns specific labels that allow for the automatic anonymization of the data.

INPUT:

O interessado João Silva submeteu o processo administrativo 5597/2023 no dia 20/05/2023, relativo ao imóvel localizado na Rua das Flores n.º 10.

Output:

O interessado <NAME> submeteu o processo administrativo <ADMIN> no dia <DATE>, relativo ao imóvel localizado na <ADDRESS>.

Results

Entity-Level Performance (Test Set)
MetricScore
F1 ScoreX%
PrecisionX%
RecallX%
Per-Entity Performance
Entity TypePrecisionRecallF1 ScoreSupport
PERSONAL-NAME1186
PERSONAL-ADMIN1186
PERSONAL-POSITION716
PERSONAL-ADDRESS368
PERSONAL-DATE249
PERSONAL-LOCATION191
PERSONAL-OTHER70
PERSONAL-INFO43
PERSONAL-COMPANY29
PERSONAL-TIME22
PERSONAL-LICENSE19
PERSONAL-DEGREE18
PERSONAL-VEHICLE14
PERSONAL-FAMILY7
PERSONAL-FACULTY6
PERSONAL-ARTISTIC4

Usage

Quick Start

The simplest way to use the model:

python
from transformers import pipeline

model_name = "anonymous270126/XLMR-anonymization-council-pt"

nlp = pipeline("ner", model=model_name, tokenizer=model_name, aggregation_strategy="simple")

text = "A reunião foi presidida por Manuel Brito no concelho de Alandroal."

results = nlp(text)

for entity in results:
    print(f"Entidade: {entity['word']} | Categoria: {entity['entity_group']} | Score: {entity['score']:.4f}")

Limitations

  • Domain Specificity: Best performance on administrative/governmental meeting minutes
  • Domain-specific: Trained specifically on Portuguese municipal meeting minutes; may not generalize well to other document types
  • Sequence length: Limited to 512 tokens per window

Version: 1.0 Last Updated: 2026-01-27


License

This project uses a custom dual-license based on AGPL v3.

See the full license terms here: LICENSE