Dialogue data acquisition method and device, computer equipment and storage medium

By obtaining the first session instruction containing the attributes of the session object and generating dialogue with the corresponding language model based on the instruction, the problem of low efficiency in the acquisition of dialogue data in the prior art is solved, and automatic generation and efficient acquisition without user participation are achieved .

CN119474282APending Publication Date: 2025-02-18BEIJING YOUZHUJU NETWORK TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310967794.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-08-02
Publication Date
2025-02-18

AI Technical Summary

Technical Problem

In the prior art, the acquisition efficiency of dialogue data is low, requiring user participation, resulting in inefficient data acquisition.

Method used

Automatic generation of dialogue data is achieved by obtaining the first session instruction containing the attributes of the session object and performing dialogue generation based on the instruction and the corresponding language model.

Benefits of technology

Without user participation, the automatic generation of dialogue data is realized, the efficiency of dialogue data acquisition is improved, and the generated dialogue data can be close to the needs of each scenario.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119474282A_ABST
    Figure CN119474282A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of computer processing, and discloses a dialogue data acquisition method and device, computer equipment and a storage medium, the method provided by the invention comprises the following steps: acquiring a first dialogue instruction, the first dialogue instruction comprising attributes of a dialogue object; and performing dialogue generation based on the first session instruction and the language models in one-to-one correspondence with the session objects to obtain dialogue data. The attributes of the two session objects are included in the first session instruction, so that the two language models perform dialogue generation based on the given attributes, and the constraint of output of the language models is given, so that the generated dialogue data can be close to the requirements of various scenes. Meanwhile, dialogue generation is carried out based on the two language models, user participation is not needed, automatic generation of dialogue data is achieved, and therefore the dialogue data obtaining efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of computer processing, and in particular to a method, device, computer equipment and storage medium for acquiring conversation data. Background Art

[0002] In the training of conversation models, high-quality conversation data is essential. In order to obtain conversation data for training conversation models, a language model is generally used to obtain multiple rounds of conversation data through the interaction between users and the language model. Among them, the language model is a simple model that predicts the probability distribution of the next word based on the input text prefix. However, the above solution requires user participation, resulting in low efficiency in obtaining conversation data. Summary of the invention

[0003] In view of this, the present disclosure provides a method, apparatus, computer device and storage medium for acquiring conversation data to solve the problem of low efficiency in acquiring conversation data.

[0004] In a first aspect, the present disclosure provides a method for collecting conversation data, the method comprising:

[0005] Obtaining a first session instruction, wherein the first session instruction includes attributes of a session object;

[0006] A dialogue is generated based on the first dialogue instruction and a language model corresponding one-to-one to the dialogue object to obtain dialogue data.

[0007] In a second aspect, the present disclosure provides a device for acquiring conversation data, the device comprising:

[0008] An instruction acquisition module, used to acquire a first session instruction, wherein the first session instruction includes attributes of a session object;

[0009] The dialogue module is used to generate a dialogue based on the first dialogue instruction and a language model corresponding to the dialogue object one by one to obtain dialogue data.

[0010] In a third aspect, the present disclosure provides a computer device, comprising: a memory and a processor, the memory and the processor being communicatively connected to each other, the memory storing computer instructions, and the processor executing the method for acquiring conversation data of the first aspect or any corresponding embodiment thereof by executing the computer instructions.

[0011] In a fourth aspect, the present disclosure provides a computer-readable storage medium having computer instructions stored thereon, the computer instructions being used to enable a computer to execute the method for acquiring conversation data of the first aspect or any corresponding embodiment thereof.

[0012] The method for acquiring dialogue data provided by the embodiment of the present disclosure includes the attributes of two dialogue objects in the first dialogue instruction, so that two language models generate dialogues based on the given attributes, and the given language models are given output constraints, so that the generated dialogue data can be close to the needs of various scenarios. At the same time, the dialogue generation is based on the two language models, and the user does not need to participate, so that the dialogue data is automatically generated, thereby improving the efficiency of acquiring dialogue data. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0014] Figure 1 is a flowchart of a method for acquiring conversation data according to an embodiment of the present disclosure;

[0015] Figure 2 is a flowchart of another method for acquiring conversation data according to an embodiment of the present disclosure;

