CN111291536A - Method and system for automatically generating poems - Google Patents

Method and system for automatically generating poems Download PDF

Info

Publication number
CN111291536A
CN111291536A CN201811392886.3A CN201811392886A CN111291536A CN 111291536 A CN111291536 A CN 111291536A CN 201811392886 A CN201811392886 A CN 201811392886A CN 111291536 A CN111291536 A CN 111291536A
Authority
CN
China
Prior art keywords
poem
poetry
generator
score
index
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201811392886.3A
Other languages
Chinese (zh)
Inventor
孙茂松
矣晓沅
李若愚
李文浩
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tsinghua University
Original Assignee
Tsinghua University
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tsinghua University filed Critical Tsinghua University
Priority to CN201811392886.3A priority Critical patent/CN111291536A/en
Publication of CN111291536A publication Critical patent/CN111291536A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q10/00Administration; Management
    • G06Q10/06Resources, workflows, human or project management; Enterprise or organisation planning; Enterprise or organisation modelling
    • G06Q10/063Operations research, analysis or management
    • G06Q10/0639Performance analysis of employees; Performance analysis of enterprise or organisation operations
    • G06Q10/06393Score-carding, benchmarking or key performance indicator [KPI] analysis

Landscapes

  • Business, Economics & Management (AREA)
  • Human Resources & Organizations (AREA)
  • Engineering & Computer Science (AREA)
  • Strategic Management (AREA)
  • Development Economics (AREA)
  • Economics (AREA)
  • Entrepreneurship & Innovation (AREA)
  • Educational Administration (AREA)
  • Operations Research (AREA)
  • Marketing (AREA)
  • Game Theory and Decision Science (AREA)
  • Quality & Reliability (AREA)
  • Tourism & Hospitality (AREA)
  • Physics & Mathematics (AREA)
  • General Business, Economics & Management (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Financial Or Insurance-Related Operations Such As Payment And Settlement (AREA)

Abstract

The embodiment of the invention provides a method and a system for automatically generating poetry, wherein the method comprises the following steps: acquiring a plurality of poems according to a plurality of keywords and a preset poem generator; evaluating each poem by using each marker to obtain each index score of each poem; obtaining a comprehensive score of each poem according to each index score of each poem; optimizing the parameters of the preset poetry generator according to the comprehensive score of each poetry; and acquiring a plurality of target poems according to the plurality of keywords and the target poem generator. According to the embodiment of the invention, the problems of limited optimization coverage and unmatched parameter optimization indexes of the existing poetry generating system are solved by directly approximating and quantizing the four indexes of the poetry evaluated by the human, so that the generated poetry can be improved in each index without conflict, and the quality of the poetry at the angle of human evaluation can be greatly improved.

Description

Method and system for automatically generating poems
Technical Field
The embodiment of the invention relates to the technical field of computers, in particular to a method and a system for automatically generating poetry.
Background
Language is an embodiment of human intelligence, and poetry is a highly condensed and artistic language art. For thousands of years, poetry has been popular with people of different countries, nationalities and cultures due to its concise form, elegant expression and rich emotion and connotation.
With the development of artificial intelligence, it is becoming a crucial step for constructing artificial intelligence systems to let computers automatically understand and use human languages. The method and the system for automatically generating the poetry are constructed, so that the computer can master the automatic poetry creation capability, and the method and the system are a necessary way for calculating innovativeness and endowing machine creation capability and artistic feeling. In addition, the automatic poetry student method can also realize interesting application, can be used as an auxiliary tool for poetry teaching, and can provide beneficial reference for literature research of poetry.
In recent years, various researchers have developed multiple poetry generation systems that improve the quality of the generated poetry in different aspects. However, these poetry generators suffer from two main problems: one is that the system optimization coverage is limited. Human poetry experts evaluate the goodness of a poem, which is usually performed from indexes of multiple angles such as (1) sentence continuity, (2) semantic richness, (3) context relevance and (4) overall quality, however, the existing poem generating system is usually only directed at one or partial indexes, so that other indexes are ignored.
Second, mismatching of parameter optimization indexes. Most of the existing systems are based on an artificial neural Network (artificial neural Network), and when model parameters are optimized, likelihood (likelihood) is used as an index instead of the index commonly used by human beings for evaluating poetry, so that a machine adopts a standard different from that of the human beings when judging the goodness and the badness of the poetry, and the poetry which is cognitively perceived by the human beings to be high in quality cannot be generated.
Disclosure of Invention
In view of the above problems, embodiments of the present invention provide a method and system for automatically generating poetry.
In a first aspect, an embodiment of the present invention provides a method for automatically generating a poem, including:
acquiring a plurality of poems according to a plurality of keywords and a preset poem generator;
evaluating each poem by utilizing each marker to obtain each index score of each poem, wherein each marker is constructed according to each evaluation index of the target poem;
obtaining a comprehensive score of each poem according to each index score of each poem;
optimizing parameters of the preset poetry generator according to the comprehensive score of each poetry until each index score of the poetry generated by the updated preset poetry generator is converged, and taking the updated preset poetry generator as a target poetry generator;
and acquiring a plurality of target poems according to the plurality of keywords and the target poem generator.
In a second aspect, an embodiment of the present invention provides a system for automatically generating poetry, including:
the generating module is used for acquiring a plurality of poems according to the plurality of keywords and a preset poem generator;
the scoring module is used for evaluating each poem by utilizing each scorer to obtain each index score of each poem, and each scorer is constructed according to each evaluation index of the target poem;
the comprehensive module is used for scoring according to each index of each poem and acquiring comprehensive scores of each poem;
the optimization module is used for optimizing the parameters of the preset poetry generator according to the comprehensive score of each poetry until each index score of the poetry generated by the updated preset poetry generator is converged, and taking the updated preset poetry generator as a target poetry generator;
and the target module is used for acquiring a plurality of target poetry according to the plurality of keywords and the target poetry generator.
In a third aspect, an embodiment of the present invention provides an electronic device, including:
at least one processor, at least one memory, a communication interface, and a bus; wherein the content of the first and second substances,
the processor, the memory and the communication interface complete mutual communication through the bus;
the communication interface is used for information transmission between the test equipment and the communication equipment of the display device;
the memory stores program instructions executable by the processor, and the processor calls the program instructions to execute a method for automatically generating poetry provided by the first aspect.
In a fourth aspect, an embodiment of the present invention provides a non-transitory computer-readable storage medium, which stores computer instructions, where the computer instructions cause the computer to execute a method for automatically generating poetry provided in the first aspect.
According to the method and the system for automatically generating the poetry, the four indexes of the poetry evaluated by the human are directly approximated and quantized, the problems that the optimization coverage is limited and the parameter optimization indexes are not matched in the existing poetry generating system are solved, the generated poetry can be improved on each index and is not mutually conflicted, and the quality of the poetry under the human evaluation angle can be greatly improved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and those skilled in the art can also obtain other drawings according to the drawings without creative efforts.
FIG. 1 is a flow chart of a method for automatically generating poetry in accordance with an embodiment of the present invention;
FIG. 2 is a schematic structural diagram of a system for automatically generating poetry according to an embodiment of the present invention;
fig. 3 illustrates a physical structure diagram of an electronic device.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Fig. 1 is a flowchart of a method for automatically generating poetry according to an embodiment of the present invention, as shown in fig. 1, the method includes:
s1, acquiring a plurality of poems according to the plurality of keywords and a preset poem generator;
s2, evaluating each poem by each marker to obtain each index score of each poem, wherein each marker is constructed according to each evaluation index of the target poem;
s3, obtaining a comprehensive score of each poem according to each index score of each poem;
s4, optimizing the parameters of the preset poetry generator according to the comprehensive score of each poetry until the score of each index of the poetry generated by the updated preset poetry generator is converged, and taking the updated preset poetry generator as a target poetry generator;
and S5, acquiring a plurality of target poems according to the plurality of keywords and the target poem generator.
Firstly, inputting a keyword into a preset poetry generator to obtain a plurality of poetry, constructing a marker for each evaluation index of the poetry, and utilizing each marker to score each obtained poetry, so that each poetry has a plurality of index scores, and integrating the index scores to obtain a comprehensive score of each poetry.
And optimizing parameters of the preset poetry generator according to the comprehensive score of each poetry until each index score of the poetry obtained by the updated preset poetry generator is converged, and taking the updated preset poetry generator as a target poetry generator.
And inputting the keywords into a target poem generator to obtain the number of the target poems.
It should be noted that the preset poetry generator is an existing artificial neural network poetry generator.
The embodiment of the invention is based on any one existing artificial neural network poetry generator, and the parameters of the preset poetry generator are updated towards the direction of obtaining higher scoring of a scorer through iteration of continuous generation-scoring-parameter updating. When iteration converges, the preset poetry generator can have better performance on human evaluation indexes, and has better integrity and is not mutually conflicted.
According to the method for automatically generating the poetry provided by the embodiment of the invention, the four indexes of the poetry evaluated by the human are directly approximated and quantized, so that the problems of limited optimization coverage and unmatched parameter optimization indexes of the existing poetry generation system are solved, the generated poetry can be improved on each index and is not mutually conflicted, and the quality of the poetry under the evaluation angle of the human can be greatly improved.
On the basis of the above embodiment, preferably, the evaluation index includes: sentence order, semantic richness, context relevance, and overall quality.
Specifically, for the sentence continuity evaluation index, scoring each poem by using the sentence continuity scorer, and scoring any poem by using the sentence continuity scorer specifically include:
Figure BDA0001874470560000051
r(lj)=max(|Plm(lj)-u|-0.25*σ,0)
wherein o represents said any poem, R1(o) a sentence smoothness score representing said any one of poetry o, m representing said any one of poetry o is comprised of m sentences, ljDenotes the jth sentence, Plm(lj) Poetry sentence ljProbability of occurrence in corpus, μ denotes Plm(lj) Mean over the corpus, σ denotes Plm(lj) Variance over the corpus, r (l)j) Poetry sentence ljThe preset poetry generator is obtained by training poetry in the corpus.
Let a poem consist of m sentences, and mark as o ═ l1,l2,…,lmCalculating a verse l using an artificial neural network language model trained on a large-scale verse corpusjProbability of occurrence in the corpus, denoted as Plm(lj)。
On the premise of large-scale corpus training, it can be approximately considered that the higher the probability of a poetry sentence appearing in corpus is, the more the poetry sentence looks like created by human, and the better the semantic currency of the poetry sentence is.
But P islm(lj) Too high a value may make the sentence produced too smooth, thereby reducing novelty; if the value is too low, the generated verse is too unsmooth.
Therefore, the smoothness score R of the poem o is calculated according to the following formula1(o):
Figure BDA0001874470560000052
r(lj)=max(|Plm(lj)-u|-0.25*σ,0)
Wherein μ represents Plm(lj) Mean over corpus, σ denotes Plm(lj) Variance over the corpus. Through the formula, the smoothness degree of the poetry sentence is limited in a reasonable interval, and the poetry sentence is neither too big nor too small.
On the basis of the above embodiment, preferably, for the semantic richness index, scoring each poem by using the semantic richness scorer, and for any poem, scoring the poem by using the semantic richness scorer specifically includes:
Figure BDA0001874470560000061
wherein o represents said any poem, R2(o) a semantic richness score representing said any one of poetry o, m representing said any one of poetry o is composed of m sentences, TjIs the number of words, C, of the jth sentence in any one of the poems otDenotes the t-th word, F (C)t) The TF-IDF value representing the tth word in said any one of poems o.
Poetry generated by the existing system has poor semantic richness, and is embodied in that the machine tends to generate words with high frequency but without definite semantics, such as virtual words and adverbs. In order to stimulate a machine to generate more words with rich semantics so as to improve the semantic richness of poetry, the embodiment of the invention adopts a TF-IDF index commonly used in the field of information retrieval. Through statistics of a large-scale ancient poem corpus, each word C is obtainedtHas a TF-IDF value of F (C)t) Then score R of semantic richness degree of poem o2(o) calculate as follows:
Figure BDA0001874470560000062
m denotes a poem consisting of m sentences, TjFor a verse l in a poemjNumber of words in (1), F (C)t) Representing the TF-IDF value of each word in said any one poem.
On the basis of the foregoing embodiment, preferably, for the context relevance index, scoring each poem by using the context relevance scorer, and scoring any poem by using the context relevance scorer specifically includes:
Figure BDA0001874470560000063
MI(l1:j-1,lj)=logPseq2seq(lj|l1:j-1)-γlogPlm(lj),
wherein o represents said any poem, R3(o) a contextual relevance score representing said any one of poetry o, m representing said any one of poetry o as consisting of m sentences, logPseq2seq(lj|l1:j-1) Representing a neural network sequence-to-sequence mapping model for measuring the probability of context co-occurrence, gamma representing a predetermined hyper-parameter, Plm(lj) Poetry sentence ljProbability of occurrence in the corpus.
A high quality poem requires better context consistency and consistency. Specifically, for the jth verse l in the verse ojPoetry sentence (marked as l) needs to be matched with the previous j-1 sentence1:j-1) The association is relatively tight. Embodiments of the present invention use Mutual Information (MI) in the Information theory to measure this closeness, denoted as MI1:j-1,lj) Then the context relevance score R of poem o3(o) calculate as follows:
MI(l1:j-1,lj)=logPseq2seq(lj|l1:j-1)-γlogPlm(lj),
Figure BDA0001874470560000071
wherein logPseq2seq(lj|l1:j-1) Is a Neural network Sequence-to-Sequence mapping Model (Neural Sequence-to-Sequence Model) for measuring the context co-occurrence probability, and gamma is a preset hyper-parameter for controlling the weight.
The scorer measures the association tightness between each sentence in a poem and the above, and can be considered that the higher the association tightness, the better the overall context association of the poem.
On the basis of the above embodiment, preferably, for the overall quality index, scoring each poem by using the overall quality scorer, and scoring any poem by using the overall quality scorer specifically include:
Figure BDA0001874470560000072
wherein o represents said any poem, R4(o) represents the overall quality score, P, of said any poem oclAnd (a | o) represents a neural network classifier constructed based on a corpus, and the value range of a is 1,2 and 3.
The three scoring indexes and corresponding scorers are all based on sentence level. However, when evaluating poetry, human often pays attention to chapter level, ignores some small flaws, and carries out overall evaluation on the overall quality of poetry.
To simulate this scoring metric, embodiments of the present invention use a neural network classifier. Specifically, a Neural network Classifier (Neural Classifier) is constructed based on the ancient poetry corpus and is marked as Pcl(a | o), a ═ 1,2, 3. For any poem, the classifier can give the probability that the poem belongs to three different categories.
These three categories are:
1: machine-generated poetry;
2: poetry created by ordinary human beings;
3: poetry created by poetry.
Then the overall quality score R of the poem o4(o) calculate as follows:
Figure BDA0001874470560000081
on the premise of higher classification accuracy based on the classifier, the probability that a poem is classified into a poem work is higher, which indicates that the poem is closer to the level of a poem in the overall quality and the overall quality is higher.
On the basis of the foregoing embodiment, preferably, the obtaining a comprehensive score of each poem according to each index score of each poem specifically includes:
Figure BDA0001874470560000082
wherein R (o)i) Represents the composite score of the ith poem, ajA predetermined weight, R, representing the jth evaluation indexj(oj) The score of the jth evaluation index is shown.
And integrating the statement continuity score, the semantic abundance score, the context relevance score and the overall quality score of each poem to obtain the integrated score of each poem.
On the basis of the above embodiment, specifically, according to the comprehensive score of each poem, the parameters of the preset poem generator are optimized, specifically:
let θ be the parameter set of the preset poetry generator. The generator parameters based on the artificial neural network can be updated using a gradient descent algorithm:
Figure BDA0001874470560000091
wherein β is a positive number less than 1 for controlling the speed of updating the parameters, and L (θ) is an error calculated according to the composite score, and is specifically calculated as follows:
Figure BDA0001874470560000092
wherein, G (o)j(ii) a Theta) represents that preset poem generator with theta as parameter set generates poem ojGiven theta and o, the probability of (A) is generally based on the generator of the artificial neural networkjThe probability value can be derived directly.
And finally, continuously repeating the steps until the score of a marker obtained by the poetry generated by the updated preset poetry generator is converged.
According to the embodiment of the invention, a corresponding automatic scoring device is designed aiming at the index of each human poetry evaluation, so that the scoring index of human can be approximated to a certain extent, and a model is stimulated to optimize a parameter set towards the direction of obtaining higher scoring.
The method provided by the invention is transparent to the preset poetry generator. The method can use any poetry preset poetry generator for deriving the generation probability as a basis, and because the method adopts the flow of generation-grading-parameter adjustment continuous iteration circulation, the method does not need to know the structural details of the generator, and can furthest keep the characteristics and the advantages of the original generator while improving the effect on each index.
Fig. 2 is a schematic structural diagram of a system for automatically generating poetry according to an embodiment of the present invention, as shown in fig. 2, the system includes: a generation module 201, a scoring module 202, a synthesis module 203, an optimization module 204, and a goal module 205, wherein:
the generating module 201 is used for acquiring a plurality of poems according to a plurality of keywords and a preset poem generator;
the scoring module 202 is configured to evaluate each poem by using each scorer to obtain each index score of each poem, and each scorer is constructed according to each evaluation index of a target poem;
the comprehensive module 203 is used for scoring according to each index of each poem to obtain the comprehensive score of each poem;
the optimization module 204 is configured to optimize parameters of the preset poetry generator according to the comprehensive score of each poem until each index score of the poems generated by the updated preset poetry generator converges, and use the updated preset poetry generator as a target poetry generator;
the target module 205 is used for obtaining a plurality of target poetry according to a plurality of keywords and the target poetry generator.
The method comprises the steps that a plurality of poems are generated in a generating module 201 according to a keyword input by a user and a preset poem generator, a scoring module 202 scores each poem by using each scorer to obtain each index score of each poem, a synthesizing module 203 synthesizes each index score of each poem to obtain a comprehensive score of each poem, an optimizing module 204 optimizes parameters of the preset poem generator according to the comprehensive score of each poem until each index score of the poem generated by the updated preset poem generator is converged, the updated preset poem generator serves as a target poem generator, and a target module 205 generates a plurality of target poems according to the keyword and the target poem generator.
According to the system for automatically generating the poetry, the four indexes of the poetry evaluated by the human are directly approximated and quantized, the problems that the optimization coverage is limited and the parameter optimization indexes are not matched in the existing poetry generating system are solved, the generated poetry can be improved on each index and is not mutually conflicted, and the quality of the poetry under the angle of human evaluation can be greatly improved.
Fig. 3 illustrates a physical structure diagram of an electronic device, and as shown in fig. 3, the server may include: a processor (processor)310, a communication Interface (communication Interface)320, a memory (memory)330 and a bus 340, wherein the processor 310, the communication Interface 320 and the memory 330 complete communication with each other through the bus 340. The communication interface 340 may be used for information transmission between the server and the smart tv. The processor 310 may call logic instructions in the memory 330 to perform the following method: receiving program information and real-time heart rate information of a television program sent by an intelligent television, wherein the program information comprises:
acquiring a plurality of poems according to a plurality of keywords and a preset poem generator;
evaluating each poem by utilizing each marker to obtain each index score of each poem, wherein each marker is constructed according to each evaluation index of the target poem;
obtaining a comprehensive score of each poem according to each index score of each poem;
optimizing parameters of the preset poetry generator according to the comprehensive score of each poetry until each index score of the poetry generated by the updated preset poetry generator is converged, and taking the updated preset poetry generator as a target poetry generator;
and acquiring a plurality of target poems according to the plurality of keywords and the target poem generator.
In addition, the logic instructions in the memory 330 may be implemented in the form of software functional units and stored in a computer readable storage medium when the software functional units are sold or used as independent products. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
The present embodiments provide a non-transitory computer-readable storage medium storing computer instructions that cause the computer to perform the methods provided by the above method embodiments, for example, including:
acquiring a plurality of poems according to a plurality of keywords and a preset poem generator;
evaluating each poem by utilizing each marker to obtain each index score of each poem, wherein each marker is constructed according to each evaluation index of the target poem;
obtaining a comprehensive score of each poem according to each index score of each poem;
optimizing parameters of the preset poetry generator according to the comprehensive score of each poetry until each index score of the poetry generated by the updated preset poetry generator is converged, and taking the updated preset poetry generator as a target poetry generator;
and acquiring a plurality of target poems according to the plurality of keywords and the target poem generator.
Those of ordinary skill in the art will understand that: all or part of the steps for implementing the method embodiments may be implemented by hardware related to program instructions, and the program may be stored in a computer readable storage medium, and when executed, the program performs the steps including the method embodiments; and the aforementioned storage medium includes: various media that can store program codes, such as ROM, RAM, magnetic or optical disks.
Through the above description of the embodiments, those skilled in the art will clearly understand that each embodiment can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware. With this understanding in mind, the above-described technical solutions may be embodied in the form of a software product, which can be stored in a computer-readable storage medium such as ROM/RAM, magnetic disk, optical disk, etc., and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the methods described in the embodiments or some parts of the embodiments.
Finally, it should be noted that: the above examples are only intended to illustrate the technical solution of the present invention, but not to limit it; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.

