计算机工程与应用 ›› 2024, Vol. 60 ›› Issue (13): 162-170.DOI: 10.3778/j.issn.1002-8331.2303-0477

• 模式识别与人工智能 • 上一篇    下一篇

融合韵律特征的诗歌生成模型

吴林东,何向真,万福成   

  1. 西北民族大学 语言与文化计算教育部重点实验室,兰州 730030
  • 出版日期:2024-07-01 发布日期:2024-07-01

Poetry Generative Model Incorporating Prosodic Features

WU Lindong, HE Xiangzhen, WAN Fucheng   

  1. Key Laboratory of Linguistic and Cultural Computing Ministry of Education, Northwest Minzu University, Lanzhou 730030, China
  • Online:2024-07-01 Published:2024-07-01

摘要: 诗歌生成中的韵律规范和主题一致性一直以来都是自然语言生成领域的研究热点。为提升诗歌生成中的韵律规范,提出了基于Transformer结合韵律特征的诗歌生成模型(Transformer and prosodic features poetry generation model,TPPG)。根据韵律特征建立平仄韵律词库和平声韵脚词库,在Transformer编码器中引入平仄韵律编码,模型训练过程中可以捕获更多平仄韵律特征的信息,学习到多种诗歌韵律;最终根据建立的平声韵脚词库规范诗歌生成韵脚,运用极大后验概率对于候选的诗歌选择当前赋有韵律特征规范的最优诗句,整体提升诗歌规范性和流畅性。实验结果表明TPPG模型生成的诗歌能够很好地符合韵律,在人工评价和机器评价中均有提高。

关键词: 诗歌生成, 韵律库, 韵律编码, 韵律特征

Abstract: Prosody specification and topic consistency in poetry generation have always been a research hotspot in the field of natural language generation. In order to improve the prosody specification in poetry generation, this paper proposes a poem generation model based on Transformer combined with prosody (Transformer and prosodic features poetry generation model, TPPG). According to the prosodic features, the prosodic thesaurus and the prosodic thesaurus are established, and the prosodic coding is introduced into the Transformer encoder. During the model training process, more prosodic feature information can be captured, and a variety of poetic rhythms can be learned. Finally, the rhyme is generated according to the established rhyme lexicon, and the optimal verse with the rhythm feature specification is selected for the candidate poem by using a large posterior probability, which improves the standardization and fluency of the poem as a whole. The experimental results show that the poetry generated by TPPG model can conform to rhythm well, and it has improved in both manual evaluation and machine evaluation.

Key words: poetry generation, rhythm library, prosodic encoding, prosodic features