[0016] Figure 3 is a schematic diagram of obtaining conversation data according to an embodiment of the present disclosure;

[0017] Figure 4 is a structural block diagram of a device for acquiring conversation data according to an embodiment of the present disclosure;

[0018] Figure 5 It is a schematic diagram of the hardware structure of the computer device of the embodiment of the present disclosure. DETAILED DESCRIPTION

[0019] In order to make the purpose, technical solution and advantages of the embodiments of the present disclosure clearer, the technical solution in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the drawings in the embodiments of the present disclosure. Obviously, the described embodiments are part of the embodiments of the present disclosure, rather than all the embodiments. Based on the embodiments in the present disclosure, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present disclosure.

[0020] It is understandable that before using the technical solutions disclosed in the embodiments of the present disclosure, the types, scope of use, usage scenarios, etc. of the personal information involved in the present disclosure should be informed to the user and the user's authorization should be obtained in an appropriate manner in accordance with relevant laws and regulations.

[0021] For example, in response to receiving an active request from a user, a prompt message is sent to the user to clearly prompt the user that the operation requested to be performed will require obtaining and using the user's personal information. Thus, the user can autonomously choose whether to provide personal information to software or hardware such as an electronic device, application, server, or storage medium that performs the operation of the technical solution of the present disclosure according to the prompt message.

[0022] As an optional but non-limiting implementation, in response to receiving an active request from the user, the prompt information may be sent to the user in the form of a pop-up window, in which the prompt information may be presented in text form. In addition, the pop-up window may also carry a selection control for the user to choose "agree" or "disagree" to provide personal information to the electronic device.

[0023] It is understandable that the above notification and the process of obtaining user authorization are merely illustrative and do not constitute a limitation on the implementation of the present disclosure. Other methods that meet the relevant laws and regulations may also be applied to the implementation of the present disclosure.

[0024] It is understandable that the data involved in this technical solution (including but not limited to the data itself, the acquisition or use of the data) shall comply with the requirements of relevant laws, regulations and relevant provisions.

[0025] In related technologies, conversation data obtained with the help of language models are focused on task-based conversations or question-and-answer data, and are committed to stimulating the instruction alignment ability of language models. However, in actual conversation scenarios, not only task-based conversation models that can accurately complete instructions are needed, but also conversation models with role attributes and the ability to chat with users are needed. Based on the needs of conversation models, rich conversation data is needed to train conversation models.

[0026] Based on this, an embodiment of the present disclosure provides a method for acquiring conversation data, which is used to acquire conversation data, and the conversation data is used for subsequent training of a conversation model. When acquiring conversation data, the attributes of a conversation object are given, and the conversation is generated by combining a language model corresponding to the conversation object. The given attributes of the conversation object enable the language model to generate a conversation based on the given attributes, thereby ensuring that the conversation data obtained can be more in line with the conversation scene and is suitable for a chat-style conversation scene.

[0027] According to an embodiment of the present disclosure, an embodiment of a method for acquiring conversation data is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0028] In this embodiment, a method for acquiring conversation data is provided, which can be used in computer devices, such as computers, servers, etc. Figure 1 is a flowchart of a method for acquiring conversation data according to an embodiment of the present disclosure. Figure 1 As shown, the process includes the following steps:

[0029] Step S101, obtaining a first session instruction.

[0030] The first session instruction includes attributes of the session object.

[0031] The first conversation instruction is used to trigger the language model to generate a dialogue. The first conversation instruction may be set in the computer device, or obtained by the computer device from a third-party device, or input through interaction with the computer device, etc. There is no limitation on the method of obtaining the first conversation instruction, and it can be set according to actual needs.

[0032] The attributes of the conversation object included in the first conversation instruction include but are not limited to the role, age, interests and hobbies of the conversation object, etc., which can be set according to actual needs. For the first conversation instruction, a standard format of the first conversation instruction can be built-in, and the position of the attribute in the first conversation instruction is represented by an attribute parameter. When it is necessary to obtain conversation data, the specific value of the attribute parameter is obtained through interactive methods, so as to determine the attribute of the conversation object, and the subsequent language model generates a conversation based on the attribute of the conversation object.

