CN117725414B - Training content generation model method, device and equipment for determining output content - Google Patents

Training content generation model method, device and equipment for determining output content Download PDF

Info

Publication number
CN117725414B
CN117725414B CN202311714112.9A CN202311714112A CN117725414B CN 117725414 B CN117725414 B CN 117725414B CN 202311714112 A CN202311714112 A CN 202311714112A CN 117725414 B CN117725414 B CN 117725414B
Authority
CN
China
Prior art keywords
vector
input corpus
personalized
target
sample input
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.)
Active
Application number
CN202311714112.9A
Other languages
Chinese (zh)
Other versions
CN117725414A (en
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.)
Beijing Haitai Fangyuan High Technology Co Ltd
Original Assignee
Beijing Haitai Fangyuan High Technology Co Ltd
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 Beijing Haitai Fangyuan High Technology Co Ltd filed Critical Beijing Haitai Fangyuan High Technology Co Ltd
Priority to CN202311714112.9A priority Critical patent/CN117725414B/en
Publication of CN117725414A publication Critical patent/CN117725414A/en
Application granted granted Critical
Publication of CN117725414B publication Critical patent/CN117725414B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Machine Translation (AREA)

Abstract

The application discloses a method for training a content generation model, a method, a device, equipment and a medium for determining output content of the content generation model, which are used for improving diversification, individuation and identifiability of the output content of the content generation model and improving user experience. In the embodiment of the application, the target personalized sample input corpus matched with the universal sample input corpus in a personalized sample input corpus set of a corresponding target user acquired in advance can be determined according to any acquired universal sample input corpus; the universal sample input corpus and the target personalized sample input corpus are fused to generate training input for training the content generation model, the content generation model is trained based on the training input and the personalized sample output content corresponding to the target personalized sample input corpus, and based on the training input and the personalized sample output content corresponding to the target personalized sample input corpus, the purposes of improving the diversification, individuation and identifiability of the output content of the content generation model and improving user experience can be achieved.

Description

