A Hybrid Model of Classification and Generation for Spatial Relation Extraction

Feng Wang, Peifeng Li, Qiaoming Zhu

Abstract

Extracting spatial relations from text is a fundamental task for natural language understanding. Previous studies have primarily approached this as a classification task, often ignoring spatial relations with "null roles" due to their sparse information. To address this, we propose HMCGR, a novel hybrid model that combines classification and generation. HMCGR utilizes a generation model to handle null-role relations and a classification model for non-null-role relations, allowing them to complement each other. Furthermore, a reflexivity evaluation mechanism is applied to improve accuracy based on the spatial principle of reflexivity. Experimental results on the SpaceEval dataset demonstrate that HMCGR significantly outperforms state-of-the-art baselines.

Introduction

Spatial Relation Extraction (SRE) involves identifying the positioning of entities relative to one another within a text—for instance, determining the relationship between a "cat" (trajector) and a "table" (landmark) in the phrase "The cat is under the table." While humans process these spatial cues intuitively, automated systems struggle with the inherent nuances and omissions in natural language.

Traditional SRE models typically treat the problem as a classification task, assuming that every spatial triplet—comprising a trajector, a landmark, and a spatial trigger—is explicitly present. However, real-world text frequently contains "null-role" relations where components are implicit or missing (e.g., in "I went biking," the destination or goal is a null role). Standard classifiers often fail in these scenarios because they lack the explicit features required to assign a label. This paper introduces HMCGR (Hybrid Model of Classification, Generation, and Reflexivity) to bridge this gap.

Methodology

The HMCGR framework consists of four integrated modules designed to capture both the structural and linguistic properties of spatial relations:

1. Candidate Triplet Extraction (CTE)

The process begins with a BERT-CRF architecture that identifies potential spatial elements and their roles from raw text, forming the basis for subsequent analysis.

2. Spatial Relation Classification (CLS)

To capture the "geometry" of a sentence, the CLS module employs a Spatial Graph Convolutional Network (GCN). This GCN constructs a graph where nodes represent words and edges represent four distinct relationship types:

  • Sentence Boundaries: Connecting adjacent words.
  • Spatial Element Intersections: Linking related spatial components.
  • Coreferences: Connecting pronouns (e.g., "it," "that") to their original referents, which is critical for resolving landmarks across multiple sentences.
  • Dependency Trees: Capturing grammatical relationships.

3. Spatial Relation Generation (GEN)

The GEN module treats extraction as a translation task. Using a T5 transformer, the model generates a structured sentence describing the spatial relation. Unlike rigid classifiers, the generation approach is flexible; it can "fill in" or gracefully omit missing roles by following learned language patterns, making it uniquely suited for null-role relations.

4. Reflexivity Evaluation (RFX)

To ensure logical consistency, the RFX module applies the principle of reflexivity. For example, if the model identifies that "Object A is inside Object B," it should logically follow that "Object B is around Object A." The model generates an inverted version of the relation and checks for embedding consistency, acting as a mathematical sanity check on the extracted data.

Experimental Results

The model was evaluated using the SpaceEval dataset (SemEval 2015), which categorizes spatial information into Qualitative Spatial Links (QSLINK), Orientation Links (OLINK), and Movement-based Links (MOVELINK).

HMCGR established a new state-of-the-art (SOTA) performance on SpaceEval:

  • F1-Score: HMCGR achieved an F1-score of 70.9, a significant improvement over the BERT-base baseline of 61.2.
  • Recall: The most notable gain was in recall, which jumped from 59.8 to 79.2. This indicates that the hybrid approach is far more effective at identifying relations that traditional models overlook, particularly those with missing components.
  • Ablation Studies: Removing the Spatial GCN or the cross-attention layers resulted in a marked performance decline, confirming that the multi-modal integration of dependency structures and coreference is vital for spatial reasoning.

Discussion and Conclusion

The success of HMCGR highlights the power of viewing relation extraction through a dual lens of classification and generation. By incorporating coreference edges, the model successfully addressed the fact that nearly 20% of spatial relations in the dataset involve demonstrative pronouns. Furthermore, the inclusion of logical constraints via the reflexivity mechanism helped the model learn the underlying "physics" of spatial relations rather than just statistical word distributions.

However, limitations remain. The GEN module, when used in isolation, still underperforms the CLS module, likely due to the limited training data available for complex spatial generation. Additionally, the model occasionally struggles when a single sentence contains both full and null-role relations. Future research will focus on refining the T5 decoder to better handle these overlapping, heterogeneous spatial structures.

Summary updated

Abstract

Extracting spatial relations from texts is a fundamental task for natural language understanding and previous studies only regard it as a classification task, ignoring those spatial relations with null roles due to their poor information. To address the above issue, we first view spatial relation extraction as a generation task and propose a novel hybrid model HMCGR for this task. HMCGR contains a generation and a classification model, while the former can generate those null-role relations and the latter can extract those non-null-role relations to complement each other. Moreover, a reflexivity evaluation mechanism is applied to further improve the accuracy based on the reflexivity principle of spatial relation. Experimental results on SpaceEval show that HMCGR outperforms the SOTA baselines significantly.
BibTeX
@inproceedings{wang2022hybrid,
  author = {Feng Wang and Peifeng Li and Qiaoming Zhu},
  title = {{A Hybrid Model of Classification and Generation for Spatial Relation Extraction}},
  booktitle = {International Conference on Computational Linguistics},
  year = {2022},
  url = {https://openreview.net/forum?id=P5tmcFJdPs},
}
Figure