[0033] There are usually two session objects, but in some cases there can be more than one. Each session object has its own attributes. The attributes of all session objects need to be described in the first session instruction so that each subsequent language model can know the attributes of the remaining session objects.

[0034] Take two conversation objects as an example, these two conversation objects are called the first conversation object and the second conversation object respectively. The role of the first conversation object is a character in a book, and the role of the second conversation object is a network user. Since the first conversation instruction is used to trigger the subsequent language model corresponding to the conversation object one by one to generate a conversation, the first conversation instruction also corresponds to the conversation object one by one, based on which the first conversation instruction can be expressed as:

[0035] The first conversation instruction corresponding to the first conversation object: From now on, I will play the {role} in {book title}, and you will play the {network user} with {personality}. Please imitate the network user and talk to me briefly, and also start your conversation with "Network user: ".

[0036] The second conversation instruction corresponding to the second conversation object: From now on, I will play the role of a {network user} with {personality}, and you will play the {role} in {book title}. Please imitate {role} and talk to me briefly, and start your conversation with "Role: ".

[0037] Among them, {book title} and {role} are attributes of the first conversation object, and {personality} of {network user} is an attribute of the second conversation object.

[0038] Step S102: generating a dialogue based on the first dialogue instruction and a language model corresponding one-to-one to the dialogue object to obtain dialogue data.

[0039] Inputting the first conversation instruction into the corresponding language model respectively can trigger the language model to generate a dialogue, wherein the input of one language model is used as the output of another language model. The language model can be built based on a large-scale language model (LLM) or a sequence generation model based on a multi-head attention mechanism, for example, a language model based on a Transformer architecture. Of course, the language model can also be built based on other structures, and there is no limitation on its specific structure here, and it is set according to actual needs.

[0040] After the first conversation execution corresponding to the conversation object is input into the corresponding language model, the language model can conduct a conversation based on the attributes of the given conversation object, thereby obtaining dialogue data.

[0041] The method for acquiring conversation data provided in this embodiment includes the attributes of the conversation object in the first conversation instruction, so that the language model corresponding to the conversation object is generated based on the given attributes for conversation, and the language model is constrained by output, so that the generated conversation data can be close to the needs of each scene. At the same time, the conversation generation is based on the language model corresponding to the conversation object, without the need for user participation, and the automatic generation of conversation data is realized, thereby improving the efficiency of acquiring conversation data.

[0042] In this embodiment, a method for acquiring conversation data is provided, which can be used in computer devices, such as computers, servers, etc. Figure 2 is a flowchart of a method for acquiring conversation data according to an embodiment of the present disclosure. Figure 2 As shown, the process includes the following steps:

[0043] Step S201, obtain a first session instruction. The first session instruction includes the attributes of the session object. Figure 1 Step S101 of the illustrated embodiment will not be described in detail here.

[0044] Step S202: generating a dialogue based on the first dialogue instruction and a language model corresponding one-to-one to the dialogue object to obtain dialogue data.

[0045] Specifically, the above step S202 includes:

[0046] Step S2021: input the first conversation instructions into the language model respectively to generate a conversation to obtain first conversation data.

[0047] The output of one language model serves as the input of another language model.

[0048] After the first conversation execution corresponding to the conversation object is input into the corresponding language model, the language models communicate with each other to obtain the first conversation data. Taking two conversation objects as an example, they correspond to the first language model and the second language model respectively, the output of the first language model is used as the input of the second language model, and the output of the second language model is used as the input of the first language model. It can also be understood that two language models are used to simulate the conversation between two conversation objects.

[0049] Step S2022: if the current conversation round number is greater than the preset conversation round number, obtain a second conversation instruction.

[0050] The second session instruction includes attributes of the session object.

[0051] In the above step S2021, the language model simulates the conversation between the conversation objects and records the number of conversation rounds during the conversation. The current number of conversation rounds is compared with the preset number of conversation rounds to determine whether the conversation task needs to be switched. Since the language model generates the conversation based on the first conversation instruction, and as the conversation history accumulates during multiple rounds of conversation, the input sequence becomes longer and longer, which results in the prompts at the beginning of the conversation having a weaker influence on the newly generated conversation, causing the language model to eventually degenerate into an artificial intelligence assistant.

