《计算机应用》唯一官方网站 ›› 2025, Vol. 45 ›› Issue (5): 1496-1503.DOI: 10.11772/j.issn.1001-9081.2024050676
• 人工智能 • 上一篇
胡婕1,2,3, 吴翠1, 孙军1,2,3(), 张龑1,2,3
收稿日期:
2024-05-27
修回日期:
2024-08-28
接受日期:
2024-08-30
发布日期:
2024-09-05
出版日期:
2025-05-10
通讯作者:
孙军
作者简介:
胡婕(1977—),女,湖北汉川人,教授,博士,主要研究方向:复杂语义大数据管理、自然语言处理基金资助:
Jie HU1,2,3, Cui WU1, Jun SUN1,2,3(), Yan ZHANG1,2,3
Received:
2024-05-27
Revised:
2024-08-28
Accepted:
2024-08-30
Online:
2024-09-05
Published:
2025-05-10
Contact:
Jun SUN
About author:
HU Jie, born in 1977, Ph. D., professor. Her research interests include complex semantic big data management, natural language processing.Supported by:
摘要:
在文档级关系抽取(DocRE)任务中,现有模型主要侧重于学习文档中实体间的交互,忽略了对实体内部结构的学习,并很少关注到文档中的代词指代识别问题以及对逻辑规则的应用,这导致模型对文档中实体间关系的建模不够准确。因此,基于Transformer的架构融合关系回指图,建模实体间交互和实体内部结构,从而利用回指将更多上下文信息聚合到相应实体上以提高关系抽取的准确性。此外,采用数据驱动方式从关系注释中挖掘逻辑规则,增强对文本隐含逻辑关系的理解和推理能力。针对样本不平衡问题,引入加权长尾损失函数提高对稀有关系的识别准确性。在2个公开数据集DocRED(Document-level Relation Extraction Dataset)和Re-DocRED(Revisiting Document-level Relation Extraction Dataset)上的实验结果表明,所提模型性能表现最优,在DocRED测试集上,基于BERT编码器的模型的IgnF1和F1值比基线模型ATLOP(Adaptive Thresholding and Localized cOniext Pooling)分别提高了1.79和2.09个百分点,可见所提模型的综合性能较高。
中图分类号:
胡婕, 吴翠, 孙军, 张龑. 基于回指与逻辑推理的文档级关系抽取模型[J]. 计算机应用, 2025, 45(5): 1496-1503.
Jie HU, Cui WU, Jun SUN, Yan ZHANG. Document-level relation extraction model based on anaphora and logical reasoning[J]. Journal of Computer Applications, 2025, 45(5): 1496-1503.
数据集 | 集合 | 文档数 | 平均 实体数 | 平均 元组数 | 平均 句子数 |
---|---|---|---|---|---|
DocRED | train | 3 053 | 19.5 | 12.5 | 7.9 |
dev | 1 000 | 19.6 | 12.3 | 8.1 | |
Re-DocRED | train | 3 053 | 19.4 | 28.1 | 7.9 |
dev | 500 | 19.4 | 34.6 | 8.2 | |
test | 500 | 19.6 | 34.9 | 7.9 |
表1 实验数据集描述
Tab. 1 Experimental datasets description
数据集 | 集合 | 文档数 | 平均 实体数 | 平均 元组数 | 平均 句子数 |
---|---|---|---|---|---|
DocRED | train | 3 053 | 19.5 | 12.5 | 7.9 |
dev | 1 000 | 19.6 | 12.3 | 8.1 | |
Re-DocRED | train | 3 053 | 19.4 | 28.1 | 7.9 |
dev | 500 | 19.4 | 34.6 | 8.2 | |
test | 500 | 19.6 | 34.9 | 7.9 |
数据集 | 编码器 | 训练轮数 | 学习率/10-4 | 批量大小 | 逻辑规则 置信度 | 证据损失 比率 |
---|---|---|---|---|---|---|
DocRED | BERT | 30 | 0.5 | 4 | 0.70 | 0.10 |
RoBERTa | 30 | 0.3 | 4 | 0.70 | 0.10 | |
Re-DocRED | RoBERTa | 30 | 0.3 | 4 | 0.65 | 0.05 |
表2 参数设置
Tab. 2 Parameter setting
数据集 | 编码器 | 训练轮数 | 学习率/10-4 | 批量大小 | 逻辑规则 置信度 | 证据损失 比率 |
---|---|---|---|---|---|---|
DocRED | BERT | 30 | 0.5 | 4 | 0.70 | 0.10 |
RoBERTa | 30 | 0.3 | 4 | 0.70 | 0.10 | |
Re-DocRED | RoBERTa | 30 | 0.3 | 4 | 0.65 | 0.05 |
编码器 | 模型 | 开发集 | 测试集 | ||||
---|---|---|---|---|---|---|---|
IgnF1 | F1 | EviF1 | IgnF1 | F1 | EviF1 | ||
BERT | ATLOP[ | 59.22 | 61.09 | — | 59.31 | 61.30 | — |
E2GRE[ | 55.22 | 58.72 | 47.12 | — | — | — | |
DocuNet[ | 59.86 | 61.83 | — | 59.93 | 61.86 | — | |
CorefDRE[ | 60.78 | 60.82 | 54.54 | 56.96 | |||
SAIS[ | 59.98 | 62.96 | 53.70 | 60.96 | 62.77 | 52.88 | |
Eider[ | 60.51 | 62.48 | 50.71 | 60.42 | 62.47 | 51.27 | |
DREEAM[ | 60.51 | 62.55 | 52.08 | 60.03 | 62.49 | 51.71 | |
AA[ | 61.31 | 63.38 | — | 60.84 | 63.10 | — | |
本文模型 | 61.43 | 63.54 | 52.53 | 61.10 | 63.39 | 52.66 | |
RoBERTa | ATLOP[ | 61.32 | 63.18 | — | 61.39 | 63.40 | — |
E2GRE[ | — | — | — | 60.30 | 62.50 | 50.5 | |
DocuNet[ | 62.23 | 64.12 | — | 62.39 | 64.55 | — | |
SAIS[ | 62.23 | 65.17 | 55.84 | 63.44 | 65.11 | 55.67 | |
Eider[ | 62.34 | 64.27 | 52.54 | 62.85 | 64.79 | 53.01 | |
DREEAM[ | 62.29 | 64.20 | 54.15 | 62.12 | 64.27 | 54.01 | |
AA[ | 63.15 | 65.19 | — | 62.88 | 64.98 | — | |
本文模型 | 63.37 | 65.35 | 54.77 | 63.01 | 65.30 | 54.58 |
表 3 不同模型在DocRED数据集的性能对比 ( %)
Tab. 3 Performance comparison of different models on DocRED dataset
编码器 | 模型 | 开发集 | 测试集 | ||||
---|---|---|---|---|---|---|---|
IgnF1 | F1 | EviF1 | IgnF1 | F1 | EviF1 | ||
BERT | ATLOP[ | 59.22 | 61.09 | — | 59.31 | 61.30 | — |
E2GRE[ | 55.22 | 58.72 | 47.12 | — | — | — | |
DocuNet[ | 59.86 | 61.83 | — | 59.93 | 61.86 | — | |
CorefDRE[ | 60.78 | 60.82 | 54.54 | 56.96 | |||
SAIS[ | 59.98 | 62.96 | 53.70 | 60.96 | 62.77 | 52.88 | |
Eider[ | 60.51 | 62.48 | 50.71 | 60.42 | 62.47 | 51.27 | |
DREEAM[ | 60.51 | 62.55 | 52.08 | 60.03 | 62.49 | 51.71 | |
AA[ | 61.31 | 63.38 | — | 60.84 | 63.10 | — | |
本文模型 | 61.43 | 63.54 | 52.53 | 61.10 | 63.39 | 52.66 | |
RoBERTa | ATLOP[ | 61.32 | 63.18 | — | 61.39 | 63.40 | — |
E2GRE[ | — | — | — | 60.30 | 62.50 | 50.5 | |
DocuNet[ | 62.23 | 64.12 | — | 62.39 | 64.55 | — | |
SAIS[ | 62.23 | 65.17 | 55.84 | 63.44 | 65.11 | 55.67 | |
Eider[ | 62.34 | 64.27 | 52.54 | 62.85 | 64.79 | 53.01 | |
DREEAM[ | 62.29 | 64.20 | 54.15 | 62.12 | 64.27 | 54.01 | |
AA[ | 63.15 | 65.19 | — | 62.88 | 64.98 | — | |
本文模型 | 63.37 | 65.35 | 54.77 | 63.01 | 65.30 | 54.58 |
模型 | IgnF1 | F1 | 模型 | IgnF1 | F1 |
---|---|---|---|---|---|
ATLOP | 76.94 | 77.73 | AA | 80.12 | 81.20 |
DocuNet | 77.27 | 77.92 | 本文模型 | 82.13 | 83.26 |
DREEAM | 79.66 | 80.73 |
表4 Re-DocRED测试集上不同模型的性能对比 ( %)
Tab. 4 Performance comparison of different models on Re-DocRED test set
模型 | IgnF1 | F1 | 模型 | IgnF1 | F1 |
---|---|---|---|---|---|
ATLOP | 76.94 | 77.73 | AA | 80.12 | 81.20 |
DocuNet | 77.27 | 77.92 | 本文模型 | 82.13 | 83.26 |
DREEAM | 79.66 | 80.73 |
模型 | F1 | IgnF1 | EviF1 |
---|---|---|---|
本文模型 | 63.54 | 61.43 | 52.53 |
-关系回指图中 的信息聚合层 | 63.29 | 61.23 | 52.45 |
-关系回指图 | 62.89 | 60.88 | 51.52 |
-逻辑规则 | 63.02 | 60.94 | 52.01 |
-加权长尾损失函数 | 63.25 | 61.16 | 52.48 |
表5 基于BERT的消融实验结果 ( %)
Tab. 5 Ablation experimental results based on BERT
模型 | F1 | IgnF1 | EviF1 |
---|---|---|---|
本文模型 | 63.54 | 61.43 | 52.53 |
-关系回指图中 的信息聚合层 | 63.29 | 61.23 | 52.45 |
-关系回指图 | 62.89 | 60.88 | 51.52 |
-逻辑规则 | 63.02 | 60.94 | 52.01 |
-加权长尾损失函数 | 63.25 | 61.16 | 52.48 |
模型 | Inter-F1 | Intra-F1 |
---|---|---|
本文模型 | 56.34 | 68.44 |
-关系回指图 | 55.51 | 68.21 |
表6 关系回指图消融对Inter-F1、Intra-F1的影响 ( %)
Tab. 6 Influence of anaphor-aware relation graph ablation on Inter-F1 and Intra-F1 values
模型 | Inter-F1 | Intra-F1 |
---|---|---|
本文模型 | 56.34 | 68.44 |
-关系回指图 | 55.51 | 68.21 |
损失函数 | 频繁类 | 长尾类 | 整体 |
---|---|---|---|
加权长尾损失函数 | 64.26 | 39.75 | 63.54 |
ATL | 64.23 | 39.01 | 63.26 |
表7 损失函数消融实验的F1值 (%)
Tab. 7 F1 values for loss function ablation experiments
损失函数 | 频繁类 | 长尾类 | 整体 |
---|---|---|---|
加权长尾损失函数 | 64.26 | 39.75 | 63.54 |
ATL | 64.23 | 39.01 | 63.26 |
置信度 | DocRED | Re-DocRED | ||
---|---|---|---|---|
F1/% | IgnF1/% | F1/% | IgnF1/% | |
0.55 | 64.88 | 62.95 | 82.79 | 81.71 |
0.60 | 64.92 | 63.01 | 82.97 | 81.87 |
0.65 | 65.13 | 63.21 | 83.26 | 82.13 |
0.70 | 65.35 | 63.37 | 83.15 | 82.02 |
0.75 | 65.21 | 63.21 | 83.10 | 81.86 |
0.80 | 65.11 | 63.18 | 83.01 | 81.79 |
表8 不同规则置信度的性能对比
Tab. 8 Performance comparison for different rule confidence values
置信度 | DocRED | Re-DocRED | ||
---|---|---|---|---|
F1/% | IgnF1/% | F1/% | IgnF1/% | |
0.55 | 64.88 | 62.95 | 82.79 | 81.71 |
0.60 | 64.92 | 63.01 | 82.97 | 81.87 |
0.65 | 65.13 | 63.21 | 83.26 | 82.13 |
0.70 | 65.35 | 63.37 | 83.15 | 82.02 |
0.75 | 65.21 | 63.21 | 83.10 | 81.86 |
0.80 | 65.11 | 63.18 | 83.01 | 81.79 |
1 | 李冬梅,张扬,李东远,等.实体关系抽取方法研究综述[J].计算机研究与发展,2020,57(7):1424-1448. |
LI D M, ZHANG Y, LI D Y, et al. Review of entity relationship extraction methods[J]. Journal of Computer Research and Development, 2020, 57(7): 1424-1448. | |
2 | VASWANI A, SHAZEER N, PARMAR N, et al. Attention is all you need[C]// Proceedings of the 31th International Conference on Neural Information Processing Systems. Red Hook: Curran Associates Inc., 2017: 6000-6010. |
3 | YAO Y, YE D, LI P, et al. DocRED: a large-scale document-level relation extraction dataset[C]// Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics. Stroudsburg: ACL, 2019: 764-777. |
4 | TAN Q, XU L, BING L, et al. Revisiting DocRED — addressing the false negative problem in relation extraction[C]// Proceedings of the 2022 Conference on Empirical Methods in Natural Language Processing. Stroudsburg: ACL, 2022: 8472-8487. |
5 | 冯钧,魏大保,苏栋,等. 文档级实体关系抽取方法研究综述[J]. 计算机科学, 2022, 49(10):224-242. |
FENG J, WEI D B, SU D, et al. Survey of document-level entity relationship extraction methods[J]. Computer Science, 2022, 49(10): 224-242. | |
6 | 祝涛杰,卢记仓,周刚,等. 文档级关系抽取技术研究综述[J]. 计算机科学, 2023, 50(5):189-200. |
ZHU T J, LU J C, ZHOU G, et al. Review of document-level relation extraction techniques[J]. Computer Science, 2023, 50(5):189-200. | |
7 | DEVLIN J, CHANG M W, LEE K, et al. BERT: pre-training of deep bidirectional Transformers for language understanding[C]// Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1 (Long and Short Papers). Stroudsburg: ACL, 2019: 4171-4186. |
8 | LIU Y, OTT M, GOYAL N, et al. RoBERTa: a robustly optimized BERT pretraining approach[EB/OL]. [2023-11-18].. |
9 | ZHOU W, HUANG K, MA T, et al. Document-level relation extraction with adaptive thresholding and localized context pooling[C]// Proceedings of the 35th AAAI Conference on Artificial Intelligence. Palo Alto: AAAI Press, 2021: 14612-14620. |
10 | HUANG K, QI P, WANG G, et al. Entity and evidence guided document-level relation extraction[C]// Proceedings of the 6th Workshop on Representation Learning for NLP. Stroudsburg: ACL, 2021: 307-315. |
11 | XIE Y, SHEN J, LI S, et al. Eider: empowering document-level relation extraction with efficient evidence extraction and inference-stage fusion[C]// Findings of the Association for Computational Linguistics: ACL 2022. Stroudsburg: ACL, 2022: 257-268. |
12 | MA Y, WANG A, OKAZAKI N. DREEAM: guiding attention with evidence for improving document-level relation extraction[C]// Proceedings of the 17th Conference of the European Chapter of the Association for Computational Linguistics. Stroudsburg: ACL, 2023: 1971-1983. |
13 | LU C, ZHANG R, SUN K, et al. Anaphor assisted document-level relation extraction[C]// Proceedings of the 2023 Conference on Empirical Methods in Natural Language Processing. Stroudsburg: ACL, 2023: 15453-15464. |
14 | ZHANG N, CHEN X, XIE X, et al. Document-level relation extraction as semantic segmentation[C]// Proceedings of the 30th International Joint Conference on Artificial Intelligence. San Francisco: Morgan Kaufmann Publishers Inc., 2021: 3999-4006. |
15 | XIAO Y, ZHANG Z, MAO Y, et al. SAIS: supervising and augmenting intermediate steps for document-level relation extraction[C]// Proceedings of the 2022 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies. Stroudsburg: ACL, 2022: 2395-2409. |
16 | QI J, XU B, ZENG K, et al. ConstGCN: constrained transmission-based graph convolutional networks for document-level relation extraction[EB/OL]. [2023-08-14].. |
17 | ZENG S, XU R, CHANG B, et al. Double graph based reasoning for document-level relation extraction[C]// Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing. Stroudsburg: ACL, 2020: 1630-1640. |
18 | KIPF T N, WELLING M. Semi-supervised classification with graph convolutional networks[EB/OL]. [2023-07-18].. |
19 | XUE Z, LI R, DAI Q, et al. CorefDRE: document-level relation extraction with coreference resolution[EB/OL]. [2023-05-25].. |
20 | ZHANG Y, ZHONG V, CHEN D, et al. Position-aware attention and supervised data improve slot filling[C]// Proceedings of the 2017 Conference on Empirical Methods in Natural Language Processing. Stroudsburg: ACL, 2017: 35-45. |
[1] | 吴俊 赵川. 基于改进DETR算法的小目标检测方法[J]. 《计算机应用》唯一官方网站, 0, (): 0-0. |
[2] | 李海丰 刘文强 李南莎 桂仲成. 面向机场跑道的探地雷达杂波抑制算法[J]. 《计算机应用》唯一官方网站, 0, (): 0-0. |
[3] | 沈斌 陈晓宁 程华 房一泉 王慧锋. 基于大语言模型的本科教学评估智能系统[J]. 《计算机应用》唯一官方网站, 0, (): 0-0. |
[4] | 田海燕, 黄赛豪, 张栋, 李寿山. 视觉指导的分词和词性标注[J]. 《计算机应用》唯一官方网站, 2025, 45(5): 1488-1495. |
[5] | 李慧, 贾炳志, 王晨曦, 董子宇, 李纪龙, 仲兆满, 陈艳艳. 基于Swin Transformer的生成对抗网络水下图像增强模型[J]. 《计算机应用》唯一官方网站, 2025, 45(5): 1439-1446. |
[6] | 胡文彬, 蔡天翔, 韩天乐, 仲兆满, 马常霞. 融合对比学习与情感分析的多模态反讽检测模型[J]. 《计算机应用》唯一官方网站, 2025, 45(5): 1432-1438. |
[7] | 牛四杰, 刘昱良. 基于知识蒸馏双分支结构的视网膜病变辅助诊断方法[J]. 《计算机应用》唯一官方网站, 2025, 45(5): 1410-1414. |
[8] | 杨俊, 庞梦雪, 乔立山. 融合时序相关信息的脑功能网络估计与分类[J]. 《计算机应用》唯一官方网站, 2025, 45(5): 1403-1409. |
[9] | 徐博, 郝德志, 于迩晨, 林鸿飞, 宗林林. 面向对话生成和心理疾病检测的心理咨询式人机对话数据集构建[J]. 《计算机应用》唯一官方网站, 2025, 45(5): 1395-1402. |
[10] | 陈鹏宇, 聂秀山, 李南君, 李拓. 基于时空解耦和区域鲁棒性增强的半监督视频目标分割方法[J]. 《计算机应用》唯一官方网站, 2025, 45(5): 1379-1386. |
[11] | 龙雨菲, 牟宇辰, 刘晔. 基于张量化图卷积网络和对比学习的多源数据表示学习模型[J]. 《计算机应用》唯一官方网站, 2025, 45(5): 1372-1378. |
[12] | 宗伟, 赵悦, 李尹, 徐晓娜. 端到端语音到语音翻译的优化方法综述[J]. 《计算机应用》唯一官方网站, 2025, 45(5): 1363-1371. |
[13] | 刘晓霞 况立群 王松 焦世超 韩慧妍 熊风光. 多尺度时空解耦的骨架行为识别对比学习[J]. 《计算机应用》唯一官方网站, 0, (): 0-0. |
[14] | 尹春勇 张不凡. 基于多尺度的多变量时间序列异常检测模型[J]. 《计算机应用》唯一官方网站, 0, (): 0-0. |
[15] | 陈晓雷 郑芷薇 黄雪 曲振彬. 联合球面对齐与自适应几何校正的全景视频超分辨率网络[J]. 《计算机应用》唯一官方网站, 0, (): 0-0. |
阅读次数 | ||||||
全文 |
|
|||||
摘要 |
|
|||||