Automatic Generation and Evaluation of French-Style Chinese Modern Poetry
Abstract
:1. Introduction
2. Related Work
2.1. Poetry Generation
2.2. Background and Operation of Large Language Models (LLMs)
2.3. Reinforcement Learning from Human Feedback
3. Method
3.1. Model Architecture
3.2. Collecting Human Feedback
3.3. Training the Reward Models
3.4. Refining the Policy with Reinforcement Learning
- Collect dataset samples by gathering human feedback and candidate outputs . Human labelers are asked to rank all four .
- Train the reward model r using the loss defined in Equation (1) on the dataset samples obtained in the previous step.
- Utilize Proximal Policy Optimization (PPO) to train , where the reward is defined by Equation (2).
4. Experiments
4.1. Datasets
4.2. Human Data Collection
- Relevance to the theme;
- Consistency of content (logical coherence);
- Creativity;
- Form, vocabulary, syntax, figurative language, idioms, and allusions.
5. Results and Evaluation
5.1. Human Evaluation
5.2. Poetic Image Evaluation
5.3. Syntactic Feature Evaluation
6. Conclusions
Author Contributions
Funding
Data Availability Statement
Conflicts of Interest
References
- Devlin, J.; Chang, M.; Lee, K.; Toutanova, K. BERT: Pre-training of deep bidirectional transformers for language understanding. In Proceedings of the Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Minneapolis, MN, USA, 2–7 June 2019; pp. 4171–4186. [Google Scholar]
- Liu, Y.; Ott, M.; Goyal, N.; Du, J.; Joshi, M.; Chen, D.; Levy, O.; Lewis, M.; Zettlemoyer, L.; Stoyanov, V. RoBERTa: A robustly optimized BERT pretraining approach. arXiv 2019, arXiv:1907.11692. [Google Scholar]
- Radford, A.; Wu, J.; Child, R.; Luan, D.; Amodei, D.; Sutskever, I. Language models are unsupervised multitask learners. OpenAI Blog 2019, 1, 9. [Google Scholar]
- Gervas, P. WASP: Evaluation of different strategies for the automatic generation of Spanish verse. In Proceedings of the AISB00 Symposium on Creative & Cultural Aspects of AI, Birmingham, UK, 17–20 April 2000; p. 93100. [Google Scholar]
- Oliveira, H.G. PoeTryMe: A versatile platform for poetry generation. In Proceedings of the ECAI 2012 Workshop on Computational Creativity, Concept Invention, and General Intelligence (C3GI), Montpellier, France, 27 August 2012. [Google Scholar]
- Jiang, L.; Zhou, M. Generating Chinese couplets using a statistical mt approach. In Proceedings of the 22nd International Conference on Computational Linguistics, Manchester UK, 18–22 August 2008; p. 377384. [Google Scholar]
- He, J.; Zhou, M.; Jiang, L. Generating Chinese classical poems with statistical machine translation models. Proc. Twenty-Sixth AAAI Conf. Artif. Intell. 2012, 26, 1650–1656. [Google Scholar] [CrossRef]
- Yan, R. i, Poet: Automatic poetry composition through recurrent neural networks with iterative polishing schema. In Proceedings of the Twenty-Fifth International Joint Conference on Artificial Intelligence (IJCAI-16), New York, NY, USA, 9–15 July 2016; pp. 2238–2244. [Google Scholar]
- Wang, Z.; He, W.; Wu, H.; Wu, H.; Li, W.; Wang, H.; Chen, E. Chinese Poetry Generation with Planning based Neural Network. In Proceedings of the COLING 2016, 26th International Conference on Computational Linguistics: Technical Papers, Osaka, Japan, 11–16 December 2016; pp. 1051–1060. [Google Scholar]
- Hämäläinen, M.; Alnajjar, K.; Poibeau, T. Modern French poetry generation with RoBERTa and GPT-2. In Proceedings of the 13th International Conference on Computational Creativity (ICCC), Bozen-Bolzano, Italy, 27 June–1 July 2022; pp. 12–16. [Google Scholar]
- Beheitt, M.E.G.; Hmida, M.B.H. Automatic Arabic poem generation with GPT-2. In Proceedings of the 14th International Conference on Agents and Artificial Intelligence (ICAART 2022), Virtual Event, 3–5 February 2022; Volume 2, pp. 366–374. [Google Scholar]
- Nehal, E.; Mervat, A.; Maryam, E.; Mohamed, A. Generating Classical Arabic Poetry using Pre-trained Models. In Proceedings of the Seventh Arabic Natural Language Processing Workshop (WANLP), Abu Dhabi, United Arab Emirates, 8 December 2022; pp. 53–62. [Google Scholar]
- Beheitt, M.E.G.; Moez, B.H. Effectiveness of Zero-shot Models in Automatic Arabic Poem Generation. Jordanian J. Comput. Inf. Technol. 2023, 9, 21–35. [Google Scholar] [CrossRef]
- Yi, X.; Sun, M.; Li, R.; Li, W. Automatic Poetry Generation with Mutual Reinforcement Learning. In Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing, Brussels, Belgium, 31 October–4 November 2018; pp. 3143–3153. [Google Scholar]
- Chen, H.; Yi, X.; Sun, M.; Li, W.; Yang, C.; Guo, Z. Sentiment-controllable Chinese poetry generation. In Proceedings of the Twenty-Eighth International Joint Conference on Artificial Intelligence, Macao, China, 10–16 August 2019; pp. 4925–4931. [Google Scholar]
- Ghazvininejad, M.; Shi, X.; Choi, Y.; Knight, K. Generating topical poetry. In Proceedings of the 2016 Conference on Empirical Methods in Natural Language Processing, Austin, TX, USA, 1–5 November 2016; pp. 1183–1191. [Google Scholar]
- Shihadeh, J.; Ackerman, M. EMILY: An Emily Dickinson machine. In Proceedings of the 11th International Conference on Computational Creativity (ICCC’20), Coimbra, Portugal, 7–11 September 2020; pp. 243–246. [Google Scholar]
- Tim, V.D.C. Automatic Poetry Generation from Prosaic Text. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, Online, 5–10 July 2020; pp. 2471–2480. [Google Scholar]
- Popescu-Belis, A.; Atrio, À.; Minder, V.; Xanthos, A.; Luthier, G.; Mattei, S.; Rodriguez, A. Constrained language models for interactive poem generation. In Proceedings of the 13th Conference on Language Resources and Evaluation (LREC 2022), Marseille, France, 20–25 June 2022; pp. 3519–3529. [Google Scholar]
- Oliveira, H.G.; Hervás, R.; Díaz, A.; Gervás, P. Adapting a generic platform for poetry generation to produce Spanish poems. In Proceedings of the 5th International Conference on Computational Creativity (ICCC), Charlotte, NC, USA, 17–21 June 2014; pp. 63–71. [Google Scholar]
- Gonçalo Oliveira, H. Automatic generation of creative text in Portuguese: An overview. Lang Resour. Eval. 2024, 58, 7–41. [Google Scholar] [CrossRef] [PubMed]
- Talafha, S.; Rekabdar, B. Arabic poem generation with hierarchical recurrent attentional network. In Proceedings of the 2019 IEEE 13th International Conference on Semantic Computing (ICSC), Newport Beach, CA, USA, 30 January–1 February 2019; pp. 316–323. [Google Scholar]
- Zhang, X.; Lapata, M. Chinese poetry generation with recurrent neural networks. In Proceedings of the 2014 Conference on Empirical Methods in Natural Language Processing (EMNLP), Doha, Qatar, 25–29 October 2014; pp. 670–680. [Google Scholar]
- Yi, X.; Li, R.; Sun, M. Generating Chinese classical poems with RNN encoder-decoder. In Proceedings of the Chinese Computational Linguistics and Natural Language Processing Based on Naturally Annotated Big Data, Nanjing, China, 13–15 October 2017; pp. 211–223. [Google Scholar]
- Gao, T.; Xiong, P.; Shen, J. A new automatic Chinese poetry generation model based on neural network. In Proceedings of the 2020 IEEE World Congress on Services (SERVICES), Beijing, China, 18–23 October 2020; pp. 41–44. [Google Scholar]
- Liu, Z.; Fu, Z.; Cao, J.; De Melo, G.; Tam, Y.C.; Niu, C.; Zhou, J. Rhetorically controlled encoder-decoder for modern Chinese poetry generation. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, Florence, Italy, 28 July–2 August 2019; pp. 1992–2001. [Google Scholar]
- Vaswani, A.; Shazeer, N.; Parmar, N.; Uszkoreit, J.; Jones, L.; Gomez, A.N.; Kaiser, Ł.; Polosukhin, I. Attention is all you need. In Proceedings of the 31st International Conference on Neural Information Processing Systems, Long Beach, CA, USA, 4–9 December 2017. [Google Scholar]
- Raffel, C.; Shazeer, N.; Roberts, A.; Lee, K.; Narang, S.; Matena, M.; Zhou, Y.; Li, W.; Liu, P.J. Exploring the limits of transfer learning with a unified text-to-text transformer. arXiv 2019, arXiv:1910.10683. [Google Scholar]
- Lewis, M.; Liu, Y.; Goyal, N.; Ghazvininejad, M.; Mohamed, A.; Levy, O.; Stoyanov, V.; Zettlemoyer, L. BART: Denoising sequence-to-sequence pre-training for natural language generation, translation, and comprehension. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, Online, 5–10 July 2020; pp. 7871–7880. [Google Scholar]
- Radford, A.; Narasimhan, K.; Salimans, T.; Sutskever, I. Improving Language Understanding by Generative Pre-Training; OpenAI: San Francisco, CA, USA, 2018. [Google Scholar]
- Brown, T.; Mann, B.; Ryder, N.; Subbiah, M.; Kaplan, J.; Dhariwal, P.; Neelakantan, A.; Shyam, P.; Sastry, G.; Askell, A.; et al. Language Models are Few-Shot Learners. In Proceedings of the Advances in Neural Information Processing Systems (NeurIPS), Virtual, 6–12 December 2020. [Google Scholar]
- Stiennon, N.; Ouyang, L.; Wu, J.; Ziegler, D.M.; Lowe, R.; Voss, C.; Radford, A.; Amodei, D.; Christiano, P. Learning to Summarize with Human Feedback. In Proceedings of the Advances in Neural Information Processing Systems (NeurIPS), Virtual, 6–12 December 2020. [Google Scholar]
- Ziegler, D.M.; Stiennon, N.; Wu, J.; Brown, T.B.; Radford, A.; Amodei, D.; Christiano, P.; Irving, G. Fine-Tuning Language Models from Human Preferences. arXiv 2019, arXiv:1909.08593. [Google Scholar]
- Christiano, P.F.; Leike, J.; Brown, T.; Martic, M.; Legg, S.; Amodei, D. Deep Reinforcement Learning from Human Preferences. In Proceedings of the Advances in Neural Information Processing Systems (NeurIPS), Long Beach, CA, USA, 4–9 December 2017. [Google Scholar]
- Minsky, M. Steps toward artificial intelligence. Proc. IRE 1961, 49, 8–30. [Google Scholar] [CrossRef]
- Coronato, A.; Naeem, M.; De Pietro, G.; Paragliola, G. Reinforcement learning for intelligent healthcare applications: A survey. Artif. Intell. Med. 2020, 109, 101964. [Google Scholar] [CrossRef] [PubMed]
- Kim, Y.; Suescun, J.; Schiess, M.C.; Jiang, X. Computational medication regimen for Parkinson’s disease using reinforcement learning. Sci. Rep. 2021, 11, 9313. [Google Scholar] [CrossRef] [PubMed]
- Nian, R.; Liu, J.; Huang, B. A review on reinforcement learning: Introduction and applications in industrial process control. Comput. Chem. Eng. 2020, 139, 106886. [Google Scholar] [CrossRef]
- Brunke, L.; Greeff, M.; Hall, A.W.; Yuan, Z.; Zhou, S.; Panerati, J.; Schoellig, A.P. Safe learning in robotics: From learning-based control to safe reinforcement learning. Annu. Rev. Control. Robot. Auton. Syst. 2022, 5, 411–444. [Google Scholar] [CrossRef]
- Silver, D.; Huang, A.; Maddison, C.J.; Guez, A.; Sifre, L.; Van Den Driessche, G.; Schrittwieser, J.; Antonoglou, I.; Panneershelvam, V.; Lanctot, M.; et al. Mastering the game of Go with deep neural networks and tree search. Nature 2016, 529, 484–489. [Google Scholar] [CrossRef] [PubMed]
- Souchleris, K.; Sidiropoulos, G.K.; Papakostas, G.A. Reinforcement Learning in Game Industry—Review, Prospects and Challenges. Appl. Sci. 2023, 13, 2443. [Google Scholar] [CrossRef]
- Ouyang, L.; Wu, J.; Jiang, X.; Almeida, D.; Wainwright, C.; Mishkin, P.; Zhang, C.; Agarwal, S.; Slama, K.; Ray, A.; et al. Training language models to follow instructions with human feedback. In Proceedings of the Advances in Neural Information Processing Systems 35, New Orleans, LA, USA, 28 November–9 December 2022; pp. 27730–27744. [Google Scholar]
- Askell, A.; Bai, Y.; Chen, A.; Drain, D.; Ganguli, D.; Henighan, T.; Jones, A.; Joseph, N.; Mann, B.; DasSarma, N.; et al. A general language assistant as a laboratory for alignment. arXiv 2021, arXiv:2112.00861. [Google Scholar]
- Wu, J.; Ouyang, L.; Ziegler, D.M.; Stiennon, N.; Lowe, R.; Leike, J.; Christiano, P. Recursively summarizing books with human feedback. arXiv 2021, arXiv:2109.10862. [Google Scholar]
- Collection of Foreign Poems in Different Schools; Li, H., Translator; Baihua Literature and Art Publishing House: Tianjin, China, 1992. [Google Scholar]
- Eluard. Selected Poems of Eluard; Luo, D., Translator; People’s Literature Publishing House: Beijing, China, 2020. [Google Scholar]
- Rimbaud. Rimbaud Poetry Complete Works; Ge, L.; Liang, D., Translators; Beijing Yanshan Publishing House: Beijing, China, 2016. [Google Scholar]
- Baudelaire. Les Fleurs du Mal; Wen, A., Translator; Jilin Publishing Group: Changchun, China, 2009. [Google Scholar]
- Yang, C.; Sun, M.; Yi, X.; Li, W. Stylistic Chinese Poetry Generation via Unsupervised Style Disentanglement. In Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing, Brussels, Belgium, 31 October–4 November 2018; pp. 3960–3969. [Google Scholar]
- Toivanen, J.M.; Toivonen, H.; Valitutti, A.; Gross, O. Corpus-based generation of content and form in poetry. In Proceedings of the 3rd International Conference on Computational Creativity, Dublin, Ireland, 30 May–1 June 2012; pp. 175–179. [Google Scholar]
- Hämäläinen, M.; Alnajjar, K. Generating modern poetry automatically in Finnish. In Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing and the 9th International Joint Conference on Natural Language Processing, Hong Kong, China, 3–7 November 2019; pp. 5999–6004. [Google Scholar]
Dataset | Types of Poetry | Number | Percentage |
---|---|---|---|
Modern Chinese versions of the works of French poets (108,000 Chinese characters, 302 poems) | Lyric Poetry | 96 | 31.8% |
Narrative Poem | 48 | 15.9% | |
Love Poetry | 92 | 30.4% | |
Philosophical Poem | 31 | 10.3% | |
Mourning Poem | 7 | 2.3% | |
Satirical poem | 13 | 4.3% | |
Pastoral poetry | 15 | 5.0% |
Model | Generated Verses | Generated Verses in English |
---|---|---|
Baseline Pre-trained Model | 它神秘的闪光吸引着我, 我迷失在它的深处, 就像诗人迷失在他的诗句中, 或画家迷失在他的颜料中。 | Its mysterious gleam draws me, I am lost in its depths, Like a poet lost in his verses, Or a painter lost in his paints. |
但是,唉!时间不会停留, 生命疾驰向它的终极命运, 而你,美丽的玫瑰,终将凋零, 像一颗流星,消失在深渊之中。 | But, alas! Time will not stand still, Life is galloping towards its ultimate destiny, And thou, the beautiful rose, will fade away, Like a shooting star, disappearing into the abyss. | |
让我们的诗句像尖锐的剑一样, 削短谎言和鄙视态度, 让我们的文字像反射镜一样, 展现真相,毫不妥协。 | Let our verses, like a sharp sword, Cut short lies and scornful attitudes, Let our words, like a mirror, Reveal the truth without compromise. | |
我记得我们快乐的时光, 我们儿时的笑声和游戏, 但现在你不在了, 我的心充满了悲痛。 | I remember our happy times, Our childhood laughs and games, But now that thou art gone, My heart is filled with sorrow. | |
我是一位灵魂的探险家, 在火焰的海洋上航行, 寻找存在的本质, 和永恒的意识本质。 | I am an explorer of the soul, Sailing on the sea of fire, In search of the essence of existence, And the eternal essence of consciousness. | |
Fine-tuned Pre-trained Model | 这是一个美丽、优雅、充满诗意的世界, 在这里,人们可以逃离现实, 生活似乎是一首交响曲, 每一刻都是神的礼物。 | This is a beautiful, elegant and poetic world, Here, people can escape from reality, Life seems like a symphony, Each moment is a gift of god. |
我望着远方的马赛, 海风拂面带来了花香, 想象着和你一起, 漫步在蓝色海岸的小路上。 | I look at Marseilles in the distance, The sea breeze brings the scent of flowers, I imagine being with thee, Stroll along the path of the Blue Coast. | |
我仍然记得你, 你温柔的声音和明亮的眼睛, 但时间过得如此之快, 现在你已经如此遥远。 | I still remember thee, Thy soft voice and bright eyes, But time flies so fast, Now thou art so far away. | |
他们沉迷于自己的虚荣, 认为自己是社会的国王, 但他们不知道真正的伟大, 在于谦卑和善良。 | Indulging in their vanity, They think they are the kings of society, But they don’t know that the true greatness, Lies in humility and kindness. | |
我爱你,如同风爱大海, 没有止境,没有边际,没有阻隔, 我爱你,如同烈火一样, 毫不畏惧地燃烧,摧毁一切。 | I love thee, as the wind loves the sea, No limit, no border, no barrier, I love thee, like the raging flames Burn undauntedly and destroy everything. |
Grammar | Evaluation content | Fluency and grammatical correctness of the poem. |
Evaluation criteria | 5 Excellent; 4 Good; 3 Average; 2 Below Average; 1 Poor. | |
Logicality | Evaluation content | Clarity of thinking, contextual coherence, lack of inconsistency. |
Evaluation criteria | 5 Excellent; 4 Good; 3 Average; 2 Below Average; 1 Poor. | |
Rhetoric | Evaluation content | Language richness and rhetorical appropriateness. |
Evaluation criteria | 5 Excellent; 4 Good; 3 Average; 2 Below Average; 1 Poor. | |
Creativity | Evaluation content | Uniqueness of expression, novelty of imagery, no clichés. |
Evaluation criteria | 5 Excellent; 4 Good; 3 Average; 2 Below Average; 1 Poor. | |
Depth | Evaluation content | Inspiring and thought-provoking. |
Evaluation criteria | 5 Excellent; 4 Good; 3 Average; 2 Below Average; 1 Poor. | |
Style | Evaluation content | Similarity to French poetry style. |
Evaluation criteria | 5 Very High; 4 High; 3 Average; 2 Below Average; 1 Very Low. | |
Human- likeness | Evaluation content | Likelihood of the poem written by human. |
Evaluation criteria | 5 Definitely; 4 Very Probably; 3 Probably; 2 Probably Not; 1 Definitely Not. |
Reliability | Grammar | Logicality | Rhetoric | Creativity | Depth | Style | Human-Likeness |
---|---|---|---|---|---|---|---|
Cronbach | 0.936 | 0.876 | 0.886 | 0.896 | 0.895 | 0.822 | 0.916 |
McDonald’s | 0.947 | 0.891 | 0.890 | 0.883 | 0.895 | 0.802 | 0.915 |
Verses from “L’Adieu” | Translation in English |
---|---|
J’ai cueilli ce brin de bruyère | I picked this sprig of heather |
L’automne est morte souviens-t’en | Autumn is dead remember it |
Nous ne nous verrons plus sur terre | We will no longer see each other on earth |
Odeur du temps brin de bruyère | Smell of time sprig of heather |
Et souviens-toi que je t’attends | And remember that I’m waiting for you |
Language | Example | Translation in English |
---|---|---|
French | En vain j’ai voulu de l’espace | In vain I wanted space |
Trouver la fin et le milieu; | To find the end and the centre; | |
Sous je ne sais quel oeil de feu | Under I don’t know what fiery eye | |
Je sens mon aile qui se casse | I feel my wing breaking | |
— Charles Baudelaire, Les Plaintes d’un Icare | — Charles Baudelaire, Lament of An Icarus | |
Chinese | 为期待而绝望 | (We’re) despairing for the sake of expectation |
为绝望而期待 | (We’re) hoping for the sake of despair | |
期待是最漫长的绝望 | Expectation is the longest despair | |
绝望是最完美的期待 | Despair is the most perfect expectation | |
—— 杨炼《偈子》 | — Yang Lian, Gatha |
Language | Example | Translation in English |
---|---|---|
French | Un air chaud me frappait, | A hot air hit me, |
comme un souffle de forge, | Like a breath of forge, | |
A chacun des soupirs qui soulevaient sa gorge. | With each sigh that raised his throat | |
— Guy de Maupassant, Au bord de l’eau | — Guy de Maupassant, The Water’s Edge | |
Chinese | 也许,人活到了这般年岁 | Perhaps, when a person lives to this age |
就能够听到——时间 | (He) can hear — time | |
——它就像是个屠夫 | — It is like the sound of (a) butcher | |
在暗地里不停地磨刀子的声音 | Sharpening his knife in the dark | |
—— 芒克《晚年》 | — Mang Ke, Twilight Years |
Language | Example | Translation in English |
---|---|---|
French | Vous avez un regard singulier et charmant; | You have a singular and charming look; |
Comme la lune au fond du lac qui la reflète, | Like the moon at the bottom of the lake which reflects it. | |
Votre prunelle, où brille une humide paillette, | Your pupil, where a moist glitter shines, | |
Au coin de vos doux yeux roule languissamment | In the corner of your sweet eyes rolls languidly | |
— Théophile Gautier, A deux beaux yeux | — Théophile Gautier, To Two Beautiful Eyes | |
Chinese | 你站在桥上看风景, | Thou stand on the bridge and look at the scenery, |
看风景人在楼上看你。 | People watching the scenery are watching thee upstairs. | |
明月装饰了你的窗子, | The bright moon decorates thy window, | |
你装饰了别人的梦。 | Thou decorate someone else’s dream. | |
——卞之琳《断章》 | — Bian Zhilin, Fragments of Chapter |
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2024 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).
Share and Cite
Zuo, L.; Zhang, D.; Zhao, Y.; Wang, G. Automatic Generation and Evaluation of French-Style Chinese Modern Poetry. Electronics 2024, 13, 2659. https://doi.org/10.3390/electronics13132659
Zuo L, Zhang D, Zhao Y, Wang G. Automatic Generation and Evaluation of French-Style Chinese Modern Poetry. Electronics. 2024; 13(13):2659. https://doi.org/10.3390/electronics13132659
Chicago/Turabian StyleZuo, Li, Dengke Zhang, Yuhai Zhao, and Guoren Wang. 2024. "Automatic Generation and Evaluation of French-Style Chinese Modern Poetry" Electronics 13, no. 13: 2659. https://doi.org/10.3390/electronics13132659
APA StyleZuo, L., Zhang, D., Zhao, Y., & Wang, G. (2024). Automatic Generation and Evaluation of French-Style Chinese Modern Poetry. Electronics, 13(13), 2659. https://doi.org/10.3390/electronics13132659