[0052] Therefore, the current conversation round number is compared with the preset conversation round number. If the current conversation round number is greater than the preset conversation round number, it means that the conversation task needs to be switched, that is, the second conversation instruction is obtained. If the current conversation round number is less than the preset conversation round number, it means that there is no need to switch the conversation task, and the conversation generation can be continued.

[0053] The second conversation instruction is used to drive the language model to convert from the conversation generation task to the conversation continuation task. The second conversation instruction also includes the attributes of the conversation object, so as to ensure that the output of the language model is based on the attributes of the conversation object, so that the attributes of the conversation object always affect the new conversation. The second conversation instruction is similar to the first conversation instruction, both of which include the attributes of the conversation object, but the difference is the representation form. The first conversation instruction is used to trigger the language model to conduct a conversation, while the second conversation instruction must not only ensure that the language models can continue to communicate, but also ensure the continuity of the conversation, that is, the continuity with the conversation data under the first conversation instruction. Therefore, the second conversation instruction also includes instructions for continuing the conversation data. For example, the second conversation instruction includes instructions for continuing the previous conversation data and the attributes of the conversation object.

[0054] Continuing with the above example, the first session object corresponds to the first language model, and the second session object corresponds to the second language model. The second session instruction can be expressed as:

[0055] The second conversation instruction corresponding to the first conversation object: The above is a set of dialogues about the {character} in {book title} and a {network user} with {personality}. Please imitate a {network user} with {personality} and reply to the {character} in {book title} with “network user:”

[0056] The second conversation instruction corresponding to the second conversation object: The above is a set of dialogues about a {character} in {book title} and a {network user} with {personality}. Please imitate a {character} in {book title} and reply to {network user} with “Role: ”.

[0057] In some optional implementations, the first conversation instruction includes a prefix prompt for indicating the attributes of the conversation object and a conversation generation instruction, and the second conversation instruction includes a suffix prompt for indicating the attributes of the conversation object and a conversation continuation instruction.

[0058] Prefix prompts use adjectives to limit the conversation object, and suffix prompts and dialogue continuation instructions are used to convert dialogue generation into dialogue continuation, thereby avoiding invalid responses such as "Goodbye" or "Let's talk about this today."

[0059] The second conversation instruction reactivated the role-playing attribute of the language model with the help of suffix-style prompts, avoiding the two language models from degenerating into artificial intelligence assistants, and ensuring the role attributes and content richness of the responses of network users and characters. Before the conversation starts, two prefix-style first conversation instructions are used to conduct the conversation in the way of dialogue generation, and then two suffix-style second conversation instructions are used to conduct the conversation in the way of dialogue continuation, ensuring that the conversation can develop in the mode of small talk.

[0060] Prefix prompts conduct dialogues in the manner of dialogue generation, and suffix prompts conduct dialogues in the manner of dialogue continuation, thereby ensuring that the dialogue process can proceed according to the given attributes.

[0061] Step S2023, continuing the conversation based on the second conversation instruction and the language model to obtain second conversation data.

[0062] The conversation data includes first conversation data and second conversation data.

[0063] After obtaining the second conversation instruction, the second conversation instruction corresponding to the conversation object is input into the corresponding language model, triggering the language model to continue the conversation and obtain the second conversation data. Therefore, the first conversation data obtained by the first conversation instruction and the second conversation data obtained by the second conversation instruction can form the conversation data.

[0064] In the method for acquiring dialogue data provided in this embodiment, the language model generates dialogue based on the first dialogue instruction, and as the dialogue history accumulates during multiple rounds of dialogue, the input sequence becomes longer and longer, which causes the prompt that appears at the beginning of the dialogue to have a weaker and weaker influence on the newly generated dialogue, so that the language model eventually degenerates into an artificial intelligence assistant. Based on this, when the dialogue reaches a preset number of dialogue rounds, the dialogue generation task is converted into a dialogue continuation task, ensuring that the attributes of the dialogue object constrain the generated dialogue data.

[0065] In some optional implementations, step S202 further includes:

[0066] Step a1: obtaining a current output of a first language model corresponding to a first conversation object.

[0067] Step a2: Analyze the attributes of the current output to determine the attributes of the current output to generate a third conversation instruction.

