Entity Linking: Disambiguation and Knowledge Base Population
Module: Natural Language Processing | Difficulty: Advanced
Entity Linking Pipeline
- Mention detection
- Candidate generation
- Disambiguation
Disambiguation Score
Knowledge Base Population
Evaluation
| Model | ACE 2004 | AIDA-CoNLL |
|---|---|---|
| Prior only | 85.2 | 78.3 |
| Context | 91.5 | 86.7 |
| BERT-based | 94.2 | 91.3 |
import torch
import torch.nn as nn
class EntityLinker(nn.Module):
def __init__(self, bert_model, n_entities):
super().__init__()
self.bert = bert_model
self.entity_embeddings = nn.Embedding(n_entities, 768)
self.classifier = nn.Linear(768*2, 1)
def forward(self, mention_repr, entity_ids):
entity_repr = self.entity_embeddings(entity_ids)
combined = torch.cat([mention_repr.expand_as(entity_repr), entity_repr], dim=-1)
return self.classifier(combined).squeeze(-1)
Research Insight: Entity linking benefits from both local context and global coherence. The key challenge is handling entities not in the knowledge base (NIL prediction). Recent models achieve 94%+ accuracy on standard benchmarks.