Data Generation Method, Apparatus, Storage Medium, and Computing Device
By introducing thinking chain technology into the pre-trained model and learning different personality attributes, the flexibility and personalization problems of reply generation in the existing technology are solved, and more personalized and diversified reply information generation is achieved.
Patent Information
- Application Number
- CN202411776027.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-04
- Publication Date
- 2025-07-25
- Estimated Expiration
- 2044-12-04
AI Technical Summary
The existing rules-based dialogue replies generation technology lacks flexibility and personalization, and cannot flexibly generate diverse replies based on input data.
A pre-trained model containing a thinking chain is used to guide the pre-trained model to generate personalized reply information by learning the personality attributes of different personas as prompt information.
It provides flexible reply selection, and the generated reply information has personalized characteristics, improving the diversity and user experience of reply information.
Smart Images

Figure CN119250041B_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present disclosure relate to the field of computer technology. More specifically, embodiments of the present disclosure relate to a data generation method, apparatus, storage medium, and computing device. Background Art
[0002] This section aims to provide background or context for the embodiments of the present disclosure. The descriptions herein are not admitted to be prior art merely because they are included in this section.
[0003] Data generation generally refers to automatically generating response data corresponding to input data using data generation techniques. Due to the high timeliness of data generation, it is widely used in various services, scenarios, or applications such as machine customer service, comment replies, and automatic question answering.
[0004] In related technologies, data generation generally adopts rule-based dialogue response generation techniques. Such techniques usually use a retrieval method. Specifically, a large amount of dialogue corpus can be pre-stored, and by performing similarity retrieval on the input data and the dialogue corpus, response data related to the input data can be obtained.
[0005] Although rule-based dialogue response generation techniques can meet the data generation requirements to a certain extent, they have the problems of lack of flexibility and personalization. For example, on the one hand, whether response data can be retrieved mainly depends on the richness of the dialogue corpus. On the other hand, for the same or similar input data, only fixed response data will be retrieved. Summary of the Invention
[0006] In a first aspect of the embodiments of the present disclosure, a data generation method is provided. The method includes:
[0007] In response to comment information to be replied, input the comment information into a pre-trained model including a thought chain; wherein the thought chain is located between the input layer and the output layer of the pre-trained model, and the thought chain is used to use the persona attributes of different personas learned in advance as prompt information for the pre-trained model to guide the pre-trained model to generate reply information made by different personas for the comment information;
[0008] Obtain the reply information made by different personas for the comment information output by the pre-trained model.
[0009] Optionally, the method further includes:
[0010] In response to a trigger operation on the target reply information in the reply information, publish the target reply information as a reply to the comment information.
[0011] Optionally, the pre-trained model containing the chain of thought is trained as follows:
[0012] Obtain a training sample set; wherein, the training sample set includes a number of sample pairs, and each sample pair contains dialogue corpus and pre-annotated persona attribute labels; the dialogue corpus includes comment samples and reply samples for the comment samples, and the persona attribute labels are used to characterize the persona who posts the reply samples;
[0013] Input the dialogue corpus and pre-annotated persona attribute labels in the training sample set into the pre-trained model;
[0014] During the training process in which the pre-trained model generates corresponding reply samples based on the comment samples in the dialogue corpus, use the chain of thought to use the pre-annotated persona attribute labels as prompt information, so that the pre-trained model learns the mapping relationship of the persona attribute labels between the comment samples and the reply samples.
[0015] Optionally, the persona attribute includes a number of different persona sub-attributes.
[0016] Optionally, after inputting the comment information into the pre-trained model containing the chain of thought, it further includes:
[0017] During the process of the pre-trained model reasoning based on the comment information, the chain of thought splits the persona attributes of different personas learned in advance, and constructs a sub-attribute sequence corresponding to each persona attribute and composed of the split persona sub-attributes.
[0018] Optionally, the chain of thought is used to use the persona attributes of different personas learned in advance as the prompt information of the pre-trained model to guide the pre-trained model to generate reply information made by different personas for the comment information, including:
[0019] The chain of thought sequentially uses the persona sub-attributes as prompt information according to the order of the persona sub-attributes in the sub-attribute sequence to guide the pre-trained model to generate intermediate information for the comment information and conforming to the persona sub-attributes; and fuses the intermediate information into the final reply information in the output layer.
[0020] Optionally, after the pre-trained model is trained, it further includes:
[0021] In response to the model fine-tuning operation for the target business segment, fine-tune the trained pre-trained model based on the fine-tuning samples in the target business segment, so that the pre-trained model tends to generate reply information conforming to the target business segment; wherein, the fine-tuning samples include positive feedback reply samples in the target business segment.
[0022] Optionally, the inputting the comment information into a pre-trained model including a chain of thought in response to the comment information to be replied includes:
[0023] In response to the comment information to be replied in the target business segment, obtain a target pre-trained model including a chain of thought obtained by fine-tuning the target business segment;
[0024] Input the comment information into the target pre-trained model.
[0025] Optionally, the persona attributes include at least one of emotion, attitude, occupation, and personality.
[0026] Optionally, the pre-trained model includes a large language model.
[0027] In a second aspect of the embodiments of the present disclosure, a data generation device is provided, and the device includes:
[0028] A response unit, which in response to the comment information to be replied, inputs the comment information into a pre-trained model including a chain of thought; wherein the chain of thought is located between the input layer and the output layer of the pre-trained model, and the chain of thought is used to use the persona attributes of different personas learned in advance as prompt information for the pre-trained model to guide the pre-trained model to generate reply information made by different personas for the comment information;
[0029] A generation unit, which obtains the reply information made by different personas for the comment information output by the pre-trained model.
[0030] Optionally, the device further includes:
[0031] A reply unit, which in response to a trigger operation on the target reply information in the reply information, publishes the target reply information as a reply to the comment information.
[0032] Optionally, the pre-trained model including a chain of thought is obtained by training through a training unit;
[0033] The training unit further includes:
[0034] An acquisition subunit, which acquires a training sample set; wherein the training sample set includes a number of sample pairs, the sample pairs include dialogue corpus and pre-annotated persona attribute labels; the dialogue corpus includes comment samples and reply samples for the comment samples, and the persona attribute labels are used to characterize the persona who publishes the reply samples;
[0035] An input subunit, which inputs the dialogue corpus and the pre-annotated persona attribute labels in the training sample set into the pre-trained model;
[0036] A training subunit, during the training process of the pre-trained model to generate corresponding response samples based on the comment samples of the dialogue corpus, uses the chain of thought to take the pre-labeled persona attribute tags as prompt information, so that the pre-trained model learns the mapping relationship of the persona attribute tags between the comment samples and the response samples.
[0037] Optionally, the persona attribute includes several different persona sub-attributes.
[0038] Optionally, after the response unit, it further includes:
[0039] A processing subunit, during the process of the pre-trained model reasoning based on the comment information, the chain of thought splits the persona attributes of different personas learned in advance, and constructs a sub-attribute sequence corresponding to each persona attribute and composed of the split persona sub-attributes.
[0040] Optionally, the chain of thought is used to take the persona attributes of different personas learned in advance as the prompt information of the pre-trained model, and guide the pre-trained model to generate response information made by different personas for the comment information, including:
[0041] The chain of thought sequentially takes the persona sub-attributes as prompt information according to the order between the persona sub-attributes in the sub-attribute sequence, guides the pre-trained model to generate intermediate information for the comment information and conforming to the persona sub-attributes; and fuses the intermediate information into the final response information in the output layer.
[0042] Optionally, after the training unit, it further includes:
[0043] A fine-tuning unit, in response to a model fine-tuning operation for a target business segment, fine-tunes the trained pre-trained model based on the fine-tuning samples under the target business segment, so that the pre-trained model tends to generate response information conforming to the target business segment; wherein, the fine-tuning samples include positive feedback response samples under the target business segment.
[0044] Optionally, the response unit includes:
[0045] In response to the comment information to be replied in the target business segment, obtain a target pre-trained model containing a chain of thought obtained by fine-tuning for the target business segment, and input the comment information into the target pre-trained model.
[0046] Optionally, the persona attribute includes at least one of emotion, attitude, occupation, and personality.
[0047] Optionally, the pre-trained model includes a large language model.
[0048] In a third aspect of the embodiments of the present disclosure, there is provided a computer-readable storage medium, including:
[0049] When the instructions in the computer-readable storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute the data generation method as described in any one of the preceding items.
[0050] In a fourth aspect of the embodiments of the present disclosure, there is provided a computing device, including:
[0051] A processor;
[0052] A memory for storing executable instructions of the processor;
[0053] Wherein, the processor is configured to execute the executable instructions to implement the data generation method as described in any one of the preceding items.
[0054] According to the data generation solution provided by the embodiments of the present disclosure, the chain of thought technology is applied to the pre-trained model for generating reply information. The chain of thought is used to learn the persona attributes of different personas, and the persona attributes of different personas are used as prompt information for the pre-trained model, so as to guide the pre-trained model to simulate the reply information made by users with different personas to the comment information. Since the generated reply information has the personalized characteristics of different personas, more flexible reply options can be provided, so that the reply information is no longer monotonous. BRIEF DESCRIPTION OF THE DRAWINGS
[0055] By referring to the drawings and reading the following detailed description, the above and other objects, features, and advantages of the exemplary embodiments of the present disclosure will become easy to understand. In the drawings, several embodiments of the present disclosure are shown in an exemplary rather than restrictive manner, wherein:
[0056] Figure 1 Schematically shows the system architecture diagram of the data generation system provided by the present disclosure;
[0057] Figure 2 Schematically shows the schematic diagram of the data generation method provided by the present disclosure;
[0058] Figure 3 Schematically shows the schematic diagram of the fine-tuning process provided by the present disclosure;
[0059] Figure 4 Schematically shows the schematic diagram of the medium provided by the present disclosure;
[0060] Figure 5 Schematically shows the schematic diagram of the data generation device provided by the present disclosure;
[0061] Figure 6 FIG. schematically shows a schematic diagram of a computing device provided by the present disclosure.
[0062] In the drawings, the same or corresponding reference numerals indicate the same or corresponding parts. DETAILED DESCRIPTION
[0063] The principles and spirit of the present disclosure will now be described with reference to several exemplary embodiments. It should be understood that these embodiments are provided only to enable those skilled in the art to better understand and implement the present disclosure, and not to limit the scope of the present disclosure in any way. On the contrary, these embodiments are provided to make the present disclosure more thorough and complete, and to fully convey the scope of the present disclosure to those skilled in the art.
[0064] Those skilled in the art know that the embodiments of the present disclosure can be implemented as a system, a device, an apparatus, a method, or a computer program product. Therefore, the present disclosure can be specifically implemented in the following forms: completely hardware, completely software (including firmware, resident software, microcode, etc.), or a combination of hardware and software.
[0065] According to an embodiment of the present disclosure, a data generation method, a computer-readable storage medium, a device, and a computing device are provided.
[0066] In this document, it should be understood that any number of elements in the drawings is for illustration rather than limitation, and any naming is only for distinction and does not have any limiting meaning.
[0067] The principles and spirit of the present disclosure will now be described in detail with reference to several representative embodiments of the present disclosure.
[0068] The data involved in the present disclosure can be data authorized by the user or fully authorized by all parties. The collection, dissemination, use, etc. of the data all comply with the requirements of relevant national laws and regulations. The embodiments / examples of the present disclosure can be combined with each other. Summary of the Invention
[0070] The present disclosure aims to provide a data generation solution, applying the chain of thought technology to a pre-trained model for generating reply information, learning the persona attributes of different personas through the chain of thought, and using the persona attributes of different personas as prompt information for the pre-trained model, so as to guide the pre-trained model to simulate the reply information made by users with different personas to comment information. Since the generated reply information has the personalized characteristics of different personas, more flexible reply options can be provided, making the reply information no longer monotonous.
[0071] After introducing the basic principles of the present disclosure, the various non-limiting embodiments of the present disclosure will now be specifically described.
[0072] Overview of Application Scenarios
[0073] First, refer to Figure 1 the system architecture diagram of a data generation system as shown. In this system architecture diagram, various network nodes can achieve information communication through the network, and then complete interaction and data processing. The system architecture diagram may include an operation server 12 that conducts data communication with one or more clients 11 via network 13, and a database 14 that can be integrated into the operation server 12 or independent of the operation server 12.
[0074] The operation server 12 may store a pre-trained model containing a chain of thought that has been pre-trained. Through the pre-trained model, the operation server 12 can be equipped with data generation capabilities, specifically referring to automatically generating reply information for different personas in response to comment information to be replied to by means of the pre-trained model.
[0075] The operation server 12 may include various service platforms that need to perform automatic replies. The service platforms may include, but are not limited to, social platforms, shopping platforms, multimedia platforms, and so on. Taking the social platform as an example, different users can conduct social interactions on the social platform. For example, when commenting on the content shared by other users, the data generation method provided in this specification can be used to generate reply information. Taking the shopping platform as an example, in the shopping platform, buyers can consult merchants about products or after-sales issues, and when the artificial customer service is busy or offline, the data generation method provided in this specification can be used to generate reply information. Taking the multimedia platform as an example, the multimedia platform may include, but is not limited to, music listening platforms, short video platforms, long video platforms, e-book platforms, and so on. After listening to or watching a multimedia object on the multimedia platform, users can express comments on the multimedia object based on their actual feelings, and at this time, the data generation method provided in this specification can be used to generate reply information.
[0076] In the system architecture diagram, each network 13 may include wired or wireless telecommunications devices, and the network devices on which the clients 11 are based can exchange data through the wired or wireless telecommunications devices. For example, each network 13 may include a local area network (“LAN”), a wide area network (“WAN”), an intranet, the Internet, a mobile phone network, a virtual private network (VPN), a cellular or other mobile communication network, Bluetooth, NFC, or any combination thereof. In the discussion of exemplary embodiments, it should be understood that the terms “data” and “information” may be used interchangeably herein to refer to text, images, audio, video, or any other form of information that may exist in a computer-based environment.
[0077] Each network device on which the client 11 is based may include a device having a communication module capable of transmitting and receiving data via the network 13. For example, each network device on which the client 11 is based may include a server, a desktop computer, a laptop computer, a tablet computer, a smart phone, a handheld computer, a personal digital assistant (“PDA”), or any other wired or wireless processor-driven device.
[0078] In Figure 1 In the depicted exemplary embodiment, the network device on which the client 11 is based may be operated by the user who posts a comment and the opposing user who may need to reply to the comment, respectively.
[0079] Users (including individuals or organizations) may use an application such as a web browser application or a stand-alone application to view, download, upload, or otherwise access files or web pages via the network 13.
[0080] The application of the web browser application or the stand-alone application may interact with a web server (or other servers, such as a social platform, a shopping platform, a multimedia platform, etc.) connected to the network 13 to complete interactions such as comments or replies.
[0081] The data / relationships that need to be read or the processing that needs to be performed involved in the interaction process may need to be obtained from the connected database 14, and the data / relationships that need to be written or the processing results involved in the interaction process may need to be written into the connected database 14.
[0082] Figure 1 In, the computing device 15, which may be in an integrated relationship or a separate relationship with the operation server 12, especially in the latter case, can generally be connected through an internal network or a dedicated network, or can also be connected through an encrypted public network. In particular, when in an integrated relationship, a connection in the form of a more efficient and faster transmission speed internal bus may be adopted. The computing device 15, whether in an integrated relationship or a separate relationship, can access the database 14 directly (not shown in the figure) or through the operation server 12.
[0083] By appropriately programming the computing device 15, the implementation of the method in this specification can be controlled by such instructions. In particular, when in an integrated relationship, the transactions processed by the computing device 15 can be regarded as the processing of the operation server 12 without special distinction.
[0084] Exemplary Method
[0085] The following combines Figure 1 the application scenario shown, and refers to Figure 2A method for generating data according to an exemplary embodiment of the present disclosure is described. It should be noted that the above application scenarios are only shown for the convenience of understanding the spirit and principles of the present disclosure, and the embodiments of the present disclosure are not limited in this regard. On the contrary, the embodiments of the present disclosure can be applied to any applicable scenario.
[0086] As Figure 2 shown, the data generation method can be applied to the aforementioned operation server and may include the following steps:
[0087] Step 210: In response to the comment information to be replied, input the comment information into a pre-trained model including a chain of thought; wherein, the chain of thought is located between the input layer and the output layer of the pre-trained model, and the chain of thought is used to use the persona attributes of different personas learned in advance as the prompt information of the pre-trained model to guide the pre-trained model to generate reply information made by different personas for the comment information.
[0088] In this specification, the pre-trained model may include a large language model (LLM). A large language model refers to a natural language processing model based on deep learning. The large language model learns knowledge such as the structure, grammar, and semantics of language by training on a large amount of text data and can be applied to services that require data generation.
[0089] In this specification, based on the pre-trained model, the performance of the pre-trained model in complex data generation tasks is further improved by means of the chain-of-thought technology.
[0090] The chain of thought (CoT) is an improved prompting strategy, which can intervene in the training of the pre-trained model and help the pre-trained model learn various personalized reply information with distinct persona characteristics during the training process.
[0091] In order to introduce the pre-trained model including the chain of thought more comprehensively, it will be further introduced below in combination with the training process of the pre-trained model.
[0092] In an exemplary embodiment, the pre-trained model including the chain of thought can be trained in the following manner:
[0093] Obtain a training sample set; wherein, the training sample set includes a number of sample pairs, the sample pairs include dialogue corpus and pre-annotated persona attribute labels; the dialogue corpus includes comment samples and reply samples for the comment samples, and the persona attribute labels are used to characterize the persona who posts the reply samples;
[0094] Input the dialogue corpus and the pre-annotated persona attribute labels in the training sample set into the pre-trained model;
[0095] During the training process where the pre-trained model generates corresponding response samples based on the comment samples in the dialogue corpus, use the chain of thought to take the pre-annotated persona attribute labels as prompt information, enabling the pre-trained model to learn the mapping relationship of the persona attribute labels between the comment samples and the response samples.
[0096] The above training process simply consists of two stages: constructing a training sample set and training a model based on the training sample set.
[0097] Among them, the construction of the above training sample set requires first collecting different types of raw data such as books, magazines, novels, scripts (such as movie scripts, TV drama scripts, stage play scripts, etc.) from the Internet or a database;
[0098] However, extract various dialogue corpora from the raw data, and pre-annotate corresponding persona attribute labels for the dialogue corpora.
[0099] In this specification, for extracting various dialogue corpora from the raw data, specifically, syntactic analysis techniques can be used to analyze the subject-predicate-object structure of each sentence in the raw data and the part-of-speech of each word in the sentence (such as verbs, nouns, pronouns, or adjectives, etc.); then, based on the subject-predicate-object structure and part-of-speech of the sentence, extract the dialogue corpora containing dialogue content. The dialogue corpora can include at least one round of comment samples and response samples for the comment samples.
[0100] In addition, to pre-annotate corresponding persona attribute labels for the dialogue corpora, specifically, the dialogue corpora can be segmented and part-of-speech tagged to obtain the part-of-speech of each word; then, based on the part-of-speech and word meaning, extract the persona attributes. Among them, the persona attributes can include at least one of, but not limited to, emotions, attitudes, occupations, personalities, etc.
[0101] Taking the persona of a manager as an example, the persona attributes can be, for example:
[0102] Enterprising spirit, decisive, never indecisive, steady in doing things, good at communication, promoting people based on their talents, and knowing people well and making good use of their talents.
[0103] After constructing the training sample set, the dialogue corpora and the pre-annotated persona attribute labels in the training sample set can be input into the pre-trained model.
[0104] Exemplarily, in order to associate the persona attributes with the response information, can be used to represent the complete text input; where represents the corpus of being good at communication, Indicates the persona attribute tags corresponding to the dialogue corpus; in addition, it can also be used to indicate that the model parameters are of the pre-trained model. In this way, the dialogue corpus and the pre-annotated persona attribute tags in the training sample set are input into the pre-trained model to realize the generation of corresponding response samples based on the comment samples in the dialogue corpus The process can be expressed as follows: The process can be expressed as:
[0105]
[0106] Among them, represents the prompt information rewritten based on the comment sample For example:
[0107] "You are playing the role of a manager.
[0108] Some classic manager dialogues H are given below.
[0109] If the question I ask is related to the events in the dialogue, please reply in combination with the content of the dialogue.
[0110] If the question I ask goes beyond the scope of the dialogue, please also reply in a consistent tone.
[0111] Please answer my questions in classical Chinese similar to the quotations.
[0112] Please try to be brief when answering.
[0113] Please do not answer that you are an AI, nor answer that you are a speech model. Please always remember that you are playing the role of a manager.
[0114] Please show the enterprising spirit of this manager, be decisive in dealing with everything, and never be indecisive. Show a steady and good communication personality. But be able to promote the worthy and know how to appoint people well."
[0115] In the above prompt information, "Please show the enterprising spirit of this manager, be decisive in dealing with everything, and never be indecisive. Show a steady and good communication personality. But be able to promote the worthy and know how to appoint people well." is the persona attribute. Here, H in "Some classic manager dialogues H are given below" corresponds to the dialogue corpus of the manager persona.
[0116] According to the dialogue corpus and the pre-annotated persona attribute tags in the input training sample set, the pre-trained model starts model training.
[0117] Specifically, in order to enable the pre-trained model to fully learn various different persona attributes, a chain of thought can be introduced to connect and , where i is a positive integer less than n and greater than 1. Each in this chain of thought is a sub-character set split from the character set attributes.
[0118] Taking the above character set attribute of "Please show the enterprising spirit of this manager, who can make decisions promptly regardless of what happens and never hesitates. A steady and good at communicating personality. But only selects the talented and knows how to appoint people properly" as an example, the following 3 can be split out:
[0119] "Please show the enterprising spirit of this manager, who can make decisions promptly regardless of what happens and never hesitates." →
[0120] "A steady and good at communicating personality." →
[0121] "But only selects the talented and knows how to appoint people properly." →
[0122] Based on this, the process of converting the comment sample into the reply information can be refined into: , where represents the reasoning prompt process of the chain of thought.
[0123] Since the chain of thought is a discrete prompt learning method, the chain of thought of independent and identically distributed character set attributes will be sampled sequentially. After sampling a single character set attribute, it will not be put back, ensuring that each character set attribute will be learned by the pre-trained model.
[0124] Through the above embodiments, using the chain of thought to use the pre-labeled character set attribute tags as prompt information enables the pre-trained model to learn the mapping relationship between different character set attribute tags from the comment sample to the reply sample.
[0125] After adjusting the training process of the pre-trained model through the chain of thought and guiding the pre-trained model to learn the mapping relationship between different character set attribute tags from the comment sample to the reply sample, the trained pre-trained model containing the chain of thought can be used for data generation.
[0126] In practical applications, after the operation server obtains a newly generated comment information, it can respond to the data generation request initiated by the user or automatically trigger the data generation process, thereby executing the aforementioned step 210. In response to the comment information to be replied, the comment information is input into the pre-trained model containing the chain of thought.
[0127] The pre-trained model can perform reasoning based on the input comment information, and combine the hint information containing different persona attributes provided by the chain of thought to generate response information made by different personas for the comment information.
[0128] In an exemplary embodiment, since each persona attribute may include several different persona sub-attributes, after inputting the comment information into the pre-trained model containing the chain of thought, it may further include:
[0129] During the process of the pre-trained model performing reasoning based on the comment information, the chain of thought splits the persona attributes for different personas learned in advance, and constructs a sub-attribute sequence corresponding to each persona attribute and composed of the split persona sub-attributes. The sub-attribute sequence may refer to that shown in the foregoing embodiment .
[0130] Correspondingly, the chain of thought is used to use the persona attributes of different personas learned in advance as hint information for the pre-trained model to guide the pre-trained model to generate response information made by different personas for the comment information, and may further include:
[0131] The chain of thought sequentially uses the persona sub-attributes in the sub-attribute sequence as hint information to guide the pre-trained model to generate intermediate information for the comment information and conforming to the persona sub-attributes; and fuses the intermediate information into the final response information in the output layer.
[0132] Taking the example shown in the foregoing embodiment as an example:
[0133] : Please show the enterprising spirit of this manager, who can make decisions promptly regardless of what happens and never hesitates.
[0134] : A steady and good communication personality.
[0135] : But only selects the talented and knows how to appoint people on their merits.
[0136] The chain of thought can sequentially use , , as hint information to guide the pre-trained model to generate intermediate information 1 that conforms to this persona sub-attribute, intermediate information 2 that conforms to this persona sub-attribute, and intermediate information that conforms to The intermediate information 3 made for this sub-attribute of the character setting; in this way, in the output layer of the pre-trained model, these 3 pieces of intermediate information can be fused into the final reply information. For example, the intermediate information 1, intermediate information 2, and intermediate information 3 can be concatenated into a reply information. For another example, the intermediate information 1, intermediate information 2, and intermediate information 3 can be used as prompt information again, and the pre-trained model generates a reply information. It should be noted that this process may not require the participation of the chain of thought.
[0137] Step 220: Obtain the reply information made for the comment information for different character settings output by the pre-trained model.
[0138] Due to the character setting attributes of different character settings, the pre-trained model can generate the reply information made for the comment information for each character setting; that is to say, multiple alternative reply information can be obtained.
[0139] After obtaining the reply information for different numbers of people, the user can select a satisfactory target reply information from them for publication. For example, the user can click on one of the target reply information from the displayed reply information. After the operation server receives the trigger operation for the target reply information, it may also include:
[0140] In response to the trigger operation on the target reply information in the reply information, publish the target reply information as the reply to the comment information.
[0141] Through the above embodiments, multiple alternative reply information for different character settings can be provided for the user. On the one hand, it can help the user quickly complete the reply to the comment information.
[0142] On the other hand, since each reply information corresponds to a different character setting, the flexibility of the user's reply information is improved, and the reply information can be made more personalized, so as to help the user better play the role of a specific character setting, better integrate into the discussion, and improve the participation and user experience of the comment reply.
[0143] On the other hand, through the personalized customization of the reply information, a more colorful community atmosphere for discussion can be created. This atmosphere can attract more users to join, improve user stickiness, activity, and retention, thereby increasing the value of the business platform.
[0144] In practical applications, business platforms usually divide business segments based on different businesses. For example, social platforms can be divided into news segments, game segments, entertainment segments, and so on.
[0145] Since there are certain differences in the discussion content of different business segments, in order to make the response information generated by the pre-trained model more suitable for the corresponding business segment, after the pre-trained model introduced in the foregoing embodiments is trained, the model can be further fine-tuned.
[0146] In an exemplary embodiment, the foregoing method embodiment may further include:
[0147] In response to the model fine-tuning operation for the target business segment, fine-tune the trained pre-trained model based on the fine-tuning samples under the target business segment, so that the pre-trained model tends to generate response information that conforms to the target business segment; wherein, the fine-tuning samples include positive feedback response samples under the target business segment.
[0148] In this embodiment, historical comment information, historical response information generated under each business segment, and interaction data of the historical response information can be collected; the interaction data includes positive feedback data (such as the number of approvals, the number of likes, etc.) and negative feedback data (such as the number of disapprovals, the number of dislikes, etc.). A large amount of historical comment information and historical response information are used as fine-tuning samples of the business segment and input into the trained pre-trained model for fine-tuning. Through multiple iterations, the pre-trained model can be made to tend to generate positive feedback response information.
[0149] In another exemplary embodiment, the interaction data of the real-time response information in the target business segment can also be used for model fine-tuning. This method can be referred to Figure 3 as shown.
[0150] As Figure 3 described, based on the pre-trained model trained using the chain of thought, actively collect the interaction data of the target response information generated and published by the pre-trained model in the target business segment; evaluate whether the target response information generated by the pre-trained model meets the expectations according to a preset threshold. For example, when the positive feedback data or negative feedback data of the target response information reaches a preset threshold such as 5, evaluation data can be generated, and further use the feedback model to fine-tune the pre-trained model according to the evaluation data. In this way, through multiple iterations, the response information generated by the pre-trained model can be made to be more in line with the real response information in the target business segment.
[0151] In this embodiment, the feedback model refers to the process of analyzing the feedback of users on the comments generated by the model (such as likes, dislikes, comments, etc.) to adjust and optimize the model output. This feedback mechanism is to improve the quality and relevance of the content generated by the model, so that the model can better respond to user needs in the future and generate more expected responses or comments.
[0152] Suppose on a news website, a pre-trained model automatically generates responses corresponding to comment information:
[0153] Other users like or dislike this response information.
[0154] By analyzing these likes and dislikes, the pre-trained model can learn that a certain tone (such as more formal or more humorous) may be more popular.
[0155] The feedback model will adjust the generation strategy based on this data, such as adjusting the use of certain words or optimizing the content structure.
[0156] Gradually, the pre-trained model improves the relevance, accuracy, and attractiveness of the responses through feedback learning.
[0157] Generally speaking, the feedback model can be a closed-loop optimization process aimed at continuously adjusting and improving the output of the pre-trained model through user feedback, making it better meet the user's expectations, thereby improving the generation quality of the pre-trained model.
[0158] Exemplary Medium
[0159] After introducing the method of the exemplary embodiments of the present disclosure, next, reference is made to Figure 4 describe the medium of the exemplary embodiments of the present disclosure.
[0160] In this exemplary embodiment, the above method can be implemented by a program product. For example, a portable compact disc read-only memory (CD-ROM) can be used and includes program code, and can run on a device, such as a personal computer. However, the program product of the present disclosure is not limited to this. In this document, a readable storage medium can be any tangible medium that contains or stores a program, and this program can be used by or in combination with an instruction execution system, apparatus, or device.
[0161] The program product can adopt any combination of one or more readable media. The readable media can be a readable signal medium or a readable storage medium. The readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the above. More specific examples (non-exhaustive list) of the readable storage medium include: an electrical connection having one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.
[0162] A computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, carrying readable program code. Such a propagated data signal may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the foregoing. The readable signal medium may also be any readable medium other than a readable storage medium, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device.
[0163] The program code contained on the readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wired, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
[0164] The program code for performing the operations of the present disclosure may be written in any combination of one or more programming languages, including object-oriented programming languages such as Java, C++, etc., and also including conventional procedural programming languages such as C or similar programming languages. The program code may be executed entirely on the user's computing device, partially on the user's computing device and partially on a remote computing device, or entirely on a remote computing device or server. In the case of a remote computing device, the remote computing device may be connected to the user's computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (e.g., by connecting through the Internet using an Internet service provider).
[0165] In summary, the present disclosure may provide a computer-readable storage medium, which, when the instructions in the computer-readable storage medium are executed by a processor of an electronic device, can enable the electronic device to execute the foregoing data generation method embodiments.
[0166] Exemplary Device
[0167] After introducing the medium of the exemplary embodiments of the present disclosure, next, reference is made to Figure 5 to describe the apparatus of the exemplary embodiments of the present disclosure.
[0168] Figure 5 A block diagram of a data generation apparatus according to an embodiment of the present disclosure is schematically shown, corresponding to the foregoing Figure 2 shown method embodiments. The data generation apparatus may include:
[0169] A response unit 510 inputs the comment information into a pre-trained model including a chain of thought in response to the comment information to be replied, where the chain of thought is located between the input layer and the output layer of the pre-trained model, and is used to use the pre-learned persona attributes of different personas as prompt information for the pre-trained model to guide the pre-trained model to generate reply information made by different personas for the comment information.
[0170] A generation unit 520 obtains the reply information made by different personas for the comment information output by the pre-trained model.
[0171] Optionally, the device further includes:
[0172] A reply unit 530 publishes the target reply information as a reply to the comment information in response to a trigger operation on the target reply information in the reply information.
[0173] Optionally, the pre-trained model including a chain of thought is obtained through a training unit 500;
[0174] The training unit 500 further includes:
[0175] An acquisition subunit 501 acquires a training sample set, where the training sample set includes a number of sample pairs, the sample pairs include dialogue corpus and pre-annotated persona attribute labels, the dialogue corpus includes comment samples and reply samples for the comment samples, and the persona attribute labels are used to represent the personas that publish the reply samples.
[0176] An input subunit 503 inputs the dialogue corpus and the pre-annotated persona attribute labels in the training sample set into the pre-trained model.
[0177] A training subunit 505, in the training process of the pre-trained model generating corresponding reply samples based on the comment samples in the dialogue corpus, uses the chain of thought to use the pre-annotated persona attribute labels as prompt information, so that the pre-trained model learns the mapping relationship of the persona attribute labels between the comment samples and the reply samples.
[0178] Optionally, the persona attributes include a number of different persona sub-attributes.
[0179] Optionally, after the response unit 510, it further includes:
[0180] A processing subunit 509, in the process of the pre-trained model reasoning based on the comment information, the chain of thought splits the persona attributes for the pre-learned persona attributes of different personas, and constructs a sub-attribute sequence corresponding to each persona attribute and constructed by the split persona sub-attributes.
[0181] Optionally, the thought chain is used to use the persona attributes of different personas learned in advance as the prompt information of the pre-trained model, and guide the pre-trained model to generate response information made by different personas for the comment information, including:
[0182] The thought chain sequentially uses the persona sub-attributes as prompt information according to the order among the persona sub-attributes in the sub-attribute sequence, guides the pre-trained model to generate intermediate information for the comment information and conforming to the persona sub-attributes; and fuses each intermediate information into the final response information in the output layer.
[0183] Optionally, after the training unit 500, it further includes:
[0184] A fine-tuning unit 507, in response to a model fine-tuning operation for a target business segment, fine-tunes the trained pre-trained model based on the fine-tuning samples under the target business segment, so that the pre-trained model tends to generate response information conforming to the target business segment; wherein, the fine-tuning samples include positive feedback response samples under the target business segment.
[0185] Optionally, the response unit 510 includes, in response to a comment information to be replied in a target business segment, obtaining a target pre-trained model containing a thought chain obtained by fine-tuning for the target business segment, and inputting the comment information into the target pre-trained model.
[0186] Optionally, the persona attributes include at least one of emotion, attitude, occupation, and personality.
[0187] Optionally, the pre-trained model includes a large language model.
[0188] Exemplary Computing Device
[0189] After introducing the methods, media, and devices of the exemplary embodiments of the present disclosure, next, reference is made to Figure 6 to describe the computing device of the exemplary embodiments of the present disclosure.
[0190] Figure 6 The computing device 1500 shown is only an example and should not impose any limitations on the functions and usage scopes of the embodiments of the present disclosure.
[0191] As Figure 6As shown, the computing device 1500 is presented in the form of a general-purpose computing device. The components of the computing device 1500 may include, but are not limited to: at least one processing unit 1501, at least one storage unit 1502, and a bus 1503 that connects different system components (including the processing unit 1501 and the storage unit 1502).
[0192] The bus 1503 includes a data bus, a control bus, and an address bus.
[0193] The storage unit 1502 may include a readable medium in the form of volatile memory, such as random access memory (RAM) 15021 and / or cache memory 15022, and may further include a readable medium in the form of non-volatile memory, such as read-only memory (ROM) 15023.
[0194] The storage unit 1502 may also include a program / utility 15025 having a set (at least one) of program modules 15024. Such program modules 15024 include, but are not limited to: an operating system, one or more application programs, other program modules, and program data. Each or some combination of these examples may include the implementation of a network environment.
[0195] The computing device 1500 may also communicate with one or more external devices 1504 (such as a keyboard, a pointing device, etc.).
[0196] This communication may be carried out through an input / output (I / O) interface 1505. Moreover, the computing device 1500 may also communicate with one or more networks (such as a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) through a network adapter 1506. As Figure 6 shown, the network adapter 1506 communicates with other modules of the computing device 1500 through the bus 1503. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with the computing device 1500, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, etc.
[0197] Through the computing device 1500 as Figure 6 shown, the foregoing data generation method may be implemented. More specifically, the storage unit 1502 stores instructions executable by the processing unit 1501, and when the processing unit 1501 executes the instructions, the foregoing data generation method is implemented.
[0198] It should be noted that although several units / modules or sub-units / modules of the data generation device are mentioned in the above detailed description, this division is merely exemplary and not mandatory. In fact, according to the embodiments of the present disclosure, the features and functions of two or more units / modules described above can be embodied in one unit / modules. Conversely, the features and functions of one unit / modules described above can be further divided and embodied by multiple units / modules.
[0199] In addition, although the operations of the method of the present disclosure are described in a specific order in the drawings, this does not require or imply that these operations must be performed in that specific order, or that all of the shown operations must be performed to achieve the desired result. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step for execution, and / or one step may be decomposed into multiple steps for execution.
[0200] Although the spirit and principles of the present disclosure have been described with reference to several specific embodiments, it should be understood that the present disclosure is not limited to the specific embodiments disclosed, and the division of each aspect does not mean that the features in these aspects cannot be combined for benefit. This division is only for the convenience of expression. The present disclosure aims to cover various modifications and equivalent arrangements included within the spirit and scope of the appended claims.
Claims
1. A data generation method, comprising: In response to comment information to be replied, inputting the comment information into a pre-trained model including a chain of thought; wherein the chain of thought is located between the input layer and the output layer of the pre-trained model, and adjusts the training process of the pre-trained model through the chain of thought to guide the pre-trained model to learn the mapping relationship between different persona attribute tags from comment samples to reply samples; During the process of the pre-trained model reasoning based on the comment information, the chain of thought splits the persona attributes for different personas learned in advance, and constructs a sub-attribute sequence corresponding to each persona attribute and composed of the split persona sub-attributes; the chain of thought sequentially uses the persona sub-attributes as prompt information in the order of the persona sub-attributes in the sub-attribute sequence to guide the pre-trained model to generate intermediate information for the comment information and conforming to the persona sub-attributes; and uses the intermediate information as prompt information again for the pre-trained model to generate the final reply information in the output layer; the persona attributes include at least one of emotion, attitude, occupation, and personality; Obtaining multiple reply information made by users with different personas output by the pre-trained model for the comment information.
2. The method according to claim 1, the method further comprising: In response to a trigger operation on the target reply information among the multiple reply information, publishing the target reply information as a reply to the comment information.
3. The method according to claim 1, the pre-trained model including a chain of thought is trained by the following method: Obtain a training sample set; wherein, The training sample set includes a number of sample pairs, the sample pairs include dialogue corpus and pre-annotated persona attribute tags; the dialogue corpus includes comment samples and reply samples for the comment samples, and the persona attribute tags are used to characterize the personas that publish the reply samples; Inputting the dialogue corpus and the pre-annotated persona attribute tags in the training sample set into the pre-trained model; During the training process of the pre-trained model generating corresponding reply samples based on the comment samples in the dialogue corpus, using the chain of thought to use the pre-annotated persona attribute tags as prompt information, so that the pre-trained model learns the mapping relationship between the persona attribute tags from the comment samples to the reply samples.
4. The method according to claim 3, after the pre-trained model is trained, further comprising: In response to a model fine-tuning operation for a target business segment, performing fine-tuning processing on the trained pre-trained model based on the fine-tuning samples in the target business segment, so that the pre-trained model tends to generate reply information conforming to the target business segment; wherein the fine-tuning samples include positive feedback reply samples in the target business segment.
5. The method according to claim 4, the inputting the comment information into a pre-trained model including a chain of thought in response to comment information to be replied, includes: In response to the comment information to be replied in the target business segment, obtain a target pre-trained model containing a chain of thought obtained by fine-tuning the target business segment; Input the comment information into the target pre-trained model.
6. The method according to claim 1, wherein the pre-trained model includes a large language model.
7. A data generation device, comprising: A response unit that, in response to comment information to be replied, inputs the comment information into a pre-trained model containing a chain of thought; wherein the chain of thought is located between the input layer and the output layer of the pre-trained model, and adjusts the training process of the pre-trained model through the chain of thought to guide the pre-trained model to learn the mapping relationship between different persona attribute tags from the comment sample to the reply sample; A processing sub-unit, during the process of the pre-trained model reasoning based on the comment information, the chain of thought splits the persona attributes for different personas learned in advance, and constructs a sub-attribute sequence corresponding to each persona attribute and composed of the split persona sub-attributes; the chain of thought sequentially uses the persona sub-attributes as prompt information in the order of the persona sub-attributes in the sub-attribute sequence to guide the pre-trained model to generate intermediate information for the comment information and conforming to the persona sub-attributes; and uses the intermediate information as prompt information again for the pre-trained model to generate the final reply information in the output layer; the persona attributes include at least one of emotion, attitude, occupation, and personality; A generation unit that obtains multiple reply information made by users with different personas output by the pre-trained model for the comment information.
8. The device according to claim 7, wherein the device further comprises: A reply unit that, in response to a trigger operation on a target reply information among the multiple reply information, publishes the target reply information as a reply to the comment information.
9. The device according to claim 8, wherein the pre-trained model containing a chain of thought is obtained by training through a training unit; The training unit further comprises: An acquisition sub-unit that acquires a training sample set; wherein the training sample set includes a number of sample pairs, and the sample pairs include dialogue corpus and pre-annotated persona attribute tags; the dialogue corpus includes a comment sample and a reply sample for the comment sample, and the persona attribute tags are used to characterize the persona that publishes the reply sample; An input sub-unit that inputs the dialogue corpus and the pre-annotated persona attribute tags in the training sample set into the pre-trained model; A training sub-unit that, during the training process of the pre-trained model generating a corresponding reply sample based on the comment sample of the dialogue corpus, uses the chain of thought to use the pre-annotated persona attribute tags as prompt information, so that the pre-trained model learns the mapping relationship of the persona attribute tags from the comment sample to the reply sample.
10. The device according to claim 9, after the training unit, further comprises: The fine-tuning unit, in response to a model fine-tuning operation for a target business segment, fine-tunes the pre-trained model that has been trained based on the fine-tuning samples under the target business segment, so that the pre-trained model tends to generate response information that conforms to the target business segment; wherein, the fine-tuning samples include positive feedback response samples under the target business segment.
11. The device according to claim 10, wherein the response unit comprises: In response to comment information to be replied in the target business segment, obtain a target pre-trained model containing a chain of thought obtained by fine-tuning the target business segment, and input the comment information into the target pre-trained model.
12. The device according to claim 7, wherein the pre-trained model includes a large language model.
13. A computer-readable storage medium, comprising: When the instructions in the computer-readable storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute the data generation method according to any one of claims 1-6.
14. A computing device, comprising: A processor; A memory for storing executable instructions of the processor; Wherein, the processor is configured to execute the executable instructions to implement the data generation method according to any one of claims 1-6.
Citation Information
Patent Citations
NPC interaction method and device and storage medium
CN117122927A
Emotion support dialogue generation method, system and device based on thinking chain reasoning
CN117932041A
Information output method and device, electronic equipment and storage medium
CN118260389A