[0068] Step a3, input the third conversation instruction and the current output into the second language model to obtain the current response to obtain the dialogue data, the second language model corresponds to the second conversation object, and the current output has the same attributes as the current response.

[0069] The role of attribute analysis is to guide the direction of the conversation with the help of different attributes. In actual chat-style dialogue scenarios, the content and tone of the user's speech are not static, and the character should have corresponding responses corresponding to different content and tone. For example, in a round of dialogue, the user suddenly wants to make a joke, and at this time the character should also respond in a joking way. Or, in another round of dialogue, the user wants to give a compliment, and at this time the character should respond in a thank you way. For example, Figure 3As described above, the output of the language model needs to be processed by the attribute controller to analyze its attributes to ensure that the current output of the two conversation objects is consistent with the attributes of the corresponding current reply. During the conversation process, it is hoped that the attributes of the current output and the current reply are the same. Based on this, the attributes of the current output are determined by analyzing the attributes of the current output, and then the current reply is obtained based on the attributes of the current output and the current output, so as to ensure that the obtained conversation data conforms to the uncertainty of the conversation object in the conversation scenario, and also increase the diversity of the conversation, so as to avoid the conversation falling into a boring cycle.

[0070] Based on this, the current output of each language model is attributed and analyzed to obtain the attributes of the current output, and the third conversation instruction is obtained. The third conversation instruction and the current output are input into another language model, so that the other language model gives a reply based on the third conversation instruction and the current output, and the current reply is obtained. Taking the current output of the first language model of the first conversation object as an example, the current output is attributed and analyzed to obtain the attributes of the current output, including but not limited to tone and the like.

[0071] In some optional implementations, step S202 further includes:

[0072] Step b1, obtaining the first model output of the language model in the current dialogue round and the second model output of the previous dialogue round.

[0073] Step b2, detecting a pattern output by the first model and a pattern output by the second model, wherein the pattern includes at least one of syntax and sentence pattern.

[0074] Step b3: If the pattern output by the first model is the same as the pattern output by the second model, the pattern output by the first model is adjusted and then input into another language model to obtain dialogue data.

[0075] Due to the powerful contextual learning ability of the language model, the output of the language model may fall into the same pattern, and once this pattern is turned on, it will become more and more serious. Therefore, in order to prevent the accumulation of patterns during multiple rounds of dialogue, pattern detection and pattern adjustment are used to ensure the diversity of grammar and sentence patterns.

[0076] For the same language model, the mode is adjusted by detecting the mode of the model outputs of two adjacent rounds. Specifically, the first model output of the language model in the current dialogue round and the second model output of the previous dialogue round are obtained, and the modes of the two model outputs are detected. If they are the same, their modes are adjusted and then input into another language model.

[0077] The mode detection and adjustment are implemented through a mode controller, and the mode controller can be a detection and adjustment model, which first performs mode detection, and then performs mode adjustment when the modes are the same, to obtain an adjusted model output.

[0078] In some optional embodiments, the mode controller is a mode detection model, which can also be built based on a large language model. The input of the model is: the first model output, the second model output and the query instruction, wherein the query instruction can be: Do the above two sentences use the same mode? Please answer me with yes or no. After getting the answer, if the reply is yes, continue to input the mode adjustment instruction, for example, please imitate the dialogue between {network user} and {role} in different modes, so as to obtain the output of the mode detection model, which is consistent with the content of the first model output of the current dialogue round, except for the needle mode.

[0079] In some optional implementations, the above step b3 includes:

[0080] Step b31, extracting the content in the first model output.

[0081] Step b32, representing the extracted content based on a preset mode to obtain an adjusted first model output.

[0082] Step b33, inputting the adjusted first model output into another of the language models to obtain dialogue data.

[0083] Specifically, the model output of each adjacent round will be sent to a mode controller to detect whether the two sentences use the same mode. The mode controller is built based on the large model and completes this task by designing corresponding prompts. Among them, the mode controller includes a mode detection module and a mode conversion module. If the mode detection module detects that two consecutive replies of the same character use the same mode, the reply of the current round and the input of the corresponding round will be sent to the mode conversion module, and then with the help of a mode conversion module built based on the large model, the reply of the current round will be repeated, and different modes will be used to complete the reply, thereby ensuring the diversity of syntax and sentence patterns.

