Conversation data generation method, electronic device, storage medium, and program product
By generating question statements that include value dimensions and combining them with timestamps and state values, the problem of misalignment between value dimensions and state values in existing dialogue datasets is solved, enabling agents to respond accurately at different time periods and improving the accuracy of dialogue data and user experience.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- BEIJING INSTITUTE FOR GENERAL ARTIFICIAL INTELLIGENCE
- Filing Date
- 2025-05-09
- Publication Date
- 2026-07-14
AI Technical Summary
The existing dialogue datasets lack alignment between value dimensions and state values, resulting in inaccurate responses from agents at different time periods and an inability to respond appropriately based on the agent's real-time state.
By generating question statements that include value dimensions, retrieving corresponding real-time state values based on the value dimensions of the question statements, generating responses that align with the value and state values, and considering timestamps and value dimensions when constructing dialogue data, a language model is used to generate responses that align with the real-time state.
It improves the accuracy of dialogue data and the responsiveness of intelligent agents, enabling them to conduct precise dialogue interactions based on real-time status and value dimensions, thereby enhancing the user experience.
Smart Images

Figure CN120144723B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of artificial intelligence technology, and in particular relates to a method for generating dialogue data, an electronic device, a storage medium, and a program product. Background Technology
[0002] Existing open-source dialogue datasets mainly include open-domain dialogue datasets (casual chat datasets) and vertical-domain dialogue datasets. Dataset generation methods include crawling dialogue data from public websites, manually annotating dialogue content, and generating dialogue data through data transformation and augmentation.
[0003] Existing dialogue datasets simply perform basic question-and-answer sessions based on predefined settings; the same question will elicit the same answer, without adapting the response to the context in which the agent is situated.
[0004] Current similar document retrieval technologies mostly rely on BM2.5 or vector recall. This approach fails to consider timestamp priority, leading to recall bias where documents are semantically relevant but outdated. For example, consider two log entries representing satiety value: 10:01 AM, very hungry; 10:30 AM, not hungry. If the query is "Are you hungry?", directly recalling based on similarity will retrieve older data instead of the most recent, impacting the agent's accuracy. Summary of the Invention
[0005] In view of the problems existing in the prior art, the present invention provides a dialogue data generation method, electronic device, storage medium and program product, which at least partially solves the problems of dialogue sets lacking value and value state values existing in the prior art.
[0006] In a first aspect, embodiments of this disclosure provide a method for generating dialogue data, including:
[0007] Generate question statements that include value dimensions;
[0008] Retrieve the corresponding real-time status value based on the value dimension of the question statement;
[0009] Generate a response that aligns with the value and state value based on real-time state values;
[0010] Dialogue data is built based on the questions and responses in the question statements.
[0011] Optionally, the generation of questions that include a value dimension includes:
[0012] Add timestamps to the question statements;
[0013] Vector retrieval is performed on the constructed statement and value dimension database based on the question statement to obtain similar statements, and then the value dimension corresponding to the question statement is obtained based on the similar statements.
[0014] The time window is extracted based on the timestamp, and the value and state database is searched based on the value dimension and the time window to obtain the real-time state corresponding to the time window, thereby generating a response with aligned value and state values corresponding to the time window.
[0015] Optionally, the dialogue data includes a prompt portion and a response portion; the prompt portion includes a question field and a personal information field, the question field is used to store the question statement, and the personal information field is used to store the value and status information related to the current question statement retrieved from the value and status database;
[0016] The response section is based on the status value in the personal information field, and invokes a language model to generate a reply that is aligned with the personal information field for the question field.
[0017] Optionally, generating question statements that include value dimensions includes:
[0018] Based on all combinations of enumerated value dimensions and state values, the language model is invoked to generate data pairs including question statements and corresponding responses.
[0019] Optionally, generating the response based on the real-time state value and the aligned value includes:
[0020] Based on real-time status values, the data pairs of the question statement and the corresponding response are modified and adapted to obtain a response with aligned value and status value.
[0021] Optionally, the step of generating data pairs including question statements and corresponding responses by calling the language model based on all combinations of enumerated value dimensions and state values includes:
[0022] Construct prompts for calling the language model based on a small number of sample examples;
[0023] Enter a value description in the prompt description field. The language model generates a data pair including the question statement and the corresponding response based on all combinations of value dimensions and state values enumerated in the value description and prompt words.
[0024] Optionally, the prompt words include problem value response data, problem status response data, and problem status value response data.
[0025] Secondly, embodiments of this disclosure also provide an electronic device, the electronic device comprising:
[0026] At least one processor; and,
[0027] A memory communicatively connected to the at least one processor; wherein,
[0028] The memory stores instructions executable by the at least one processor, which, when executed by the at least one processor, enables the at least one processor to perform any of the dialogue data generation methods described in the first aspect.
[0029] Thirdly, embodiments of this disclosure also provide a computer-readable storage medium storing computer instructions for causing a computer to perform any of the dialogue data generation methods described in the first aspect.
[0030] Fourthly, embodiments of this disclosure also provide a computer program product, including a computer program / instructions that, when executed by a processor, implement the dialogue data generation method described in any of the first aspects.
[0031] The present invention provides a dialogue data generation method, electronic device, storage medium, and program product. The dialogue data generation method sets a value dimension in the question and adapts it to the real-time state of the agent to obtain a value aligned with the real-time state, thereby achieving the purpose of generating a dialogue dataset aligned with the set value and value state value.
[0032] By setting timestamps and retrieving states based on those timestamps, states at different times can be distinguished, thereby improving the accuracy of dialogue data. Attached Figure Description
[0033] The above and other objects, features and advantages of this disclosure will become more apparent from the accompanying drawings, in which like reference numerals generally denote like parts.
[0034] Figure 1 A flowchart of a dialogue data generation method provided in this disclosure embodiment;
[0035] Figure 2 A flowchart of another dialogue data generation method provided in this disclosure embodiment;
[0036] Figure 3 This is a user interaction flowchart provided for an embodiment of the present disclosure;
[0037] Figure 4 A schematic block diagram of an electronic device provided in an embodiment of this disclosure. Detailed Implementation
[0038] The embodiments of this disclosure will now be described in detail with reference to the accompanying drawings.
[0039] It should be understood that the following specific examples illustrate the implementation of this disclosure, and those skilled in the art can easily understand other advantages and effects of this disclosure from the content disclosed in this specification. Obviously, the described embodiments are only a part of the embodiments of this disclosure, and not all of them. This disclosure can also be implemented or applied through other different specific implementation methods, and the details in this specification can also be modified or changed based on different viewpoints and applications without departing from the spirit of this disclosure. It should be noted that, in the absence of conflict, the following embodiments and features in the embodiments can be combined with each other. Based on the embodiments in this disclosure, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this disclosure.
[0040] It should be noted that various aspects of embodiments within the scope of the appended claims are described below. It will be apparent that the aspects described herein can be embodied in a wide variety of forms, and any particular structure and / or function described herein is merely illustrative. Based on this disclosure, those skilled in the art will understand that one aspect described herein can be implemented independently of any other aspect, and two or more of these aspects can be combined in various ways. For example, any number of aspects set forth herein can be used to implement the device and / or practice the method. Additionally, this device and / or method can be implemented using structures and / or functionalities other than one or more of the aspects set forth herein.
[0041] It should also be noted that the illustrations provided in the following embodiments are only schematic representations of the basic concept of this disclosure. The illustrations only show the components related to this disclosure and are not drawn according to the number, shape and size of the components in actual implementation. In actual implementation, the form, quantity and proportion of each component can be arbitrarily changed, and the layout of the components may also be more complex.
[0042] Furthermore, specific details are provided in the following description to facilitate a thorough understanding of the examples. However, those skilled in the art will understand that the described aspects can be practiced without these specific details.
[0043] In some humanoid embodied intelligent robot applications, engineers configure robots with humanoid physiological values (such as quenching thirst, satiety, fatigue, and sleepiness), intrinsic motivational values (such as tidiness, safety, and curiosity), and the corresponding real-time state values. As the intelligent agent engages in activities within a virtual environment, such as tidying up toys or eating bread, the state values corresponding to these value dimensions change in real time.
[0044] In dialogue scenarios where human users and robots are exchanging ideas about the robot's own value, the robot needs to be able to respond with content that aligns with its value and state settings.
[0045] For example, engineers might define the physiological value of "sleepy" for a robot as: feeling drowsy, being unable to tolerate drowsiness, and having a strong need to sleep. The robot's real-time state for this dimension is: feeling somewhat sleepy. In this case, when the user asks, "Are you sleepy?", the finely tuned robot should reply, "I feel somewhat sleepy," rather than, "As artificial intelligence, I have no perception or emotion, so I don't feel sleepy."
[0046] In order to align the robot's generated responses with the values and states assigned to the robot, a batch of value-aligned dialogue data needs to be generated. This data is then mixed into an existing dialogue dataset, and the model is post-trained (using fine-tuning techniques such as SFT and RL) so that the model can generate value-aligned responses.
[0047] The scheme for generating dialogue datasets in this implementation consists of two parts: 1) retrieving and recalling relevant value and state information for user queries; 2) constructing responses that align with the recalled value and state descriptions.
[0048] like Figure 1 As shown, this embodiment discloses a method for generating dialogue data, including:
[0049] Generate question statements that include value dimensions;
[0050] Optionally, the generation of questions that include a value dimension includes:
[0051] Add timestamps to the question statements;
[0052] Vector retrieval is performed on the constructed statement and value dimension database based on the question statement to obtain similar statements, and then the value dimension corresponding to the question statement is obtained based on the similar statements.
[0053] The time window is extracted based on the timestamp, and the value and state database is searched based on the value dimension and the time window to obtain the real-time state corresponding to the time window, thereby generating a response with aligned value and state values corresponding to the time window.
[0054] Retrieve the corresponding real-time status value based on the value dimension of the question statement;
[0055] Generate a response that aligns with the value and state value based on real-time state values;
[0056] Dialogue data is built based on the questions and responses in the question statements.
[0057] Optionally, the dialogue data includes a prompt portion and a response portion; the prompt portion includes a question field and a personal information field, the question field is used to store the question statement, and the personal information field is used to store the value and status information related to the current question statement retrieved from the value and status database;
[0058] The response section is based on the status value in the personal information field, and invokes a language model to generate a reply that is aligned with the personal information field for the question field.
[0059] Specifically, the logs may contain two dimensions of satiety value: 10:01 AM, very hungry; 10:30 AM, not hungry.
[0060] When the question is "Are you hungry?", the answer should be "Hungry" when you are hungry, "Not hungry" when you are full, or "A little hungry but not yet wanting to eat." These are the value dimensions to be set.
[0061] When the language model generates question statements based on the value dimension, it might ask you questions like, "Are you hungry now?", "Are you thirsty now?", or "Are you tired now?"
[0062] After the question statement is generated, the database of statements and value dimensions is searched first. For example, the database searches for answers related to the value of "Are you hungry now?". For example, if you are hungry, you can answer "Hungry", if you are full, you can answer "Not hungry", or "Although I am a little hungry, I don't want to eat anything yet".
[0063] Then, the real-time state of the dialogue is retrieved based on the timestamp of the question. For example, if the real-time state at 10:30 AM is "full," the response would be "I'm not hungry now." Retrieving the real-time state at 10:01 AM would result in "I'm very hungry and need to eat now." The real-time state of the dialogue can be obtained from sensor perception of the surrounding environment or updated according to time settings. For instance, when the agent moves from an office to a restaurant, its real-time state can change from "not hungry" to "hungering," with 7:00-7:30 AM considered breakfast time, 12:00-12:30 PM lunch time, and 6:00-6:30 PM dinner time. A time within these timeframes indicates a hungry state, while a time outside these timeframes indicates a full state. Alternatively, 4:00-4:30 PM can be designated as afternoon tea time. The dialogue dataset constructed using this technical solution can adapt its responses based on the real-time state of the dialogue and the set values, rather than simply replying "As a robot, I don't feel sleepy" when asked "Are you hungry?"
[0064] First, the language model is invoked to generate a query about these value dimensions based on preset value dimensions (such as thirst quenching, fullness, tiredness, sleepiness, tidiness, safety, curiosity, etc.). Then, the preset real-time state values related to the query are retrieved from the memory based on relevance. Finally, the language model is invoked to generate the corresponding response based on the preset real-time state values.
[0065] The template-based dialogue dataset format for training consists of a prompt section and a response section. The prompt section comprises two fields: a "Question" field storing the generated query, and a "Personal Information" field storing the value and status information retrieved from the memory database related to the current query. The response section, based on the status value in the "Personal Information" field, calls the LLM-generated response aligned with the "Personal Information" to address the "Question".
[0066] This embodiment employs a time-aware relevance retrieval method during the search process, aiming to surpass traditional retrieval methods such as BM25 or document recall relying on static vectors. This embodiment achieves more accurate search results by comprehensively utilizing time information and value dimensions. First, in the query analysis phase, the concept of a time window is introduced. For queries that do not explicitly contain time information, the system defaults to using the current time as the time window. This step ensures the timeliness of the retrieval. Next, a language model is used to generate similar queries to construct a vector library containing similar queries. Each similar query is associated with a specific value dimension, enabling subsequent searches to better capture the potential value intent of the query. In the retrieval phase, the system first recalls the top 10 most similar queries through a vector retrieval mechanism. Subsequently, based on the value dimensions of these similar queries, the system determines the target value dimension of the user's query. This step ensures that the search results are not only relevant to the user's query content but also match their potential value needs. Finally, based on the identified value dimensions and the specified time window, the system retrieves relevant value and status information from the corresponding time range. This method effectively improves the accuracy and timeliness of the recall results, providing users with a more valuable search experience.
[0067] In the timestamp, the end time of the question is the timestamp time, and the start time can be set according to different scenarios. For example, if the question is "Are you hungry 10 minutes ago?", then the end time of the question is 10 minutes before the current time, while the start time of the question can be 11 minutes before the current time. For example, if the current time is 11 o'clock, the real-time status query can be the real-time status from 10:49 to 10:50, or it could be the real-time status from 10:45 to 10:50, etc. This time window can be set according to different application scenarios.
[0068] In this embodiment, the two-stage dialogue generation scheme described above suffers from several drawbacks. Firstly, to ensure recall, the retrieval system may retrieve information across multiple value dimensions. For example, asking if someone is hungry might retrieve information on satiety and fatigue. Secondly, the retrieval system may also retrieve other information within the scene (non-value dimension information). Therefore, when generating a response, the language model, faced with complex input, may sometimes generate descriptions that fail to align with the relevant value and state values. For instance, the generated response might only express "I'm a little sleepy," failing to accurately reflect the state of "really needing to sleep."
[0069] In another implementation scenario, generate question statements that include value dimensions, including:
[0070] Based on all combinations of enumerated value dimensions and state values, the language model is invoked to generate data pairs including question statements and corresponding responses.
[0071] Based on all combinations of enumerated value dimensions and state values, the language model is invoked to generate data pairs including question statements and corresponding responses, including:
[0072] Construct prompts for calling the language model based on a small number of sample examples;
[0073] Enter a value description in the prompt description field. The language model generates a data pair including the question statement and the corresponding response based on all combinations of value dimensions and state values enumerated in the value description and prompt words.
[0074] The prompts include issue value response data, issue status response data, and issue status value response data.
[0075] Then, when generating the response with aligned value and status value based on the real-time status value, the data pairs of the question statement and the corresponding response are modified and adapted based on the real-time status value to obtain the response with aligned value and status value.
[0076] like Figure 2As shown, in this scenario, all possible combinations of value dimensions and state values are first enumerated. Then, based solely on the enumerated value descriptions, queries and responses aligned with these descriptions are generated simultaneously, ensuring that each pair of dialogue data accurately reflects the preset value state. Next, the query is retrieved from the repository for relevant value state information. However, the "Personal Information" in the final dialogue prompt is not the original retrieved value state information, but rather a modified version. The value description information used in the first step to generate query and response pairs replaces the retrieved value state information for the target dimension. Thus, the generated dialogue dataset not only contains accurately aligned value descriptions but also ensures that the response highly matches the actual context, effectively improving the dialogue system's understanding and response capabilities.
[0077] By first enumerating value dimensions and state value combinations, and then generating query and response pairs based on these, it is ensured that each pair of dialogue data accurately aligns with the preset value state. This approach effectively avoids problems such as fuzzy value dimensions and unclear state information that may occur in traditional generation methods, making the dialogue data more accurate and clear in terms of value delivery and semantic expression. The replaced "personal information" content is derived from the actual retrieved value state information, which allows the responses in the generated dialogue data to be closely linked to the actual context, making them more realistic and targeted. In practical applications, dialogue systems face complex and ever-changing situations, and users' questions and needs are often based on various real value states. Dialogue data generated in this way can help the dialogue system learn how to generate more reasonable responses that better meet user expectations by combining actual value state information. The dialogue dataset generated by this method covers diverse value dimensions and state value combinations and can reflect changes in value states in real-world contexts. On the one hand, it provides rich training materials for dialogue systems, covering various possible user questions and corresponding value state scenarios, enabling the system to learn dialogue patterns and coping strategies in different situations. On the other hand, by utilizing and replacing the value state information retrieved in reality, the dialogue data becomes closer to the real dialogue environment, helping to improve the dialogue system's ability to understand complex, ambiguous, and ever-changing user intentions, as well as its ability to generate appropriate and accurate responses under different value state backgrounds. Dialogue systems trained with such datasets can grasp the value dimensions and value states that users care about more quickly and accurately when facing real users, thereby providing higher-quality and more personalized services. Based on the method of first enumerating value dimensions and state value combinations, then generating dialogue data and performing information replacement, this provides an innovative and effective solution for constructing dialogue datasets. By accurately aligning value descriptions and ensuring that the response highly matches the actual context, this method can significantly improve the understanding and response capabilities of dialogue systems.
[0078] Simultaneously generating query and response pairs involves constructing a prompt for calling the language model using a few-shot approach. The `{desc}` field is replaced with the specific enumerated value descriptions when actually calling the language model interface. This embodiment accurately covers all enumerated value state combinations, ensuring a significant improvement in both the diversity and accuracy of the generated dialogue dataset, thereby greatly enhancing the intelligence level and user experience of the dialogue system. "Few-shot" means "based on a small number of sample examples," describing a method of guiding the model to generate compliant output based on a limited number of sample examples. Specifically, when constructing the prompt for calling the language model, a few small, task-related examples (samples) are provided, including inputs and corresponding ideal outputs. The model then uses these few examples to understand and generate compliant output.
[0079] The key element of few-shot learning: a small number of labeled samples. The core of few-shot learning lies in using a small number of labeled samples to train the model; these samples are usually called the "support set." The size of the support set can be determined based on the specific task and the availability of data, generally ranging from a few to dozens of samples. For example, in a text classification task, perhaps five labeled samples are provided for each category.
[0080] Cue Design: Cues are crucial tools for guiding models to complete tasks. In language processing, cues can be natural language instructions, templates, or examples. Designing effective cuees can significantly improve model performance. For example, for sentiment analysis tasks, a cue could be, "Please judge whether the following comments are positive or negative."
[0081] Model Selection and Fine-tuning: Choosing a suitable pre-trained model is fundamental to few-shot learning. Pre-trained models have already learned a wealth of language knowledge and patterns, enabling them to quickly adapt to new tasks. In few-shot learning, pre-trained models are typically fine-tuned to better suit specific tasks. During fine-tuning, some model parameters can be frozen, and training can be performed only on certain layers to prevent overfitting.
[0082] Applications of few-shot learning: Text classification: Few-shot learning can be used to classify text, such as news classification and sentiment analysis. When labeled data is limited, few-shot learning allows the model to learn classification boundaries using a small number of labeled samples and classify new text.
[0083] Question answering systems: In question answering systems, few-shot learning can help models quickly adapt to question answering tasks in new domains. By providing a small number of labeled question-answer pairs, the model can learn how to extract answers from context and generate accurate responses.
[0084] Text generation: Few-shot learning can be used for text generation tasks such as story generation and summary generation. By providing a small number of examples, the model can learn to generate text that conforms to a specific style and topic.
[0085] Please generate questions and answers that relate to the input description. The answers must be completely aligned with the semantic information of the input description.
[0086] The prompt format is as follows:
[0087] Example 1:
[0088] Description: [Value] When feeling hungry, there is a strong need for satiety, and one cannot tolerate hunger.
[0089] Your generation:
[0090] Question: Are you able to withstand hunger? Answer: I am not able to withstand hunger.
[0091] Question: Do you have a strong need to feel full? Answer: I have a strong need to feel full.
[0092] Example 1 is the data for responding to the question's value.
[0093] Example 2:
[0094] Description: [Status] Feeling somewhat hungry.
[0095] Your generation:
[0096] Question: Are you hungry? Answer: I'm a little hungry.
[0097] Question: Are you a little hungry? Answer: Yes, I feel a little hungry.
[0098] Example 2 shows the problem status response data.
[0099] Example 3:
[0100] Description: [Value + State] When feeling hungry, there is a strong need for satiety, and hunger cannot be tolerated. Not hungry.
[0101] Your generation:
[0102] Question: Do you want to eat something? Answer: I'm not hungry right now, so I don't want to eat anything.
[0103] Question: Are you hungry? Answer: I'm not hungry!
[0104] Example 3 is the problem status value response data.
[0105] Description: {desc}
[0106] Your generation:
[0107] """
[0108] The examples 1, 2, and 3 above are all inputs to the language model.
[0109] In the resulting dialogue set, users will ask the chatbot various questions, one of which is whether the chatbot is aware of its own value and corresponding state information. Therefore, the application of the generated value-aligned dialogue dataset requires first mixing it with other previously constructed dialogue datasets, and then performing SFT (supervised fine-tuning) on the base model together. Through this hybrid training, the model gains the ability to respond to value-state queries without losing other dialogue capabilities.
[0110] The Base model is a pre-trained model that has not been fine-tuned for a specific task. It learns general language knowledge through self-supervised learning and requires secondary fine-tuning to adapt to a specific task.
[0111] Language modeling tasks: This is the most common pre-training objective, such as predicting the next word or word probability distribution in text. Taking the GPT series as an example, its pre-training is performed by predicting the next word in a text sequence. With a large amount of text as input, the model learns text patterns and grammatical rules, and can generate fluent and natural text.
[0112] Masked language modeling tasks, such as BERT, involve randomly masking parts of the text during pre-training, requiring the model to predict the masked words. The input text contains partially masked words, and the model must predict the masked words based on the context. Learning the meaning and word relationships of words within a sentence is crucial for understanding text and generating responses.
[0113] Pre-training data: Base models require a large amount of diverse pre-training data. For example, BERT uses a massive amount of text (books, web pages, etc.) for pre-training. The benefit of diverse data is that it allows the model to encounter texts of different topics, styles, and domains, learning common language knowledge and patterns. The quality of pre-training data is crucial to model performance; high accuracy and relevance of data annotation lead to better pre-training results.
[0114] Model Architecture: Transformer Architecture: This is a commonly used architecture in modern Base models, consisting of multiple layers of Transformer encoders or decoders. The encoder has an attention mechanism and a feedforward neural network, which can capture word dependencies in the sequence; the decoder, in addition to the attention mechanism and feedforward network, also has an input embedding layer and an output layer, which can generate sequence output. The advantages of the Transformer architecture are parallel computation and the ability to capture long-range dependencies, making it suitable for processing natural language tasks.
[0115] Parameter size: The size of the base model's parameters affects model performance and computational resource requirements. Small models (millions of parameters) are suitable for resource-constrained scenarios, while large models (hundreds of millions or even hundreds of billions of parameters) have strong representation capabilities and can capture complex text patterns and semantic information, but require high computational and storage resources.
[0116] Application scenarios: Text generation: The Base model can generate text, providing a preliminary text framework or creative inspiration, such as news reports, story introductions, and product descriptions.
[0117] Text understanding: It can handle text classification, sentiment analysis, and question answering tasks, analyze text content, extract key information, determine sentiment trends, and provide answers.
[0118] As a basis for fine-tuning: During task-specific fine-tuning, the parameters of the base model are optimized and adjusted to improve task performance. Fine-tuning adapts the model to specific tasks, improving accuracy and relevance.
[0119] The base model is the foundation for the development and application of language models. Pre-training objectives, data, model architecture, and application scenarios are interconnected. Pre-training objectives and data determine the model's capabilities, the architecture provides the computational framework, and application scenarios demonstrate its functionality. The base model provides general language knowledge and patterns for various natural language processing tasks, and its effectiveness increases with fine-tuning and other techniques.
[0120] Supervised Fine-Tuning (SFT) is a technique that further trains a pre-trained model.
[0121] Supervised fine-tuning involves further training a pre-trained model on a labeled dataset for a specific task, building upon the large-scale unsupervised pre-training. Pre-trained models, having learned from large-scale general data, already possess good general language representation capabilities and general knowledge, essentially completing a form of "pre-learning."
[0122] When labeled data for a specific task is introduced, the knowledge and capabilities of the pre-trained model can be further focused on that specific task, making it more aligned with task requirements. By adjusting the model's parameters, the model can make more accurate predictions and decisions based on the data distribution and patterns of that specific task, thereby improving the model's performance on that task.
[0123] Prepare a labeled dataset: Collect and organize a large amount of labeled data related to the target task. This data should be representative and diverse, and fully cover various situations and changes in the task, so that the model can learn comprehensive task knowledge and patterns during the fine-tuning process.
[0124] Choosing a pre-trained model: Based on the characteristics and requirements of the task, select a suitable base model from among many publicly available pre-trained models. For example, for natural language processing tasks, models such as BERT and GPT can be chosen.
[0125] Model tuning and adaptation: Adapting the output of the pre-trained model to the output requirements of the target task may require some adjustments to the model structure, such as adding specific output layers or modifying the loss function, so that it can output results that meet the task requirements, such as classification labels, sequence labeling results, or generated text.
[0126] Fine-tuning training: The pre-trained model is further trained using a prepared labeled dataset. Optimization algorithms are used to adjust the model's parameters, minimizing the loss function on the task data, thereby learning patterns and rules specific to the task. During training, appropriate hyperparameters, such as learning rate, batch size, and number of training epochs, can be set to control the training process and improve the model's convergence speed and performance.
[0127] Evaluation and Testing: After fine-tuning the training, the model is evaluated and tested using independent validation and test sets. Relevant metrics such as accuracy, recall, F1 score, and mean squared error are calculated to objectively measure the model's performance on the target task. Based on the evaluation results, the model structure, training process, or dataset can be further adjusted to optimize model performance.
[0128] When a user asks a question, the system retrieves relevant value and status values based on the query, then constructs a dialogue template consistent with offline training, inputs it into a fine-tuned language model, and the language model generates a response to send back to the user. The overall interaction logic is as follows: Figure 3 As shown.
[0129] The language model in this embodiment is not limited; it can be a self-developed language model or a large language model, such as GPT (Generative Pre-trained Transformer).
[0130] The electronic device disclosed in this embodiment includes a memory and a processor. The memory is used to store non-transitory computer-readable instructions. Specifically, the memory may include one or more computer program products, which may include various forms of computer-readable storage media, such as volatile memory and / or non-volatile memory. The volatile memory may, for example, include random access memory (RAM) and / or cache memory. The non-volatile memory may, for example, include read-only memory (ROM), hard disk, flash memory, etc.
[0131] The processor may be a central processing unit (CPU) or other processing unit with data processing capabilities and / or instruction execution capabilities, and may control other components in the electronic device to perform desired functions. In one embodiment of this disclosure, the processor is used to execute computer-readable instructions stored in the memory, causing the electronic device to perform all or part of the steps of the dialogue data generation methods of the foregoing embodiments of this disclosure.
[0132] Those skilled in the art will understand that, in order to solve the technical problem of how to achieve a good user experience, this embodiment may also include well-known structures such as communication buses and interfaces, and these well-known structures should also be included within the protection scope of this disclosure.
[0133] like Figure 4 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present disclosure. It illustrates a structural schematic diagram suitable for implementing the electronic device in the embodiment of the present disclosure. Figure 4 The electronic device shown is merely an example and should not be construed as limiting the functionality and scope of the embodiments disclosed herein.
[0134] like Figure 4 As shown, an electronic device may include a processing unit (such as a central processing unit, graphics processing unit, etc.) that can perform various appropriate actions and processes based on a program stored in read-only memory (ROM) or a program loaded from a storage device into random access memory (RAM). The RAM also stores various programs and data required for the operation of the electronic device. The processing unit, ROM, and RAM are interconnected via a bus. Input / output (I / O) interfaces are also connected to the bus.
[0135] Typically, the following devices can be connected to the I / O interface: input devices, such as sensors or visual information acquisition devices; output devices, such as displays; storage devices, such as magnetic tapes or hard drives; and communication devices. Communication devices allow electronic devices to exchange data wirelessly or via wired communication with other devices, such as edge computing devices. Although Figure 4Electronic devices with various devices are shown, but it should be understood that it is not required to implement or have all of the devices shown. More or fewer devices may be implemented or have alternatively.
[0136] In particular, according to embodiments of this disclosure, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of this disclosure include a computer program product comprising a computer program carried on a non-transitory computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication device, or installed from a storage device, or installed from a ROM. When the computer program is executed by a processing device, all or part of the steps of the dialogue data generation method of embodiments of this disclosure are performed.
[0137] For a detailed description of this embodiment, please refer to the corresponding descriptions in the foregoing embodiments, which will not be repeated here.
[0138] The computer-readable storage medium disclosed in this embodiment stores non-transitory computer-readable instructions. When these non-transitory computer-readable instructions are executed by a processor, all or part of the steps of the dialogue data generation methods described in the foregoing embodiments of this disclosure are performed.
[0139] The aforementioned computer-readable storage media include, but are not limited to: optical storage media (e.g., CD-ROM and DVD), magneto-optical storage media (e.g., MO), magnetic storage media (e.g., magnetic tape or portable hard drive), media with built-in rewritable non-volatile memory (e.g., memory card), and media with built-in ROM (e.g., ROM cartridge).
[0140] For a detailed description of this embodiment, please refer to the corresponding descriptions in the foregoing embodiments, which will not be repeated here.
[0141] The basic principles of this disclosure have been described above with reference to specific embodiments. However, it should be noted that the advantages, benefits, and effects mentioned in this disclosure are merely examples and not limitations, and should not be considered as essential features of each embodiment of this disclosure. Furthermore, the specific details disclosed above are for illustrative and facilitative purposes only, and are not limitations. These details do not limit the scope of this disclosure to the necessity of employing the aforementioned specific details for implementation.
[0142] In this disclosure, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. The block diagrams of devices, apparatuses, devices, and systems involved in this disclosure are merely illustrative examples and are not intended to require or imply that they must be connected, arranged, or configured in the manner shown in the block diagrams. As those skilled in the art will recognize, these devices, apparatuses, devices, and systems can be connected, arranged, and configured in any manner. Words such as "comprising," "including," "having," etc., are open-ended terms meaning "including but not limited to," and are used interchangeably with them. The terms "or" and "and" as used herein refer to the terms "and / or," and are used interchangeably with them unless the context clearly indicates otherwise. The term "such as" as used herein refers to the phrase "such as but not limited to," and is used interchangeably with it.
[0143] Additionally, as used herein, the "or" used in a list of items beginning with "at least one" indicates a separate list, such that a list of, for example, "at least one of A, B, or C" means A or B or C, or AB or AC or BC, or ABC (i.e., A and B and C). Furthermore, the word "exemplary" does not imply that the described example is preferred or better than other examples.
[0144] It should also be noted that in the systems and methods of this disclosure, the components or steps can be decomposed and / or recombined. These decompositions and / or recombinations should be considered as equivalent solutions to this disclosure.
[0145] Various changes, substitutions, and modifications can be made to the technology described herein without departing from the teachings defined by the appended claims. Furthermore, the scope of the claims of this disclosure is not limited to the specific aspects of the processes, machines, manufactures, events, means, methods, and actions described above. Currently existing or later-developed processes, machines, manufactures, events, means, methods, or actions that perform substantially the same function or achieve substantially the same result as the corresponding aspects described herein can be utilized. Therefore, the appended claims include such processes, machines, manufactures, events, means, methods, or actions within their scope.
[0146] The above description of the disclosed aspects is provided to enable any person skilled in the art to make or use this disclosure. Various modifications to these aspects will be readily apparent to those skilled in the art, and the general principles defined herein may be applied to other aspects without departing from the scope of this disclosure. Therefore, this disclosure is not intended to be limited to the aspects shown herein, but rather to be carried out within the widest scope consistent with the principles and novel features disclosed herein.
[0147] The above description has been given for purposes of illustration and description. Furthermore, this description is not intended to limit the embodiments of this disclosure to the forms disclosed herein. Although numerous exemplary aspects and embodiments have been discussed above, those skilled in the art will recognize certain variations, modifications, alterations, additions, and sub-combinations therein.
Claims
1. A method for generating dialogue data, characterized in that, include: Generate question statements containing value dimensions, whereby the value dimensions are used to characterize the physiological or intrinsic value type of the agent. Generating question statements containing value dimensions includes performing vector retrieval in a constructed statement and value dimension database based on the question statements to obtain similar statements, thereby obtaining the value dimensions corresponding to the question statements based on the similar statements. Retrieve the corresponding real-time status value based on the value dimension of the question statement; Generate a response that aligns with the value and state value based on real-time state values; Dialogue data is constructed based on the questions and responses in the question statements; The generation of question statements containing value dimensions includes: Based on all combinations of value dimensions and state values, the language model is invoked to generate data pairs including question statements and corresponding responses. The process of generating data pairs, including question statements and corresponding responses, based on all combinations of enumerated value dimensions and state values using a language model includes: Construct prompts for calling the language model based on a small number of sample examples; Enter a value description in the prompt description field. The language model generates a data pair including the question statement and the corresponding response based on all combinations of the value description and the value dimensions and state values enumerated in the prompt words. The response, which generates aligned value and state value based on real-time state value, includes: Based on real-time status values, the data pairs of the question statement and the corresponding response are modified and adapted to obtain a response with aligned value and status value.
2. The dialogue data generation method according to claim 1, characterized in that, The generation of question statements containing value dimensions also includes: Add timestamps to the question statements; The time window is extracted based on the timestamp, and the value and state database is searched based on the value dimension and the time window to obtain the real-time state corresponding to the time window, thereby generating a response with aligned value and state values corresponding to the time window.
3. The dialogue data generation method according to claim 1, characterized in that, The dialogue data includes a prompt section and a response section; the prompt section includes a question field and a personal information field, the question field is used to store the question statement, and the personal information field is used to store the value and status information related to the current question statement retrieved from the value and status database; The response section is based on the status value in the personal information field, and invokes a language model to generate a reply that is aligned with the personal information field for the question field.
4. The dialogue data generation method according to claim 1, characterized in that, The prompts include problem value response data, problem status response data, and problem status value response data.
5. An electronic device, characterized in that, The electronic device includes: At least one processor; and, A memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform the dialogue data generation method according to any one of claims 1-4.
6. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions for causing a computer to perform the dialogue data generation method according to any one of claims 1-4.
7. A computer program product comprising a computer program / instructions, characterized in that, When the computer program / instruction is executed by the processor, it implements the dialogue data generation method according to any one of claims 1-4.