Please wait a minute...
Frontiers of Computer Science

ISSN 2095-2228

ISSN 2095-2236(Online)

CN 10-1014/TP

Postal Subscription Code 80-970

2018 Impact Factor: 1.129

Front. Comput. Sci.    2025, Vol. 19 Issue (2) : 192308    https://doi.org/10.1007/s11704-023-3305-4
Artificial Intelligence
Integrating element correlation with prompt-based spatial relation extraction
Feng WANG, Sheng XU, Peifeng LI(), Qiaoming ZHU
School of Computer Science and Technology, Soochow University, Suzhou 215006, China
 Download: PDF(3418 KB)   HTML
 Export: BibTeX | EndNote | Reference Manager | ProCite | RefWorks
Abstract

Spatial relations in text refer to how a geographical entity is located in space in relation to a reference entity. Extracting spatial relations from text is a fundamental task in natural language understanding. Previous studies have only focused on generic fine-tuning methods with additional classifiers, ignoring the importance of the semantic correlation between different spatial elements and the large offset between the relation extraction task and the pre-trained models. To address the above two issues, we propose a spatial relation extraction model based on Dual-view Prompt and Element Correlation (DPEC). Specifically, we first reformulate spatial relation extraction as a mask language model with a Dual-view Prompt (i.e., Link Prompt and Confidence Prompt). Link Prompt can not only guide the model to incorporate more contextual information related to the spatial relation extraction task, but also better adapt to the original pre-training task of the language models. Meanwhile, Confidence Prompt can measure the confidence of candidate triplets in Link Prompt and work as a supplement to identify those easily confused examples in Link Prompt. Moreover, we incorporate the element correlation to measure the consistency between different spatial elements, which is an effective cue for identifying the rationality of spatial relations. Experimental results on the popular SpaceEval show that our DPEC significantly outperforms the SOTA baselines.

Keywords spatial relation extraction      Dual-view Prompt      spatial element correlation      Link Prompt      Confidence Prompt     
Corresponding Author(s): Peifeng LI   
About author: Li Liu and Yanqing Liu contributed equally to this work.
Just Accepted Date: 26 December 2023   Issue Date: 22 April 2024
 Cite this article:   
Feng WANG,Sheng XU,Peifeng LI, et al. Integrating element correlation with prompt-based spatial relation extraction[J]. Front. Comput. Sci., 2025, 19(2): 192308.
 URL:  
https://academic.hep.com.cn/fcs/EN/10.1007/s11704-023-3305-4
https://academic.hep.com.cn/fcs/EN/Y2025/V19/I2/192308
Fig.1  An example of spatial relation extraction where three spatial relations are extracted from the sentences
Fig.2  Overall structure of our model DPEC
Fig.3  Candidate triplet extraction
Tool/parameter Version/value
Pytorch 1.7.0+cu110
BERT bert-base-uncased
Allennlp 2.6.0
Learning rate 2e-5
Batch size 8
Random seed 1024
Hidden size 768
Optimizer AdamW
GPU NVIDIA RTX 3090
CPU i7
Tab.1  Key parameters and tools used in our model
Model P R F1
OpenIE 82.0 80.2 81.1
BERT+CRF 88.1 91.2 89.1
Tab.2  The results of spatial role extraction
Model QSLINK OLINK MOVELINK Overall
P R F1 P R F1 P R F1 P R F1
SpRL-CWW 66.1 53.8 59.4 69.1 51.7 59.1 57.1 45.1 50.4 63.6 50.1 56.1
R-BERT 45.1 58.3 50.5 71.0 69.6 70.2 62.7 61.5 62.1 62.7 59.8 61.2
HMCGR 53.5 73.1 61.1 73.1 85.2 78.6 66.8 83.0 73.9 64.3 79.2 70.9
DPEC 81.0 80.8 80.9 57.0 73.8 63.3 91.3 92.0 91.6 76.4 82.2 79.2
Tab.3  Performance comparison between the baselines and our DPEC on SpaceEval. Since R-BERT did not report the results on each category, we run their sharing codes to obtain the results (underlined)
Base model P R F1
BERT 76.4 82.2 79.2
ROBERTa 66.9 80.1 72.9
T5 72.4 80.9 76.4
GPT2 71.1 82.0 77.1
Tab.4  Performance comparison of different base models
Model Parameter number
R-BERT 110 M
HMCGR 330 M
DPEC 110 M
Tab.5  Comparison of parameters in different models
Model QSLINK OLINK MOVELINK Overall
P R F1 P R F1 P R F1 P R F1
DPEC 81.0 80.8 80.9 57.0 73.8 63.3 91.3 92.0 91.6 76.4 82.2 79.2
w/o element correlation ?18.7 ?9.8 ?15.4 ?5.8 ?13.1 ?8.3 ?22.3 ?5.0 ?15.6 ?15.6 ?9.3 ?13.7
w/o Link Prompt ?10.3 ?1.3 ?6.2 ?8.0 ?10.1 ?8.0 ?8.6 ?2.3 ?5.9 ?8.9 ?4.5 ?7.3
w/o Confidence Prompt ?2.0 0.0 ?1.1 ?2.0 0.0 ?0.5 +1.0 0.0 +0.7 ?1.0 0.0 ?0.9
w/o L&C ?23.7 ?5.5 ?12.9 ?4.5 ?25.5 ?16.8 ?12.6 ?3.0 ?8.6 ?13.6 ?7.7 ?12.4
Tab.6  The results of our DEPD and its simplified versions on SpaceEval where L&C refers to Link Prompt and Confidence Prompt
Fig.4  Three sub-relation distances of spatial elements for BERT (upper line) and DPEC (bottom line), where the red, yellow and blue color refer to MOVELINK, OLINK and QSLINK, respectively. (a) BERT-TM-TR; (b) BERT-TM-LG; (c) BERT-LG-TR; (d) DPED-TM-TR; (e) DPED-TM-LG; (f) DPED-LG-TR
Fig.5  Trigger distribution of QSLINKs and MOVELINKs
Model P R F1
DPEC 76.4 82.2 79.2
TM-TR 73.5 80.7 76.3
LG-TR 70.0 78.1 73.3
TM-LG 60.8 72.9 65.5
Tab.7  Results on different sub-relations
Model P R F1
DPEC 76.4 82.2 79.2
* 70.5 75.7 73.0
? 75.2 81.9 78.4
cos 72.5 82.2 78.7
Tab.8  Results on different methods of integrating element correlation
Link Prompt P R F1
In this sentence tm tr lg form a [MASK] 76.4 82.2 79.2
Within this sentence, you can find a [MASK] triplet, which is (tm, tr, lg) 74.4 80.2 77.2
In the construction of this sentence, (tm, tr, lg) is utilized as the [MASK] triplet 72.6 82.1 77.0
Tab.9  Performance comparison of three different Link Prompts
Model car on hill we at lawn woman in table
R-BERT OLINK NOLINK QSLINK
LP OLINK QSLINK QSLINK
CP QSLINK NOLINK OLINK
L&C QSLINK QSLINK NOLINK
Tab.10  Examples of prediction in the simplified models of DPEC
Model 5% 30% 50% 75% 100%
DPEC 50.4 59.2 70.2 73.3 79.2
BERT 23.5 30.7 50.0 60.1 61.2
HMCGR 30.0 34.1 55.2 65.2 70.9
Tab.11  F1 results on few-shot settings
Fig.6  Example of the errors in QSLINK and OLINK
  
  
  
  
1 L, Zhang R, Wang J, Zhou J, Yu Z, Ling H Xiong . Joint intent detection and entity linking on spatial domain queries. In: Proceedings of Findings of Association for Computational Linguistics: EMNLP 2020. 2020, 4937−4947
2 T Y, Yang A, Lan K Narasimhan . Robust and interpretable grounding of spatial references with relation networks. In: Proceedings of Findings of the Association for Computational Linguistics: EMNLP 2020. 2020, 1908−1923
3 C, Song Y, Lin S, Guo H Wan . Spatial-temporal synchronous graph convolutional networks: a new framework for spatial-temporal network data forecasting. In: Proceedings of the 34th AAAI Conference on Artificial Intelligence. 2020, 914−921
4 J, Pustejovsky P, Kordjamshidi M, Moens A, Levine S, Dworman Z Yocum . SemEval-2015 task 8: SpaceEval. In: Proceedings of the 9th International Workshop on Semantic Evaluation. 2015, 884−894
5 J, Pustejovsky J L, Moszkowicz M Verhagen . Using ISO-space for annotating spatial information. In: Proceedings of International Conference on Spatial Information Theory. 2011
6 J, Devlin M W, Chang K, Lee K Toutanova . BERT: pre-training of deep bidirectional transformers for language understanding. In: Proceedings of 2019 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1. 2019, 4171−4186
7 T B, Brown B, Mann N, Ryder M, Subbiah J, Kaplan , et al.. Language models are few-shot learners. In: Proceedings of the 34th International Conference on Neural Information Processing Systems, 2020, 159
8 N, Ramrakhiyani G, Palshikar V Varma . A simple neural approach to spatial role labelling. In: Proceedings of the 41st European Conference on IR Research on Advances in Information Retrieval. 2019, 102−108
9 Shin H J, Park J Y, Yuk D B, Lee J S. BERT-based spatial information extraction. In: Proceedings of the 3rd International Workshop on Spatial Language Understanding. 2020, 10−17
10 T, Shin Y, Razeghi IV R L, Logan E, Wallace S Singh . AutoPrompt: eliciting knowledge from language models with automatically generated prompts. In: Proceedings of 2020 Conference on Empirical Methods in Natural Language Processing. 2020, 4222−4235
11 T, Schick H Schütze . It’s not just size that matters: small language models are also few-shot learners. In: Proceedings of 2021 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies. 2021, 2339−2352
12 I, Mani C, Doran D, Harris J, Hitzeman R, Quimby J, Richer B, Wellner S, Mardis S Clancy . SpatialML: annotation scheme, resources, and evaluation. Language Resources and Evaluation, 2010, 44( 3): 263–280
13 P, Kordjamshidi Otterlo M, van M F Moens . Spatial role labeling: towards extraction of spatial relations from natural language. ACM Transactions on Speech and Language Processing, 2011, 8( 3): 4
14 Kordjamshidi P, Bethard S, Moens M F. SemEval-2012 task 3: spatial role labeling. In: Proceedings of the 1st Joint Conference on Lexical and Computational Semantics – Volume 1: Proceedings of the Main Conference and the Shared Task, and Volume 2: Proceedings of the 6th International Workshop on Semantic Evaluation. 2012, 365−373
15 Kolomiyets O, Kordjamshidi P, Moens M F, Bethard S. Semeval-2013 task 3: spatial role labeling. In: Proceedings of the 2nd Joint Conference on Lexical and Computational Semantics (*SEM), Volume 2: Proceedings of the 7th International Workshop on Semantic Evaluation. 2013, 255−262
16 E, Nichols F Botros . SpRL-CWW: spatial relation classification with independent multi-class models. In: Proceedings of the 9th International Workshop on Semantic Evaluation. 2015, 895−901
17 J, Pennington R, Socher C Manning . GloVe: global vectors for word representation. In: Proceedings of 2014 Conference on Empirical Methods in Natural Language Processing. 2014, 1532−1543
18 J, D’Souza V Ng . Sieve-based spatial relation extraction with expanding parse trees. In: Proceedings of 2015 Conference on Empirical Methods in Natural Language Processing. 2015, 758−768
19 H, Salaberri O, Arregi B Zapirain . IXAGroupEHUSpaceEval: (X-space) a WordNet-based approach towards the automatic recognition of spatial information following the ISO-space annotation scheme. In: Proceedings of the 9th International Workshop on Semantic Evaluation. 2015, 856−861
20 T, Rahgooy U, Manzoor P Kordjamshidi . Visually guided spatial relation extraction from text. In: Proceedings of 2018 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 2. 2018, 788−794
21 Q, Qiu Z, Xie K, Ma Z, Chen L Tao . Spatially oriented convolutional neural network for spatial relation extraction from natural language texts. Transactions in GIS, 2022, 26( 2): 839–866
22 V, Blukis C, Paxton D, Fox A, Garg Y Artzi . A persistent spatial semantic representation for high-level natural language instruction execution. In: Proceedings of the 5th Conference on Robot Learning. 2022, 706−717
23 S, Wu Y He . Enriching pre-trained language model with entity information for relation classification. In: Proceedings of the 28th ACM International Conference on Information and Knowledge Management. 2019, 2361−2364
24 F, Wang P, Li Q Zhu . A hybrid model of classification and generation for spatial relation extraction. In: Proceedings of the 29th International Conference on Computational Linguistics. 2022, 1915−1924
25 Y K, Chia L, Bing S, Poria L Si . RelationPrompt: leveraging prompts to generate synthetic data for zero-shot relation triplet extraction. In: Proceedings of Findings of Association for Computational Linguistics: ACL 2022. 2022, 45−57
26 X, Han W, Zhao N, Ding Z, Liu M Sun . PTR: prompt tuning with rules for text classification. AI Open, 2022, 3: 182–192
[1] FCS-23305-OF-FW_suppl_1 Download
Viewed
Full text


Abstract

Cited

  Shared   
  Discussed