[0084] Since the mode is adjusted rather than the content, the extracted content is repeated using the preset mode during mode conversion to obtain the adjusted first model output, thereby achieving mode adjustment and preventing the model output from falling into a mode loop. Through the above-mentioned attribute analysis and mode detection processing, it can be ensured that the automatic chat-style dialogue will not fall into a content and mode loop when it is carried out for multiple rounds, ensuring the richness and fun of the automatic chat-style dialogue when it is carried out for multiple rounds.

[0085] In some optional implementations, the detection of the pattern of the first model output and the second model output in the above step b2 is obtained by a pattern detection model. Based on this, the method for determining the pattern detection model includes:

[0086] Step c1, obtaining a sample sentence and a target pattern of the sample sentence.

[0087] Step c2: input the sample sentence and the target pattern into the pattern detection model so that the pattern detection model determines the pattern corresponding to the sentence.

[0088] In order to enhance the detection effect of the above pattern detection model, by giving sample sentences and their target patterns, the pattern detection model's ability to detect sentences is improved with the help of the context learning ability of the large model itself.

[0089] For example, the input is: sample sentence 1, sample sentence 2 and detection instructions, and the detection instruction can be: Do the above two sentences use the same pattern? Please answer with yes or no. At the same time, the answer is given, yes. All of these are input into the pattern controller, so that the pattern controller uses the context learning ability to learn the same pattern sentence, thereby improving the detection effect of the pattern.

[0090] By giving sample sentences and their target patterns, the model's ability to detect sentences is improved by leveraging the contextual learning capabilities of the pattern detection model itself.

[0091] In some optional implementations, the method further includes: training a conversation model based on the conversation data to determine a target conversation model.

[0092] The conversation data obtained through the above steps is generated based on the attributes of the conversation object, and through attribute analysis and pattern detection, the richness and diversity of the automatic chat conversation can be guaranteed. Based on this, the conversation model is trained using the conversation data to obtain the target conversation model, which can improve the performance of the target conversation model.

[0093] As a specific application example of the embodiment of the present disclosure, Figure 3As shown, the conversation data collected this time is a conversation between two characters in the same book, and the attributes of the two characters are given. Based on this, the first conversation instruction 1 corresponding to character 1 and the first conversation instruction 2 corresponding to character 2 are respectively input into the two large language models to trigger the two large language models to generate conversations. When the conversation has a certain number of rounds, the second conversation instruction including the suffix prompt is input to the two large language models respectively, and the conversation generation is converted into the conversation continuation. Furthermore, for the model output of two adjacent rounds of the same language model, the mode controller is used to perform mode detection, and if the mode is the same, the mode conversion is performed to ensure the richness of the model output mode. For different language models, each round of conversation needs to ensure that the attributes are consistent, that is, the tone, etc. are consistent, which is specifically achieved through the attribute controller. The current output of a large language model and the attributes of the current output are sent to another large language model together to ensure that the attributes of the current reply of the other large language model are consistent with the attributes of the current output.

[0094] In this embodiment, a device for acquiring conversation data is also provided, which is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. As used below, the term "module" can be a combination of software and / or hardware that implements a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.

[0095] This embodiment provides a device for acquiring conversation data, such as Figure 4 As shown, including:

[0096] The instruction acquisition module 401 is used to acquire a first session instruction, where the first session instruction includes attributes of a session object.

[0097] The dialogue module 402 is used to generate a dialogue based on the first dialogue instruction and a language model corresponding to the dialogue object one by one to obtain dialogue data.

[0098] In some optional implementations, the dialogue module 402 includes:

[0099] The input unit is used to input the first conversation instruction into each language model respectively to generate a conversation to obtain the first conversation data, wherein the output of one language model is used as the input of another language model.

[0100] The instruction acquisition unit is used to acquire a second conversation instruction if the current conversation round number is greater than a preset conversation round number, where the second conversation instruction includes attributes of two conversation objects.

[0101] The conversation continuation unit is used to continue the conversation based on the second conversation instruction and the language model to obtain second conversation data, where the conversation data includes the first conversation data and the second conversation data.

