amanraj74/MHIPEX

0

stars

50

commits

Jupyter Notebook

primary language

Aug 27, 2026

updated

README

MHIPEX Architecture

MHIPEX

Multilingual Historical Person–Place Relation Extraction
A Calibrated Transformer Ensemble with Relation-Specific Language-Adaptive Routing

License Python PyTorch Transformers HIPE-2026


Overview

MHIPEX is a research framework for extracting person–place relations from multilingual historical newspaper archives. Given a (person, location) entity pair and its surrounding newspaper article, MHIPEX classifies two distinct relations:

RelationQuestionClasses
atDid this person have a geographical connection to this place?FALSE · PROBABLE · TRUE
isAtIs this person physically at this place around the article's publication date?FALSE · TRUE

The system operates across three languages (English, French, German) and is evaluated using macro-recall (MR) across both relations — a metric that penalizes models which ignore rare classes.

Authors: Aman Jaiswal & Dr. Sarika Jain
Affiliation: National Institute of Technology Kurukshetra, India
Target Journal: Knowledge-Based Systems (Elsevier)


Key Results

Official HIPE-2026 Test Set

SystemMRat RecallisAt Recall
MHIPEX-RLAE (Ours)0.6094 ± 0.00160.52160.6972
LIA-Avignon (1st Place HIPE)0.58420.50110.6673
UvA-ILPS (2nd Place HIPE)0.56100.48550.6365
Mistral-7B (4-bit, few-shot)0.42810.35820.4980

Development Set (2,081 pairs)

SystemMRatisAt
Majority class baseline0.3330.3330.333
mBERT0.42700.35430.4997
hmBERT (calibrated)0.55270.45040.6550
mDeBERTa-v3 (best single)0.57980.47140.6882
Fixed ensemble (β = 0.60)0.60570.51340.6980
MHIPEX-RLAE0.6148 ± 0.00210.53040.6993
  • +43.9% relative improvement over mBERT baseline
  • +6.0% relative improvement over best single model (mDeBERTa-v3)
  • Statistical significance confirmed: McNemar's χ² = 40.01, p = 2.53 × 10⁻¹⁰

Architecture

MHIPEX employs a dual-encoder architecture with post-hoc ensemble routing:

 Newspaper Article + Entity Pair
              │
    ┌─────────┴─────────┐
    ▼                   ▼
 Input Enrichment    Input Enrichment
 (<P>, <L>, <DATE>,  (<P>, <L>, <DATE>,
  <LANG> markers)     <LANG> markers)
    │                   │
    ▼                   ▼
 mDeBERTa-v3         XLM-RoBERTa
  (278M)              Large (560M)
    │                   │
 CLS + Mean Pooling  CLS + Mean Pooling
 + Multi-Sample      + Multi-Sample
   Dropout (K=3)       Dropout (K=3)
    │                   │
 Dual Heads          Dual Heads
 (at: 3-way,         (at: 3-way,
  isAt: 2-way)        isAt: 2-way)
    │                   │
    └─────────┬─────────┘
              ▼
   RLAE: Relation-Specific
   Language-Adaptive Ensemble
   (per-relation, per-language
    β weights + τ thresholds)
              │
              ▼
       Final Predictions

What Makes RLAE Novel

RLAE (Relation-Specific Language-Adaptive Ensemble) is a conditional Mixture-of-Experts gating mechanism that learns independent mixing weights for each (relation type × language) combination. Unlike global ensembling:

  • Spatial reasoning (at) benefits from mDeBERTa-v3's disentangled attention
  • Temporal reasoning (isAt) varies by language — XLM-R Large dominates for French, while mDeBERTa-v3 is stronger for German
  • The weight matrix β is fully interpretable and requires no model retraining

Experiments

All experiments are designed to run on Kaggle with 2 × NVIDIA T4 GPUs (16 GB VRAM each). Each script is fully self-contained — paste into a single notebook cell and run.

#ExperimentScriptOutput
1Master Pipeline (Official Test Set)mhipex_master_pipeline.pyresults/
2Main Training (v31)kaggle_mhipex_v31_a1.py + a2.pyModel checkpoints
3RLAE Optimizationkaggle_mhipex_rlae.pyout_rlae/
4Ablation Study (A0–A6)kaggle_mhipex_ablations.pyablation_results.csv
5Cross-Dataset Validationkaggle_mhipex_crossval.pycrossval_results.csv
6Entity-Marker Baselinekaggle_mhipex_entity_marker_baseline.pyentity_marker_results.csv
7KG Augmentation (Single)kaggle_mhipex_kg.pykg_results.csv
8Multi-KG (Wikidata / GeoNames / Getty)kaggle_mhipex_multikg.pymulti_kg_results.csv
9OCR-Noise Robustnesskaggle_mhipex_ocr_robustness.pyocr_robustness_results.csv

