Target Word Masking for Location Metonymy Resolution

Haonan Li, Maria Vasardani, Martin Tomko, Timothy Baldwin · DOI

Abstract

Existing metonymy resolution approaches rely on features extracted from external resources like dictionaries and hand-crafted lexical resources. In this paper, we propose an end-to-end word-level classification approach based only on BERT, without dependencies on taggers, parsers, curated dictionaries of place names, or other external resources. We show that our approach achieves the state-of-the-art on 5 datasets, surpassing conventional BERT models and benchmarks by a large margin. We also show that our approach generalises well to unseen data.

Introduction

Metonymy is a linguistic phenomenon where a concept is referred to by the name of a closely associated entity. A common example is location metonymy, such as "Germany lost in the semi-final," where "Germany" refers to a national sports team rather than the geographic landmass. While intuitive for humans, metonymy resolution is a significant challenge for Natural Language Processing (NLP) tasks like Named Entity Recognition (NER) and Word Sense Disambiguation (WSD).

Traditional systems often default to tagging place names as literal locations, ignoring context. Previous attempts to resolve this relied on "hand-crafted" features—complex rules, specialized dictionaries, and syntactic parsers. These methods are inherently brittle; errors in the parser or gaps in the dictionary lead to system failure. This research proposes an end-to-end deep learning approach using BERT that eliminates the need for these external dependencies.

Methodology: Target Word Masking (TWM)

The core innovation is Target Word Masking (TWM) applied during the fine-tuning of BERT (Bidirectional Encoder Representations from Transformers).

In standard fine-tuning, a model is given a sentence and the identity of the "Potentially Metonymic Word" (PMW). However, on smaller datasets, models often develop a "lexical bias," memorizing that specific names (e.g., "Vancouver") are typically metonymic while others are literal, regardless of context. To force the model to rely on linguistic context, the authors replace the target word with a generic [MASK] token during both training and evaluation. By hiding the word's identity, the model must analyze surrounding verbs, adjectives, and structural cues (e.g., "lost," "welcomes," "semi-final") to determine if the missing word represents a literal location or a metonymic entity.

Accuracy over epochs for BERT-BASE and BERT-LG models, demonstrating the performance boost provided by masking (+MASK).

Experimental Setup and Datasets

The model was evaluated across five diverse benchmarks to ensure robustness:

  • SEMEVAL (2007): A classic benchmark for location (LOC) and organization (ORG) metonyms.
  • RELOCAR & CoNLL: Datasets derived from Wikipedia and news sources focused on location metonymy.
  • GWN: A fine-grained dataset of toponyms.
  • WIMCOR: A large-scale, semi-automatically annotated Wikipedia dataset containing 206,000 samples.

Results and Analysis

The proposed BERT-LG+MASK model achieved state-of-the-art (SOTA) results across all datasets, outperforming previous benchmarks by 5.1% on SEMEVAL, 12.2% on RELOCAR, and 4.8% on WIMCOR.

Attention Shift

Visual analysis of the model's internal mechanics reveals why TWM is effective. In the final layers of the neural network, the masked model exhibits a significant shift in attention weights. Compared to the unmasked version, the masked model "attends" much more heavily to context words, confirming that the model is indeed learning patterns of use rather than specific word associations.

Average attention weights across layers for BERT-BASE and BERT-LG models, comparing unmasked (No) vs. masked (Yes) inputs.

Generalization and Extrinsic Value

Because the model learns contextual patterns, it generalizes exceptionally well to "unseen" data—locations not encountered during training. Furthermore, integrating this resolver into a geoparser (a tool mapping text to coordinates) significantly reduced geographic mapping errors by correctly identifying non-literal uses of place names.

Limitations and Future Work

While the masking approach is highly effective, certain challenges remain:

  1. World Knowledge: Some cases require historical or external facts (e.g., recognizing "Vietnam" as a war context).
  2. Complex Syntax: Convoluted sentence structures can still lead to misclassification.
  3. Mixed Meanings: Sentences using a word both literally and metonymically are difficult for binary classifiers.

Future research will explore incorporating broader document context and external knowledge bases to address these complex linguistic scenarios.

Summary updated

BibTeX
@inproceedings{li2020target,
  author = {Haonan Li and Maria Vasardani and Martin Tomko and Timothy Baldwin},
  title = {{Target Word Masking for Location Metonymy Resolution}},
  booktitle = {International Conference on Computational Linguistics},
  year = {2020},
  url = {https://openreview.net/forum?id=67VKFPCU3uW},
}
Figure