DeBERTa-CRF-VotIE: Portuguese Voting Information Extraction
This model is a fine-tuned DeBERTa v3 Base with a Conditional Random Fields (CRF) layer for extracting structured voting information from Portuguese municipal meeting minutes. It achieves state-of-the-art performance on the VotIE benchmark dataset.
Model Description
DeBERTa-CRF-VotIE combines the robust contextual representations of Microsoft's DeBERTa v3 multilingual base model with a CRF layer for structured sequence prediction. The model performs token-level classification to identify and extract voting-related entities from Portuguese administrative text.
Key Features
Architecture: DeBERTa v3 Base (768-dim, 12 layers) + Linear + CRF
Task: Squence Labeling with BIO tagging
Language: Portuguese (Portugal)
Domain: Municipal meeting minutes and voting records
Entity Types: 8 types (17 labels with BIO encoding)
Performance: 93.00% entity-level F1 score
Intended Uses
This model is designed for:
Extracting voting information from Portuguese municipal documents
Identifying participants and their voting positions (favor, against, abstention, absent)
Recognizing voting subjects and counting methods
Structuring unstructured administrative text
Research in information extraction from Portuguese administrative documents
Entity Types
The model recognizes 8 entity types in BIO format (17 labels total):
Entity Type
Description
Example
VOTER-FAVOR
Participants who voted in favor
"The Municipal Executive"
VOTER-AGAINST
Participants who voted against
"João Silva"
VOTER-ABSTENTION
Participants who abstained
"The councilor from PS"
VOTER-ABSENT
Participants who were absent
"Ana Simões"
VOTING
Voting action expressions
"deliberado", "aprovado"
SUBJECT
The subject matter being voted on
"budget changes"
COUNTING-UNANIMITY
Unanimous vote indicators
"unanimously"
COUNTING-MAJORITY
Majority vote indicators
"by majority"
Training Details
Training Data
The model was trained on the VotIE dataset, which consists of Portuguese municipal meeting minutes annotated with voting information:
Training set: 1,737 examples
Validation set: 433 examples
Test set: 433 examples
Total tokens: ~300K tokens
Total entities: ~5K entities
Training Procedure
Hyperparameters:
Base model: microsoft/deberta-v3-base
Batch size: 16
Learning rate: 5e-5 (linear decay with warmup)
Warmup proportion: 10%
Weight decay: 0.01
Dropout: 0.1
Max sequence length: 512 tokens
Epochs: 10
Optimizer: AdamW
Training time: ~1.5 hours on NVIDIA L40 GPU
Training Details:
Class imbalance handling with weighted loss (O-tag weight: 0.01)
O-tag bias initialization (bias: 6.0) to prevent model collapse
Windowing for long documents (512 tokens with 50-token overlap)
Early stopping with patience=3 epochs
BIO constraint validation during evaluation
Results
Entity-Level Performance (Test Set)
Metric
Score
F1 Score
93.00%
Precision
91.08%
Recall
95.01%
Per-Entity Performance
Entity Type
Precision
Recall
F1 Score
Support
COUNTING-MAJORITY
92.86%
100.00%
96.30%
52
COUNTING-UNANIMITY
94.47%
100.00%
97.16%
222
SUBJECT
84.22%
84.45%
84.34%
373
VOTER-ABSENT
95.45%
95.45%
95.45%
22
VOTER-ABSTENTION
88.46%
100.00%
93.88%
138
VOTER-AGAINST
97.44%
95.00%
96.20%
40
VOTER-FAVOR
92.19%
97.25%
94.66%
255
VOTING
94.50%
98.26%
96.34%
402
Comparison with Other Models
This model achieves the best performance among all tested architectures on the VotIE dataset:
1from transformers import AutoTokenizer, AutoModel
23# Load model4model_name ="Anonymous3445/DeBERTa-CRF-VotIE"5tokenizer = AutoTokenizer.from_pretrained(model_name, trust_remote_code=True)6model = AutoModel.from_pretrained(model_name, trust_remote_code=True)78# Analyze text9text ="O Executivo deliberou aprovar o projeto por unanimidade."10inputs = tokenizer(text, return_tensors="pt")11predictions = model.decode(**inputs, tokenizer=tokenizer, text=text)1213# Print results14for pred in predictions:15print(f"{pred['word']:20}{pred['label']}")
Output:
O B-VOTER-FAVOR
Executivo I-VOTER-FAVOR
deliberou B-VOTING
aprovar O
o O
projeto O
por B-COUNTING-UNANIMITY
unanimidade. I-COUNTING-UNANIMITY
Extract Entities
Get structured entities from voting documents:
python
1from transformers import AutoTokenizer, AutoModel
23model_name ="Anonymous3445/DeBERTa-CRF-VotIE"4tokenizer = AutoTokenizer.from_pretrained(model_name, trust_remote_code=True)5model = AutoModel.from_pretrained(model_name, trust_remote_code=True)67text ="""A Câmara Municipal deliberou aprovar a proposta apresentada pelo
8Senhor Presidente. Votaram a favor os Senhores Vereadores João Silva e
9Maria Costa. Votou contra o Senhor Vereador Pedro Santos."""1011inputs = tokenizer(text, return_tensors="pt")12predictions = model.decode(**inputs, tokenizer=tokenizer, text=text)1314# Extract entities by type15entities ={}16current_entity =[]17current_type =None1819for pred in predictions:20 label = pred['label']21 word = pred['word']2223if label.startswith('B-'):24# Save previous entity25if current_entity:26 entity_type = current_type.replace('B-','').replace('I-','')27if entity_type notin entities:28 entities[entity_type]=[]29 entities[entity_type].append(' '.join(current_entity))30# Start new entity31 current_entity =[word]32 current_type = label
3334elif label.startswith('I-')and current_entity:35 current_entity.append(word)3637else:# O tag38if current_entity:39 entity_type = current_type.replace('B-','').replace('I-','')40if entity_type notin entities:41 entities[entity_type]=[]42 entities[entity_type].append(' '.join(current_entity))43 current_entity =[]44 current_type =None4546# Save last entity47if current_entity:48 entity_type = current_type.replace('B-','').replace('I-','')49if entity_type notin entities:50 entities[entity_type]=[]51 entities[entity_type].append(' '.join(current_entity))5253# Print entities54for entity_type, entity_list in entities.items():55print(f"\n{entity_type}:")56for entity in entity_list:57print(f" - {entity}")
Output:
VOTER-FAVOR:
- A Câmara Municipal
- João Silva
- Maria Costa
VOTING:
- deliberou
VOTER-AGAINST:
- Pedro Santos
With Character Offsets
Useful for highlighting entities in your UI:
python
1from transformers import AutoTokenizer, AutoModel
23model_name ="Anonymous3445/DeBERTa-CRF-VotIE"4tokenizer = AutoTokenizer.from_pretrained(model_name, trust_remote_code=True)5model = AutoModel.from_pretrained(model_name, trust_remote_code=True)67text ="O Executivo deliberou aprovar o projeto por unanimidade."8inputs = tokenizer(text, return_tensors="pt")910# Get predictions with character positions11predictions = model.decode(**inputs, tokenizer=tokenizer, text=text, return_offsets=True)1213# Show only entities (non-O tags)14for pred in predictions:15if pred['label']!='O':16print(f"{pred['word']:20}{pred['label']:25} [{pred['start']}:{pred['end']}]")
Output:
O B-VOTER-FAVOR [0:1]
Executivo I-VOTER-FAVOR [1:11]
deliberou B-VOTING [11:21]
por B-COUNTING-UNANIMITY [39:43]
unanimidade. I-COUNTING-UNANIMITY [43:56]
Limitations and Bias
Limitations
Domain-specific: Trained specifically on Portuguese municipal meeting minutes; may not generalize well to other document types
Portuguese only: Optimized for European Portuguese;
Sequence length: Limited to 512 tokens per window (handles longer documents via windowing)
Entity types: Limited to 8 predefined voting-related entity types
Complex sentences: May struggle with highly complex or nested voting descriptions
Bias Considerations
Geographic bias: Training data predominantly from Portuguese municipalities; may not capture regional variations
Temporal bias: Training data from municipal minutes of specific time periods
Formality bias: Trained on formal administrative language; informal voting descriptions may be less accurate
Class imbalance: O-tag (non-entity) and rare voter types tokens significantly outnumber entity tokens; addressed with class weighting
Model Card Authors
Anonymous Authors (for blind review)
Model Card Contact
For questions or issues, please open an issue in the GitHub repository.