Pre-training model text generation method based on reverse prompt

文档序号:1938092 发布日期:2021-12-07 浏览:18次 中文

阅读说明:本技术 基于反向提示的预训练模型文本生成方法 (Pre-training model text generation method based on reverse prompt ) 是由 史小文 唐杰 杨珍 仇瑜 刘德兵 张鹏 于 2021-07-02 设计创作,主要内容包括:本申请提出了一种基于反向提示的预训练模型文本生成方法,该方法包括:步骤S1:将初始提示文本输入至大规模预训练模型中进行文本生成,生成第一条语句的多个候选语句;步骤S2:对多个候选语句进行文本筛选,按照候选语句的分数从高到低的顺序选择预设个数的候选语句作为备选语句;步骤S3:将每一个备选语句作为下一条语句的上文输入至大规模预训练模型中,生成下一条语句的多个候选语句;步骤S4:重复进行步骤S2、步骤S3,直到句子生成结束,选出分数最高的语句的组合作为最终生成文本。采用上述方案的本申请能够更好的控制文本的生成,增强提示与生成的文本之间的相关性,提供更好的可控性,并且已经在实际应用中取得了较好的效果。(The application provides a pre-training model text generation method based on reverse prompt, which comprises the following steps: step S1: inputting the initial prompt text into a large-scale pre-training model for text generation, and generating a plurality of candidate sentences of a first sentence; step S2: text screening is carried out on a plurality of candidate sentences, and a preset number of candidate sentences are selected as candidate sentences from high to low according to the scores of the candidate sentences; step S3: inputting each alternative sentence as the upper part of the next sentence into a large-scale pre-training model to generate a plurality of candidate sentences of the next sentence; step S4: and repeating the steps S2 and S3 until the sentence generation is finished, and selecting the combination of the sentences with the highest score as the final generated text. By adopting the scheme, the generation of the text can be better controlled, the correlation between the prompt and the generated text is enhanced, better controllability is provided, and better effects are obtained in practical application.)

1. A pre-training model text generation method based on reverse prompt is characterized by comprising the following steps:

step S1: inputting the initial prompt text into a large-scale pre-training model for text generation, and generating a plurality of candidate sentences of a first sentence;

step S2: performing text screening on the candidate sentences, and selecting a preset number of candidate sentences as candidate sentences according to the sequence of scores of the candidate sentences from high to low;

step S3: inputting each alternative sentence as the upper part of the next sentence into the large-scale pre-training model to generate a plurality of candidate sentences of the next sentence;

step S4: and repeating the steps S2 and S3 until the sentence generation is finished, and selecting the combination of the sentences with the highest score as the final generated text.

2. The method of claim 1, wherein the large-scale pre-training model is used for text generation from input text, and the text generation is specifically:

and giving a language model with probability distribution, realizing the maximization of conditional probability through beam search, and completing text generation.

3. The method of claim 1, wherein text filtering the plurality of candidate sentences comprises:

constructing a plurality of pairs of reverse prompt texts according to a current input sentence of the large-scale pre-training model and a plurality of candidate sentences which are correspondingly generated, wherein the number of the candidate sentences is the same as that of the reverse prompt texts, each pair of reverse prompt texts comprises an input text and an evaluation text, the input text is the current input sentence, and the evaluation text is one candidate sentence of the plurality of candidate sentences which are correspondingly generated;

inputting the reverse prompt text into the large-scale pre-training model to generate a new text;

similarity calculation is carried out on the vector center of the model coding of the new text and the vector center of the evaluation text, and the calculated value is used as the score of the corresponding candidate sentence, wherein the score of the candidate sentence is positively correlated with the similarity of the candidate sentence and the input sentence;

and selecting a preset number of candidate sentences as candidate sentences according to the scores of the candidate sentences.

4. The method of claim 3, wherein the similarity calculation is performed using a refined bundle search scoring function expressed as:

f(cg|cp)=logp(c'p|c'g)

wherein, c'pIs evaluation text in reverse prompt text, c'gFor reverse prompt text in a new format, cgText generated for the model, cpTo prompt the text, p (-) is the maximize conditional probability.

5. The method of claim 1, wherein an initial prompt text is randomly selected, a final generated text is generated using the large-scale pre-training model, and then the large-scale pre-training model of the final generated text is fine-tuned for a plurality of cycles to achieve the purpose of fine-tuning the large-scale pre-training model.

