Poetry generation method, device, electronic device and readable storage medium

By obtaining poetry description information and using preset poetry generators to interact with users, and iteratively adjusting candidate clauses, the problem that poetry generators in the prior art is difficult to take into account efficiency and quality, and high-quality poetry generation is achieved.

CN115310426BActive Publication Date: 2024-11-22LESHAN NORMAL UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210885016.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-07-26
Publication Date
2024-11-22
Estimated Expiration
2042-07-26

AI Technical Summary

Technical Problem

The existing poetry generator based on deep learning is difficult to take into account the efficiency and quality of poetry creation. The poetry generated is poor in theme and has low manual creation efficiency.

Method used

By obtaining poetry description information, the first preset poetry generator generates the theme vernacular sequence, and combines the poetry clauses entered by the user to process the candidate clauses, iteratively adjusts the candidate clause set to achieve the generation of the target poetry, combining the first and second presets Poetry generator interacts with users to improve creative efficiency and quality.

Benefits of technology

The balance of improving the efficiency and quality of poetry creation has been achieved, the problem of poor themes of poetry generated based on text generators has been overcome, and the quality of generated poetry has been improved through human-computer interaction.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115310426B_ABST
    Figure CN115310426B_ABST
Patent Text Reader

Abstract

The present application discloses a poetry generation method, device, electronic device and readable storage medium, which are applied to the field of natural language processing technology. The poetry generation method includes: obtaining poetry description information; generating a subject vernacular text sequence corresponding to a target poem based on the poetry description information and a first preset poetry generator; inputting the subject vernacular text sequence into the first preset poetry generator to obtain a candidate poetry clause set corresponding to the target poem, wherein the candidate poetry clause set is a set of candidate clauses describing the theme of the target poem; iteratively adjusting the candidate poetry clause sequence corresponding to the candidate poetry clause set based on a second preset poetry generator and a poetry clause processing command input by a user to obtain the target poem. The present application solves the technical problem of difficulty in balancing the creation efficiency and quality of poetry.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of natural language processing, and in particular to a poetry generation method, device, electronic device and readable storage medium. Background Art

[0002] With the continuous development of artificial intelligence, deep learning technology has been applied to more and more fields. Taking poetry generation in the cultural field as an example, it can generate a large amount of text content in a short time by relying on a text generator trained based on deep learning technology, and then generate the poetry needed by users. However, due to the lack of learning signals that accurately quantify the theme of poetry, the poetry generated by the text generator is often not very themed. For example, the seven-character regulated verse "The tide comes from the east of Jiujiang, and half of the fragrant lotus fills the county. When I go to the northwest of Qiongtai, I suspect I am already in the smoke." The theme of the first half is the tide, while the second half describes it with people as the main body. Therefore, the current poetry generation system constructed based on text generators generates poems of poor quality. If the method of artificially creating poetry is continued, it is limited by factors such as creative talent and creative quality, and the efficiency of creating poetry is usually low. Therefore, it is currently difficult to take into account both the efficiency and quality of poetry creation. Summary of the invention

[0003] The main purpose of this application is to provide a poetry generation method, device, electronic device and readable storage medium, aiming to solve the technical problem in the prior art that it is difficult to strike a balance between poetry creation efficiency and poetry quality.

[0004] To achieve the above objectives, the present application provides a poetry generation method, which comprises:

[0005] Get poem description information;

[0006] Generate a subject vernacular text sequence corresponding to the target poem according to the poem description information and the first preset poem generator;

[0007] Inputting the subject vernacular text sequence into the first preset poetry generator to obtain a set of candidate poetry clauses corresponding to the target poem, wherein the set of candidate poetry clauses is a set of candidate clauses describing the subject of the target poem;

[0008] Based on the second preset poetry generator and the poetry clause processing command input by the user, the candidate poetry clause sequence corresponding to the candidate poetry clause set is iteratively adjusted to obtain the target poem.

[0009] To achieve the above purpose, the present application also provides a poetry generation device, the poetry generation device comprising:

[0010] The acquisition module is used to obtain the poem description information;

[0011] A generation module, used to generate a theme vernacular text sequence corresponding to the target poem according to the poem description information and a first preset poem generator;

[0012] An input module, used for inputting the subject vernacular text sequence into the first preset poetry generator to obtain a set of candidate poetry clauses corresponding to the target poem, wherein the set of candidate poetry clauses is a set of candidate clauses describing the subject of the target poem;

[0013] An adjustment module is used to iteratively adjust the candidate poetry clause sequence corresponding to the candidate poetry clause set according to the second preset poetry generator and the poetry clause processing command input by the user to obtain the target poem.

[0014] The present application also provides an electronic device, comprising: a memory, a processor, and a program of the poetry generation method stored in the memory and executable on the processor. When the program of the poetry generation method is executed by the processor, the steps of the poetry generation method as described above can be implemented.

[0015] The present application also provides a computer-readable storage medium, on which is stored a program for implementing the poetry generation method. When the program of the poetry generation method is executed by a processor, the steps of the poetry generation method as described above are implemented.

[0016] The present application also provides a computer program product, including a computer program, which implements the steps of the above-mentioned poetry generation method when executed by a processor.

[0017] The present application provides a poetry generation method, device, electronic device and readable storage medium, that is, obtaining poetry description information; generating a theme vernacular sequence corresponding to a target poem based on the poetry description information and a first preset poetry generator; inputting the theme vernacular sequence into the first preset poetry generator to obtain a set of candidate poetry clauses corresponding to the target poem, wherein the candidate poetry clause set is a collection of candidate clauses that describe the theme of the target poem; iteratively adjusting the candidate poetry clause sequence corresponding to the candidate poetry clause set based on a second preset poetry generator and a poetry clause processing command input by a user to obtain the target poem. Since a set of candidate clauses describing the theme of the poem can be obtained through the first preset poem generator, that is, the purpose of generating candidate clauses that highlight the theme of the target poem can be achieved through the first preset poem generator, and then the candidate clauses are adjusted interactively by the second preset poem generator and the poem clause processing command input by the user, and finally the target verse corresponding to the target poem is obtained. That is, based on the poem description information of the target poem, with the cooperation of the first preset poem generator, the second preset poem generator and the user command, the purpose of obtaining the target verse corresponding to the poem description information is achieved. Since the first preset poem generator and the second preset poem generator have the characteristics of fast generation efficiency and low generation cost, the generation process of the candidate clause corresponding to the target verse is guaranteed. That is, The efficiency of creating candidate clauses is improved. At the same time, since users can make a more objective evaluation of the pros and cons of candidate clauses than text generators, the target sentences obtained after iterative adjustment can be more in line with market demand. That is, by iteratively processing candidate clauses through human-computer interactive cooperation between the text generator and the user, the goal of obtaining higher quality than the single processing of candidate clauses by the text generator can be achieved. Therefore, the goal of balancing the efficiency of poetry creation and the quality of poetry is achieved, rather than just generating the poetry required by users based on a text generator trained with deep learning technology. Therefore, the technical defect of the poetry generation system constructed based on the text generator, which leads to poor thematicity of the generated poetry, is overcome. Therefore, the efficiency of poetry creation and the quality of poetry are achieved. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0019] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0020] Figure 1 This is a flow chart of the first embodiment of the poetry generation method of the present application;