Claims (10)

1. A method of automatically generating poetry, comprising:
acquiring a plurality of poems according to a plurality of keywords and a preset poem generator;
evaluating each poem by utilizing each marker to obtain each index score of each poem, wherein each marker is constructed according to each evaluation index of the target poem;
obtaining a comprehensive score of each poem according to each index score of each poem;
optimizing parameters of the preset poetry generator according to the comprehensive score of each poetry until each index score of the poetry generated by the updated preset poetry generator is converged, and taking the updated preset poetry generator as a target poetry generator;
and acquiring a plurality of target poems according to the plurality of keywords and the target poem generator.
2. The method of claim 1, wherein the evaluation index comprises: sentence order, semantic richness, context relevance, and overall quality.
3. The method as claimed in claim 2, wherein for the sentence smoothness evaluation index, scoring each poem by using the sentence smoothness scorer, and for any poem, scoring the poem by using the sentence smoothness scorer specifically comprises:
Figure FDA0001874470550000011
r(lj)=max(|Plm(lj)-u|-0.25*σ,0)
wherein o represents said any poem, R1(o) a sentence smoothness score representing said any one of poetry o, m representing said any one of poetry o is comprised of m sentences, ljDenotes the jth sentence, Plm(lj) Poetry sentence ljProbability of occurrence in corpus, μ denotes Plm(lj) Mean over the corpus, σ denotes Plm(lj) Variance over the corpus, r (l)j) Poetry sentence ljThe preset poetry generator is obtained by training poetry in the corpus.
4. The method as recited in claim 2, wherein for the semantic richness index, scoring each poem with a semantic richness scorer, and for any poem, scoring the poem with a semantic richness scorer specifically comprises:
Figure FDA0001874470550000021
wherein o represents said any poem, R2(o) a semantic richness score representing said any one of poetry o, m representing said any one of poetry o is composed of m sentences, TjIs the number of words, C, of the jth sentence in any one of the poems otDenotes the t-th word, F (C)t) The TF-IDF value representing the tth word in said any one of poems o.
5. The method as claimed in claim 2, wherein for the context relevance index, scoring each poem with a context relevance scorer, and for any poem, scoring the poem with a context relevance scorer specifically comprises:
Figure FDA0001874470550000022
MI(l1:j-1,lj)=logPseq2seq(lj|l1:j-1)-γlogPlm(lj),
wherein o represents said any poem, R3(o) a contextual relevance score representing said any one of poetry o, m representing said any one of poetry o being composed of m sentences,logPseq2seq(lj|l1:j-1) Representing a neural network sequence-to-sequence mapping model for measuring the probability of context co-occurrence, gamma representing a predetermined hyper-parameter, Plm(lj) Poetry sentence ljProbability of occurrence in the corpus.
6. The method as recited in claim 2, wherein for the overall quality index, scoring each poem with an overall quality scorer, and for any poem, scoring the any poem with an overall quality scorer specifically comprises:
Figure FDA0001874470550000023
wherein o represents said any poem, R4(o) represents the overall quality score, P, of said any poem oclAnd (a | o) represents a neural network classifier constructed based on a corpus, and the value range of a is 1,2 and 3.
7. The method according to claim 1, wherein the obtaining of the comprehensive score of each poem according to each index score of each poem specifically comprises:
Figure FDA0001874470550000031
wherein R (o)i) Represents the composite score of the ith poem, ajA predetermined weight, R, representing the jth evaluation indexj(oj) The score of the jth evaluation index is shown.
8. A system for automatically generating poetry, comprising:
the generating module is used for acquiring a plurality of poems according to the plurality of keywords and a preset poem generator;
the scoring module is used for evaluating each poem by utilizing each scorer to obtain each index score of each poem, and each scorer is constructed according to each evaluation index of the target poem;
the comprehensive module is used for scoring according to each index of each poem and acquiring comprehensive scores of each poem;
the optimization module is used for optimizing the parameters of the preset poetry generator according to the comprehensive score of each poetry until each index score of the poetry generated by the updated preset poetry generator is converged, and taking the updated preset poetry generator as a target poetry generator;
and the target module is used for acquiring a plurality of target poetry according to the plurality of keywords and the target poetry generator.
9. An electronic device, comprising:
at least one processor, at least one memory, a communication interface, and a bus; wherein the content of the first and second substances,
the processor, the memory and the communication interface complete mutual communication through the bus;
the communication interface is used for information transmission between the test equipment and the communication equipment of the display device;
the memory stores program instructions executable by the processor, the processor invoking the program instructions to perform the method of any one of claims 1-7.
10. A non-transitory computer-readable storage medium storing computer instructions that cause a computer to perform the method of any one of claims 1 to 7.
CN201811392886.3A 2018-11-21 2018-11-21 Method and system for automatically generating poems Pending CN111291536A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811392886.3A CN111291536A (en) 2018-11-21 2018-11-21 Method and system for automatically generating poems

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811392886.3A CN111291536A (en) 2018-11-21 2018-11-21 Method and system for automatically generating poems