Quick Start (Kaggle)

  1. Open Kaggle → New Notebook
  2. Set Accelerator → GPU T4 × 2, Internet → ON
  3. Paste the contents of any .py script into a single cell
  4. Run — data downloads automatically from this repository

Quick Start (Local)

git clone https://github.com/amanraj74/MHIPEX.git
cd MHIPEX
pip install torch transformers datasets scikit-learn pandas tqdm
python mhipex_master_pipeline.py

Project Structure

MHIPEX/
│
├── paper/
│   ├── main.tex                              # Full paper source (journal format)
│   ├── compile_pdf.py                        # LaTeX → PDF with embedded figures
│   └── figures/
│       ├── architecture1.png                 # System architecture diagram
│       ├── fig1_label_distribution.png       # Class distribution visualization
│       ├── fig2_confusion_matrices.png       # Confusion matrices (at + isAt)
│       └── fig6_error_analysis.png           # Error category breakdown
│
├── data/
│   ├── de-train.jsonl / de-dev.jsonl         # German data
│   ├── en-train.jsonl / en-dev.jsonl         # English data
│   └── fr-train.jsonl / fr-dev.jsonl         # French data
│
├── mhipex_master_pipeline.py                 # End-to-end: train → evaluate → report
├── kaggle_mhipex_v31_a1.py                   # Training cell 1: setup + mDeBERTa-v3
├── kaggle_mhipex_v31_a2.py                   # Training cell 2: XLM-R Large
├── kaggle_mhipex_rlae.py                     # RLAE weight optimization
├── kaggle_mhipex_ablations.py                # Ablation study (A0–A6)
├── kaggle_mhipex_crossval.py                 # Cross-dataset / zero-shot transfer
├── kaggle_mhipex_entity_marker_baseline.py   # Soares et al. entity-marker baseline
├── kaggle_mhipex_kg.py                       # Single KG augmentation experiment
├── kaggle_mhipex_multikg.py                  # Multi-KG comparison experiment
├── kaggle_mhipex_ocr_robustness.py           # OCR noise robustness experiment
├── run_mcnemar.py                            # Statistical significance test
├── gen_architecture.py                       # Architecture figure generator
│
├── *_results.csv                             # Experiment result files
├── results/                                  # Official test set metrics
└── README.md

Requirements

DependencyVersion
Python3.10+
PyTorch2.x (CUDA)
Transformers4.44.2
scikit-learn1.3+
pandas2.0+
GPUNVIDIA T4 16 GB or better

Paper

Title: MHIPEX: A Calibrated Transformer Ensemble for Multilingual Person–Place Relation Extraction in Historical Newspapers

Authors: Aman Jaiswal, Sarika Jain (NIT Kurukshetra)

Paper Structure

SectionContent
§1 IntroductionProblem formulation, 5 Research Questions (RQs), contributions
§2 Related WorkMultilingual transformers, document-level RE, KG integration, literature survey
§3 Dataset & MethodologyTask definition, architecture, RLAE algorithm, calibration
§4 Experimental SetupBaselines, hyperparameters, reproducibility
§5 Results & AnalysisPerformance tables, ablations, RLAE analysis, error analysis
§6 Core ExtensionsKG augmentation, OCR robustness, ontology constraints
§7 LimitationsHonest assessment of current system boundaries
§8 Future WorkHIPE-2027, RAG-RE, GNN extensions
§9 ConclusionSummary of contributions and findings

Key Tables

TableContent
Table 1Comprehensive literature survey (2019–2026)
Table 2Dataset statistics & class distribution
Table 3Hyperparameter configuration
Table 4Main results (all backbones + ensemble)
Table 5Per-language performance breakdown
Table 6Computational cost comparison
Table 7Official test set results vs. leaderboard
Table 8Class-wise precision / recall / F1
Table 9Ablation study (A0–A6)
Table 10Cross-dataset & zero-shot transfer
Table 11RLAE weight matrix (β)
Table 12KG augmentation results
Table 13OCR noise robustness

Citation

@article{jaiswal2026mhipex,
  title     = {MHIPEX: A Calibrated Transformer Ensemble for Multilingual
               Person--Place Relation Extraction in Historical Newspapers},
  author    = {Jaiswal, Aman and Jain, Sarika},
  journal   = {Knowledge-Based Systems},
  publisher = {Elsevier},
  year      = {2026},
  note      = {Under review}
}

License

This project is released under the MIT License. If you use any part of this work in your research, please cite our paper.


Built with ❤️ at NIT Kurukshetra

Contributors

amanraj74

50 commits

amanraj74/MHIPEX

0

stars

