In the field of natural language generation,the generation of ancient poetry has positive significance for the exploration of ancient poetry culture in China.Through natural language processing,further enhancing the creative generation of ancient poetry will help to promote ancient poetry and enhance our cultural heritage.At present,poetry generation has become a challenging research direction in natural language processing.Many researchers have conducted model research on the generation of ancient poetry based on existing deep learning technologies.However,the current generative model of ancient poetry has room for improvement in terms of the quality,theme focus and convergence speed of generating ancient poetry.Therefore,how to enhance the quality of poetry text generation and improve the training efficiency of the model while avoiding theme bias has become the focus of this article’s research.The main work of this article is as follows:Firstly,in response to the issue of theme shift in ancient poetry,this thesis proposes an encoding decoding model based on an extended theme word screening mechanism.The method involves expanding a single topic word to multiple keywords as the source text,and then explicitly filtering the importance of the source text marker group.At the same time,in order to better cooperate with the filtering work of the extended keyword filtering mechanism,this article applies a bidirectional GLU encoder to fully explore the association information and dependency relationships between tags,in order to assist the extended keyword filtering network in more accurate positioning of important tags.Experiments show that the proposed method can efficiently model the importance of tags and improve the performance of ancient poetry generative model.Secondly,in response to the issue of further improving the quality of ancient poetry generation,this article proposes to apply the LeakGAN model to improve the discriminator module in the original LeakGAN model.By introducing a multi head self attention mechanism,it can screen and extract semantic feature information from input information,capturing global and local semantic relationships.Generate high-quality high-dimensional feature information through convolutional neural networks to guide the generator’s generation work.The experimental results show that the improved LeakGAN model has an improved BLEU score compared to the original model,from 0.791 to 0.843,and compared with other GAN models,the score performance is also excellent,confirming the effectiveness of the model in improving generation quality.Finally,in response to the problem of using Monte Carlo sampling to obtain reward values in the original LeakGAN model,which requires a large amount of sampling and leads to slow convergence speed,this thesis proposes using an improved bundle search,which introduces a penalty factor to reduce the diversity of candidate sentences,using a smaller bundle width,reducing memory usage,and improving convergence speed.The experimental results show that the improved version of LeakGAN has improved convergence speed by 12.68% and 6.03%compared to LeakGAN and Rel GAN,confirming the feasibility of the model in improving convergence speed.To sum up,this thesis takes the LeakGAN model as the starting point to research on the task of generating ancient poetry,and the proposed methods and models have verified their feasibility and effectiveness in experiments,providing support for work in related fields in Natural language processing. |