Imposing Relation Structure in Language-Model Embeddings Using Contrastive Learning

Christos Theodoropoulos, James Henderson, Andrei Catalin Coman, Marie-Francine Moens


Abstract
Though language model text embeddings have revolutionized NLP research, their ability to capture high-level semantic information, such as relations between entities in text, is limited. In this paper, we propose a novel contrastive learning framework that trains sentence embeddings to encode the relations in a graph structure. Given a sentence (unstructured text) and its graph, we use contrastive learning to impose relation-related structure on the token level representations of the sentence obtained with a CharacterBERT (El Boukkouri et al., 2020) model. The resulting relation-aware sentence embeddings achieve state-of-the-art results on the relation extraction task using only a simple KNN classifier, thereby demonstrating the success of the proposed method. Additional visualization by a tSNE analysis shows the effectiveness of the learned representation space compared to baselines. Furthermore, we show that we can learn a different space for named entity recognition, again using a contrastive learning objective, and demonstrate how to successfully combine both representation spaces in an entity-relation task.
Anthology ID:
2021.conll-1.27
Volume:
Proceedings of the 25th Conference on Computational Natural Language Learning
Month:
November
Year:
2021
Address:
Online
Editors:
Arianna Bisazza, Omri Abend
Venue:
CoNLL
SIG:
SIGNLL
Publisher:
Association for Computational Linguistics
Note:
Pages:
337–348
Language:
URL:
https://aclanthology.org/2021.conll-1.27
DOI:
10.18653/v1/2021.conll-1.27
Bibkey:
Cite (ACL):
Christos Theodoropoulos, James Henderson, Andrei Catalin Coman, and Marie-Francine Moens. 2021. Imposing Relation Structure in Language-Model Embeddings Using Contrastive Learning. In Proceedings of the 25th Conference on Computational Natural Language Learning, pages 337–348, Online. Association for Computational Linguistics.
Cite (Informal):
Imposing Relation Structure in Language-Model Embeddings Using Contrastive Learning (Theodoropoulos et al., CoNLL 2021)
Copy Citation:
PDF:
https://aclanthology.org/2021.conll-1.27.pdf
Video:
 https://aclanthology.org/2021.conll-1.27.mp4
Code
 christos42/CLDR_CLNER_models
Data
Adverse Drug Events (ADE) Corpus