Training content generation model method, device and equipment for determining output content
Technical Field
The present application relates to the field of data processing technologies, and in particular, to a method for training a content generation model, and a method, apparatus, device, and medium for determining output content of the content generation model.
Background
Taking the content generation model as a question-answering model as an example, the content generation model can convert the questions presented by the user into a format which can be understood by a machine, so that the questions presented by the user can be automatically and intelligently answered, and the method is widely applied to various fields. However, in the related art, for the same questions posed by users with different personalities, the content generation model generally provides answers (output content) with close content and even identical content, so that the output content of the content generation model is single and the user experience is low.
Therefore, a technical solution that can improve the diversification, individuality and identifiability of the output content of the content generation model and improve the user experience is needed.
Disclosure of Invention
The embodiment of the application provides a method for training a content generation model, a method, a device, equipment and a medium for determining output content of the content generation model, which are used for improving diversification, individuation and identifiability of the output content of the content generation model and improving user experience.
In a first aspect, the present application provides a method of training a content generation model, the method comprising:
determining a target personalized sample input corpus matched with any acquired universal sample input corpus in a personalized sample input corpus set of a corresponding target user;
fusing the universal sample input corpus with the target personalized sample input corpus to generate training input for training a content generation model;
And training the content generation model based on the training input and the personalized sample output content corresponding to the target personalized sample input corpus.
According to the embodiment of the application, the universal sample input corpus and the target personalized sample input corpus which can reflect the personalized features of the target user can be fused to generate the training input for training the content generation model, the content generation model is trained based on the training input and the personalized sample output content which can reflect the personalized features of the target user and improve the diversification and the identifiability of the output content, when the output content corresponding to the user input corpus is determined by the content generation model trained by the method, the output content provided by the content generation model can be ensured to reflect the personalized features of the user to the greatest extent, the personalized needs of the user can be met, the diversity and the identifiability of the output content can be improved to the greatest extent, and the purposes of improving the diversification, individuation and the identifiability of the output content of the content generation model and improving the user experience are achieved.
In a possible implementation manner, the determining the pre-collected personalized sample input corpus corresponding to the target user, the target personalized sample input corpus matching the universal sample input corpus, includes:
Determining a first vector of the universal sample input corpus based on a pre-trained language model, and determining a second vector of each sample input corpus in the personalized sample input corpus set;
determining a vector similarity between the first vector and each of the second vectors;
And determining target personalized sample input corpus matched with the universal sample input corpus based on the vector similarity.
According to the method and the device for determining the target personalized sample input corpus, the target personalized sample input corpus matched with the pervasive sample input corpus can be determined based on the vector similarity between the first vector of the pervasive sample input corpus and the second vector of each sample input corpus, and therefore accuracy of the determined target personalized sample input corpus can be improved.
In a possible implementation manner, the determining, based on the vector similarity, a target personalized sample input corpus that matches the universal sample input corpus includes:
each second vector with vector similarity higher than the set similarity threshold value is respectively determined as a candidate vector; selecting a target vector from the candidate vectors, and determining personalized sample input corpus corresponding to the target vector as target personalized sample input corpus matched with the universal sample input corpus.
Because the embodiment of the application can select one target vector from the second vectors (candidate vectors) with the vector similarity higher than the set similarity threshold, the vector similarity between the target vector and the first vector of the universal sample input corpus can be ensured, the accuracy of the determined target personalized sample input corpus can be ensured when the personalized sample input corpus corresponding to the target vector is determined to be the target personalized sample input corpus matched with the universal sample input corpus, and the efficiency can be improved.
In a possible implementation manner, the fusing the universal sample input corpus and the target personalized sample input corpus to generate training input for training a content generation model includes:
And splicing the obtained universal sample vector of the universal sample input corpus with the personalized sample vector of the target personalized sample input corpus, and determining the training input based on the vector generated by splicing.
According to the embodiment of the application, the universal sample input corpus and the target personalized sample input corpus can be combined into one corpus quickly by a mode of splicing the universal sample vector of the universal sample input corpus and the personalized sample vector of the target personalized sample input corpus, so that training input for training the content generation model is generated, and the diversification, individuation and identifiability of the output content of the content generation model can be improved conveniently and quickly.
In a possible implementation manner, the fusing the universal sample input corpus and the target personalized sample input corpus to generate training input for training a content generation model includes:
Obtaining a first preset weight corresponding to the universal sample input corpus and a second preset weight corresponding to the target personalized sample input corpus;
determining a first weighted value of the obtained universal sample vector of the universal sample input corpus and the first preset weight and a second weighted value of the personalized sample vector of the target personalized sample input corpus and the second preset weight;
The training input is determined based on the first weight value and the second weight value.
The method and the device can improve the flexibility of the fusion process of the universal sample input corpus and the target personalized sample input corpus by configuring the first preset weight of the universal sample input corpus and the second preset weight of the target personalized sample input corpus, and can improve the diversification, individuation, identifiability and accuracy of the output content of the content generation model when the content generation model is trained based on the corpus generated by fusion in the mode.
In one possible implementation, the process of obtaining the universal sample vector includes:
determining a first vector of the pervasive sample input corpus determined based on a pre-trained language model as the pervasive sample vector; or alternatively
The method comprises the steps of segmenting the universal sample input corpus to obtain a first target code of the universal sample input corpus, and obtaining a universal sample vector based on a vector of the first target code, wherein the first target code comprises word codes, position codes and segment codes of the universal sample input corpus.
The method and the device can determine the universal sample vector based on the language model, or obtain the first target code of the universal sample input corpus by cutting the universal sample input corpus, and obtain the universal sample vector based on the vector of the first target code, so that the universal sample vector of the universal sample input corpus can be rapidly and accurately determined.
In one possible implementation, the process of obtaining the personalized sample vector includes:
determining a second vector of the personalized sample input corpus determined based on a pre-trained language model as the personalized sample vector; or alternatively
The personalized sample input corpus is segmented, a second target code of the personalized sample input corpus is obtained, and the personalized sample vector is obtained based on a vector of the second target code, wherein the second target code comprises word codes, position codes and segment codes of the personalized sample input corpus.
The embodiment of the application can determine the personalized sample vector based on the language model, or obtain the second target code of the personalized sample input corpus by cutting the personalized sample input corpus, and obtain the personalized sample vector based on the vector of the second target code, thereby rapidly and accurately determining the personalized sample vector of the personalized sample input corpus.
In a second aspect, the present application provides a method of determining output content of a content generation model, the method comprising:
if the corpus input by the user is received, identifying a target user identifier;
determining a pre-collected personalized input corpus corresponding to the target user identification, and a target personalized input corpus matched with the user input corpus;
Fusing the user input corpus and the target personalized input corpus, determining target output content based on target input generated by fusion and a content generation model trained by the method according to any one of the first aspects.
In a third aspect, the present application provides an apparatus for training a content generation model, the apparatus comprising:
the determining module is used for determining a target personalized sample input corpus matched with the universal sample input corpus in a pre-acquired personalized sample input corpus set of a corresponding target user aiming at any acquired universal sample input corpus;
The generation module is used for fusing the universal sample input corpus and the target personalized sample input corpus to generate training input for training a content generation model;
and the training module is used for training the content generation model based on the training input and the personalized sample output content corresponding to the target personalized sample input corpus.
In a possible implementation manner, the determining module is specifically configured to:
Determining a first vector of the universal sample input corpus based on a pre-trained language model, and determining a second vector of each sample input corpus in the personalized sample input corpus set;
determining a vector similarity between the first vector and each of the second vectors;
And determining target personalized sample input corpus matched with the universal sample input corpus based on the vector similarity.
In a possible implementation manner, the determining module is specifically configured to:
Each second vector with vector similarity higher than the set similarity threshold value is respectively determined as a candidate vector;
selecting a target vector from the candidate vectors, and determining personalized sample input corpus corresponding to the target vector as target personalized sample input corpus matched with the universal sample input corpus.
In a possible implementation manner, the generating module is specifically configured to:
And splicing the obtained universal sample vector of the universal sample input corpus with the personalized sample vector of the target personalized sample input corpus, and determining the training input based on the vector generated by splicing.
In a possible implementation manner, the generating module is specifically configured to:
Obtaining a first preset weight corresponding to the universal sample input corpus and a second preset weight corresponding to the target personalized sample input corpus;
determining a first weighted value of the obtained universal sample vector of the universal sample input corpus and the first preset weight and a second weighted value of the personalized sample vector of the target personalized sample input corpus and the second preset weight;
The training input is determined based on the first weight value and the second weight value.
In a possible implementation manner, the generating module is specifically configured to:
determining a first vector of the pervasive sample input corpus determined based on a pre-trained language model as the pervasive sample vector; or alternatively
The method comprises the steps of segmenting the universal sample input corpus to obtain a first target code of the universal sample input corpus, and obtaining a universal sample vector based on a vector of the first target code, wherein the first target code comprises word codes, position codes and segment codes of the universal sample input corpus.
In a possible implementation manner, the generating module is specifically configured to:
determining a second vector of the personalized sample input corpus determined based on a pre-trained language model as the personalized sample vector; or alternatively
The personalized sample input corpus is segmented, a second target code of the personalized sample input corpus is obtained, and the personalized sample vector is obtained based on a vector of the second target code, wherein the second target code comprises word codes, position codes and segment codes of the personalized sample input corpus.
In a fourth aspect, the present application provides an apparatus for determining output content based on a content generation model, the apparatus comprising:
the receiving module is used for identifying a target user identifier if the corpus input by the user is received;
the matching module is used for determining target personalized input corpus matched with the user input corpus in the pre-acquired personalized input corpus corresponding to the target user identification;
The output module is used for fusing the user input corpus and the target personalized input corpus, determining target output content based on target input generated by fusion and a content generation model obtained by training based on any one of the methods in the first aspect.
In a fifth aspect, the present application provides an electronic device comprising at least a processor and a memory, the processor being arranged to implement the steps of the method according to any of the first and second aspects when executing a computer program stored in the memory.
In a sixth aspect, the present application provides a computer readable storage medium storing a computer program which when executed by a processor performs the steps of the method according to any one of the first and second aspects.
In the embodiment of the application, the target personalized sample input corpus matched with the universal sample input corpus in a personalized sample input corpus set of a corresponding target user acquired in advance can be determined according to any acquired universal sample input corpus; the universal sample input corpus and the target personalized sample input corpus are fused to generate training input for training the content generation model, and the content generation model is trained based on the training input and personalized sample output content corresponding to the target personalized sample input corpus. According to the embodiment of the application, the universal sample input corpus and the target personalized sample input corpus which can reflect the personalized features of the target user can be fused to generate the training input for training the content generation model, the content generation model is trained based on the training input and the personalized sample output content which can reflect the personalized features of the target user and improve the diversification and the identifiability of the output content, when the output content corresponding to the user input corpus is determined by the content generation model trained by the method, the output content provided by the content generation model can be ensured to reflect the personalized features of the user to the greatest extent, the personalized needs of the user can be met, the diversity and the identifiability of the output content can be improved to the greatest extent, and the purposes of improving the diversification, individuation and the identifiability of the output content of the content generation model and improving the user experience are achieved.
Drawings
In order to more clearly illustrate the embodiments of the present application or the implementation of the related art, the drawings that are required for the embodiments or the related art description will be briefly described, and it is apparent that the drawings in the following description are some embodiments of the present application and that other drawings may be obtained according to these drawings for a person having ordinary skill in the art.
FIG. 1 is a schematic diagram of a first training content generation model according to an embodiment of the present application;
FIG. 2 is a schematic diagram of a second training content generation model according to an embodiment of the present application;
FIG. 3 is a schematic diagram of a third training content generation model according to an embodiment of the present application;
FIG. 4 is a schematic diagram of a process for determining output content of a content generation model according to an embodiment of the present application;
FIG. 5 is a schematic diagram of a training content generation model according to an embodiment of the present application;
FIG. 6 is a schematic diagram of an apparatus for determining output content of a content generation model according to an embodiment of the present application;
fig. 7 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application will be described in further detail below with reference to the accompanying drawings, and it is apparent that the described embodiments are only some embodiments of the present application, not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to be within the scope of the application.
The terms first, second and the like in the description and in the claims and in the above-described figures are used for distinguishing between similar or similar objects or entities and not necessarily for describing a particular sequential or chronological order, unless otherwise indicated. It is to be understood that the terms so used are interchangeable under appropriate circumstances.
In order to improve diversification, individuation and identifiability of output content of a content generation model and improve user experience, the embodiment of the application provides a method for training the content generation model, a method, a device, equipment and a medium for determining the output content of the content generation model.
Example 1:
fig. 1 is a schematic diagram of a process of training a content generation model according to an embodiment of the present application, where the process includes the following steps:
s101: aiming at any acquired universal sample input corpus, a target personalized sample input corpus matched with the universal sample input corpus in a pre-acquired personalized sample input corpus set corresponding to a target user is determined.
The method for training the content generation model provided by the embodiment of the application is applied to electronic equipment, and the electronic equipment can be, for example, equipment such as a PC (personal computer), a mobile terminal and the like, and can also be a server and the like.
In one possible implementation manner, in order to improve diversification, individualization and identifiability of output content of the content generation model, when training the content generation model, the content generation model may be trained based on a universal sample input corpus and an individualization sample input corpus corresponding to a target user. The universal sample input corpus can be a sample input corpus used for training a content generation model in the related technology, and the universal sample input corpus can be considered to not reflect personalized features of a user. The personalized sample input corpus corresponding to the target user may be considered as a corpus that can reflect personalized features of the target user. The method and the device have the advantages that specific contents of the universal sample input corpus and the personalized sample input corpus are not particularly limited, and the method and the device can be flexibly set according to requirements. The target user may be an individual, an enterprise (organization), or the like, and the present application is not particularly limited thereto. The method for acquiring the personalized sample input corpus corresponding to the target user is not particularly limited, and can be flexibly selected according to requirements.
In one possible implementation manner, when training the content generation model, for each pervasive sample input corpus included in the obtained pervasive sample input corpus, a target personalized sample input corpus matched with the pervasive sample input corpus in a pre-collected personalized sample input corpus of a corresponding target user may be determined. Alternatively, when determining the target personalized sample input corpus that matches the universal sample input corpus, a first vector of the universal sample input corpus may be determined based on the language model that is trained in advance (for convenience of description, the vector of the universal sample input corpus determined based on the language model is referred to as a first vector). In addition, a second vector of each sample input corpus (personalized sample input corpus) in the personalized sample input corpus set may also be determined based on the language model that has been trained in advance (for convenience of description, a vector of the personalized sample input corpus determined based on the language model is referred to as a second vector).
Alternatively, in order to accurately determine a target personalized sample input corpus that matches the pervasive sample input corpus, a vector similarity between the first vector and each of the second vectors may be determined. The process of determining the first vector, the second vector, and the vector similarity between the first vector and the second vector may be performed by using the prior art, which is not described herein. A target personalized sample input corpus that matches the pervasive sample input corpus may be determined based on the vector similarity between the first vector and each of the second vectors. Alternatively, the second vector with the highest vector similarity with the first vector may be determined as a target vector, and the personalized sample input corpus corresponding to the target vector may be determined as a target personalized sample input corpus matching the universal sample input corpus.
According to the method and the device for determining the target personalized sample input corpus, the target personalized sample input corpus matched with the pervasive sample input corpus can be determined based on the vector similarity between the first vector of the pervasive sample input corpus and the second vector of each sample input corpus, and therefore accuracy of the determined target personalized sample input corpus can be improved.
Optionally, when determining the target personalized sample input corpus matched with the universal sample input corpus, each second vector with the vector similarity higher than the set similarity threshold value between the first vectors can be respectively determined as a candidate vector, then, one target vector is selected from the candidate vectors, and the personalized sample input corpus corresponding to the target vector is determined as the target personalized sample input corpus matched with the universal sample input corpus. When selecting a target vector from the candidate vectors, one vector may be randomly selected from the candidate vectors to be used as the target vector in order to improve efficiency. The manner in which the target vector is selected from the candidate vectors is not particularly limited in the present application.
Because the embodiment of the application can select one target vector from the second vectors (candidate vectors) with the vector similarity higher than the set similarity threshold, the vector similarity between the target vector and the first vector of the universal sample input corpus can be ensured, the accuracy of the determined target personalized sample input corpus can be ensured when the personalized sample input corpus corresponding to the target vector is determined to be the target personalized sample input corpus matched with the universal sample input corpus, and the efficiency can be improved.
S102: and fusing the universal sample input corpus with the target personalized sample input corpus to generate training input for training a content generation model.
In one possible implementation manner, in order to improve diversification, individuation and identifiability of output content of the content generation model, any universal sample input corpus and a matched target individuation sample input corpus can be fused to form a corpus, so that training input for training the content generation model is generated.
Alternatively, when the universal sample input corpus and the target personalized sample input corpus are fused, the universal sample vector of the obtained universal sample input corpus and the personalized sample vector of the target personalized sample input corpus are spliced according to a set sequence to generate a vector, and the vector generated by splicing is determined as the training input of the training content generation model. Illustratively, assuming that the pervasive sample vector is represented by [ Ess ], the personalized sample vector is represented by [ Esc ], and the connector when the pervasive sample vector is spliced with the personalized sample vector is represented by [ sep ], the training input Esn generated by the splice can be represented by the following formula: esn = [ Ess ] + [ sep ] + [ Esc ].
According to the embodiment of the application, the universal sample input corpus and the target personalized sample input corpus can be combined into one corpus quickly by a mode of splicing the universal sample vector of the universal sample input corpus and the personalized sample vector of the target personalized sample input corpus, so that training input for training the content generation model is generated, and the diversification, individuation and identifiability of the output content of the content generation model can be improved conveniently and quickly.
Optionally, when the universal sample input corpus and the target personalized sample input corpus are fused, a first preset weight corresponding to the preset universal sample input corpus and a second preset weight corresponding to the target personalized sample input corpus can be obtained. The specific numerical values of the first preset weight and the second preset weight are not particularly limited, and the method and the device can be flexibly set according to requirements. The first weighted value of the universal sample vector and the first preset weight of the universal sample input corpus may be determined, in addition, the second weighted value of the personalized sample vector and the second preset weight of the target personalized sample input corpus may be determined, and a vector generated based on the first weighted value and the second weighted value may be determined as a training input. For ease of understanding, the process of determining the training input is explained in the form of a formula. For example, assuming that the universal sample vector is represented by Ess, the personalized sample vector is represented by est, the first preset weight corresponding to the universal sample input corpus is represented by α, the second preset weight corresponding to the target personalized sample input corpus is represented by 1- α, the first weighting value α Ess of the universal sample vector and the first preset weight, and the second weighting value (1- α) Esc of the target personalized sample vector and the second preset weight may be determined first. The vector generated by adding the first weight value and the second weight value may be determined as a training input, i.e. training input Esn = αess+ (1- α) Esc.
The method and the device can improve the flexibility of the fusion process of the universal sample input corpus and the target personalized sample input corpus by configuring the first preset weight of the universal sample input corpus and the second preset weight of the target personalized sample input corpus, and can improve the diversification, individuation, identifiability and accuracy of the output content of the content generation model when the content generation model is trained based on the corpus generated by fusion in the mode.
When determining the universal sample vector of the universal sample input corpus, a first vector of the universal sample input corpus may be determined based on a pre-trained language model, and the first vector may be determined as the universal sample vector of the universal sample input corpus.
In addition, when determining the universal sample vector of the universal sample input corpus, the universal sample input corpus may be segmented to obtain the first target codes, namely word codes, position codes and segment codes, of the universal sample input corpus. And then adding the vectors coded by the first targets, and obtaining a universal sample vector of the universal sample input corpus based on the vectors coded by the first targets. The first target code includes word codes, position codes and segment codes of the universal sample input corpus, wherein a vector of the word codes of the universal sample input corpus is represented by Ews, a vector of the position codes is represented by Eps, a vector of the segment codes is represented by Egs, and then universal sample vector ess=ews+eps+ Egs of the universal sample input corpus si. The universal sample input corpus can be segmented by adopting the prior art, so that word codes, position codes, segment codes and the like of the universal sample input corpus are obtained, and are not repeated here.
The method and the device can determine the universal sample vector based on the language model, or obtain the first target code of the universal sample input corpus by cutting the universal sample input corpus, and obtain the universal sample vector based on the vector of the first target code, so that the universal sample vector of the universal sample input corpus can be rapidly and accurately determined.
Similar to the process of determining the universal sample vector, when determining the personalized sample vector, a second vector of the personalized sample input corpus may also be determined based on the pre-trained language model, and the second vector may be determined as the personalized sample vector of the personalized sample input corpus.
In addition, when the personalized sample vector of the personalized sample input corpus is determined, the personalized sample input corpus may be segmented, so as to obtain the second target codes, namely the word codes, the position codes and the segment codes of the personalized sample input corpus. And then adding the vectors coded by the second targets, and obtaining personalized sample vectors of the personalized sample input corpus based on the vectors coded by the second targets. The second target code includes word codes, position codes and segment codes of the personalized sample input corpus, wherein a vector of the word codes of the personalized sample input corpus is denoted by Ewc, a vector of the position codes is denoted by Epc, a vector of the segment codes is denoted by Egc, and personalized sample vectors of the personalized sample input corpus ci are denoted by esc= Ewc +epc+egc.
The embodiment of the application can determine the personalized sample vector based on the language model, or obtain the second target code of the personalized sample input corpus by cutting the personalized sample input corpus, and obtain the personalized sample vector based on the vector of the second target code, thereby rapidly and accurately determining the personalized sample vector of the personalized sample input corpus.
S103: and training the content generation model based on the training input and the personalized sample output content corresponding to the target personalized sample input corpus.
In one possible implementation manner, in order to improve diversification, individuality and identifiability of the output content of the content generation model, an individualization sample output content corresponding to the target individualization sample input corpus acquired in advance may be obtained, where the individualization sample output content may be considered as an output content capable of reflecting individualization characteristics of the target user and improving diversification and identifiability of the output content. The content generation model may be trained based on the training input and the personalized sample output content. The application is not particularly limited to the personalized sample output content. Based on the training input and the personalized sample output content, when the content generation model is trained, the training input can be used for inputting the personalized sample output content into the content generation model as a supervision signal, and the content generation model is trained, and therefore details are omitted.
For ease of understanding, the content creation model training process provided by the present application is explained below by way of one specific embodiment. Referring to fig. 2, fig. 2 is a schematic diagram of a process of generating a model by using a second training content according to an embodiment of the present application, where the process includes the following steps:
S201: for any acquired universal sample input corpus, determining a first vector of the universal sample input corpus based on a pre-trained language model, and determining a second vector of each sample input corpus in a pre-acquired personalized sample input corpus set of a corresponding target user; determining a vector similarity between the first vector and each of the second vectors; and determining target personalized sample input corpus matched with the universal sample input corpus based on the vector similarity.
S202: and splicing the obtained universal sample vector of the universal sample input corpus with the personalized sample vector of the target personalized sample input corpus, and determining the vector generated by splicing as the training input for training the content generation model.
S203: and training the content generation model based on the training input and the personalized sample output content corresponding to the target personalized sample input corpus.
For ease of understanding, the content creation model training process provided by the present application is explained below by way of a specific embodiment. Referring to fig. 3, fig. 3 is a schematic diagram of a process of generating a model for third training content according to an embodiment of the present application, where the process includes the following steps:
S301: for any acquired universal sample input corpus, determining a first vector of the universal sample input corpus based on a pre-trained language model, and determining a second vector of each sample input corpus in a pre-acquired personalized sample input corpus set of a corresponding target user; determining a vector similarity between the first vector and each of the second vectors; and determining target personalized sample input corpus matched with the universal sample input corpus based on the vector similarity.
S302: obtaining a first preset weight corresponding to the universal sample input corpus and a second preset weight corresponding to the target personalized sample input corpus; determining a first weighting value of a pervasive sample vector and a first preset weight of the obtained pervasive sample input corpus and a second weighting value of a personalized sample vector and a second preset weight of the target personalized sample input corpus; a vector generated based on the first weight and the second weight is determined as a training input.
S303: and training the content generation model based on the training input and the personalized sample output content corresponding to the target personalized sample input corpus.
According to the embodiment of the application, the universal sample input corpus and the target personalized sample input corpus which can reflect the personalized features of the target user can be fused to generate the training input for training the content generation model, the content generation model is trained based on the training input and the personalized sample output content which can reflect the personalized features of the target user and improve the diversification and the identifiability of the output content, when the output content corresponding to the user input corpus is determined by the content generation model trained by the method, the output content provided by the content generation model can be ensured to reflect the personalized features of the user to the greatest extent, the personalized needs of the user can be met, the diversity and the identifiability of the output content can be improved to the greatest extent, and the purposes of improving the diversification, individuation and the identifiability of the output content of the content generation model and improving the user experience are achieved.
Example 2:
In order to improve diversification, individuation and identifiability of output contents of a content generation model, on the basis of the above embodiment, the present application further provides a method for determining output contents of a content generation model, referring to fig. 4, fig. 4 is a schematic diagram of a process for determining output contents of a content generation model according to an embodiment of the present application, where the process includes the following steps:
s401: and if the corpus input by the user is received, identifying the target user identification.
The method for determining the output content of the content generation model provided by the embodiment of the application is applied to electronic equipment, and the electronic equipment can be, for example, equipment such as a PC (personal computer), a mobile terminal and the like, and can also be a server and the like. In one possible implementation, an Application (App) or the like that determines output content corresponding to the user input corpus based on the content generation model may be installed in the electronic device. For example, the user may log in the App based on an account or the like, and speak (input) an input corpus such as a question to be asked, and when the electronic device receives the user input corpus, the identity of the account currently logged in the App may be determined as the target user identity.
S402: and determining a pre-collected personalized input corpus corresponding to the target user identification, and a target personalized input corpus matched with the user input corpus.
In one possible implementation manner, similar to the training process of the content generation model, in order to improve diversification, individuation and identifiability of the output content provided by the content generation model, after receiving the input corpus of the user and identifying the target user identifier of the user, the individuation input corpus matched with the input corpus input by the user at this time can be determined from the individuation input corpus set acquired in advance and corresponding to the target user identifier.
Similar to the process of determining the target personalized sample input corpus matching the universal sample input corpus in the above embodiment, when determining the personalized input corpus matching the input corpus, the third vector of the input corpus may be determined based on the pre-trained language model, and the fourth vector of each personalized input corpus in the pre-collected personalized input corpus set corresponding to the target user identifier may be determined. A vector similarity between the third vector and each fourth vector may be determined, and a target personalized input corpus that matches the input corpus is determined based on the vector similarity between the third vector and each fourth vector. Optionally, a fourth vector with highest vector similarity with the third vector may be determined as a target vector, and the personalized input corpus corresponding to the target vector may be determined as a target personalized input corpus matched with the input corpus. Optionally, when determining the target personalized input corpus matched with the input corpus, each fourth vector with the vector similarity higher than the set similarity threshold value between the third vector and the fourth vector may be determined as a candidate vector, one target vector is randomly selected from the candidate vectors, and the personalized input corpus corresponding to the target vector is determined as the target personalized input corpus matched with the input corpus, which is not described herein.
S403: and fusing the user input corpus with the target personalized input corpus, determining target output content based on target input generated by fusion and a content generation model trained by any method.
In a possible implementation manner, similar to the process of fusing the universal sample input corpus and the target personalized sample input corpus in the foregoing embodiment, when fusing the input corpus (the user input corpus) and the target personalized input corpus, the vector of the obtained user input corpus (for convenience of description, the vector of the user input corpus is referred to as a universal input vector) and the vector of the target personalized input corpus (for convenience of description, the vector of the personalized input corpus is referred to as a personalized input vector) may be spliced according to a set sequence, a vector is generated by splicing, and the vector generated by splicing is determined as the target input for generating the target output content in the input content generation model. Illustratively, assuming that the pervasive input vector is represented by [ Eq ], the personalized input vector by [ Ed ], and the connector when the pervasive input vector is spliced with the personalized input vector by [ sep ], the vector Eqn that spells the generated target input can be represented by the following formula: eqn = [ Eq ] + [ sep ] + [ Ed ].
Optionally, when the user input corpus and the target personalized input corpus are fused, a first preset weight corresponding to the preset user input corpus and a second preset weight corresponding to the target personalized input corpus may be obtained. The third weighted value of the universal input vector and the first preset weight of the user input corpus may be determined, in addition, the fourth weighted value of the personalized input vector and the second preset weight of the target personalized input corpus may be determined, and a vector generated based on the third weighted value and the fourth weighted value may be determined as the generated vector of the target input. For example, assuming that the pervasive input vector is represented by Eq, the personalized input vector is represented by Ed, the first preset weight corresponding to the user input corpus is represented by α, the second preset weight corresponding to the target personalized input corpus is represented by 1- α, the third weighting value αeq of the pervasive input vector and the first preset weight, and the fourth weighting value (1- α) Ed of the target personalized input vector and the second preset weight may be determined first. The vector generated by adding the third weight value and the fourth weight value may be determined as the vector of the target input, that is, vector Eqn =αeq+ (1- α) Ed of the target input.
Similar to the process of determining the pervasive sample vector of the pervasive sample input corpus, when determining the pervasive input vector of the user input corpus, the vector (third vector) of the user input corpus may be determined based on the language model trained in advance, and the vector is determined as the pervasive input vector of the user input corpus. In addition, when determining the universal input vector of the user input corpus, the user input corpus may be segmented to obtain the third target codes, namely word codes, position codes and segment codes, of the user input corpus. And then adding the vectors coded by the third targets, and obtaining the universal input vector of the user input corpus based on the vectors coded by the third targets. For example, the third target code includes word code, position code and segment code of the user input corpus, where the word code vector of the user input corpus is denoted by Ewq, the position code vector is denoted by Epq, the segment code vector is denoted by Egq, and then the universal input vector eq= Ewq + Epq + Egq of the user input corpus qi.
In addition, similar to the process of determining the personalized sample vector, when determining the personalized input vector, a vector (fourth vector) of the personalized input corpus may be determined based on the language model trained in advance, and the vector may be determined as the personalized input vector of the personalized input corpus. In addition, when determining the personalized input vector of the personalized input corpus, the personalized input corpus may be segmented to obtain fourth target codes, such as word codes, position codes and segment codes, of the personalized input corpus. And then adding the vectors coded by the fourth targets, and obtaining personalized input vectors of the personalized input corpus based on the vectors coded by the fourth targets. For example, the fourth target code includes word codes, position codes and segment codes of the personalized input corpus, wherein a vector of the word codes of the personalized input corpus is denoted by Ewd, a vector of the position codes is denoted by Epd, a vector of the segment codes is denoted by Egd, and then the personalized input vector Ed of the personalized input corpus di= Ewd + Epd + Egd.
In one possible implementation, after fusing the vector Eq of the user input corpus with the vector Ed of the target personalized input corpus to generate the vector Eqn of the target input, eqn may be input into a trained content generation model, which may determine target output content suitable for the Eqn based on the Eqn.
Because the content generation model in the embodiment of the application is trained based on the training input capable of reflecting the personalized characteristics of the user and improving the diversity and the identifiability of the output content and the personalized sample output content in the training process, the target output content determined based on the content generation model after training can also be considered as the output content which can reflect the personalized characteristics of the user to the greatest extent and meet the personalized requirements of the user, and the diversity, the individuation and the identifiability of the output content provided by the content generation model can be improved, and the user experience is improved.
Optionally, the model structure of the content generation model may be a model structure similar to a mask content generation model, an autoregressive content generation model, or the like, for example, including a coding layer (Embedding), a conversion layer (transform), an output layer, or the like of the autoregressive content generation model.
In addition, the content generation model in the embodiment of the application can be applied to various application scenes such as story renewal, advertisement document pushing, letter writing, answers of output questions, prediction of current words according to a plurality of words in front of a sentence, and the like, and can provide various types of output content. In addition, the content generation model in the embodiment of the application can be a basic model such as a large language model, or a task model such as a question-answer model. The training process of the content generation model can adopt a supervised learning mode, a self-supervised learning mode and the like, and the application is not particularly limited to the method.
Optionally, in order to improve diversification, individualization and identifiability of the output content of the content generation model, when determining the target output content of the content generation model, the type of the target output content desired by the user may also be obtained. For example, when receiving an input corpus input by a user, a target keyword included in the input corpus is identified, and a target output content type corresponding to the target keyword is determined as a type of target output content desired by the user according to a correspondence between a preset keyword and the output content type. In addition, the user may be asked about a desired type of the target output content, and the type of the output content inputted by the user may be determined as the type of the target output content desired by the user. Optionally, the electronic device may input the input corpus and the target output content type into the content generation model, and the content generation model may determine the output content belonging to the target output content type based on the input corpus and the input information such as the target output content type, thereby improving accuracy of the target output content determined by the content generation model and improving user experience.
Correspondingly, when the content generation model is trained, training input and corresponding target output content types can be input into the content generation model, and the content generation model is trained based on the input information and corresponding personalized sample output content, so that the trained content generation model can accurately output different types of output content, and the details are not repeated.
The process of collecting the personalized sample input corpus of the user and the corresponding personalized sample output content is described below.
Optionally, collection of the personalized sample input corpus and the corresponding personalized sample output content (the personalized sample input corpus and the corresponding personalized sample output content can also be called as cognitive corpus) can be completed in a man-machine interaction mode. For example, the user may be guided to input or select questions of different types (e.g., history, novels, job site, music, etc.) based on a large language model (content generation model) experience system, multiple candidate answers (output content) may be displayed back based on the user input or selected questions, the user may select or input preferred answers, and the electronic device records and correspondingly saves the different user input (selected) questions and output content (cognitive corpus). Optionally, the personalized sample input corpus used in the training process may be completely the same as or partially the same as the personalized input corpus used when determining the target output content based on the content generation model, and of course, may be completely different, and may be flexibly set according to the requirements, where the collecting processes of the two (the personalized sample input corpus and the personalized input corpus) may be the same, and will not be described herein.
For example, the user may also input article content or the like authored or liked by himself as personalized sample output content into the electronic device. In addition, taking the user as an enterprise as an example, the user can input article contents and the like with self personalized features (personalized identifiers) and capable of improving self identifiability into the electronic equipment, so that the output contents capable of reflecting the personalized features (personalized identifiers) of the enterprise and improving the diversity and identifiability of the output contents can be output based on the trained content generation model, the entertainment, individuation and diversity of the output contents output by the content generation model can be improved, and meanwhile the identifiability of the user can be improved, so that the purpose of protecting the special intellectual property of the user can be achieved.
Optionally, after the personalized sample input corpus and the personalized input corpus are collected, the collected personalized sample input corpus and personalized input corpus can be subjected to preprocessing such as coding format adjustment and clause, so as to generate personalized sample input corpus and personalized input corpus of single sentence. The pre-processed personalized sample input corpus and the vectors of the personalized input corpus can be determined based on a pre-trained language model, each vector is stored in a cognitive vector library, the subsequent rapid determination is convenient based on the vectors stored in the cognitive vector library, the target personalized sample input corpus matched with the universal sample input corpus and the target personalized input corpus matched with the input corpus are determined, and the description is omitted.
Example 3:
based on the same technical conception, the application also provides a device for training the content generation model. Referring to fig. 5, fig. 5 is a schematic diagram of an apparatus for training a content generation model according to an embodiment of the present application, where the apparatus includes:
The determining module 51 is configured to determine, for any acquired universal sample input corpus, a target personalized sample input corpus that is acquired in advance and that matches the universal sample input corpus, where the personalized sample input corpus corresponds to a target user;
the generating module 52 is configured to fuse the universal sample input corpus with the target personalized sample input corpus, and generate a training input for training a content generating model;
The training module 53 is configured to train the content generation model based on the training input and the personalized sample output content corresponding to the target personalized sample input corpus.
In a possible implementation manner, the determining module 51 is specifically configured to:
Determining a first vector of the universal sample input corpus based on a pre-trained language model, and determining a second vector of each sample input corpus in the personalized sample input corpus set;
determining a vector similarity between the first vector and each of the second vectors;
And determining target personalized sample input corpus matched with the universal sample input corpus based on the vector similarity.
In a possible implementation manner, the determining module 51 is specifically configured to:
Each second vector with vector similarity higher than the set similarity threshold value is respectively determined as a candidate vector;
selecting a target vector from the candidate vectors, and determining personalized sample input corpus corresponding to the target vector as target personalized sample input corpus matched with the universal sample input corpus.
In a possible implementation manner, the generating module 52 is specifically configured to:
And splicing the obtained universal sample vector of the universal sample input corpus with the personalized sample vector of the target personalized sample input corpus, and determining the training input based on the vector generated by splicing.
In a possible implementation manner, the generating module 52 is specifically configured to:
Obtaining a first preset weight corresponding to the universal sample input corpus and a second preset weight corresponding to the target personalized sample input corpus;
determining a first weighted value of the obtained universal sample vector of the universal sample input corpus and the first preset weight and a second weighted value of the personalized sample vector of the target personalized sample input corpus and the second preset weight;
The training input is determined based on the first weight value and the second weight value.
In a possible implementation manner, the generating module 52 is specifically configured to:
determining a first vector of the pervasive sample input corpus determined based on a pre-trained language model as the pervasive sample vector; or alternatively
The method comprises the steps of segmenting the universal sample input corpus to obtain a first target code of the universal sample input corpus, and obtaining a universal sample vector based on a vector of the first target code, wherein the first target code comprises word codes, position codes and segment codes of the universal sample input corpus.
In a possible implementation manner, the generating module 52 is specifically configured to:
determining a second vector of the personalized sample input corpus determined based on a pre-trained language model as the personalized sample vector; or alternatively
The personalized sample input corpus is segmented, a second target code of the personalized sample input corpus is obtained, and the personalized sample vector is obtained based on a vector of the second target code, wherein the second target code comprises word codes, position codes and segment codes of the personalized sample input corpus.
Based on the same technical conception, the application also provides a device for determining output content based on the content generation model. Referring to fig. 6, fig. 6 is a schematic diagram of an apparatus for determining output content based on a content generation model according to an embodiment of the present application, where the apparatus includes:
the receiving module 61 is configured to identify a target user identifier if a corpus input by a user is received;
The matching module 62 is configured to determine a target personalized input corpus that matches the user input corpus, from among the pre-collected personalized input corpuses corresponding to the target user identifier;
And the output module 63 is configured to fuse the user input corpus with the target personalized input corpus, determine target output content based on target input generated by fusion and a content generation model trained based on any one of the methods.
Example 4:
On the basis of the foregoing embodiments, the embodiment of the present application further provides an electronic device, and fig. 7 is a schematic structural diagram of the electronic device provided by the embodiment of the present application, as shown in fig. 7, where the electronic device includes: the processor 71, the communication interface 72, the memory 73 and the communication bus 74, wherein the processor 71, the communication interface 72 and the memory 73 complete communication with each other through the communication bus 74;
The memory 73 has stored therein a computer program which, when executed by the processor 71, causes the processor 71 to perform the steps of any of the method embodiments described above.
Because the principle of the electronic device for solving the problem is similar to the method for training the content generation model and the method for determining the output content of the content generation model, the implementation of the electronic device can be referred to the implementation of the method, and the repetition is omitted.
The communication bus mentioned above for the electronic device may be a peripheral component interconnect standard (PERIPHERAL COMPONENT INTERCONNECT, PCI) bus or an extended industry standard architecture (Extended Industry Standard Architecture, EISA) bus, etc. The communication bus may be classified as an address bus, a data bus, a control bus, or the like. For ease of illustration, the figures are shown with only one bold line, but not with only one bus or one type of bus.
The communication interface 72 is used for communication between the above-described electronic device and other devices.
The Memory may include random access Memory (Random Access Memory, RAM) or may include Non-Volatile Memory (NVM), such as at least one disk Memory.
The processor may be a general-purpose processor, including a central processing unit, a network processor (Network Processor, NP), etc.; but also digital instruction processors (DIGITAL SIGNAL Processing units, DSPs), application specific integrated circuits, field programmable gate arrays or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.
Example 5:
on the basis of the foregoing embodiments, an embodiment of the present invention provides a computer readable storage medium, where a computer program executable by an electronic device is stored in the computer readable storage medium, and when the program runs on the electronic device, the program causes the electronic device to execute the steps of any one of the foregoing method embodiments, which is not described herein again.
The computer readable storage medium may be any available medium or data storage device that can be accessed by a processor in an electronic device, including but not limited to magnetic memories such as floppy disks, hard disks, magneto-optical disks (MO), etc., optical memories such as CD, DVD, BD, HVD, etc., and semiconductor memories such as ROM, EPROM, EEPROM, nonvolatile memories (NAND FLASH), solid State Disks (SSD), etc.
It will be appreciated by those skilled in the art that embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to the invention. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
It will be apparent to those skilled in the art that various modifications and variations can be made to the present invention without departing from the spirit or scope of the invention. Thus, it is intended that the present invention also include such modifications and alterations insofar as they come within the scope of the appended claims or the equivalents thereof.