6. A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the method of any one of claims 1-5 when executing the computer program.

7. A non-transitory computer-readable storage medium having stored thereon a computer program, wherein the computer program, when executed by a processor, implements the method of any one of claims 1-5.

Technical Field

The application relates to the technical field of pre-training models, in particular to a pre-training model text generation method based on reverse prompting and computer equipment.

Background

In recent years, the appearance of large-scale pre-training models brings Natural Language Processing (NLP) into a new era, which has made great progress on various downstream NLP tasks such as text generation, text classification, machine reading and understanding, and has gradually become a mainstream model in the NLP field. Large scale pre-training models have demonstrated powerful functionality for generating realistic text, but the results generated tend to drift off topic as the length of the generated text increases. How to control the generation result of the large-scale pre-training model is an urgent problem to be solved. The current mainstream solution is to add prompt information, but the prompt information is far insufficient to generate controllable text. It is not uncommon for language models to deviate from the original prompt and generate text for unrelated topics.

Language models (language models) have been widely used as targets for pre-training and show strong generalization capability. Starting from the word embedding method (word embedding), the pre-training method shows increasing importance in the field of natural language processing. These models are more general and require less domain-specific data to achieve powerful performance. In particular, the main type of pre-trained model is the auto-regressive language model. Generative Pretraining (GPT) and Transformer-XL have achieved significant improvements in complexity and also improved quality of generation, as well as adaptation to different languages.

Although realistic text can now be automatically generated by large-scale pre-training models, how to resolve deviations of the generated results from the input subject matter remains a challenging problem. The current mainstream solution is to input extra prompt contents related to a main body, but this method has a certain limitation in improving the relevance of the generation result and the theme, and this extra prompt only improves the relevance of the text generation result of the first paragraph, and optimizes the text generation in the subsequent generation. A common improvement is to use manually defined patterns to select the generation when generating the text, which limits the creativity of the model and the consistency of the text content. CTRL suggests the use of control codes to provide conditions for the language model. The PPLM performs back propagation during testing to adjust the generation to maximize the score given by the attribute model.

The dual process is a method of enhancing the quality of AI generation by the dual nature of input and output with the output and input being the inverse premise. Xia et al describe dual learning for machine translation tasks, which uses multiple different models to form a translation loop, and hopefully the context will remain unchanged after passing through the loop.

Disclosure of Invention

The present application is directed to solving, at least to some extent, one of the technical problems in the related art.

Therefore, a first objective of the present application is to provide a method for generating a pre-training model text based on reverse prompt, which solves the technical problem that the large-scale pre-training model generation result deviates from the input subject content in the existing method, and also solves the technical problem that the existing method has limitation in improving the correlation between the generation result and the subject by inputting additional prompts related to the subject. Meanwhile, the reverse prompting method provided by the application utilizes a dual process to enhance the text generation capability of artificial intelligence, does not need additional attribute model training or manual definition mode, directly uses the original language model to improve the generation capability, and has a good effect in practical application.

A second object of the present application is to propose a computer device.

A third object of the present application is to propose a non-transitory computer-readable storage medium.

In order to achieve the above object, an embodiment of a first aspect of the present application provides a method for generating a pre-training model text based on reverse hinting, including: step S1: inputting the initial prompt text into a large-scale pre-training model for text generation, and generating a plurality of candidate sentences of a first sentence; step S2: text screening is carried out on a plurality of candidate sentences, and a preset number of candidate sentences are selected as candidate sentences from high to low according to the scores of the candidate sentences; step S3: inputting each alternative sentence as the upper part of the next sentence into a large-scale pre-training model to generate a plurality of candidate sentences of the next sentence; step S4: and repeating the steps S2 and S3 until the sentence generation is finished, and selecting the combination of the sentences with the highest score as the final generated text.

Optionally, in an embodiment of the present application, the large-scale pre-training model is used for generating a text according to an input text, where the text generation specifically is:

and giving a language model with probability distribution, realizing the maximization of conditional probability through beam search, and completing text generation.

Optionally, in an embodiment of the present application, the text screening of the plurality of candidate sentences includes:

constructing a plurality of pairs of reverse prompt texts according to a current input sentence of the large-scale pre-training model and a plurality of candidate sentences generated correspondingly, wherein the number of the candidate sentences is the same as that of the reverse prompt texts, each pair of reverse prompt texts comprises an input text and an evaluation text, the input text is the current input sentence, and the evaluation text is one candidate sentence of the plurality of candidate sentences generated correspondingly;

inputting the reverse prompt text into a large-scale pre-training model to generate a new text;

carrying out similarity calculation on the vector center of the model code of the new text and the vector center of the evaluation text, and taking the calculated value as the score of the corresponding candidate sentence, wherein the score of the candidate sentence is positively correlated with the similarity of the candidate sentence and the input sentence;

and selecting a preset number of candidate sentences as candidate sentences according to the scores of the candidate sentences.

Optionally, in an embodiment of the present application, the similarity calculation is performed by using an improved bundle search scoring function, where the improved bundle search scoring function is expressed as:

f(cg|cp)=logp(c'p|c'g)

wherein, c'pIs evaluation text in reverse prompt text, c'gFor reverse prompt text in a new format, cgText generated for the model, cpTo prompt the text, p (-) is the maximize conditional probability.

Optionally, in an embodiment of the present application, the initial prompt text is randomly selected, the large-scale pre-training model is used to generate a final generated text, and then the large-scale pre-training model of the final generated text is subjected to fine tuning and is cycled for multiple times, so as to achieve the purpose of training the large-scale pre-training model.

To achieve the above object, a second aspect of the present application provides a computer device, including: the processor executes the computer program to realize the pre-training model text generation method based on the reverse prompt.

To achieve the above object, a non-transitory computer-readable storage medium is provided in a third aspect of the present application, and when executed by a processor, the instructions in the storage medium can execute a method for generating a pre-training model text based on reverse hinting.

The pre-training model text generation method based on reverse prompt, the computer device and the non-transitory computer readable storage medium solve the technical problem that the large-scale pre-training model generation result deviates from the input subject content in the existing method, and also solve the technical problem that the existing method has limitation in improving the correlation between the generation result and the subject by inputting extra prompts related to a main body. Meanwhile, the reverse prompting method provided by the application utilizes a dual process to enhance the text generation capability of artificial intelligence, does not need additional attribute model training or manual definition mode, directly uses the original language model to improve the generation capability, and has a good effect in practical application.

Additional aspects and advantages of the present application will be set forth in part in the description which follows and, in part, will be obvious from the description, or may be learned by practice of the present application.

Drawings

The foregoing and/or additional aspects and advantages of the present application will become apparent and readily appreciated from the following description of the embodiments, taken in conjunction with the accompanying drawings of which:

fig. 1 is a flowchart of a method for generating a pre-training model text based on reverse prompt according to an embodiment of the present application;

FIG. 2 is a detailed illustration diagram of the language model generation and the language model reverse prompt of the pre-training model text generation method based on reverse prompt according to the embodiment of the present application;

FIG. 3 is a schematic diagram of a text generation process of a pre-training model text generation method based on reverse prompt according to an embodiment of the present application;

FIG. 4 is a constructed prompt score chart of a pre-training model text generation method based on reverse prompts according to an embodiment of the present application;

FIG. 5 is a diagram of candidate sentences screened by the method for generating pre-training model texts based on reverse prompt in the embodiment of the present application;

fig. 6 is a flowchart illustrating a generation process of a chinese traditional poem titled new york in the method for generating a pre-training model text based on reverse cue according to an embodiment of the present application.

Detailed Description

Reference will now be made in detail to embodiments of the present application, examples of which are illustrated in the accompanying drawings, wherein like or similar reference numerals refer to the same or similar elements or elements having the same or similar function throughout. The embodiments described below with reference to the drawings are exemplary and intended to be used for explaining the present application and should not be construed as limiting the present application.

The method and the device for generating the pre-training model text based on the reverse prompt in the embodiment of the application are described below with reference to the accompanying drawings.

Fig. 1 is a flowchart of a method for generating a pre-training model text based on reverse prompt according to an embodiment of the present application.

As shown in fig. 1, the method for generating the pre-training model text based on the reverse prompt includes the following steps:

step 101, inputting an initial prompt text into a large-scale pre-training model for text generation, and generating a plurality of candidate sentences of a first sentence;

102, performing text screening on a plurality of candidate sentences, and selecting a preset number of candidate sentences as candidate sentences from high to low according to the scores of the candidate sentences;