[0102] In some optional implementations, the first conversation instruction includes a prefix prompt for indicating the attributes of the conversation object and a conversation generation instruction, and the second conversation instruction includes a suffix prompt for indicating the attributes of the conversation object and a conversation continuation instruction.

[0103] In some optional implementations, the dialogue module 402 further includes:

[0104] The first output acquisition unit is used to acquire the current output of the first language model corresponding to the first conversation object.

[0105] The attribute analysis unit is used to perform attribute analysis on the current output to determine the attribute of the current output so as to generate a third conversation instruction.

[0106] The input unit is used to input the third conversation instruction and the current output into the second language model to obtain the current reply to obtain the dialogue data. The second language model corresponds to the second conversation object, and the current output has the same attribute as the current reply.

[0107] In some optional implementations, the dialogue module 402 includes:

[0108] The second output acquisition unit is used to acquire the first model output of the language model in the current dialogue round and the second model output of the previous dialogue round.

[0109] The detection unit is used to detect the pattern output by the first model and the pattern output by the second model, and the pattern includes at least one of syntax and sentence pattern.

[0110] The adjustment unit is used to adjust the pattern output by the first model and input it into another language model to obtain dialogue data if the pattern output by the first model is the same as the pattern output by the second model.

[0111] In some optional implementations, the adjustment unit includes:

[0112] The extraction subunit is used to extract the content in the first model output.

[0113] The adjustment subunit is used to represent the extracted content based on a preset mode to obtain an adjusted first model output.

[0114] The input subunit is used to input the adjusted first model output into another language model to obtain the dialogue data.

[0115] In some optional implementations, the detection of the pattern of the first model output and the second model output is obtained through a pattern detection model, and the determination module of the pattern detection model includes:

[0116] A sample acquisition unit, used for acquiring sample sentences and target patterns of the sample sentences;

[0117] The sample input unit is used to input the sample sentence and the target pattern into the pattern detection model so that the pattern detection model determines the pattern corresponding to the sentence.

[0118] In some optional embodiments, the device further comprises:

[0119] The training module is used to train a conversation model based on the conversation data to determine a target conversation model.

[0120] The conversation data acquisition device in this embodiment is presented in the form of a functional unit, where the unit refers to an ASIC (Application Specific Integrated Circuit) circuit, a processor and memory that executes one or more software or fixed programs, and / or other devices that can provide the above functions.

[0121] The further functional description of each of the above modules and units is the same as that of the above corresponding embodiments and will not be repeated here.

[0122] The present disclosure also provides a computer device having the above Figure 4 The device for acquiring conversation data is shown.

[0123] See also Figure 5 , Figure 5 is a schematic diagram of a computer device provided by an optional embodiment of the present disclosure, such as Figure 5 As shown, the computer device includes: one or more processors 10, a memory 20, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. Various components are connected to each other using different buses for communication, and can be installed on a common mainboard or installed in other ways as needed. The processor can process the instructions executed in the computer device, including instructions stored in or on the memory to display the graphical information of the GUI on an external input / output device (such as, a display device coupled to the interface). In some optional embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple computer devices can be connected, and each device provides some necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Figure 5 A processor 10 is taken as an example.

[0124] The processor 10 may be a central processing unit, a network processor or a combination thereof. The processor 10 may further include a hardware chip. The hardware chip may be a dedicated integrated circuit, a programmable logic device or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable gate array, a general purpose array logic or any combination thereof.

[0125] The memory 20 stores instructions executable by at least one processor 10, so that the at least one processor 10 executes the method shown in the above embodiment.

[0126] The memory 20 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of the computer device, etc. In addition, the memory 20 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some optional embodiments, the memory 20 may optionally include a memory remotely arranged relative to the processor 10, and these remote memories may be connected to the computer device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0127] The memory 20 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a flash memory, a hard disk or a solid state drive; the memory 20 may also include a combination of the above types of memory.

[0128] The computer device further comprises a communication interface 30 for the computer device to communicate with other devices or a communication network.