Claims (14)

1. A method of training a content creation model, the method comprising:
determining a target personalized sample input corpus matched with any acquired universal sample input corpus in a personalized sample input corpus set of a corresponding target user;
fusing the universal sample input corpus with the target personalized sample input corpus to generate training input for training a content generation model;
training the content generation model based on the training input and personalized sample output content corresponding to the target personalized sample input corpus;
The determining a target personalized sample input corpus matched with the universal sample input corpus in a personalized sample input corpus set of a corresponding target user, which is acquired in advance, comprises the following steps:
Determining a first vector of the universal sample input corpus based on a pre-trained language model, and determining a second vector of each sample input corpus in the personalized sample input corpus set;
determining a vector similarity between the first vector and each of the second vectors;
Each second vector with vector similarity higher than the set similarity threshold value is respectively determined as a candidate vector;
selecting a target vector from the candidate vectors, and determining personalized sample input corpus corresponding to the target vector as target personalized sample input corpus matched with the universal sample input corpus.
2. The method of claim 1, wherein the fusing the pervasive sample input corpus with the target personalized sample input corpus generates training inputs for training a content generation model, comprising:
And splicing the obtained universal sample vector of the universal sample input corpus with the personalized sample vector of the target personalized sample input corpus, and determining the training input based on the vector generated by splicing.
3. The method of claim 1, wherein the fusing the pervasive sample input corpus with the target personalized sample input corpus generates training inputs for training a content generation model, comprising:
Obtaining a first preset weight corresponding to the universal sample input corpus and a second preset weight corresponding to the target personalized sample input corpus;
determining a first weighted value of the obtained universal sample vector of the universal sample input corpus and the first preset weight and a second weighted value of the personalized sample vector of the target personalized sample input corpus and the second preset weight;
The training input is determined based on the first weight value and the second weight value.
4. A method according to claim 2 or 3, wherein the process of obtaining the pervasive sample vector comprises:
determining a first vector of the pervasive sample input corpus determined based on a pre-trained language model as the pervasive sample vector; or alternatively
The method comprises the steps of segmenting the universal sample input corpus to obtain a first target code of the universal sample input corpus, and obtaining a universal sample vector based on a vector of the first target code, wherein the first target code comprises word codes, position codes and segment codes of the universal sample input corpus.
5. A method according to claim 2 or 3, wherein the process of obtaining the personalized sample vector comprises:
determining a second vector of the personalized sample input corpus determined based on a pre-trained language model as the personalized sample vector; or alternatively
The personalized sample input corpus is segmented, a second target code of the personalized sample input corpus is obtained, and the personalized sample vector is obtained based on a vector of the second target code, wherein the second target code comprises word codes, position codes and segment codes of the personalized sample input corpus.
6. A method of determining output content of a content generation model, the method comprising:
if the corpus input by the user is received, identifying a target user identifier;
determining a pre-collected personalized input corpus corresponding to the target user identification, and a target personalized input corpus matched with the user input corpus;
Fusing the user input corpus with the target personalized input corpus, determining target output content based on target input generated by fusion and a content generation model trained based on the method of any one of claims 1-5.
7. An apparatus for training a content creation model, the apparatus comprising:
the determining module is used for determining a target personalized sample input corpus matched with the universal sample input corpus in a pre-acquired personalized sample input corpus set of a corresponding target user aiming at any acquired universal sample input corpus;
The generation module is used for fusing the universal sample input corpus and the target personalized sample input corpus to generate training input for training a content generation model;
The training module is used for training the content generation model based on the training input and personalized sample output content corresponding to the target personalized sample input corpus;
The determining module is specifically configured to:
Determining a first vector of the universal sample input corpus based on a pre-trained language model, and determining a second vector of each sample input corpus in the personalized sample input corpus set;
determining a vector similarity between the first vector and each of the second vectors;
Each second vector with vector similarity higher than the set similarity threshold value is respectively determined as a candidate vector;
selecting a target vector from the candidate vectors, and determining personalized sample input corpus corresponding to the target vector as target personalized sample input corpus matched with the universal sample input corpus.
8. The apparatus of claim 7, wherein the generating module is specifically configured to:
And splicing the obtained universal sample vector of the universal sample input corpus with the personalized sample vector of the target personalized sample input corpus, and determining the training input based on the vector generated by splicing.
9. The apparatus of claim 7, wherein the generating module is specifically configured to:
Obtaining a first preset weight corresponding to the universal sample input corpus and a second preset weight corresponding to the target personalized sample input corpus;
determining a first weighted value of the obtained universal sample vector of the universal sample input corpus and the first preset weight and a second weighted value of the personalized sample vector of the target personalized sample input corpus and the second preset weight;
The training input is determined based on the first weight value and the second weight value.
10. The apparatus according to claim 8 or 9, wherein the generating module is specifically configured to:
determining a first vector of the pervasive sample input corpus determined based on a pre-trained language model as the pervasive sample vector; or alternatively
The method comprises the steps of segmenting the universal sample input corpus to obtain a first target code of the universal sample input corpus, and obtaining a universal sample vector based on a vector of the first target code, wherein the first target code comprises word codes, position codes and segment codes of the universal sample input corpus.
11. The apparatus according to claim 8 or 9, wherein the generating module is specifically configured to:
determining a second vector of the personalized sample input corpus determined based on a pre-trained language model as the personalized sample vector; or alternatively
The personalized sample input corpus is segmented, a second target code of the personalized sample input corpus is obtained, and the personalized sample vector is obtained based on a vector of the second target code, wherein the second target code comprises word codes, position codes and segment codes of the personalized sample input corpus.
12. An apparatus for determining output content of a content generation model, the apparatus comprising:
the receiving module is used for identifying a target user identifier if the corpus input by the user is received;
the matching module is used for determining target personalized input corpus matched with the user input corpus in the pre-acquired personalized input corpus corresponding to the target user identification;
The output module is used for fusing the user input corpus and the target personalized input corpus, determining target output content based on target input generated by fusion and a content generation model obtained by training based on the method of any one of claims 1-5.
13. An electronic device comprising at least a processor and a memory, the processor being adapted to implement the steps of the method according to any of claims 1-6 when executing a computer program stored in the memory.
14. A computer-readable storage medium, characterized in that it stores a computer program which, when executed by a processor, implements the steps of the method according to any of claims 1-6.
CN202311714112.9A 2023-12-13 2023-12-13 Training content generation model method, device and equipment for determining output content Active CN117725414B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311714112.9A CN117725414B (en) 2023-12-13 2023-12-13 Training content generation model method, device and equipment for determining output content

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311714112.9A CN117725414B (en) 2023-12-13 2023-12-13 Training content generation model method, device and equipment for determining output content