103, inputting each alternative sentence as the upper text of the next sentence into the large-scale pre-training model to generate a plurality of alternative sentences of the next sentence;

and step 104, repeating the step 102 and the step 103 until the sentence generation is finished, and selecting the combination of the sentences with the highest scores as the final generated text.

The pre-training model text generation method based on reverse prompt in the embodiment of the application comprises the following steps of S1: inputting the initial prompt text into a large-scale pre-training model for text generation, and generating a plurality of candidate sentences of a first sentence; step S2: text screening is carried out on a plurality of candidate sentences, and a preset number of candidate sentences are selected as candidate sentences from high to low according to the scores of the candidate sentences; step S3: inputting each alternative sentence as the upper part of the next sentence into a large-scale pre-training model to generate a plurality of candidate sentences of the next sentence; step S4: and repeating the steps S2 and S3 until the sentence generation is finished, and selecting the combination of the sentences with the highest score as the final generated text. Therefore, the technical problem that the generated result of the large-scale pre-training model is deviated from the input subject content in the existing method can be solved, the technical problem that the generation result and the subject relevance are limited due to the fact that the additional prompt related to the subject is input in the existing method can be solved, the bundle scoring function in bundle searching is improved by the reverse prompt method, the relevance between the prompt and the generated text is enhanced, and better controllability is provided. Meanwhile, the reverse prompting method provided by the application utilizes a dual process to enhance the text generation capability of artificial intelligence, does not need additional attribute model training or manual definition mode, directly uses the original language model to improve the generation capability, and has a good effect in practical application.

Further, in this embodiment of the present application, the large-scale pre-training model is used for generating a text according to an input text, where the text generation specifically includes:

and giving a language model with probability distribution, realizing the maximization of conditional probability through beam search, and completing text generation.

Further, in the embodiment of the present application, text screening is performed on a plurality of candidate sentences, including:

constructing a plurality of pairs of reverse prompt texts according to a current input sentence of the large-scale pre-training model and a plurality of candidate sentences generated correspondingly, wherein the number of the candidate sentences is the same as that of the reverse prompt texts, each pair of reverse prompt texts comprises an input text and an evaluation text, the input text is the current input sentence, and the evaluation text is one candidate sentence of the plurality of candidate sentences generated correspondingly;

inputting the reverse prompt text into a large-scale pre-training model to generate a new text;

carrying out similarity calculation on the vector center of the model code of the new text and the vector center of the evaluation text, and taking the calculated value as the score of the corresponding candidate sentence, wherein the score of the candidate sentence is positively correlated with the similarity of the candidate sentence and the input sentence;

and selecting a preset number of candidate sentences as candidate sentences according to the scores of the candidate sentences.

When the initial prompt text is input, the model starts to generate text, and every time a sentence is generated (when a punctuation mark is generated, and the number of words generated in the sentence is more than 25, the sentence is defined as a sentence), text screening of the group is required. For machine poetry applications, the initial prompt text is: "subject author: author name genre: poetry subject name: subject text:". (wherein italic bolding is a variable input). For example: hope that the model does a poem of big mountain of plum white writing, the suggestion text is: "mountain author: Libai cutting: poetry title: mountain text:".

When each sentence is generated, 10 candidate sentences of the sentence are generated, and 10 pairs of reverse prompt texts responding to each candidate sentence and the initial prompt text are constructed according to specific application characteristics. The reverse prompt text has 2 parts, 1 part being the input text and 1 part being the evaluation text. Reverse prompt text is constructed from text generated from a given segment. Specifically, the prompt text is input: after a mountain author, a Libai cut, a poetry subject name, a mountain text, a large-scale pre-training model can output a first sentence of the poem, wherein 4 set candidate sentences are respectively ' facing to a broken mountain, facing to a transverse disc hard bed, facing to a floating cloud, entering a cang tongue ', and sunlight cold mountain bizhong '. And constructing a reverse prompt text according to the 4 sentence candidates and the original input prompt text. Therefore, the reverse prompt text is composed of two parts, namely 4 sentences of reverse prompt input text and 1 sentence of reverse prompt evaluation text.