[0129] The embodiments of the present disclosure also provide a computer-readable storage medium. The above-mentioned method according to the embodiments of the present disclosure can be implemented in hardware, firmware, or can be implemented as a computer code that can be recorded in a storage medium, or can be implemented as a computer code that is originally stored in a remote storage medium or a non-temporary machine-readable storage medium and will be stored in a local storage medium and downloaded through a network, so that the method described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only storage memory, a random access memory, a flash memory, a hard disk or a solid-state drive, etc.; further, the storage medium can also include a combination of the above-mentioned types of memory. It can be understood that a computer, a processor, a microprocessor controller, or programmable hardware includes a storage component that can store or receive software or computer code. When the software or computer code is accessed and executed by a computer, a processor, or hardware, the method shown in the above embodiment is implemented.

[0130] Although the embodiments of the present disclosure have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present disclosure, and such modifications and variations are all within the scope defined by the appended claims.

Claims

1. A method for acquiring conversation data, characterized in that: The method comprises: Obtaining a first session instruction, wherein the first session instruction includes attributes of a session object; A dialogue is generated based on the first dialogue instruction and a language model corresponding one-to-one to the dialogue object to obtain dialogue data.

2. The method according to claim 1, characterized in that The generating of the dialogue based on the first dialogue instruction and the language model corresponding to the dialogue object one by one to obtain the dialogue data includes: Inputting the first conversation instruction into each of the language models respectively to generate a conversation to obtain first conversation data, wherein the output of one of the language models is used as the input of another of the language models; If the current conversation round number is greater than the preset conversation round number, obtaining a second conversation instruction, where the second conversation instruction includes attributes of the two conversation objects; The conversation is continued based on the second conversation instruction and the language model to obtain second conversation data, where the conversation data includes the first conversation data and the second conversation data.

3. The method according to claim 2, characterized in that The first conversation instruction includes a prefix prompt for indicating the attribute of the conversation object and a conversation generation instruction, and the second conversation instruction includes a suffix prompt for indicating the attribute of the conversation object and a conversation continuation instruction.

4. The method according to claim 1, characterized in that: The generating of the dialogue based on the first dialogue instruction and the language model corresponding to the dialogue object one by one to obtain the dialogue data further includes: Obtaining a current output of a first language model corresponding to a first conversation object; Performing attribute analysis on the current output to determine the attribute of the current output to generate a third conversation instruction; The third conversation instruction and the current output are input into a second language model to obtain a current reply, so as to obtain the dialogue data, wherein the second language model corresponds to a second conversation object, and the current output has the same attribute as the current reply.

5. The method according to claim 1, characterized in that The generating of the dialogue based on the first dialogue instruction and the language model corresponding to the dialogue object one by one to obtain the dialogue data includes: Obtaining a first model output of the language model in a current dialogue round and a second model output in a previous dialogue round; Detecting a pattern output by the first model and a pattern output by the second model, wherein the pattern includes at least one of syntax and sentence type; If the pattern output by the first model is the same as the pattern output by the second model, the pattern output by the first model is adjusted and then input into another of the language models to obtain the dialogue data.

6. The method according to claim 5, characterized in that The adjusting the pattern output by the first model and inputting it into another language model to obtain the dialogue data includes: extracting content from the first model output; Representing the extracted content based on a preset mode to obtain an adjusted first model output; The adjusted first model output is input into another of the language models to obtain the dialogue data.

7. The method according to claim 5, characterized in that The detection of the pattern of the first model output and the second model output is obtained by a pattern detection model, and the determination method of the pattern detection model includes: Acquire a sample sentence and a target mode of the sample sentence; The sample sentence and the target pattern are input into a pattern detection model so that the pattern detection model determines the pattern corresponding to the sentence.

8. The method according to any one of claims 1 to 7, characterized in that The method further comprises: A conversation model is trained based on the conversation data to determine a target conversation model.

9. A device for acquiring conversation data, characterized in that: The device comprises: An instruction acquisition module, used to acquire a first session instruction, wherein the first session instruction includes attributes of a session object; The dialogue module is used to generate a dialogue based on the first dialogue instruction and a language model corresponding to the dialogue object one by one to obtain dialogue data.

10. A computer device, characterized in that: include: A memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the method for acquiring conversation data according to any one of claims 1 to 8 by executing the computer instructions.

11. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the method for acquiring conversation data according to any one of claims 1 to 8.