Publications (2)

Publication Number Publication Date
CN117725414A CN117725414A (en) 2024-03-19
CN117725414B true CN117725414B (en) 2024-07-19

Family

ID=90199282

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311714112.9A Active CN117725414B (en) 2023-12-13 2023-12-13 Training content generation model method, device and equipment for determining output content

Country Status (1)

Country Link
CN (1) CN117725414B (en)

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116561265A (en) * 2023-02-14 2023-08-08 北京邮电大学 Personalized dialogue generation method, model training method and device

Family Cites Families (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110737758B (en) * 2018-07-03 2022-07-05 百度在线网络技术(北京)有限公司 Method and apparatus for generating a model
CN110287285B (en) * 2019-05-31 2023-06-16 平安科技(深圳)有限公司 Method and device for identifying problem intention, computer equipment and storage medium
CN111753551B (en) * 2020-06-29 2022-06-14 北京字节跳动网络技术有限公司 Information generation method and device based on word vector generation model
CN112506359B (en) * 2020-12-21 2023-07-21 北京百度网讯科技有限公司 Method and device for providing candidate long sentences in input method and electronic equipment
CN112579760B (en) * 2020-12-29 2024-01-19 深圳市优必选科技股份有限公司 Man-machine conversation method, device, computer equipment and readable storage medium
CN113901191A (en) * 2021-06-16 2022-01-07 北京金山数字娱乐科技有限公司 Question-answer model training method and device
CN114357973B (en) * 2021-12-10 2023-04-07 马上消费金融股份有限公司 Intention recognition method and device, electronic equipment and storage medium
CN114462423A (en) * 2022-03-03 2022-05-10 平安普惠企业管理有限公司 Method and device for training intention recognition model, model and electronic equipment
CN115048505A (en) * 2022-06-17 2022-09-13 北京百度网讯科技有限公司 Corpus screening method and device, electronic equipment and computer readable medium
CN115309877B (en) * 2022-08-03 2023-05-30 北京百度网讯科技有限公司 Dialogue generation method, dialogue model training method and device
CN116881428B (en) * 2023-09-06 2023-11-21 杭州华鲤智能科技有限公司 Language model training method and device
CN116955590B (en) * 2023-09-20 2023-12-08 成都明途科技有限公司 Training data screening method, model training method and text generation method

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116561265A (en) * 2023-02-14 2023-08-08 北京邮电大学 Personalized dialogue generation method, model training method and device

Also Published As

Publication number Publication date
CN117725414A (en) 2024-03-19

Similar Documents

Publication Publication Date Title
CN111859960B (en) Semantic matching method, device, computer equipment and medium based on knowledge distillation
CN111738016B (en) Multi-intention recognition method and related equipment
CN109165291B (en) Text matching method and electronic equipment
CN109313719B (en) Dependency resolution for generating text segments using neural networks
CN111143226B (en) Automatic test method and device, computer readable storage medium and electronic equipment
CN111222317A (en) Sequence labeling method, system and computer equipment
CN112380853B (en) Service scene interaction method and device, terminal equipment and storage medium
CN111753076B (en) Dialogue method, dialogue device, electronic equipment and readable storage medium
CN111460290B (en) Information recommendation method, device, equipment and storage medium
CN112860841A (en) Text emotion analysis method, device and equipment and storage medium
US11126797B2 (en) Toxic vector mapping across languages
CN112632254B (en) Dialogue state determining method, terminal device and storage medium
CN112364664B (en) Training of intention recognition model, intention recognition method, device and storage medium
CN111009238A (en) Spliced voice recognition method, device and equipment
CN111400471A (en) Question recommendation method, system, electronic device and storage medium
CN111177307A (en) Test scheme and system based on semantic understanding similarity threshold configuration
CN107967304A (en) Session interaction processing method, device and electronic equipment
CN114626380A (en) Entity identification method and device, electronic equipment and storage medium
CN116756276A (en) Prompt information generation system and prompt information generation model obtaining method
CN114333803A (en) Method, device and equipment for processing voice recognition model and storage medium
CN113010785B (en) User recommendation method and device
CN116739004B (en) Intention recognition method, device, equipment and readable storage medium
CN117725414B (en) Training content generation model method, device and equipment for determining output content
CN116822591A (en) Legal consultation recovery method and legal field generation type large model training method
US20170262755A1 (en) Supporting generation of a response to an inquiry

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
GR01 Patent grant
GR01 Patent grant