And inputting 10 pairs of reverse prompt texts of the group into a model to generate n texts, calculating the similarity between the vector centers coded by the 10 generated texts and the vector center of the evaluation text, and taking the value as the score of the corresponding candidate sentence. In the application of machine-written poetry of 'poetry generation in open territory', a given reverse prompt c is calculated according to a pre-training modelpTime of origin prompt cgIs denoted as f (c)g|cp). Conditional likelihood function f (c)g|cp) The best candidate sentence may be selected by a bundle search scoring function f (-) used in the bundle search (beam search), namely:

respectively inputting the generated reverse prompt input texts into a model, outputting vector representation of the generated texts, and respectively calculating a central vector s' e c of each sentencegSimultaneously, the reverse prompt evaluation text is vector-representation encoded with a model, and a center vector c 'is calculated'pFinally, these 2 center vectors c 'are calculated'pAnd s' and a score function f (-) for the bundle search, and calculating the similarity as a score of each sentence to form the candidate sentences of the group.

From the set of candidate sentences, m sentences with the highest score (m can be preset) are selected as the previous text input models of the next sentence.

Further, in the embodiment of the present application, an improved bundle search scoring function is used to perform similarity calculation, where the improved bundle search scoring function is expressed as:

f(cg|cp)=logp(c'p|c'g)

wherein, c'pIs evaluation text in reverse prompt text, c'gFor reverse prompt text in a new format, cgText generated for the model, cpTo prompt the text, p (-) is the maximize conditional probability.

Given a language model with a probability distribution p, a simple and widely used method of text generation is to maximize the conditional probability p (c)g|cp). This is typically achieved by beam search. In the case of a bundle size of n, the bundle search holds the first n sequences during decoding according to a bundle search scoring function f (·). A commonly used beam scoring function is defined using a log-likelihood function, i.e., f (c)g|cp)=logp(cg|cp)。

One important reason affecting the quality of the generated text is that as text is generated, it becomes increasingly irrelevant to a given prompt. As the distance between a given prompt and a generated sentence becomes larger, the generator is prevented from keeping a close relationship with the prompt. To alleviate this problem, a novel bundle search scoring function f (-) is proposed, as in the formula f(cg|cp)=logp(cp|cg) As defined, the function may evaluate the inverse log-likelihood; if the prompts can be generated from text, the prompts should be very relevant to each other.

Simply reading the text in the reverse way, the text must be unsmooth. A simple reverse definition may lead to learning failure. Due to the nature of natural language, there are some ways in which contexts can be rearranged so that they appear correctly in the reverse order. To implement the reverse cue, an improved bundle search scoring function f (c) is employedg|cp)=logp(c'p|c'g). Reverse hinting orders the different bundles according to their likelihood functions, thereby producing the original hinting in a reverse manner to facilitate generation of the most relevant text. Reverse hints may be used as long as the language supports a reverse structure to rearrange the hints and context in an appropriate manner.

The technology for 'poem generation in open domains' in a large-scale pre-training model randomly generates clauses according to a language model LM, and performs bundle search at clause level by using reverse prompts. Reverse hints are applied and summed for each clause. To streamline the generated context, the score is combined with the forward confusion of normalization. In addition, a poem term l is added in the bundle searchformat(cg) This penalizes the context depending on how far the context violates the tempo or pitch. The scoring function for the "verses generated in open field" bundle search is defined as follows:

further, in the embodiment of the application, the initial prompt text is randomly selected, the large-scale pre-training model is used for generating the final generated text, and then the large-scale pre-training model of the final generated text is subjected to fine tuning and is circulated for multiple times, so that the purpose of training the large-scale pre-training model is achieved.

"verse creation in open field" requires AI to create a long and in-depth context from relatively short cues, demonstrating the excellent performance of reverse cues. A large-scale language model which is trained on a general corpus in advance is adopted, and reverse prompts are utilized to enhance the generation quality of the language model.

Given that the model is trained on modern chinese text that contains little poetry-formatted text, it is nearly impossible to generate text that fully complies with the poetry format, while at the same time maintaining a high degree of correlation with a given title. Therefore, to improve its performance, an attempt is made to use the generate and fine-tune self-training protocol in AlphaGo-Zero to accomplish this task. First 1500 titles were randomly selected and then the model was asked to produce poems based on them. The model in these generated poems is then fine tuned 2000 steps. This cycle may be repeated multiple times. The fine-tuned model is more likely to generate sentences with better poetry formats and other poetry-specific attributes (e.g., aesthetics) without losing their relevance to a given title.

