Divergence-Aware Hallucination-Remediated SRL Projection
A Python framework for improving cross-lingual Semantic Role Labeling (SRL) projection using divergence-aware alignment and hallucination mitigation techniques.
DAHRS is a framework for projecting semantic role labels (SRL) across languages while addressing a key challenge:
- Hallucinated role alignments — incorrect or spurious mappings that arise from cross-lingual divergences (naturally occurring structural and lexical differences between languages)
The system builds on alignment analysis techniques and introduces strategies to improve projection quality through:
- Divergence-aware alignment handling
- Function word filtering
- Structured alignment resolution (FCFA: First-Come-First-Assign)
This repo goes along with the paper:
"DAHRS: Divergence-Aware Hallucination-Remediated SRL Projection"
It covers the ideas, methods, and experiments behind what's behind implemented here.
https://arxiv.org/abs/2407.09283
Captures and analyzes:
- One-to-many alignments
- Many-to-one alignments
- Structural mismatches between languages
Reduces incorrect alignments by:
- Filtering function words
- Removing inconsistent mappings
- Prioritizing stable alignment structures
Implements a First-Come-First-Assign (FCFA) approach:
- Sequential alignment resolution
- Conflict reduction in many-to-one mappings
- Improved consistency in projected labels
from fcfa_framework import FCFAFramework
framework = FCFAFramework()
src_tokens = {0: "I", 1: "do", 2: "n't", 3: "know"}
tgt_tokens = {0: "Je", 1: "ne", 2: "sais", 3: "pas"}
framework.load_alignment_output("0-0 1-1 2-3 3-2", (src_tokens, tgt_tokens))
print(framework.get_alignment_statistics())