[0021] Figure 2 This is a flow chart of the second embodiment of the poetry generation method of the present application;

[0022] Figure 3 A schematic diagram of a device of a third embodiment of the poetry generation method of the present application;

[0023] Figure 4 This is a schematic diagram of the device structure of the hardware operating environment involved in the poetry generation method in the embodiment of the present application.

[0024] The purpose, features and advantages of this application will be further described in conjunction with the embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0025] In order to make the above-mentioned purposes, features and advantages of the present invention more obvious and easy to understand, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work belong to the scope of protection of the present invention.

[0026] Embodiment 1

[0027] First of all, it should be understood that in the field of natural language processing technology, especially in poetry creation, both humans and machines have unique advantages. The poetry generator based on deep learning is efficient in generating poetry, but humans have universal subjectivity in judging the quality of poetry. That is, different people have different judgments on the quality of poems of different qualities, but they have the same judgment criteria for poems with large quality differences. For example, based on the poetry generator that generates two poems A "Ten miles of streets and alleys looking for old friends, mountains and rivers looking for bosom friends" and B "Today is a good day, with the sun in my heart", the generator cannot make an objective evaluation of the quality of poems A and B. However, if The creation and evaluation processes are all done manually, which will make the creation efficiency low. At the same time, poetry emphasizes logic, emotion and artistic conception. If the subject reflected in the first and second paragraphs of a poem is inconsistent, it will give people a feeling that the theme is not prominent. At present, there is a lack of corresponding learning signals for the abstract concept of theme, which also leads to the fact that the theme of the poem generated by the text generator usually does not meet people's expectations. Therefore, the current poetry generation method has the technical defects of low efficiency of manual creation and poor quality of poetry generator creation. Therefore, there is an urgent need for a method that takes into account both the creation efficiency and the quality of poetry.

[0028] The present application embodiment provides a poetry generation method. In the first embodiment of the poetry generation method of the present application, refer to Figure 1 , the poetry generation method comprises:

[0029] Step S10, obtaining poem description information;

[0030] Step S20, generating a subject vernacular text sequence corresponding to the target poem according to the poem description information and the first preset poem generator;

[0031] In this embodiment, it should be noted that the poetry generation method is arranged in a poetry generation system, and the poetry generation system can be installed on smart devices such as mobile phones and computers. The target poem is a poem that meets the expected needs obtained by the user through the poetry generation system. The poem description information is used to describe the user's needs for poetry. When the user needs to compose a poem, the poem description information can be input into the poetry generation system of the smart device, and then based on the simple interaction between the user and the poetry generation system, a poem that meets the needs is generated. In an implementable manner, assuming that the poetry generation system is installed on a mobile phone terminal, the user inputs "generate a five-character regulated verse that blesses the future" in the interactive interface of the mobile phone, then the poetry generation system uses "generate a five-character regulated verse that blesses the future" as the poem description information, and generates a poem with the theme of "blessing the future" and the genre of "five-character regulated verse".

[0032] In addition, it should be noted that the first preset poetry generator is used to generate poetry sentence by sentence that meets the specifications of poetry sentences and has a prominent theme corresponding to each sentence. For example, in an implementable method, the user inputs multiple keywords as poetry description information, wherein the poetry description information includes "the genre of the poetry is regulated verse", then the first preset poetry generator generates vernacular clauses corresponding to the user's keywords with a specified number of poems, wherein each vernacular clause is used to describe the theme of the poem, and then generates corresponding candidate poetry clauses according to each vernacular clause, wherein the vernacular clause is used to represent the clause that meets the theme of the poem, and the candidate poetry clause is used to represent the clause that meets the theme and genre of the poem. For example, assuming the genre of the poem is seven For regulated verse, the number of vernacular clauses and the number of candidate poetry clauses are both 8. The theme vernacular sequence is the input parameter of the first preset poetry generator, which is used to characterize the total vernacular clauses that conform to the theme of the poem, wherein the total vernacular clauses are the sum of the vernacular clauses. For example, in an implementable manner, assuming that the poem description information includes "the poetry genre is five-character quatrain", "u1", "u2" and "u3", that is, the number of vernacular clauses is 4 (k=4), and the vernacular clauses are "e1", "e2", "e3" and "e4", then the theme vernacular sequence can be (u1, u2, u3, #, e1, e2, e3, e4), wherein "#" is a separator in the middle of the sequence.

[0033] As an example, step S10 to step S20 include: obtaining poem description information of a target poem input by a user; and generating a theme vernacular sequence corresponding to the target poem based on the poem description information and a first preset poem generator.

[0034] The poem description information includes poem number description information and poem theme description information, and the step of generating a theme vernacular text sequence corresponding to the target poem based on the poem description information and the first preset poem generator includes:

[0035] Step A10, determining the target number of verses of the target poem according to the verse number description information;

[0036] Step A20, determining the poem theme sequence of the target poem according to the poem theme description information;

[0037] Step A30, according to the candidate clause processing command input by the user, iteratively inputting the poem topic sequence into the first preset poem generator until a candidate topic sequence corresponding to the candidate vernacular clause sequence containing the target number of poem sentences is obtained;

[0038] Step A40, preprocessing the candidate topic sequence to obtain the topic vernacular sequence.