Fig. 2 is a detailed illustration diagram of the language model generation and the language model reverse prompt of the pre-training model text generation method based on the reverse prompt according to the embodiment of the present application.

As shown in FIG. 2, in a pre-trained model text generation method based on reverse cues, the reverse cues rank different bundles according to their likelihood functions, thereby producing the original cues in a reverse manner to facilitate generation of the most relevant text. Reverse hints may be used as long as the language supports a reverse structure to rearrange the hints and context in an appropriate manner. Reverse hinting is a simple, easy to implement method, does not require additional models or data processing, the reverse hint score can be simply calculated through the same generative language model, and reverse hinting greatly improves the quality of the generated text.

Fig. 3 is a schematic diagram of a text generation process of the pre-training model text generation method based on reverse prompt according to the embodiment of the present application.

As shown in fig. 3, the method for generating the pre-training model text based on the reverse prompt includes: step 1, outputting an initial prompt text by a model, inputting the initial prompt text, and starting generating a text by the model; step 2, constructing a reverse prompt text, and constructing the reverse prompt text according to the candidate sentences and the initial prompt text, wherein the reverse prompt text comprises 2 parts, the 1 part is an input text, and the 1 part is an evaluation text; step 3, screening candidate sentences, inputting the reverse prompt text into a model to generate n texts, respectively calculating the similarity between the vector center of the model code of the generated text and the vector center of the evaluation text, and taking the value as the score of the corresponding candidate sentence; step 4, determining the next input, and selecting m sentences with the highest scores (m can be preset) as the upper text respective input models of the next sentence; and 5, obtaining a final generated text, repeating the steps from two to four until the generation of the sentence is finished, and finally selecting the combination of the sentences with the highest scores as the final generation of the text.

Fig. 4 is a constructed prompt score chart of a pre-training model text generation method based on reverse prompts in the embodiment of the present application.

As shown in fig. 4, in the pre-training model text generation method based on reverse prompt, in the application of poetry writing by a machine, 4 reverse prompt input texts and 1 reverse prompt evaluation text are respectively generated according to 4 candidate sentences, specifically, the input prompt texts are: after a mountain author, a Libai cut, a poetry subject name, a mountain text, a large-scale pre-training model can output a first sentence of the poem, wherein 4 set candidate sentences are respectively ' facing to a broken mountain, facing to a transverse disc hard bed, facing to a floating cloud, entering a cang tongue ', and sunlight cold mountain bizhong '. And constructing a reverse prompt text according to the 4 candidate sentences and the original input prompt text, wherein the reverse prompt text consists of two parts, namely a 4 reverse prompt input text and a 1 reverse prompt evaluation text.

Fig. 5 is a diagram of candidate sentences screened by the pre-training model text generation method based on reverse prompt in the embodiment of the present application.

As shown in fig. 5, the pre-training model text generation method based on reverse cue calculates a given reverse cue c according to the pre-training model in the application of machine-written poetry of' poetry generation of poetry in open fieldpTime of origin prompt cgIs denoted as f (c)g|cp) Respectively inputting the generated reverse prompt input text into the model, outputting the vector representation of the generated text, and respectively calculating the central vector s' e c of each sentencegSimultaneously, the reverse prompt evaluation text is vector-representation encoded with a model, and a center vector c 'is calculated'pFinally, these 2 center vectors c 'are calculated'pAnd s' and a score function f (-) for the bundle search, and calculating the similarity as a score of each sentence to form the candidate sentences of the group.

Fig. 6 is a flowchart illustrating a generation process of a chinese traditional poem titled new york in the method for generating a pre-training model text based on reverse cue according to an embodiment of the present application.

As shown in fig. 6, to explain the overall process of machine-written poetry in more detail, the machine-written poetry employs chinese traditional poetry generated under the new york heading, incorporating not only modern concepts of new york, such as manhattan and the financial center, but also traditional forms, such as traditional poetry images of cloud and rain. On this task, human experts' evaluation showed that the effect of reverse prompting was significantly better than that of the prompting baseline.

