一个模型同时识别实体和关系,支持零样本推理。
GLiNER-Relex: A Unified Framework for Joint Named Entity Recognition and Relation Extraction

- 统一架构共享编码器,联合处理实体与关系抽取。
- 在4个基准上表现媲美专用模型,且推理高效。
- 支持任意类型标签的零样本推理,适合知识图谱构建。
联合命名实体识别(NER)与关系抽取(RE)是自然语言处理中从非结构化文本构建知识图谱的基础任务。现有方法通常将两者视为独立任务并使用不同模型,我们提出GLiNER-Relex,一种基于GLiNER框架的统一架构,可在单一模型中完成实体识别与关系抽取。该方法利用共享的双向Transformer编码器,联合表示文本、实体类型标签与关系类型标签,实现推理时任意实体与关系类型的零样本提取。通过识别的实体跨度构建实体对表示,并使用专用的关系评分模块,将其与关系类型嵌入进行匹配。我们在CoNLL04、DocRED、FewRel和CrossRE四个标准基准上评估模型,结果表明其性能可与专用关系抽取模型及大语言模型比肩,同时保持GLiNER家族的计算效率。模型以开源Python包形式发布,提供简洁的推理API,支持在推理时指定任意实体与关系类型标签,并单次调用返回实体与关系三元组。所有模型与代码均公开可用。
原文摘要 · Abstract (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.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。