Publications (1)

Publication Number Publication Date
CN111291536A true CN111291536A (en) 2020-06-16

Family

ID=71022853

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811392886.3A Pending CN111291536A (en) 2018-11-21 2018-11-21 Method and system for automatically generating poems

Country Status (1)

Country Link
CN (1) CN111291536A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112989812A (en) * 2021-03-04 2021-06-18 中山大学 Distributed poetry generation method based on cloud data center

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105955964A (en) * 2016-06-13 2016-09-21 北京百度网讯科技有限公司 Method and apparatus for automatically generating poem
CN106095752A (en) * 2016-06-07 2016-11-09 北京百度网讯科技有限公司 A kind of method and apparatus for automatically generating poem
CN107480132A (en) * 2017-07-25 2017-12-15 浙江工业大学 A kind of classic poetry generation method of image content-based

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106095752A (en) * 2016-06-07 2016-11-09 北京百度网讯科技有限公司 A kind of method and apparatus for automatically generating poem
CN105955964A (en) * 2016-06-13 2016-09-21 北京百度网讯科技有限公司 Method and apparatus for automatically generating poem
CN107480132A (en) * 2017-07-25 2017-12-15 浙江工业大学 A kind of classic poetry generation method of image content-based

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
XIAOYUAN YI 等: "Automatic Poetry Generation with Mutual Reinforcement Learning", 《PROCEEDINGS OF THE 2018 CONFERENCE ON EMPIRICAL METHODS IN NATURAL LANGUAGE PROCESSING》 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112989812A (en) * 2021-03-04 2021-06-18 中山大学 Distributed poetry generation method based on cloud data center

