基于词性对齐与依存关系的中文排比句生成方法
Chinese Parallelism Generation Based on Part-of-Speech Alignment and Dependency Relation
-
摘要: 排比句是一种常用的修辞手法,其使用具有增强气势、强调突出、层次清晰的效果。排比句生成对于文本生成具有重要意义,能够丰富文本生成的风格和形式,提升教育、广告和文学创作的质量,但目前暂无生成模型和公开的排比句语料库。为此,该文在收集和构建排比句数据集的基础上,结合排比句具有的语言学特征,提出了一种基于词性对齐与依存关系的中文排比句生成模型,称为CPG-PosDep。模型从语言学出发,首先用设定的分词、句内词序和句间位置三种特殊符号及随机采样策略对排比句进行全局标识,并结合改进的Transformer注意力机制学习排比句的词性对齐特征,然后使用BERT和注意模块将给定分句的依存关系信息融入模型中,融合生成排比句。在排比句数据集上的实验表明,模型能够生成与给定分句在对应位置词性一致、依存关系相同的通顺分句,相比使用现有对联或诗歌生成模型生成的排比句,该文所提模型生成的排比句质量更具优势。Abstract: Parallelism is a popular rhetorical device featured by its ability to enhance momentum, emphasize key points, and provide clear structure, and there is now no dedicated generation model or publicly available corpus for parallelism. This paper proposes a Chinese parallelism generation model named CPG-PosDep, developed based on the collection and construction of a parallelism dataset and considering the linguistic characteristics of parallelism. Followinging a linguistic approach, the model employs predefined segmentation markers, intra-sentence word order indicators, and inter-sentence position symbols, combined with a random sampling strategy to globally annotate parallelism. It integrates an enhanced Transformer attention mechanism to learn part-of-speech alignment features, and adopts BERT and attention mechanisms to incorporate dependency relation information from sentences into the model. Experiments indicate that the model can generate coherent sentences that maintain consistent part-of-speech and dependency relations with the given clauses, much better than those by existing couplet or poetry models.
下载: