数字人文视域下多粒度特征融合的古文命名实体识别
|
孟佳娜,教授,博士,硕士生导师; |
|
许英傲,硕士研究生; |
|
赵丹丹,副教授,博士,硕士生导师,通信作者,E-mail:86313700@qq.com; |
|
李丰毅,硕士研究生; |
|
赵迪,讲师,博士。 |
收稿日期: 2024-07-22
网络出版日期: 2025-04-28
基金资助
教育部人文社会科学研究规划基金项目“基于知识图谱的中华文化互联网智慧传播研究”(23YJA860010)
中央高校基本科研业务费资助基金项目“基于大模型和知识驱动的情感分析研究”(140250)
Multi-Granularity Feature Fusion for Named Entity Recognition of Classical Chinese Texts from the Perspective of Digital Humanities
|
Meng Jiana, professor, PhD, master supervisor; |
|
Xu Ying’ao, master candidate; |
|
Zhao Dandan, associate professor, PhD, master supervisor, corresponding author, E-mail: 86313700@qq.com; |
|
Li Fengyi, master candidate; |
|
Zhao Di, lecturer, PhD. |
Received date: 2024-07-22
Online published: 2025-04-28
Supported by
Humanities and Social Sciences Research Planning Fund project titled “The Research on the Internet Smart Dissemination of Chinese Culture Based on Knowledge Graphs”(23YJA860010)
Fundamental Research Funds for the Central Universities project titled “Research on Sentiment Analysis Based on Large Models and Knowledge-Driven Approaches”(140250)
[目的/意义] 利用命名实体识别技术深入挖掘古籍文献,推动中文古籍数字化进程,对于推动历史学习、增强文化自信以及弘扬中国传统文化具有重要意义。[方法/过程] 提出多粒度特征融合的古文命名实体识别方法,以《左传》为研究语料,构建人名、地名、时间等命名实体识别任务。首先,将古文字信息、词性信息及字形特征融合,提高输入特征表示能力;然后,在加入预测实体头尾辅助任务学习古句边界信息的同时利用Transfer交互器启发式学习古文实体构词规律,并用BiLSTM和IDCNN联合抽取上下文信息;最后,将学习到的多种古文特征加权融合,输入CRF中进行实体预测。[结果/结论] 实验结果表明,多粒度特征融合的古文命名实体识别方法,相比主流的BERT-BiLSTM-CRF模型,精确率、召回率和F1值分别提升5.09%、13.45%和9.87%。多粒度特征融合的古文命名实体识别方法能够精准地实现对古籍文本的命名实体识别。
孟佳娜 , 许英傲 , 赵丹丹 , 李丰毅 , 赵迪 . 数字人文视域下多粒度特征融合的古文命名实体识别[J]. 知识管理论坛, 2024 , 9(6) : 533 -546 . DOI: 10.13266/j.issn.2095-5472.2024.039
[Purpose/Significance] Leveraging Named Entity Recognition (NER) techniques for the thorough exploration of ancient literary documents not only drives forward the digitization of ancient Chinese texts, including the vital process of Ancient text digitization, which is crucial for historical studies, bolstering cultural confidence, promoting traditional Chinese culture, and advancing Named Entity Recognition (NER) as a foundational task in NLP. [Method/Process] A method for named entity recognition in classical Chinese texts with multi-granularity feature fusion was proposed, Leveraging "Zuo Zhuan" as the research corpus and formulating named entity recognition tasks for personal names, geographical names, temporal entities, etc. Initially, ancient character information, part-of-speech (POS) information, and glyph features were integrated to enhance input feature representation. Subsequently, auxiliary tasks for predicting entity boundaries were introduced, alongside the utilization of a Transfer Interactor heuristic to learn classical Chinese entity formation rules. This was complemented by joint contextual information extraction using BiLSTM and IDCNN (Iterated Dilated Convolutional Neural Network). Finally, learned features were weighted and merged into a CRF (Conditional Random Field) for entity prediction. [Result/Conclusion] Experimental results demonstrate that the proposed method of multi-granularity feature fusion for named entity recognition in classical Chinese texts enhances precision, recall, and F1 score by 5.09%, 13.45%, and 9.87%, respectively, compared to the mainstream BERT-BiLSTM-CRF method. Multi-granularity feature fusion for named entity recognition in classical Chinese texts is crucial for accurately identifying named entities in ancient texts.
,每一个字符的向量表示如公式(1)所示:
和一个词性向量序列
,对于融合后的向量表示如公式(2)所示:
和融合3种字体的字形结构向量序列
,对于嵌入后的向量表示如公式(3)所示:
、
为两个独立BILSTM的输出,将其分别与特征交互矩阵W相乘并用双曲正切函数激活,得到包含实体头与实体尾关联特征信息的矩阵
、
。计算方法如公式(4)、公式(5)所示:
、
分别与特征降维矩阵V相乘,进一步优化特征空间,并对其归一化得到信息矩阵
、
。计算方法如公式(6)、公式(7)所示:
、
分别与信息矩阵
、
相乘,得到包含了实体头与实体尾特征关联关系的输出矩阵Head_out和Tail_out。计算方法如公式(8)、公式(9)所示:
、
、
分别为可学习参数,可以更好地平衡不同
模块对于模型的贡献程度。
和
分别为预测实体头与实体尾的输出矩阵,为学习到的特征融合矩阵。
表1 《左传》数据集统计表Table 1 Data set statistical table of Zuo Zhuan (单位:千) |
| 数据集 | 类型 | 训练集大小 | 验证集大小 | 测试集大小 |
| 《左传》 | Sentence Char | 8.9K 21.4K | 1.2K 3.7K | 1.0K 3.0K |
表2 《左传》实体分布统计表Table 2 Entity distribution statistical table of Zuo Zhuan (单位:个) |
| 实体种类 | 训练集 | 验证集 | 测试集 |
| 人名 | 10 662 | 2 107 | 2 157 |
| 地名 | 5 199 | 1 486 | 1 875 |
| 时间 | 1 474 | 472 | 459 |
表3 《左传》序列标注方式Table 3 Sequence labeling of Zuo Zhuan |
| 字 | 含义 | 序列标签 | 字 | 含义 | 序列标签 |
| 簡 | 人名 | B-Name | 有 | 非实体词 | O |
| 子 | 人名 | E-Name | , | 非实体词 | O |
| 謂 | 非实体词 | O | 而 | 非实体词 | O |
| 無 | 人名 | B-Name | 無 | 非实体词 | O |
| 恤 | 人名 | E-Name | 以 | 非实体词 | O |
| 曰 | 非实体词 | O | 尹 | 人名 | B-Name |
| : | 非实体词 | O | 鐸 | 人名 | E-Name |
| “ | 非实体词 | O | 為 | 非实体词 | O |
| 晉 | 地名 | B-LOC | 少 | 非实体词 | O |
| 國 | 地名 | E-LOC | ” | 非实体词 | O |
| 難 | 非实体词 | O | 。 | 非实体词 | O |
表4 HanLP2.x分词及词性标注效果Table 4 HanLP 2.x segmentation and part-of-speech tagging performance |
| 《左传》原文选取 | HanLP2.x分词 | HanLP2.x词性标注 |
| 春秋左傳隱公 | 春秋||左傳||隱公 | t||n||nr |
| 元年春,王周正月,不書卽位,攝也。 | 元年||春||,||王周||正月||,||不|| 書||卽位||,||攝||也||。 | t||Tg||w||nr||t|w||d|Vg||v||w||Vg||v||w |
| 三月,公及邾儀父盟于蔑——邾子克也。 | 三月||,||公||及||邾儀||父||盟||于||蔑||——||邾子||克||也||。 | t||w||Ng||v||nr||n||Vg||p||Ng||w||n||nr||y||w |
| 夏四月,費伯帥師城郎。 | 夏||四月||,||費伯||帥||師||城||郎||。 | Tg||t||w||nr||Vg||Ng||ns||Ng||w |
表5 参数设置表Table 5 Parameter settings table |
| 超参数 | 值 |
| 学习率 | 1e-5 |
| Batch大小 | 16 |
| 迭代次数 | 100 |
| 卷积核大小 | 3×3 |
| BiLSTM隐藏层维度 | 128 |
| 输入句子最大长度 | 100 |
| BERT隐藏层维度 | 768 |
| 图像特征维度 | 1 200 |
| 梯度下降优化器 | Adam |
| Dropout | 0.3 |
表6 预训练模型实验对比Table 6 Pre-training model experiment comparison |
| 对比预训练模型 | 评估指标/% | ||
| P | R | F1 | |
| Bert-base-Chinese+BiLSTM+CRF | 86.25 | 64.16 | 73.58 |
| Bert-ancient-Chinese+BiLSTM+CRF | 89.17 | 70.12 | 78.72 |
| SikuBERT+BiLSTM+CRF | 87.92 | 69.91 | 77.89 |
| SikuRoBERTa+BiLSTM+CRF | 88.31 | 70.35 | 78.32 |
| GuwenBERT+BiLSTM+CRF | 55.27 | 35.88 | 43.51 |
表7 不同分词方式实验对比Table 7 Experimental comparison of different segmentation methods |
| 分词方式 | 评估指标/% | ||
| P | R | F1 | |
| jieba | 90.66 | 70.14 | 79.09 |
| HanLP2.x | 91.95 | 73.14 | 81.47 |
| HanLP2.x+人工重构 | 88.02 | 77.25 | 82.28 |
表8 不同模型对比实验Table 8 Comparative experiment of different model |
| 模型 | 评估指标 | ||
| P/% | R/% | F1/% | |
| FLAT | 88.69 | 75.83 | 81.76 |
| SIMP | 89.73 | 75.96 | 82.13 |
| MECT | 90.07 | 75.04 | 81.85 |
| HGN | 88.53 | 79.12 | 83.56 |
| MG-NER-Glyph | 94.26 | 83.57 | 88.59 |
| MG-NER+Glyph | 91.33 | 84.32 | 87.67 |
表9 消融实验Table 9 Ablation experiment |
| 模型 | 评估指标/% | ||
| P | R | F1 | |
| MG-NER-Glyph | 94.26 | 83.57 | 88.59 |
| MG-NER+Glyph | 91.33 | 84.32 | 87.67 |
| -IDCNN | 91.72 | 77.74 | 83.58 |
| -Transfer交互器 | 93.95 | 81.56 | 87.07 |
| -Pos | 91.90 | 79.42 | 84.91 |
| -边界感知层 | 92.66 | 80.37 | 85.86 |
孟佳娜:设计研究方案,修改论文;
许英傲:提出研究思路,撰写论文;
赵丹丹:采集、清洗和分析数据;
李丰毅:设计实验,处理数据;
赵 迪:修订论文与定稿。
| [1] |
王东波.SikuBERT:数字人文下的古籍智能信息处理(专题前言)[J]. 图书馆论坛,2022,42(6):30.(WANG D B. SikuBERT: intelligent information processing of ancient texts in digital humanities(special introduction)[J]. Library tribune,2022,42(6):30.)
|
| [2] |
GRISHMAN R, SUNDHEIM B. Message understanding conference 6: a brief history[C]// Proceedings of the 16th conference on computational linguistics. Stroudsburg: Association for Computational Linguistics, 1996.
|
| [3] |
HAMMERTON J. Named entity recognition with long short-term memory[C]// Proceedings of Conference on natural language learning at HLT-NAACL. Stroudsburg: Association for Computational Linguistics, 2003.
|
| [4] |
COLLOBERT R, WESTON J, BOTTOU L, et al. Natural language processing (almost) from scratch[J]. Journal of machine learning research, 2011, 12(1):2493-2537.
|
| [5] |
HUANG Z, XU W, YU K. Bidirectional LSTM-CRF models for sequence tagging: computer science[EB/OL]. [2024-06-20].https://arxiv.org/abs/1508.01991.
|
| [6] |
CHIU J P C, NICHOLS E. Named entity recognition with bidirectional LSTM-CNNs: computer science[EB/OL].[2024-06-20].https://aclanthology.org/Q16-1026.
|
| [7] |
AKBIK A, BLYTHE D, VOLLGRAF R. Contextual string embeddings for sequence labeling[C]// Proceedings of International conference on computational linguistics. Stroudsburg: Association for Computational Linguistics, 2018.
|
| [8] |
DEVLIN J, CHANG M W, LEE K, et al. Bert: pre-training of deep bidirectional transformers for language understanding: computer science[EB/OL]. [2024-06-20].https://arxiv.org/abs/1810.04805.
|
| [9] |
LAN Z, CHEN M, GOODMAN S, et al. ALBERT: a lite BERT for self-supervised learning of language representations: computer science[EB/OL]. [2024-07-15].https://arxiv.org/abs/1909.11942.
|
| [10] |
LIU Y, OTT M, GOYAL N, et al. RoBERTa: a robustly optimized BERT pretraining approach: computer science[EB/OL]. [2024-07-15].https://arxiv.org/abs/1907.11692.
|
| [11] |
刘江峰,冯钰童,王东波,等. 数字人文视域下SikuBERT增强的史籍实体识别研究[J].图书馆论坛,2022,42(10):61-72.(LIU J F, FENG Y T, WANG D B. Research on historical entity recognition enhanced by SikuBERT under the perspective of digital humanities[J]. Library tribune,2022,42(10):61-72.)
|
| [12] |
WANG P, REN Z. The uncertainty-based retrieval framework for ancient Chinese CWS and POS: computer science[EB/OL]. [2024-07-20].https://arxiv.org/abs/2310.08496.
|
| [13] |
ZHANG Y, YANG J. Chinese NER using Lattice LSTM: computer science[EB/OL]. [2024-07-20].https://arxiv.org/abs/1805.02023.
|
| [14] |
LI X, YAN H, QIU X, et al. FLAT: Chinese NER using Flat-Lattice Transformer: computer science[EB/OL]. [2024-07-20].https://arxiv.org/abs/2004.11795.
|
| [15] |
谢靖,刘江峰,王东波.古代中国医学文献的命名实体识别研究——以Flat-lattice增强的SikuBERT预训练模型为例[J].图书馆论坛,2022,42(10):51-60.(XIE J, LIU J F, WANG D B. Research on named entity recognition of ancient Chinese medical literature: a case study of flat-lattice enhanced SikuBERT pre-trained model[J]. Library tribune,2022,42(10):51-60.)
|
| [16] |
PENG M, MA R, ZHANG Q, et al. Simplify the usage of lexicon in Chinese NER: computer science[EB/OL]. [2024-07-20].https://arxiv.org/abs/1908.05969.
|
| [17] |
SUN Z, LI X, SUN X, et al. Chinesebert: Chinese pretraining enhanced by glyph and pinyin information: computer science[EB/OL]. [2024-07-26].https://arxiv.org/abs/2106.16038.
|
| [18] |
尹成龙, 陈爱国. 融合多重嵌入的中文命名实体识别[J].中文信息学报,2023,37(4):63-71.(YIN C L, CHEN A G. Chinese Named entity recognition with integrated multiple embeddings[J]. Journal of Chinese information processing, 2023,37(4):63-71.)
|
| [19] |
孙红,王哲. 多粒度融合的命名实体识别[J]. 中文信息学报, 2023, 37(3): 123-134.(SUN H, WANG Z. Named entity recognition with multi-granularity fusion[J]. Journal of Chinese information processing, 2023, 37(3): 123-134.)
|
| [20] |
CHEN C, KONG F. Enhancing entity boundary detection for better Chinese named entity recognition[C]//Proceedings of the 59th annual meeting of the Association for Computational Linguistics and the 11th International joint conference on natural language processing. Stroudsburg: Association for Computational Linguistics, 2021: 20-25.
|
| [21] |
GU Y, QU X, WANG Z, et al. Delving deep into regularity: a simple but effective method for Chinese named entity recognition[J]. arxiv:2204.05544, 2022.
|
| [22] |
LAFFERTY J, MCCALLUM A, PEREIRA F C N. Conditional random fields: probabilistic models for segmenting and labeling sequence data[C]//Proceedings of International conference on machine learning. San Francisco: Morgan Kaufmann Publishers, 2002.
|
| [23] |
ZHOU P, SHI W, TIAN J, et al. Attention-based bidirectional long short-term memory networks for relation classification[C]//Proceedings of the 54th annual meeting of the Association for Computational Linguistics. Berlin: Association for Computational Linguistics, 2016.
|
| [24] |
STRUBELL E, VERGA P, BELANGER D, et al. Fast and accurate entity recognition with iterated dilated convolutions: computer science[EB/OL]. [2024-07-26].https://arxiv.org/abs/1702.02098.
|
| [25] |
王东波, 刘畅, 朱子赫, 等. SikuBERT与SikuRoBERTa:面向数字人文的《四库全书》预训练模型构建及应用研究[J].图书馆论坛,2022,42(6):31-43.(WANG D B,LIU C,ZHU Z H. SikuBERT and SikuRoBERTa: research on the construction and application of pre-trained models for the Siku Quanshu (Complete Library of the Four Treasuries)in the Context of Digital Humanities[J]. Library tribune, 2022, 42(6):31-43.)
|
| [26] |
李正辉,廖光忠.基于多层次特征提取的中文医疗实体识别[J].计算机技术与发展,2023,33(9):119-125.(LI Z H,LIAO G Z. Chinese medical entity recognition based on multi-level feature extraction[J].Computer technology and development,2023,33(9):119-125.)
|
| [27] |
WU S, SONG X, FENG Z. MECT: multi-metadata embedding based cross-transformer for Chinese named entity recogtion[EB/OL]. https://aclanthology.org/2021.acl-long.121.pdf.
|
| [28] |
HU J, SHEN Y, LIU Y, et al. Hero-gang neural model for named entity recognition[C]//Proceedings of the 2022 conference of the North American Chapter of the Association for Computational Linguistics: human language technologies. Seattle: Association for Computational Linguistics, 2022: 1924-1936.
|
/
| 〈 |
|
〉 |