Similar Documents

Publication Publication Date Title
EP4060565A1 (en) Method and apparatus for acquiring pre-trained model
CN109960800B (en) Weak supervision text classification method and device based on active learning
US20220245365A1 (en) Translation method and apparatus based on multimodal machine learning, device, and storage medium
CN108363753B (en) Comment text emotion classification model training and emotion classification method, device and equipment
US10255275B2 (en) Method and system for generation of candidate translations
CN104050160B (en) Interpreter's method and apparatus that a kind of machine is blended with human translation
US11729120B2 (en) Generating responses in automated chatting
TW202009749A (en) Human-machine dialog method, device, electronic apparatus and computer readable medium
WO2020233380A1 (en) Missing semantic completion method and apparatus
CN110175229B (en) Method and system for on-line training based on natural language
WO2021114841A1 (en) User report generating method and terminal device
CN107870901A (en) Similar literary method, program, device and system are generated from translation source original text
CN110489554B (en) Attribute-level emotion classification method based on location-aware mutual attention network model
CN109614618A (en) Word treatment method and device outside collection based on multi-semantic meaning
CN107679225A (en) A kind of reply generation method based on keyword
US20220058349A1 (en) Data processing method, device, and storage medium
CN108664465A (en) One kind automatically generating text method and relevant apparatus
CN113408430A (en) Image Chinese description system and method based on multistage strategy and deep reinforcement learning framework
CN112231554A (en) Search recommendation word generation method and device, storage medium and computer equipment
CN117271736A (en) Question-answer pair generation method and system, electronic equipment and storage medium
CN103336803B (en) A kind of computer generating method of embedding name new Year scroll
CN111291536A (en) Method and system for automatically generating poems
US20230075339A1 (en) Method of training information generation model, method of generating information, and device
CN109271633B (en) Word vector training method and device for single semantic supervision
CN110990537A (en) Sentence similarity calculation method based on edge information and semantic information

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20200616