In the Turing test (also known as a simulated game), a human challenger is asked to distinguish between a generated poem and a human poem. An online gaming platform in which any player can participate without limitation. In the game, each player is given several pairs of poems, each pair of poems containing a poem written by a human poem, and the other is produced under the same title by the AI. In the game, the player needs to figure out which poem the human poem wrote, generate 1,500 pairs of poems, and randomly display 5 pairs of poems for each game. 1,656 game records were collected from 370 different users with an average response time of 23.9 seconds. Each game record relates to a binary selection between human and AI poetry. The 45.2% of the user records selected AI verses and the remaining 54.8% selected human verses, indicating that the quality of the verses generated by reverse prompting + self-training for domain-specific titles may be close to human level for ordinary online users.

In order to implement the foregoing embodiments, the present application further provides a computer device, which includes a memory, a processor, and a computer program stored on the memory and executable on the processor, and when the processor executes the computer program, the method for generating a pre-training model text based on reverse prompt of the foregoing embodiments is implemented.

In order to implement the foregoing embodiments, the present application further proposes a non-transitory computer-readable storage medium on which a computer program is stored, the computer program, when executed by a processor, implementing the method for generating a pre-training model text based on reverse hinting of the foregoing embodiments.

In the description herein, reference to the description of the term "one embodiment," "some embodiments," "an example," "a specific example," or "some examples," etc., means that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the application. In this specification, the schematic representations of the terms used above are not necessarily intended to refer to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples. Furthermore, various embodiments or examples and features of different embodiments or examples described in this specification can be combined and combined by one skilled in the art without contradiction.

Furthermore, the terms "first", "second" and "first" are used for descriptive purposes only and are not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one such feature. In the description of the present application, "plurality" means at least two, e.g., two, three, etc., unless specifically limited otherwise.

Any process or method descriptions in flow charts or otherwise described herein may be understood as representing modules, segments, or portions of code which include one or more executable instructions for implementing steps of a custom logic function or process, and alternate implementations are included within the scope of the preferred embodiment of the present application in which functions may be executed out of order from that shown or discussed, including substantially concurrently or in reverse order, depending on the functionality involved, as would be understood by those reasonably skilled in the art of the present application.

The logic and/or steps represented in the flowcharts or otherwise described herein, e.g., an ordered listing of executable instructions that can be considered to implement logical functions, can be embodied in any computer-readable medium for use by or in connection with an instruction execution system, apparatus, or device, such as a computer-based system, processor-containing system, or other system that can fetch the instructions from the instruction execution system, apparatus, or device and execute the instructions. For the purposes of this description, a "computer-readable medium" can be any means that can contain, store, communicate, propagate, or transport the program for use by or in connection with the instruction execution system, apparatus, or device. More specific examples (a non-exhaustive list) of the computer-readable medium would include the following: an electrical connection (electronic device) having one or more wires, a portable computer diskette (magnetic device), a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disc read-only memory (CDROM). Additionally, the computer-readable medium could even be paper or another suitable medium upon which the program is printed, as the program can be electronically captured, via for instance optical scanning of the paper or other medium, then compiled, interpreted or otherwise processed in a suitable manner if necessary, and then stored in a computer memory.

It should be understood that portions of the present application may be implemented in hardware, software, firmware, or a combination thereof. In the above embodiments, the various steps or methods may be implemented in software or firmware stored in memory and executed by a suitable instruction execution system. If implemented in hardware, as in another embodiment, any one or combination of the following techniques, which are known in the art, may be used: a discrete logic circuit having a logic gate circuit for implementing a logic function on a data signal, an application specific integrated circuit having an appropriate combinational logic gate circuit, a Programmable Gate Array (PGA), a Field Programmable Gate Array (FPGA), or the like.

It will be understood by those skilled in the art that all or part of the steps carried by the method for implementing the above embodiments may be implemented by hardware related to instructions of a program, which may be stored in a computer readable storage medium, and when the program is executed, the program includes one or a combination of the steps of the method embodiments.

In addition, functional units in the embodiments of the present application may be integrated into one processing module, or each unit may exist alone physically, or two or more units are integrated into one module. The integrated module can be realized in a hardware mode, and can also be realized in a software functional module mode. The integrated module, if implemented in the form of a software functional module and sold or used as a stand-alone product, may also be stored in a computer readable storage medium.

The storage medium mentioned above may be a read-only memory, a magnetic or optical disk, etc. Although embodiments of the present application have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting the present application, and that variations, modifications, substitutions and alterations may be made to the above embodiments by those of ordinary skill in the art within the scope of the present application.

15页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:一种基于自然语言处理技术的文档自写作系统

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!