GLiNER-Relex:一個用於聯合命名實體識別與關係抽取的統一框架
GLiNER-Relex: A Unified Framework for Joint Named Entity Recognition and Relation Extraction
May 11, 2026
作者: Ihor Stepanov, Oleksandr Lukashov, Mykhailo Shtopko, Vivek Kalyanarangan
cs.AI
摘要
聯合命名實體識別(NER)與關係提取(RE)是自然語言處理中從非結構化文本建構知識圖譜的基本任務。儘管近期方法將NER與RE視為需要獨立模型的個別任務,我們提出GLiNER-Relex——一種統一架構,將GLiNER框架擴展,以單一模型同時執行實體識別與關係提取。我們的方法利用共享的雙向變壓器編碼器,共同表示文本、實體類型標籤與關係類型標籤,從而能在推論即時指定任意實體與關係類型時進行零樣本提取。GLiNER-Relex從識別出的區間建構實體對表示,並透過專用的關係評分模組,將這些表示與關係類型嵌入進行比對評分。我們在四個標準關係提取基準資料集(CoNLL04、DocRED、FewRel 與 CrossRE)上評估模型,結果顯示在維持GLiNER系列計算效率特性的同時,與專門的關係提取模型及大型語言模型相比,皆具有競爭力。本模型以開源Python套件形式發布,附帶簡潔的推論API,允許使用者在推論時指定任意實體與關係類型標籤,並透過單次呼叫同時取得實體與關係三元組。所有模型與程式碼均公開提供。
English
Joint named entity recognition (NER) and relation extraction (RE) is a fundamental task in natural language processing for constructing knowledge graphs from unstructured text. While recent approaches treat NER and RE as separate tasks requiring distinct models, we introduce GLiNER-Relex, a unified architecture that extends the GLiNER framework to perform both entity recognition and relation extraction in a single model. Our approach leverages a shared bidirectional transformer encoder to jointly represent text, entity type labels, and relation type labels, enabling zero-shot extraction of arbitrary entity and relation types specified at inference time. GLiNER-Relex constructs entity pair representations from recognized spans and scores them against relation type embeddings using a dedicated relation scoring module. We evaluate our model on four standard relation extraction benchmarks: CoNLL04, DocRED, FewRel, and CrossRE, and demonstrate competitive performance against both specialized relation extraction models and large language models, while maintaining the computational efficiency characteristic of the GLiNER family. The model is released as an open-source Python package with a simple inference API that allows users to specify arbitrary entity and relation type labels at inference time and obtain both entities and relation triplets in a single call. All models and code are publicly available.