[0039] In this embodiment, it should be noted that the verse quantity description information is used to describe the number of verse clauses of the target poem, and the poem theme description information is used to describe the theme represented by the poem clauses of the target poem, which may specifically be poem keywords, etc. For example, in an implementable manner, assuming that the verse quantity description information is "4", and the poem theme information is the two major keywords "farewell" and "friend", and then the target poem is a five-character quatrain with the theme of "farewell to friends", wherein the verse quantity description information is the target verse quantity, and the poem theme sequence is initialized to a sequence determined by the poem theme description information. For example, assuming that the poem theme description information is the poem keywords "u4" and "u5", the poem theme sequence is (u1, u2, #).

[0040] In addition, it should be noted that the candidate clause processing command is used to process the candidate clauses of the target poem, the candidate vernacular clause sequence is the sequence corresponding to the candidate vernacular clauses, and the candidate topic sequence is the sequence of candidate topics of the target poem, wherein the candidate topic is the vernacular topic generated by the poem generation system based on the poem description information. For example, in an implementable manner, assuming that the genre of the target poem is a five-character quatrain, wherein the poem keywords "u7", "u8", "u9" and "u 10 ", the theme sequence of the poem is, (u7,u8,u9,u 10 ,#) When the poem theme sequence corresponding to the poem keyword is input into the first preset poem generator, the first preset poem generator will generate a plurality of candidate vernacular sentences, wherein the candidate vernacular sentences may be "r1", "r2", "r3" ... "r n ”, then (r1), (r2), (r3)… or r n can be used to represent candidate vernacular clause sequences. If the final target vernacular clauses selected are "r1", "r2", "r3" and "r4", the candidate subject sequence can be (u7,u8,u9,u 10 ,#,e7,e8) or (u7,u8,u9,u 10 ,#,e7,e8,e9) etc.

[0041] As an example, steps A10 to A40 include: taking the number represented by the verse quantity description information as the target verse quantity of the target poem; splicing the description sequence corresponding to the poem theme description information into a poem theme sequence of the target poem, wherein the description sequence is used to represent the sequence corresponding to the description information, and the description information may be one or more; according to the candidate clause processing command input by the user, iteratively inputting the poem theme sequence into the first preset poem generator until a candidate theme sequence corresponding to the candidate vernacular clause sequence containing the target verse quantity is obtained; inserting a preset sequence separator into the candidate theme sequence to obtain the theme vernacular sequence, wherein the preset sequence separator may be “&”.

[0042] In one feasible manner, after receiving the poem description information input by the user, the poetry generation system first obtains the poem theme sequence through initialization, and then iteratively inputs the poem theme sequence into the first preset poem generator to obtain a preset number of candidate vernacular clauses, and then manually judges whether the candidate vernacular clauses meet the quality effect, and then performs sentence processing on the candidate vernacular clauses that meet the quality effect to obtain the corresponding candidate vernacular clause sequence and insert it into the poem theme sequence, until the candidate theme sequence corresponding to the poem theme sequence includes the candidate vernacular clause sequence of the number of poem clauses corresponding to the poem sentence quantity description information, and finally performs interval processing on the candidate theme sequence (adding sequence separators) to obtain a theme vernacular text sequence.

[0043] The candidate clause processing command input by the user includes a candidate clause detection command and a candidate clause modification command. The step of iteratively inputting the poem topic sequence in the first preset poem generator according to the candidate clause processing command input by the user until obtaining a candidate topic sequence corresponding to a candidate vernacular clause sequence containing the target number of poem sentences includes:

[0044] Step B10, inputting the poem theme sequence into the first preset poem generator to generate a candidate vernacular clause set;

[0045] Step B20, detecting whether there is a candidate vernacular clause in the candidate vernacular clause set according to the candidate clause detection command;

[0046] Step B30, if the candidate vernacular clause does not exist, then return to the execution step: input the poem theme sequence into the first preset poem generator to generate a candidate vernacular clause set;

[0047] Step B40, if the candidate vernacular clause exists, modify the candidate vernacular clause according to the candidate clause modification command to obtain a target vernacular clause;

[0048] Step B50, iteratively updating the poetry theme sequence according to the target vernacular clauses, until the updated poetry theme sequence has candidate vernacular clause sequences of the target number of sentences.

[0049] In this embodiment, it should be noted that the candidate clause detection command is used to detect whether the candidate vernacular clause meets the user's quality effect requirements for the target poem, that is, to detect whether the candidate vernacular clause is a target vernacular clause, the target vernacular clause is a clause that meets the user's quality effect requirements for the target poem, the candidate vernacular clause set is a set of candidate vernacular clauses that describe the theme of the target poem, and the candidate clause modification command is used to modify the candidate vernacular clause, and the specific degree of modification is determined by the user. For example, in an implementable manner, assuming that the poetry keyword input by the user is "hope", the candidate vernacular clause is "Although there are many obstacles ahead, we will still ride the wind and waves, hang up the cloud sails, cross the sea, and reach the ideal other side", then the target vernacular clause can be "There will always be a day to ride the wind and waves, hang high sails to cross the vast ocean", wherein the process from the candidate vernacular clause to the target vernacular clause is to improve the user's satisfaction with the vernacular clause.

[0050] As an example, step B10 to step B50 include: inputting the poetry theme sequence into the first preset poetry generator to generate multiple candidate vernacular clauses; detecting whether there is a candidate vernacular clause in the candidate vernacular clause set based on the candidate clause detection command input by the user; if it is detected that the candidate vernacular clause does not exist in the candidate vernacular clause set, returning to the execution step: inputting the poetry theme sequence into the first preset poetry generator to generate a candidate vernacular clause set; if it is detected that the candidate vernacular clause exists in the candidate vernacular clause set, modifying the candidate vernacular clause according to the candidate clause modification command input by the user to obtain a target vernacular clause; iteratively inserting the target vernacular clause sequence corresponding to the target vernacular clause into the poetry theme sequence to obtain a candidate theme sequence having the candidate vernacular clause sequence of the target number of poetry sentences.

[0051] Step S30, inputting the subject vernacular text sequence into the first preset poem generator to obtain a set of candidate poem clauses corresponding to the target poem, wherein the set of candidate poem clauses is a set of candidate clauses describing the subject of the target poem;

[0052] Step S40, based on the second preset poetry generator and the poetry clause processing command input by the user, iteratively adjust the candidate poetry clause sequence corresponding to the candidate poetry clause set to obtain the target poem.

[0053] In this embodiment, it should be noted that the candidate poetry clause set is a set of candidate sentences that describe the target poetry theme, that is, the candidate poetry clause set is a set of multiple candidate poetry clauses, and the second preset poetry generator is used to optimize the poetry clauses sentence by sentence to generate poetry that meets user needs. For example, in one implementable method, assuming that the target poem is a five-character quatrain, that is, the candidate poetry clause is five characters, then the second preset poetry generator can optimize each character of each candidate poetry clause, and the specific characters are determined by the interaction process between the user and the poetry generation system.

[0054] As an example, steps S30 to S40 include: inputting the subject vernacular text sequence into the first preset poetry generator to obtain a set of candidate poetry clauses corresponding to the target poetry, wherein the candidate poetry clause set is a collection of candidate clauses that describe the subject of the target poetry; iteratively adjusting the candidate poetry clause sequence corresponding to the candidate poetry clause set according to the second preset poetry generator and a poetry clause processing command input by the user to obtain the target poetry, wherein the poetry clause processing command is used to process the candidate poetry clauses.

[0055] The poetry clause processing command input by the user includes a poetry clause detection command and a poetry clause evaluation command. The step of iteratively adjusting the candidate poetry clause sequence corresponding to the candidate poetry clause set according to the second preset poetry generator and the poetry clause processing command input by the user to obtain the target poem includes:

[0056] Step C10, determining the target number of verses of the target poem based on the candidate poem clause set;

[0057] Step C20, detecting whether there is a candidate poetry clause in the candidate poetry clause set according to the poetry clause detection command;

[0058] Step C30, if it does not exist, then return to the execution step: input the subject vernacular text sequence into the first preset poetry generator to obtain a set of candidate poetry clauses corresponding to the target poem, wherein the set of candidate poetry clauses is a set of candidate clauses describing the subject of the target poem;

[0059] Step C40, if it exists, iteratively updating the candidate poetry clause sequence according to the poetry clause evaluation command and the candidate poetry clause, until the updated candidate poetry clause sequence contains the target poetry clause sequence of the target number of poetry clauses;

[0060] Step C50, converting the target sentence sequence in the updated candidate poem clause sequence into the target sentence.

[0061] As an example, steps C10 to C50 include: taking the number of candidate poetry clauses in the candidate poetry clause set as the target number of poetry sentences of the target poem; detecting whether there are candidate poetry clauses in the candidate poetry clause set according to the poetry clause detection command, wherein the poetry clause detection command is used to detect whether the candidate poetry clause meets the user's quality effect requirements for the target poem; if it is detected that the candidate poetry clause does not exist in the candidate poetry clause set, returning to the execution step: inputting the theme vernacular text sequence into the first preset poetry generator to obtain the candidate poetry clause set corresponding to the target poem, wherein the candidate poetry clause set is a collection of candidate clauses describing the theme of the target poem; if it is detected that the candidate poetry clause exists in the candidate poetry clause set, iteratively updating the candidate poetry clause sequence according to the poetry clause evaluation command and the candidate poetry clause until the updated candidate poetry clause sequence contains the target poetry sentence sequence of the target number of poetry sentences; converting the target poetry sentence sequence in the updated candidate poetry clause sequence into the target poetry sentence.

[0062] The step of iteratively updating the candidate poetry clause sequence according to the poetry clause evaluation command and the candidate poetry clause until the updated candidate poetry clause sequence contains the target poetry clause sequence of the target number of poetry clauses comprises:

[0063] Step D10, evaluating and editing the candidate poem clauses according to the first poem clause evaluation command, to obtain the evaluated and edited candidate poem clauses;

[0064] Step D20, determining whether the candidate poem is a target poem according to the second poem clause evaluation command;

[0065] Step D30: if yes, then update the candidate poem clause sequence according to the candidate poem;

[0066] Step D40, if not, determining the candidate poem sentence sequence corresponding to the candidate poem clause sequence;

[0067] Step D50, processing the candidate poem sequence according to the clause sequence number of the candidate poem clause to obtain a processed candidate poem sequence;

[0068] Step D60, input the processed candidate poem sequence into the second preset poem generator to obtain the target poem sentence, and return to the execution step: according to the poem clause detection command, detect whether the candidate poem clause set exists.

[0069] In this embodiment, it should be noted that the first poetry clause evaluation command is used to feedback the user's evaluation result on the poetry clause, the second poetry clause evaluation command is used to feedback the user's evaluation result on the entire poem, the clause sequence number is used to identify the position of different candidate poetry clauses in the target poem, and the candidate poetry clause sequence is spliced ​​by each of the candidate poetry clause sequences. For example, in an implementable manner, assuming that after the subject vernacular sequence is input into the first preset poetry generator, the candidate poetry clauses are "p1", "p2", "p3"... "p n According to the first poem clause evaluation command input by the user, the candidate poem clause "s k ", and then insert the sequence corresponding to the evaluated and edited candidate verses into the subject vernacular text sequence until the number of target verses inserted into the subject vernacular text sequence is consistent with the number represented by the verse quantity description information.

[0070] As an example, steps D10 to D60 include: based on the first poetry clause evaluation command input by the user, evaluating and editing the candidate poetry clause to obtain the evaluated and edited candidate poetry clause; based on the second poetry clause evaluation command input by the user, determining whether the candidate poetry clause is the target poetry clause; if it is determined that the candidate poetry clause is the target poetry clause, splicing the candidate poetry clause sequence corresponding to the candidate poetry clause to the candidate poetry clause sequence; if it is determined that the candidate poetry clause is not the target poetry clause, determining the candidate poetry clause sequence corresponding to the candidate poetry clause sequence; based on the clause sequence number of the candidate poetry clause, processing the candidate poetry clause sequence to obtain a processed candidate poetry clause sequence; inputting the processed candidate poetry clause sequence into the second preset poetry generator to obtain the target poetry clause, and returning to the execution step: based on the poetry clause detection command, detecting whether the candidate poetry clause exists in the candidate poetry clause set.

[0071] Wherein, before the step of obtaining the poem description information, the poem generation method further includes:

[0072] Step E10, obtaining a poem keyword sequence corresponding to the poem training corpus and a poem theme sequence corresponding to the translation training corpus, wherein the poem training corpus of the poem training corpus and the translation training corpus of the translation training corpus correspond one to one;

[0073] Step E20, concatenating the poetry training corpus sequence, the poetry keyword sequence and the poetry theme sequence into a poetry training corpus sequence;

[0074] Step E30, splicing and adjusting the poetry training corpus sequence according to a first preset splicing method to obtain a first training corpus sequence;

[0075] Step E40, training the first generator to be trained according to the first training corpus sequence to obtain a first preset poetry generator.

[0076] In this embodiment, it should be noted that the poetry training corpus is a collection of poetry training corpora, the poetry training corpus is used to represent poems randomly extracted by the poetry generation system from a cloud database, the translation training corpus is a collection of translations of the poetry training corpus, the poetry keyword sequence is a sequence corresponding to poetry keywords extracted by the poetry generation system from the poetry training corpus, the poetry theme sequence is used to represent the sequence corresponding to the description theme of the translation training corpus of the translation training corpus, the first preset splicing method is a splicing method with keyword-theme-poetry clause as the splicing order, the first training corpus sequence is used to train the first generator to be trained, and the first generator to be trained can be GTP-2, etc.

[0077] As an example, steps E10 to E40 include: obtaining a poetry keyword sequence corresponding to a poetry training corpus and a poetry theme sequence corresponding to a translation training corpus, wherein the poetry training corpus of the poetry training corpus and the translation training corpus of the translation training corpus correspond one to one; splicing the poetry training corpus sequence, the poetry keyword sequence and the poetry theme sequence into a poetry training corpus sequence; splicing the poetry training corpus sequence, the poetry keyword sequence and the poetry theme sequence into a poetry training corpus sequence; splicing and adjusting the poetry training corpus sequence in the order of keyword-theme-poetry clause to obtain a first training corpus sequence.

[0078] In one practicable manner, assume that the poetry training corpus is {s1, s2, s3, s4}, where s k The subscript "k" is used to represent the position of the poem clause corresponding to the poem training corpus in the poem, and then the keywords of the poem training corpus are extracted to form a poem keyword sequence (u1, u2, u3...u s ), where u s The subscript "s" of is used to represent the importance level of the poetry keywords corresponding to the translation training corpus, that is, the keywords with higher importance level are placed at the front in the corresponding keyword sequence, wherein the extraction method can be based on the translation or completely based on manual extraction, and then the corresponding translation topic sequence (e1, e2, e3...e4) is obtained after the translation training corpus is processed and edited. k ), and is spliced ​​into a first training corpus sequence (u1, u2, u3…u s ,#,e1,e2,e3……e k ,&,s1,s2,s3……sk ), and then train the first generator to be trained based on the first training corpus sequence to obtain a first preset poetry generator.

[0079] An embodiment of the present application provides a poetry generation method, namely, obtaining poetry description information; generating a theme vernacular text sequence corresponding to a target poem based on the poetry description information and a first preset poetry generator; inputting the theme vernacular text sequence into the first preset poetry generator to obtain a set of candidate poetry clauses corresponding to the target poem, wherein the candidate poetry clause set is a collection of candidate clauses that describe the theme of the target poem; iteratively adjusting the candidate poetry clause sequence corresponding to the candidate poetry clause set based on a second preset poetry generator and a poetry clause processing command input by a user to obtain the target poem. Since a set of candidate clauses describing the theme of the poem can be obtained through the first preset poem generator, that is, the purpose of generating candidate clauses that highlight the theme of the target poem can be achieved through the first preset poem generator, and then the candidate clauses are adjusted interactively by the second preset poem generator and the poem clause processing command input by the user, and finally the target verse corresponding to the target poem is obtained. That is, based on the poem description information of the target poem, with the cooperation of the first preset poem generator, the second preset poem generator and the user command, the purpose of obtaining the target verse corresponding to the poem description information is achieved. Since the first preset poem generator and the second preset poem generator have the characteristics of fast generation efficiency and low generation cost, the generation process of the candidate clause corresponding to the target verse is guaranteed. That is, The efficiency of creating candidate clauses is improved. At the same time, since users can make a more objective evaluation of the pros and cons of candidate clauses than text generators, the target sentences obtained after iterative adjustment can be more in line with market demand. That is, by iteratively processing candidate clauses through human-computer interactive cooperation between the text generator and the user, the goal of obtaining higher quality than the single processing of candidate clauses by the text generator can be achieved. Therefore, the goal of balancing the efficiency of poetry creation and the quality of poetry is achieved, rather than just generating the poetry required by users based on a text generator trained with deep learning technology. Therefore, the technical defect of the poetry generation system constructed based on the text generator, which leads to poor thematicity of the generated poetry, is overcome. Therefore, the efficiency of poetry creation and the quality of poetry are achieved.

[0080] Embodiment 2

[0081] Further, refer to Figure 2 In another embodiment of the present application, the same or similar contents as those in the above-mentioned embodiment 1 can be referred to the above introduction and will not be described in detail later. On this basis, after the step of splicing the poetry training corpus sequence, the poetry keyword sequence and the poetry theme sequence into a poetry training corpus sequence, the poetry generation method further includes:

[0082] Step F10, splicing and adjusting the poetry training corpus sequence according to a second preset splicing method to obtain a second training corpus sequence;

[0083] Step F20, performing masking processing on the second training corpus sequence to obtain a target training corpus sequence;

[0084] Step F30, training the second generator to be trained according to the target training corpus sequence to obtain a second preset poetry generator.

[0085] In this embodiment, it should be noted that the second preset splicing method is used to represent a method of splicing in the order of theme-poetry clause, wherein different sequences are separated by intermediate separators. In an practicable manner, the second training corpus sequence can be (e1, e2, e3...e k ,&,s1,s2,s3……s k ), the target training corpus sequence is the second training corpus sequence after masking by a preset training algorithm. For example, assuming that the target training corpus sequence is (e1, e2, e3…e k ,&,s1,s2,s3……s k * ), then s k * To mask the poem clauses, in order to be consistent with the actual application, the masking positions can be set to k1, k2...k m , where "m" is used to represent the number of occlusions, 1≤m≤M, and the value of "M" is: 4 for five-character poems and 5 for seven-character poems. In order to ensure the operating efficiency of the poetry generation system and user psychology, this algorithm only applies to the current clause s k * Masking is performed, where the following cross entropy loss function is used when training the generator to be trained with the target training corpus sequence:

[0086]

[0087] Where s is, D1 is the poetry training corpus, k is the clause sequence number, K is the number of target sentences, i is the character of the occluded poem clause, m is the number of occlusions, softmax(G2(x k ),k i ) is the pair k i The occluded characters at the position are calculated using the softmax function. Since a part of the input of this algorithm always remains unchanged, random masking decoding is used while ensuring the advantages of machine translation, which can realize masking of non-adjacent words in a certain poem clause.

[0088] As an example, steps F10 to F30 include: splicing and adjusting the poetry training corpus sequence in the order of topic-poetry clause to obtain a second training corpus sequence; masking the second training corpus sequence to obtain a target training corpus sequence; training the second generator to be trained based on the target training corpus sequence to obtain a second preset poetry generator, wherein the second generator to be trained can be a bidirectional generator such as BERT-2.

[0089] The embodiment of the present application provides a poetry generator training method, that is, according to a second preset splicing method, the poetry training corpus sequence is spliced ​​and adjusted to obtain a second training corpus sequence, the second training corpus sequence is masked to obtain a target training corpus sequence, and the second generator to be trained is trained according to the target training corpus sequence to obtain a second preset poetry generator. Compared with training the second generator to be trained by the traditional text generation training method, the embodiment of the present application can randomly mask a preset number of characters of the current poetry clause. Since only the current poetry clause is masked, the purpose of ensuring the efficiency of training the poetry generator can be achieved. At the same time, since the algorithm can mask a preset number of characters of the current poetry clause, that is, it can mask both the adjacent characters of the current poetry clause and the non-adjacent characters of the current poetry clause, it overcomes the technical defect of the prior art that the masking of the non-adjacent characters of the current poetry clause takes a long time, which leads to the low efficiency of the training generator, so it lays a foundation for the application effect of the poetry generator.

[0090] Embodiment 3

[0091] The present application also provides a poetry generation device, referring to Figure 3 , the poetry generating device comprises:

[0092] The acquisition module is used to obtain the poem description information;

[0093] A generation module, used to generate a theme vernacular text sequence corresponding to the target poem according to the poem description information and a first preset poem generator;

[0094] An input module, used for inputting the subject vernacular text sequence into the first preset poetry generator to obtain a set of candidate poetry clauses corresponding to the target poem, wherein the set of candidate poetry clauses is a set of candidate clauses describing the subject of the target poem;

[0095] An adjustment module is used to iteratively adjust the candidate poetry clause sequence corresponding to the candidate poetry clause set according to the second preset poetry generator and the poetry clause processing command input by the user to obtain the target poem.

[0096] Optionally, the poetry clause processing command input by the user includes a poetry clause detection command and a poetry clause evaluation command, and the adjustment module is further used to:

[0097] Determining the target number of verses of the target poem based on the candidate poem clause set;

[0098] According to the poem clause detection command, detecting whether there is a candidate poem clause in the candidate poem clause set;

[0099] If it does not exist, return to the execution step: input the subject vernacular text sequence into the first preset poetry generator to obtain a set of candidate poetry clauses corresponding to the target poem, wherein the set of candidate poetry clauses is a set of candidate clauses describing the subject of the target poem;

[0100] If so, iteratively updating the candidate poetry clause sequence according to the poetry clause evaluation command and the candidate poetry clause until the updated candidate poetry clause sequence contains the target poetry clause sequence of the target number of poetry clauses;

[0101] The target sentence sequence in the updated candidate poem clause sequence is converted into the target sentence.

[0102] Optionally, the adjustment module is further used for:

[0103] According to the first poem clause evaluation command, the candidate poem clause is evaluated and edited to obtain the candidate poem clause after evaluation and editing;

[0104] Determining whether the candidate poem is a target poem according to the second poem clause evaluation command;

[0105] If yes, then update the candidate poem clause sequence according to the candidate poem;

[0106] If not, determining the candidate poem sentence sequence corresponding to the candidate poem sentence sequence;

[0107] Processing the candidate poem sentence sequence according to the clause sequence numbers of the candidate poem sentence to obtain a processed candidate poem sentence sequence;

[0108] Input the processed candidate poem sequence into the second preset poem generator to obtain the target poem sentence, and return to the execution step: according to the poem clause detection command, detect whether the candidate poem clause set has a candidate poem clause

[0109] Optionally, the poem description information includes poem number description information and poem theme description information, and the generation module is further used to:

[0110] Determining a target number of verses of the target poem according to the verse number description information;

[0111] Determining the poem theme sequence of the target poem according to the poem theme description information;

[0112] According to the candidate clause processing command input by the user, the poem topic sequence is iteratively input into the first preset poem generator until a candidate topic sequence corresponding to the candidate vernacular clause sequence containing the target number of poem sentences is obtained;

[0113] The candidate topic sequence is preprocessed to obtain the topic vernacular sequence.

[0114] Optionally, the candidate clause processing command input by the user includes a candidate clause detection command and a candidate clause modification command, and the generating module is further used to:

[0115] Inputting the poem theme sequence into the first preset poem generator to generate a candidate vernacular clause set;

[0116] According to the candidate clause detection command, detecting whether there is a candidate vernacular clause in the candidate vernacular clause set;

[0117] If the candidate vernacular clause does not exist, return to the execution step: input the poem theme sequence into the first preset poem generator to generate a candidate vernacular clause set;

[0118] If the candidate vernacular clause exists, modify the candidate vernacular clause according to the candidate clause modification command to obtain a target vernacular clause;

[0119] The poem theme sequence is iteratively updated according to the target vernacular clauses until the updated poem theme sequence has candidate vernacular clause sequences with the target number of sentences.

[0120] Optionally, the poetry generating device is further used for:

[0121] Obtaining a poem keyword sequence corresponding to a poem training corpus set and a poem theme sequence corresponding to a translation training corpus set, wherein the poem training corpus of the poem training corpus set and the translation training corpus of the translation training corpus set correspond one to one;

[0122] The poetry training corpus sequence, the poetry keyword sequence and the poetry theme sequence are concatenated together into a poetry training corpus sequence;

[0123] According to a first preset splicing method, the poetry training corpus sequence is spliced ​​and adjusted to obtain a first training corpus sequence;

[0124] Based on the first training corpus sequence, the first generator to be trained is trained to obtain a first preset poetry generator.

[0125] Optionally, the poetry generating device is further used for:

[0126] According to a second preset splicing method, the poetry training corpus sequence is spliced ​​and adjusted to obtain a second training corpus sequence;

[0127] Performing masking processing on the second training corpus sequence to obtain a target training corpus sequence;

[0128] Based on the target training corpus sequence, the second generator to be trained is trained to obtain a second preset poetry generator.

[0129] The poetry generation device provided by the present invention adopts the poetry generation method in the above embodiment to solve the technical problem of difficulty in balancing the efficiency of poetry creation and the quality of poetry. Compared with the prior art, the beneficial effects of the poetry generation device provided by the embodiment of the present invention are the same as the beneficial effects of the poetry generation method provided by the above embodiment, and other technical features in the poetry generation device are the same as the features disclosed in the above embodiment method, which will not be repeated here.

[0130] Embodiment 4

[0131] An embodiment of the present invention provides an electronic device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the device control method based on the electronic manual in the above-mentioned embodiment one.

[0132] Reference below Figure 4 , which shows a schematic diagram of the structure of an electronic device suitable for implementing the embodiments of the present disclosure. The electronic device in the embodiments of the present disclosure may include, but is not limited to, mobile terminals such as mobile phones, notebook computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 4 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.

[0133] like Figure 4As shown, the electronic device may include a processing device 1001 (e.g., a central processing unit, a graphics processing unit, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 1002 or a program loaded from a storage device 1003 to a random access memory (RAM) 1004. Various programs and data required for the operation of the electronic device are also stored in the RAM 1004. The processing device 1001, the ROM 1002, and the RAM 1004 are connected to each other via a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus.

[0134] Typically, the following systems can be connected to the I / O interface 1006: input devices 1007 including, for example, a touch screen, a touchpad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; output devices 1008 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; storage devices 1003 including, for example, a magnetic tape, a hard disk, etc.; and communication devices 1009. The communication device can allow the electronic device to communicate with other devices wirelessly or by wire to exchange data. Although the figure shows an electronic device with various systems, it should be understood that it is not required to implement or have all the systems shown. More or fewer systems may be implemented or have alternatively.

[0135] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program contains program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication device 1009, or installed from the storage device 1003, or installed from the ROM 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiment of the present disclosure are executed.

[0136] The electronic device provided by the present invention adopts the device control method based on the electronic manual in the above embodiment, which solves the technical problem of low efficiency in controlling the electronic manual and the smart device operation interface to complete pairing. Compared with the prior art, the beneficial effects of the electronic device provided by the embodiment of the present invention are the same as the beneficial effects of the device control method based on the electronic manual provided by the above embodiment, and other technical features in the electronic device are the same as the features disclosed in the above embodiment method, which will not be repeated here.

[0137] It should be understood that the various parts of the present disclosure can be implemented with hardware, software, firmware or a combination thereof. In the description of the above embodiments, specific features, structures, materials or characteristics can be combined in any one or more embodiments or examples in a suitable manner.

[0138] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed by the present invention, which should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.

[0139] Embodiment 5

[0140] This embodiment provides a computer-readable storage medium having computer-readable program commands stored thereon, and the computer-readable program commands are used to execute the poetry generation method in the above-mentioned embodiment one.

[0141] The computer-readable storage medium provided in the embodiment of the present invention may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, systems or devices, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In the present embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program, which may be used by or in combination with a command execution system, system or device. The program code contained on the computer-readable storage medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination thereof.

[0142] The computer-readable storage medium may be included in the electronic device, or may exist independently without being installed in the electronic device.

[0143] The above-mentioned computer-readable storage medium carries one or more programs. When the above-mentioned one or more programs are executed by an electronic device, the electronic device is enabled to: obtain poem description information; generate a theme vernacular sequence corresponding to a target poem based on the poem description information and a first preset poem generator; input the theme vernacular sequence into the first preset poem generator to obtain a set of candidate poem clauses corresponding to the target poem, wherein the candidate poem clause set is a collection of candidate clauses that describe the theme of the target poem; iteratively adjust the candidate poem clause sequence corresponding to the candidate poem clause set based on a second preset poem generator and a poem clause processing command input by a user to obtain the target poem.

[0144] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages, or a combination thereof, including object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., through the Internet using an Internet service provider).

[0145] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present invention. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable commands for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer commands.

[0146] The modules involved in the embodiments described in the present disclosure may be implemented by software or hardware, wherein the name of the module does not limit the unit itself in some cases.

[0147] The computer-readable storage medium provided by the present invention stores computer-readable program commands for executing the above-mentioned poetry generation method, which solves the technical problem of difficulty in balancing the efficiency of poetry creation and the quality of poetry. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided by the embodiment of the present invention are the same as the beneficial effects of the poetry generation method provided by the above-mentioned embodiment, and will not be repeated here.

[0148] Embodiment 6

[0149] The present application also provides a computer program product, including a computer program, which implements the steps of the above-mentioned poetry generation method when executed by a processor.

[0150] The computer program product provided by the present application solves the technical problem of the difficulty in balancing the efficiency of poetry creation and the quality of poetry. Compared with the prior art, the beneficial effects of the computer program product provided by the embodiment of the present invention are the same as the beneficial effects of the poetry generation method provided by the above embodiment, which will not be repeated here.

[0151] The above are only preferred embodiments of the present application, and are not intended to limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent processing scope of the present application.

Claims

1. A poetry generation method, characterized in that: The poetry generation method comprises: Acquire poem description information, wherein the poem description information includes poem verse quantity description information and poem theme description information; Determining a target number of verses of a target poem according to the verse number description information; Determining the poem theme sequence of the target poem according to the poem theme description information; According to the candidate clause processing command input by the user, the poem topic sequence is iteratively input into the first preset poem generator until a candidate topic sequence corresponding to the candidate vernacular clause sequence containing the target number of poem sentences is obtained; Preprocessing the candidate theme sequence to obtain a theme vernacular text sequence corresponding to the target poem; Inputting the subject vernacular text sequence into the first preset poetry generator to obtain a set of candidate poetry clauses corresponding to the target poem, wherein the set of candidate poetry clauses is a set of candidate clauses describing the poetry theme of the target poem; According to the second preset poetry generator and the poetry clause processing command input by the user, the candidate poetry clause sequence corresponding to the candidate poetry clause set is iteratively adjusted to obtain the target poetry. The poetry clause processing command input by the user includes a poetry clause detection command and a poetry clause evaluation command. The poetry clause detection command is used to detect whether the candidate poetry clause meets the user's quality effect requirements for the target poetry.

2. The poetry generation method according to claim 1, characterized in that: The step of iteratively adjusting the candidate poetry clause sequence corresponding to the candidate poetry clause set according to the second preset poetry generator and the poetry clause processing command input by the user to obtain the target poem includes: Determining the target number of verses of the target poem based on the candidate poem clause set; According to the poem clause detection command, detecting whether there is a candidate poem clause in the candidate poem clause set; If it does not exist, return to the execution step: input the subject vernacular text sequence into the first preset poetry generator to obtain a set of candidate poetry clauses corresponding to the target poem, wherein the set of candidate poetry clauses is a set of candidate clauses describing the poetry theme of the target poem; If so, iteratively updating the candidate poetry clause sequence according to the poetry clause evaluation command and the candidate poetry clause until the updated candidate poetry clause sequence contains the target poetry clause sequence of the target number of poetry clauses; The target sentence sequence in the updated candidate poem clause sequence is converted into the target sentence.

3. The poetry generation method as claimed in claim 2, characterized in that: The poetry clause evaluation command includes a first poetry clause evaluation command and a second poetry clause evaluation command, and the step of iteratively updating the candidate poetry clause sequence according to the poetry clause evaluation command and the candidate poetry clause until the updated candidate poetry clause sequence includes the target poetry clause sequence of the target number of poetry clauses includes: According to the first poem clause evaluation command, the candidate poem clause is evaluated and edited to obtain the candidate poem clause after evaluation and editing; Determining whether the candidate poem is a target poem according to the second poem clause evaluation command; If yes, then update the candidate poem clause sequence according to the candidate poem; If not, determining the candidate poem sentence sequence corresponding to the candidate poem sentence sequence; Processing the candidate poem sentence sequence according to the clause sequence numbers of the candidate poem sentence to obtain a processed candidate poem sentence sequence; The processed candidate poem sequence is input into the second preset poem generator to obtain the target poem sentence, and the execution step is returned: according to the poem clause detection command, the candidate poem clause set is detected to see whether there is a candidate poem clause.

4. The poetry generation method according to claim 1, characterized in that: The candidate clause processing command input by the user includes a candidate clause detection command and a candidate clause modification command. The step of iteratively inputting the poem topic sequence in the first preset poem generator according to the candidate clause processing command input by the user until a candidate topic sequence corresponding to the candidate vernacular clause sequence containing the target number of poem sentences is obtained comprises: Inputting the poem theme sequence into the first preset poem generator to generate a candidate vernacular clause set; According to the candidate clause detection command, detecting whether there is a candidate vernacular clause in the candidate vernacular clause set; If the candidate vernacular clause does not exist, return to the execution step: input the poem theme sequence into the first preset poem generator to generate a candidate vernacular clause set; If the candidate vernacular clause exists, modify the candidate vernacular clause according to the candidate clause modification command to obtain a target vernacular clause; The poem theme sequence is iteratively updated according to the target vernacular clauses until the updated poem theme sequence has candidate vernacular clause sequences with the target number of sentences.

5. The poetry generation method according to claim 1, characterized in that: Before the step of obtaining the poem description information, the poem generation method further includes: Obtaining a poem keyword sequence corresponding to a poem training corpus set and a poem theme sequence corresponding to a translation training corpus set, wherein the poem training corpus of the poem training corpus set and the translation training corpus of the translation training corpus set correspond one to one; The poetry training corpus sequence, the poetry keyword sequence and the poetry theme sequence are concatenated together into a poetry training corpus sequence; According to a first preset splicing method, the poetry training corpus sequence is spliced ​​and adjusted to obtain a first training corpus sequence; Based on the first training corpus sequence, the first generator to be trained is trained to obtain a first preset poetry generator.

6. The poetry generation method according to claim 5, characterized in that: After the step of splicing the poetry training corpus sequence, the poetry keyword sequence and the poetry theme sequence into a poetry training corpus sequence, the poetry generation method further comprises: According to a second preset splicing method, the poetry training corpus sequence is spliced ​​and adjusted to obtain a second training corpus sequence; Performing masking on the second training corpus sequence to obtain a target training corpus sequence; Based on the target training corpus sequence, the second generator to be trained is trained to obtain a second preset poetry generator.

7. A poetry generation device, characterized in that: The poetry generating device comprises: An acquisition module, used to acquire poem description information, wherein the poem description information includes poem number description information and poem theme description information; A generating module, for determining a target number of verses of a target poem according to the verse number description information; Determining the poem theme sequence of the target poem according to the poem theme description information; According to the candidate clause processing command input by the user, the poem topic sequence is iteratively input into the first preset poem generator until a candidate topic sequence corresponding to the candidate vernacular clause sequence containing the target number of poem sentences is obtained; Preprocessing the candidate theme sequence to obtain a theme vernacular text sequence corresponding to the target poem; An input module, used for inputting the subject vernacular text sequence into the first preset poetry generator to obtain a set of candidate poetry clauses corresponding to the target poem, wherein the set of candidate poetry clauses is a set of candidate clauses describing the poetry theme of the target poem; An adjustment module is used to iteratively adjust the candidate poetry clause sequence corresponding to the candidate poetry clause set according to a second preset poetry generator and a poetry clause processing command input by a user to obtain the target poetry. The poetry clause processing command input by the user includes a poetry clause detection command, and the poetry clause detection command is used to detect whether the candidate poetry clause meets the user's quality effect requirements for the target poetry.

8. An electronic device, characterized in that: The electronic device comprises: at least one processor; and, a memory communicatively connected to the at least one processor; wherein, The memory stores commands executable by the at least one processor, and the commands are executed by the at least one processor to enable the at least one processor to perform the steps of the poetry generation method described in any one of claims 1 to 6.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a program for implementing the poetry generation method, and the program for implementing the poetry generation method is executed by a processor to implement the steps of the poetry generation method as described in any one of claims 1 to 6.