50

commits

Jupyter Notebook

primary language

Aug 27, 2026

updated

README

MHIPEX Architecture

MHIPEX

Multilingual Historical Person–Place Relation Extraction
A Calibrated Transformer Ensemble with Relation-Specific Language-Adaptive Routing

License Python PyTorch Transformers HIPE-2026


Overview

MHIPEX is a research framework for extracting person–place relations from multilingual historical newspaper archives. Given a (person, location) entity pair and its surrounding newspaper article, MHIPEX classifies two distinct relations:

RelationQuestionClasses
atDid this person have a geographical connection to this place?FALSE · PROBABLE · TRUE
isAtIs this person physically at this place around the article's publication date?FALSE · TRUE

The system operates across three languages (English, French, German) and is evaluated using macro-recall (MR) across both relations — a metric that penalizes models which ignore rare classes.

Authors: Aman Jaiswal & Dr. Sarika Jain
Affiliation: National Institute of Technology Kurukshetra, India
Target Journal: Knowledge-Based Systems (Elsevier)


Key Results

Official HIPE-2026 Test Set

SystemMRat RecallisAt Recall
MHIPEX-RLAE (Ours)0.6094 ± 0.00160.52160.6972
LIA-Avignon (1st Place HIPE)0.58420.50110.6673
UvA-ILPS (2nd Place HIPE)0.56100.48550.6365
Mistral-7B (4-bit, few-shot)0.42810.35820.4980

Development Set (2,081 pairs)

SystemMRatisAt
Majority class baseline0.3330.3330.333
mBERT0.42700.35430.4997
hmBERT (calibrated)0.55270.45040.6550
mDeBERTa-v3 (best single)0.57980.47140.6882
Fixed ensemble (β = 0.60)0.60570.51340.6980
MHIPEX-RLAE0.6148 ± 0.00210.53040.6993
  • +43.9% relative improvement over mBERT baseline
  • +6.0% relative improvement over best single model (mDeBERTa-v3)
  • Statistical significance confirmed: McNemar's χ² = 40.01, p = 2.53 × 10⁻¹⁰

Architecture

MHIPEX employs a dual-encoder architecture with post-hoc ensemble routing:

 Newspaper Article + Entity Pair
              │
    ┌─────────┴─────────┐
    ▼                   ▼
 Input Enrichment    Input Enrichment
 (<P>, <L>, <DATE>,  (<P>, <L>, <DATE>,
  <LANG> markers)     <LANG> markers)
    │                   │
    ▼                   ▼
 mDeBERTa-v3         XLM-RoBERTa
  (278M)              Large (560M)
    │                   │
 CLS + Mean Pooling  CLS + Mean Pooling
 + Multi-Sample      + Multi-Sample
   Dropout (K=3)       Dropout (K=3)
    │                   │
 Dual Heads          Dual Heads
 (at: 3-way,         (at: 3-way,
  isAt: 2-way)        isAt: 2-way)
    │                   │
    └─────────┬─────────┘
              ▼
   RLAE: Relation-Specific
   Language-Adaptive Ensemble
   (per-relation, per-language
    β weights + τ thresholds)
              │
              ▼
       Final Predictions

What Makes RLAE Novel

RLAE (Relation-Specific Language-Adaptive Ensemble) is a conditional Mixture-of-Experts gating mechanism that learns independent mixing weights for each (relation type × language) combination. Unlike global ensembling:

  • Spatial reasoning (at) benefits from mDeBERTa-v3's disentangled attention
  • Temporal reasoning (isAt) varies by language — XLM-R Large dominates for French, while mDeBERTa-v3 is stronger for German
  • The weight matrix β is fully interpretable and requires no model retraining

Experiments

All experiments are designed to run on Kaggle with 2 × NVIDIA T4 GPUs (16 GB VRAM each). Each script is fully self-contained — paste into a single notebook cell and run.

#ExperimentScriptOutput
1Master Pipeline (Official Test Set)mhipex_master_pipeline.pyresults/
2Main Training (v31)kaggle_mhipex_v31_a1.py + a2.pyModel checkpoints
3RLAE Optimizationkaggle_mhipex_rlae.pyout_rlae/
4Ablation Study (A0–A6)kaggle_mhipex_ablations.pyablation_results.csv
5Cross-Dataset Validationkaggle_mhipex_crossval.pycrossval_results.csv
6Entity-Marker Baselinekaggle_mhipex_entity_marker_baseline.pyentity_marker_results.csv
7KG Augmentation (Single)kaggle_mhipex_kg.pykg_results.csv
8Multi-KG (Wikidata / GeoNames / Getty)kaggle_mhipex_multikg.pymulti_kg_results.csv
9OCR-Noise Robustnesskaggle_mhipex_ocr_robustness.pyocr_robustness_results.csv

