CokeBERT: Contextual Knowledge Selection and Embedding towards Enhanced Pre-Trained Language Models

Yusheng Su, Xu Han, Zhengyan Zhang, Peng Li, Zhiyuan Liu +3 more
9/29/2020
cs.CLcs.AI

Official code: thunlp/CokeBERT (30 stars, Python, PyTorch, last commit 2023-07-02).

Abstract

Several recent efforts have been devoted to enhancing pre-trained language models (PLMs) by utilizing extra heterogeneous knowledge in knowledge graphs (KGs) and achieved consistent improvements on various knowledge-driven NLP tasks. However, most of these knowledge-enhanced PLMs embed static sub-graphs of KGs ("knowledge context"), regardless of that the knowledge required by PLMs may change dynamically according to specific text ("textual context").

Show full abstract

In this paper, we propose a novel framework named Coke to dynamically select contextual knowledge and embed knowledge context according to textual context for PLMs, which can avoid the effect of redundant and ambiguous knowledge in KGs that cannot match the input text. Our experimental results show that Coke outperforms various baselines on typical knowledge-driven NLP tasks, indicating the effectiveness of utilizing dynamic knowledge context for language understanding. Besides the performance improvements, the dynamically selected knowledge in Coke can describe the semantics of text-related knowledge in a more interpretable form than the conventional PLMs. Our source code and datasets will be available to provide more details for Coke.

View on arXivView PDF

Code Implementations(1)

thunlp/CokeBERTOfficial100%
PyTorch

CokeBERT: Contextual Knowledge Selection and Embedding towards Enhanced Pre-Trained Language Models

309Python, C++Mar 1, 20213 years ago
bertknowledge-graphnlppretrained-language-modelpytorch

Similar Papers

Cite this paper

@article{su2020cokebert,
  title  = {CokeBERT: Contextual Knowledge Selection and Embedding towards Enhanced Pre-Trained Language Models},
  author = {Yusheng Su and Xu Han and Zhengyan Zhang and Peng Li and Zhiyuan Liu and Yankai Lin and Jie Zhou and Maosong Sun},
  year   = {2020},
  eprint = {2009.13964},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2009.13964}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2009.13964.svg)](https://codeofpaper.com/paper/2009.13964)

Discussion