Quick Start (Kaggle)

  1. Open Kaggle → New Notebook
  2. Set Accelerator → GPU T4 × 2, Internet → ON
  3. Paste the contents of any .py script into a single cell
  4. Run — data downloads automatically from this repository

Quick Start (Local)

git clone https://github.com/amanraj74/MHIPEX.git
cd MHIPEX
pip install torch transformers datasets scikit-learn pandas tqdm
python mhipex_master_pipeline.py

Project Structure

MHIPEX/
│
├── paper/
│   ├── main.tex                              # Full paper source (journal format)
│   ├── compile_pdf.py                        # LaTeX → PDF with embedded figures
│   └── figures/
│       ├── architecture1.png                 # System architecture diagram
│       ├── fig1_label_distribution.png       # Class distribution visualization
│       ├── fig2_confusion_matrices.png       # Confusion matrices (at + isAt)
│       └── fig6_error_analysis.png           # Error category breakdown
│
├── data/
│   ├── de-train.jsonl / de-dev.jsonl         # German data
│   ├── en-train.jsonl / en-dev.jsonl         # English data
│   └── fr-train.jsonl / fr-dev.jsonl         # French data
│
├── mhipex_master_pipeline.py                 # End-to-end: train → evaluate → report
├── kaggle_mhipex_v31_a1.py                   # Training cell 1: setup + mDeBERTa-v3
├── kaggle_mhipex_v31_a2.py                   # Training cell 2: XLM-R Large
├── kaggle_mhipex_rlae.py                     # RLAE weight optimization
├── kaggle_mhipex_ablations.py                # Ablation study (A0–A6)
├── kaggle_mhipex_crossval.py                 # Cross-dataset / zero-shot transfer
├── kaggle_mhipex_entity_marker_baseline.py   # Soares et al. entity-marker baseline
├── kaggle_mhipex_kg.py                       # Single KG augmentation experiment
├── kaggle_mhipex_multikg.py                  # Multi-KG comparison experiment
├── kaggle_mhipex_ocr_robustness.py           # OCR noise robustness experiment
├── run_mcnemar.py                            # Statistical significance test
├── gen_architecture.py                       # Architecture figure generator
│
├── *_results.csv                             # Experiment result files
├── results/                                  # Official test set metrics
└── README.md

Requirements

DependencyVersion
Python3.10+
PyTorch2.x (CUDA)
Transformers4.44.2
scikit-learn1.3+
pandas2.0+
GPUNVIDIA T4 16 GB or better

Paper

Title: MHIPEX: A Calibrated Transformer Ensemble for Multilingual Person–Place Relation Extraction in Historical Newspapers

Authors: Aman Jaiswal, Sarika Jain (NIT Kurukshetra)

Paper Structure

SectionContent
§1 IntroductionProblem formulation, 5 Research Questions (RQs), contributions
§2 Related WorkMultilingual transformers, document-level RE, KG integration, literature survey
§3 Dataset & MethodologyTask definition, architecture, RLAE algorithm, calibration
§4 Experimental SetupBaselines, hyperparameters, reproducibility
§5 Results & AnalysisPerformance tables, ablations, RLAE analysis, error analysis
§6 Core ExtensionsKG augmentation, OCR robustness, ontology constraints
§7 LimitationsHonest assessment of current system boundaries
§8 Future WorkHIPE-2027, RAG-RE, GNN extensions
§9 ConclusionSummary of contributions and findings

Key Tables

TableContent
Table 1Comprehensive literature survey (2019–2026)
Table 2Dataset statistics & class distribution
Table 3Hyperparameter configuration
Table 4Main results (all backbones + ensemble)
Table 5Per-language performance breakdown
Table 6Computational cost comparison
Table 7Official test set results vs. leaderboard
Table 8Class-wise precision / recall / F1
Table 9Ablation study (A0–A6)
Table 10Cross-dataset & zero-shot transfer
Table 11RLAE weight matrix (β)
Table 12KG augmentation results
Table 13OCR noise robustness

Citation

@article{jaiswal2026mhipex,
  title     = {MHIPEX: A Calibrated Transformer Ensemble for Multilingual
               Person--Place Relation Extraction in Historical Newspapers},
  author    = {Jaiswal, Aman and Jain, Sarika},
  journal   = {Knowledge-Based Systems},
  publisher = {Elsevier},
  year      = {2026},
  note      = {Under review}
}

License

This project is released under the MIT License. If you use any part of this work in your research, please cite our paper.


Built with ❤️ at NIT Kurukshetra

Contributors

amanraj74

50 commits

Languages

Jupyter Notebook

45.2%

Python

37.9%

TeX

16.9%