Dialogue data processing method and device, electronic equipment and storage medium
By grouping, organizing, and matching dialogue data, the problem of contextual irrelevance in AI large language models was solved, improving the accuracy and relevance of answers, and enhancing user experience and efficiency.
Patent Information
- Application Number
- CN202511398645.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-26
- Publication Date
- 2026-01-13
AI Technical Summary
In existing technologies, AI large language models are easily influenced by historical dialogue contexts that are unrelated to the current user's input question when generating answers, resulting in reduced accuracy and relevance of the answers.
By grouping and organizing historical dialogue data, relevant dialogue groups are matched with the current question to determine the target historical context. The final dialogue is then generated based on the target question and answer, and the dialogue groups are updated to improve the relevance of the context.
It improves the accuracy and relevance of generated answers, enhances user experience, saves time, and increases work efficiency.
Smart Images

Figure CN121327083A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of artificial intelligence technology, and is applicable to the fields of fintech and healthcare, and particularly to a contextual data processing method and apparatus, electronic device, and storage medium. Background Technology
[0002] In the field of artificial intelligence (AI) technology, large AI language models can generate answers based on user input. For example, in the context of intelligent investment in fintech, a user might input, "I want to know the current risk level of my investment portfolio?" The large model can generate an answer such as, "Based on your current asset allocation, market volatility, and risk appetite, your portfolio's risk level is approximately medium to high." Similarly, in the context of intelligent medication assistants in healthcare, a patient might input, "What are the indications and common adverse reactions of amoxicillin tablets?" The large model can generate an answer such as, "Common indications for amoxicillin tablets include respiratory, ear, nose, throat, skin, and urinary tract infections caused by bacterial infections. Common adverse reactions may include gastrointestinal discomfort (nausea, diarrhea), rash, and allergic reactions."
[0003] In related technologies, AI large language models are used to generate answers based on context and the current user input question. This context is typically derived from all historical dialogues preceding the current user input question. However, historical dialogues may be irrelevant to the current user input question, and these technologies can easily lead to the introduction of context from historical dialogues unrelated to the current user input question. Summary of the Invention
[0004] The main objective of this application is to propose a dialogue data processing method, apparatus, electronic device, and storage medium that enables the grouping and organization of dialogue data, thereby improving the relevance between the context used to generate answers and the current user input question, i.e., improving the accuracy of the context, and thus improving the accuracy of generating answers using dialogue data.
[0005] To achieve the above objectives, a first aspect of this application proposes a dialogue data processing method, the method comprising: Identify the target problem; Historical dialogue data is obtained based on the target question; wherein, the historical dialogue data includes candidate historical dialogue groups; The candidate historical dialogue groups are filtered according to the target question to obtain the target historical context; The target answer is generated based on the target question and the target historical context. The target dialogue is obtained by merging the target question and the target answer. Based on the target dialogue and each candidate historical dialogue group, a relevance match is performed to obtain the group matching degree; The candidate historical dialogue groups are updated based on the group matching degree and the target dialogue.
[0006] Optionally, the step of filtering the candidate historical dialogue groups according to the target question to obtain the target historical context includes: The relevance matching is performed based on the target question and the candidate historical dialogue groups to obtain the question matching degree; The candidate historical dialogue groups are filtered according to the question matching degree to obtain the target historical context.
[0007] Optionally, the step of performing relevance matching based on the target question and the candidate historical dialogue groups to obtain the question matching degree includes: Based on the keywords in the target question, keyword matching is performed on the candidate historical dialogue group to obtain the first keyword matching degree; Based on the topic corresponding to the target question, the candidate historical dialogue group is matched with the topic to obtain the first topic matching degree; Based on the target question, the answers in the candidate historical dialogue group are matched to obtain the first question-answer matching degree. The question matching degree is calculated based on the first keyword matching degree, the first topic matching degree, and the first question-and-answer matching degree.
[0008] Optionally, after calculating the question matching degree based on the first keyword matching degree, the first topic matching degree, and the first question-answer matching degree, the method further includes: Based on the intent corresponding to the target question, the candidate historical dialogue groups are subjected to intent matching to obtain a first intent matching degree; Based on the target question, keyword duplication detection is performed on the keywords in the candidate historical dialogue group to obtain the first keyword duplication rate; Context matching is performed based on the context corresponding to the target question and the candidate historical dialogue grouping to obtain the first context matching degree; The question matching degree is updated based on the first intent matching degree, the first keyword repetition degree, and the first context matching degree.
[0009] Optionally, the step of performing relevance matching based on the target dialogue and each candidate historical dialogue group to obtain a group matching degree includes: Based on the keywords in the target dialogue, keyword matching is performed on the candidate historical dialogue group to obtain the second keyword matching degree; Based on the topic corresponding to the target dialogue, the candidate historical dialogue group is matched with the topic to obtain the second topic matching degree; Based on the target answer in the target dialogue, the questions in the candidate historical dialogue group are matched to obtain the second question-answer matching degree. The group matching degree is calculated based on the second keyword matching degree, the second topic matching degree, and the second question-and-answer matching degree.
[0010] Optionally, updating the candidate historical dialogue group based on the group matching degree and the target dialogue includes: The matching degree of each of the historical dialogue groups is sorted to obtain the maximum dialogue matching degree; If the maximum dialogue matching degree is greater than or equal to a predetermined threshold, the target dialogue is added to the candidate historical dialogue group corresponding to the maximum dialogue matching degree. If the maximum dialogue matching degree is less than the predetermined threshold, a new historical dialogue group is created, the target dialogue is added to the new historical dialogue group, and the new historical dialogue group is used as a candidate historical dialogue group in the historical dialogue data.
[0011] Optionally, obtaining historical dialogue data based on the target question includes: In response to obtaining the target question, a dialogue identifier is assigned to the target question to obtain a target dialogue identifier; wherein, the dialogue identifier remains unchanged within a set time period; The target dialogue identifier is used to read data from a preset dialogue database to obtain a historical dialogue tuple; wherein the historical dialogue identifier corresponding to the question in the historical dialogue tuple is the same as the target dialogue identifier. The historical dialogue data is obtained by merging the various historical dialogue pairs.
[0012] To achieve the above objectives, a second aspect of this application provides a dialogue data processing apparatus, the apparatus comprising: The problem retrieval module is used to retrieve the target problem; The dialogue acquisition module is used to acquire historical dialogue data based on the target question; wherein, the historical dialogue data includes candidate historical dialogue groups; The dialogue filtering module is used to filter the candidate historical dialogue groups according to the target question to obtain the target historical context; The answer generation module is used to generate an answer based on the target question and the target historical context, thereby obtaining the target answer; A dialogue generation module is used to merge the target question and the target answer to obtain a target dialogue. The dialogue matching module is used to perform relevance matching based on the target dialogue and the candidate historical dialogue groups to obtain the group matching degree. The dialogue update module is used to update the candidate historical dialogue group based on the group matching degree and the target dialogue.
[0013] To achieve the above objectives, a third aspect of this application provides an electronic device, which includes a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the dialogue data processing method described in the first aspect.
[0014] To achieve the above objectives, a fourth aspect of the present application provides a storage medium, which is a computer-readable storage medium storing a computer program that, when executed by a processor, implements the dialogue data processing method described in the first aspect.
[0015] The dialogue data processing method, apparatus, electronic device, and storage medium proposed in this application first acquire a target question. Then, to determine the context, historical dialogue data is acquired based on the target question. However, instead of directly using the historical dialogue data as context, considering that the historical dialogue data contains dialogues with different meanings or types, the historical dialogue data is pre-classified into candidate historical dialogue groups. Historical dialogues within the same candidate historical dialogue group have the same or similar meanings or types. Then, the candidate historical dialogue groups for the target question are filtered to obtain the target historical context. In this way, the target historical context is the historical dialogue with a high relevance to the current user input question. Further, an answer is generated based on the target question and the target historical context to obtain the target answer. The target question and the target answer are then merged to obtain the target dialogue. Because the target historical context has a high relevance to the target question, the accuracy of the target answer is also improved. Further, relevance matching is performed between the target dialogue and each candidate historical dialogue group to obtain the group matching degree. Finally, the candidate historical dialogue groups are updated based on the group matching degree and the target dialogue. In summary, this application achieves grouping and organizing of dialogue data, thereby improving the relevance between the context used to generate answers and the current user input question, i.e., improving the accuracy of the context, and thus improving the accuracy of generating answers using dialogue data.
[0016] Additional aspects and advantages of this application will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of this application. Attached Figure Description
[0017] Figure 1 This is a flowchart of the dialogue data processing method provided in the embodiments of this application; Figure 2 yes Figure 1 The flowchart for step 102 in the document; Figure 3 yes Figure 2 The flowchart for step 201 in the document; Figure 4 This is a flowchart of a dialogue data processing method provided in another embodiment of this application; Figure 5 yes Figure 1 The flowchart for step 106 in the document; Figure 6 yes Figure 1 The flowchart for step 107 in the document; Figure 7 This is a block diagram of the module structure of the dialogue data processing device provided in the embodiments of this application; Figure 8 This is a schematic diagram of the hardware structure of the electronic device provided in the embodiments of this application. Detailed Implementation
[0018] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0019] It should be noted that although functional modules are divided in the device schematic diagram and a logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in a different order than the module division in the device or the order in the flowchart. The terms "first," "second," etc., in the specification, claims, and the aforementioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence.
[0020] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein is for the purpose of describing embodiments of this application only and is not intended to limit this application.
[0021] First, let's analyze some of the terms used in this application: Artificial intelligence (AI) is a new branch of computer science that studies, develops, and applies theories, methods, technologies, and systems to simulate, extend, and expand human intelligence. It aims to understand the essence of intelligence and produce intelligent machines that can react in a way similar to human intelligence. Research in this field includes robotics, speech recognition, image recognition, natural language processing, and expert systems. AI can simulate the information processes of human consciousness and thought. Furthermore, AI utilizes digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, perceiving the environment, acquiring knowledge, and using that knowledge to achieve optimal results.
[0022] Natural Language Processing (NLP): NLP uses computers to process, understand, and utilize human language (such as Chinese and English). It is a branch of artificial intelligence and an interdisciplinary field of computer science and linguistics, often referred to as computational linguistics. NLP includes syntactic analysis, semantic analysis, and discourse understanding. It is commonly used in machine translation, handwritten and printed character recognition, speech recognition and text-to-speech conversion, information and image processing, information extraction and filtering, text classification and clustering, sentiment analysis, and opinion mining. It involves data mining, machine learning, knowledge acquisition, knowledge engineering, artificial intelligence research, and linguistic research related to language computation.
[0023] Currently, when users interact with AI language models, their interaction typically involves inputting questions in a chat or conversation, and then the model responding. The model adjusts its responses based on the context, influencing aspects such as accuracy, tone, logic, coherence, and error correction. However, users often input questions arbitrarily within a chat, without considering their relevance or relevance. Contextual information unrelated to the question can significantly impact the language model's response relevance, ambiguity, accuracy, logic, and coherence, preventing the user from receiving the expected answer.
[0024] This application belongs to the field of artificial intelligence technology, more specifically to the field of natural language processing. By classifying and organizing the historical dialogues of the current chat, related dialogues are grouped into dialogue groups and matched with the current question for relevance. The historical dialogues with the highest matching degree are used as the "context" of the current question and input into a large model. Based on the input "context", the large model can provide answers that further meet the user's expectations. Then, based on the current question and answer as the latest dialogue, the above dialogue groups are updated to facilitate subsequent question and answering.
[0025] The dialogue data processing method provided in this application can be applied to terminals and servers, or it can be software running on the server. The server can be configured as an independent physical server, or as a server cluster or distributed system composed of multiple physical servers, or it can be configured as a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms; the software can be an application that implements the dialogue data processing method, but it is not limited to the above forms.
[0026] This application can be used in a wide variety of general-purpose or special-purpose computer system environments or configurations. Examples include server computers, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronics devices, network PCs, and distributed computing environments including any of the above systems or devices. This application can be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc., that perform specific tasks or implement specific abstract data types. This application can also be practiced in distributed computing environments where tasks are performed by remote processing devices connected via a communication network. In distributed computing environments, program modules can reside in local and remote computer storage media, including storage devices.
[0027] This application provides a dialogue data processing method, a dialogue data processing apparatus, an electronic device, and a computer-readable storage medium. The specific details are illustrated in the following embodiments. First, the dialogue data processing method in this application is described.
[0028] It should be noted that in each specific implementation of this application, when it is necessary to process data related to user identity or characteristics, such as user dialogue data, the user's permission or consent will be obtained first. Moreover, the collection, use and processing of this data will comply with relevant laws, regulations and standards.
[0029] Reference Figure 1 , Figure 1 This is an optional flowchart of the dialogue data processing method provided in the embodiments of this application, which may include, but is not limited to, steps 101 to 107.
[0030] Step 101, Identify the target problem; Step 102: Obtain historical dialogue data based on the target question; wherein, the historical dialogue data includes candidate historical dialogue groups; Step 103: Group and filter candidate historical dialogues according to the target question to obtain the target historical context; Step 104: Generate the answer based on the target question and the target historical context to obtain the target answer; Step 105: Combine the target question and target answer to obtain the target dialogue; Step 106: Perform relevance matching based on the target dialogue and each candidate historical dialogue group to obtain the group matching degree; Step 107: Update the candidate historical dialogue groups based on the group matching degree and the target dialogue.
[0031] Steps 101 to 107, as illustrated in this embodiment, firstly, a target question is obtained. Then, to determine the context, historical dialogue data is obtained based on the target question. However, instead of directly using the historical dialogue data as context, considering that the historical dialogue data contains historical dialogues with different meanings or types, the historical dialogue data is pre-classified to obtain candidate historical dialogue groups. Historical dialogues within the same candidate historical dialogue group have the same or similar meanings or types. Then, the candidate historical dialogue groups for the target question are filtered to obtain the target historical context. In this way, the target historical context has a high correlation with the historical dialogues of the current user input question. Further, an answer is generated based on the target question and the target historical context to obtain the target answer. Then, the target question and the target answer are merged to obtain the target dialogue. Because the target historical context has a high correlation with the target question, the accuracy of the target answer is also improved. Further, relevance matching is performed between the target dialogue and each candidate historical dialogue group to obtain the group matching degree. Finally, the candidate historical dialogue groups are updated based on the group matching degree and the target dialogue. In summary, this application achieves grouping and organizing of dialogue data, thereby improving the relevance between the context used to generate answers and the current user input question, i.e., improving the accuracy of the context, and thus improving the accuracy of generating answers using dialogue data.
[0032] In step 101 of some embodiments, a target question is obtained. The target question is a question input by the target object. During the interaction between the target object and the AI, the target object inputs the target question using an input box, and the AI answers it using a large model. In the fintech field, the target object can be a customer conducting online business. For example, in an insurance scenario, the target object is the policyholder. Or, in a smart investment scenario, the target object is the investor. In the healthcare field, the target object can be a patient, doctor, nurse, etc.
[0033] For example, in the context of smart investment in the fintech field, an investor's target question could be, "I want to know what the current risk level of my portfolio is?"
[0034] For example, in the scenario of intelligent medication assistant in the medical and health field, the patient's target question is "What are the indications and common adverse reactions of amoxicillin tablets?"
[0035] In step 102 of some embodiments, historical dialogue data is obtained based on the target question. Historical dialogue data refers to the dialogue records between the target object and the AI before the target question. For example, if the target question is the Nth question input by the target object, then the historical dialogue data includes a first historical dialogue tuple (the first question and the first answer), a second historical dialogue tuple (the second question and the second answer), ..., the (N-1)th historical dialogue tuple (the (N-1)th question and the (N-1)th answer).
[0036] Historical dialogue pairs in the historical dialogue data are grouped into candidate historical dialogue groups. Any two candidate historical dialogue groups are of different types, reflecting varying degrees of relevance in the dialogue content. The historical dialogue pairs within any two candidate historical dialogue groups are distinct. For example, if the historical dialogue data includes three candidate historical dialogue groups, represented as A, B, and C, then, using the example above and assuming N=6, grouping based on the content relevance of any two historical dialogue pairs (e.g., using clustering), then A could include the first historical dialogue pair (related to disease) and the third historical dialogue pair (related to disease); B could include the second historical dialogue pair (related to investment) and the fifth historical dialogue pair (related to investment); and C could include the fourth historical dialogue pair (related to insurance).
[0037] In one embodiment, step 102 may include: In response to the acquisition of the target question, a dialogue identifier is assigned to the target question, and the target dialogue identifier is obtained; wherein, the dialogue identifier remains unchanged within a set time period; The database is read based on the target dialogue identifier to obtain historical dialogue pairs; the historical dialogue identifier corresponding to the question in the historical dialogue pair is the same as the target dialogue identifier. The historical dialogue data is obtained by merging the various historical dialogue pairs.
[0038] Specifically, the time period can be set according to needs. For example, if the time period is set to 09:00 to 11:00, the dialogue identifier is 009. If the current time of the target question (e.g., 10:00) is obtained within the set time period, then 009 will be used as the target dialogue identifier. The dialogue database stores historical dialogue tuples, and the questions in the historical dialogue tuples correspond to dialogue identifiers. For example, if a question in a historical dialogue tuple (e.g., at 09:50) was obtained within the set time period, then the historical dialogue identifier is 009. In this way, historical dialogue tuples with the same target dialogue identifier can be combined to obtain historical dialogue data, which can reduce the risk of context being introduced with content unrelated to the question.
[0039] In step 103 of some embodiments, candidate historical dialogue groups are filtered according to the target question to obtain the target historical context. The target historical context includes a candidate historical dialogue group.
[0040] In one embodiment, reference is made to Figure 2 Step 102 may include: Step 201: Based on the target question and candidate historical dialogues, perform relevance matching to obtain the question matching degree; Step 202: Filter each candidate historical dialogue group according to the question matching degree to obtain the target historical context.
[0041] In step 201, the question matching degree is used to characterize the relevance between the target question and the candidate historical dialogue group. The question matching degree can be obtained by calculating the similarity between the text vector corresponding to the target question and the text vector of the candidate historical dialogue group.
[0042] In step 202, candidate historical dialogue groups can be sorted according to their question matching scores, and candidate historical dialogue groups that meet predetermined conditions in terms of question matching scores can be merged to obtain the target historical context. These predetermined conditions may include a question matching score greater than a predetermined matching score threshold, or a question matching score that is the maximum value.
[0043] The advantage of the embodiments of steps 201 to 202 described above is that by considering the relevance of the target question and candidate historical dialogue groups in terms of content, the accuracy of the target historical context is improved.
[0044] In one embodiment, reference is made to Figure 3 Step 201 may include: Step 301: Perform keyword matching on candidate historical dialogue groups based on keywords in the target question to obtain the first keyword matching degree; Step 302: Perform topic matching on candidate historical dialogue groups according to the topic corresponding to the target question to obtain the first topic matching degree; Step 303: Perform question-and-answer matching on the answers in the candidate historical dialogue group based on the target question to obtain the first question-and-answer matching degree; Step 304: Calculate the question matching degree based on the first keyword matching degree, the first topic matching degree, and the first question-and-answer matching degree.
[0045] In step 301, the first keyword matching degree refers to the degree of matching between the target question and the candidate historical dialogue group in terms of keywords. Specifically, based on the keywords of the target question, the parts containing the same keywords are searched in the historical dialogue pairs of the candidate historical dialogue group. These parts are likely to be relevant to the question because they may involve the same topic. Therefore, the first keyword matching degree can be generated through keyword matching. For example, if the target question is "The performance of a certain model of Tesla? The battery range of a BYD car?", then the keywords are "Tesla", "BYD", "range", etc.
[0046] In step 302, the first topic matching degree refers to the degree of matching between the target question and the candidate historical dialogue group in terms of topic dimension. Specifically, it is possible to check whether the historical dialogue pairs in the candidate historical dialogue group involve topics related to the target question. If the historical dialogue pairs involve topics that are the same as or similar to the question, these parts can be considered potentially relevant. Therefore, the first topic matching degree can be generated through topic matching.
[0047] For example, if the target question is "What is the performance of a certain Tesla model? What is the battery range of a BYD car?", then the topic could be "Product analysis of automobiles".
[0048] In step 303, the first question-answer matching degree refers to the degree of matching between the target question and the candidate historical dialogue group in the question-answer dimension. Specifically, it can be determined by checking whether the historical dialogue pairs in the candidate historical dialogue group contain answers, explanations, guidance, or related information relevant to the target question. If so, they are considered relevant. Therefore, the first question-answer matching degree can be generated through question-answer matching.
[0049] For example, the higher the matching degree of the first question and answer, the better if the keywords of the target question are contained in the answers of the historical dialogue pairs, or if the intent of the target question matches the intent of the answers of the historical dialogue pairs.
[0050] In step 304, the first keyword matching degree, the first topic matching degree, and the first question-and-answer matching degree obtained in the previous steps can be weighted and summed to obtain the question matching degree.
[0051] The advantage of the embodiments of steps 301 to 304 described above is that by determining the question matching degree from the keyword dimension, topic dimension and question answer dimension, the accuracy of question matching degree is improved, thereby improving the accuracy of determining the context, and thus improving the accuracy of overall dialogue data processing.
[0052] In one embodiment, after step 304, refer to Figure 4 Dialogue data processing methods may also include: Step 401: Perform intent matching on candidate historical dialogue groups according to the intent corresponding to the target question to obtain the first intent matching degree; Step 402: Perform keyword duplication detection on the keywords in the candidate historical dialogue group based on the target question to obtain the first keyword duplication rate; Step 403: Context matching is performed based on the context corresponding to the target question and the candidate historical dialogue groups to obtain the first context matching degree; Step 404: Update the question matching score based on the first intent matching score, the first keyword repetition score, and the first context matching score.
[0053] In step 401, the first intent matching degree refers to the degree of matching between the target question and the candidate historical dialogue group in the intent dimension. Specifically, the intent of the target question and the candidate historical dialogue group can be identified separately using a deep learning model. If the candidate historical dialogue group expresses an intent related to the target question, they are considered related. Therefore, the first intent matching degree can be generated through intent matching.
[0054] For example, if a user previously asked about the differences between the Xiaomi SU7 and the Wenjie M7, then if this user asks a car-related question, it can be assumed that the user is planning to buy a car, and Xiaomi and Wenjie are the car brands the user is primarily considering, thus indicating a high degree of initial intent matching.
[0055] In step 402, the first keyword reusability refers to the degree of matching between the target question and the candidate historical dialogue group on the reusability dimension. Specifically, it is used to characterize the frequency / number of times the keywords of the candidate historical dialogue group are used in the target question. Specifically, if the keywords of the candidate historical dialogue group are cited or mentioned again in the target question, it indicates that the candidate historical dialogue group may be relevant to the target question. After keyword duplication detection, the corresponding first keyword reusability is given for different candidate historical dialogue groups.
[0056] In step 403, the first context matching degree refers to the degree of matching between the target question and the candidate historical dialogue group in the context dimension. Context can also be referred to as situation, scene, etc. Specifically, the deep learning model refers to the historical dialogue pairs of the candidate historical dialogue groups to determine which groups provide contextual descriptions, situational descriptions, or scene descriptions related to the target question. Therefore, the first context matching degree can be generated through context matching. Context matching between the target question and the candidate historical dialogue group can be performed using a large model.
[0057] In step 404, the first intent matching degree, the first keyword repetition degree, and the first context matching degree obtained in the previous steps are weighted and summed to obtain the auxiliary matching degree. Then, the auxiliary matching degree and the question matching degree are weighted and summed to obtain the updated question matching degree.
[0058] The advantage of the above embodiments is that by updating the question matching degree from the dimensions of intent, keyword repetition, and context, the accuracy of question matching degree is further improved, thereby further improving the accuracy of determining the context, and thus improving the accuracy of dialogue data processing.
[0059] In step 104 of some embodiments, a large model can be used to generate an answer to the target question and the target historical context, thus obtaining the target answer. The large model can be a Large Language Model (LLM). An LLM is a deep learning model trained on a large amount of text data, enabling it to generate natural language text or understand the meaning of language text. These models can provide in-depth knowledge and language production on a wide range of topics by training on massive datasets. Its core idea is to learn the patterns and structures of natural language through large-scale unsupervised training, simulating, to some extent, the human language cognition and generation process.
[0060] In the context of smart investment within the fintech field, an investor's target question could be, "I want to know the current risk level of my portfolio?" A large model can then generate a corresponding answer based on this question, such as, "Based on your current asset allocation, market volatility, and risk appetite, your portfolio's risk level is approximately medium to high."
[0061] For example, in the scenario of intelligent medication assistant in the medical and health field, the patient's target question is "What are the indications and common adverse reactions of amoxicillin tablets?" The large model can generate corresponding answers based on this question, such as "Common indications of amoxicillin tablets include respiratory, ear, nose and throat, skin and urinary tract infections caused by bacterial infections. Common adverse reactions may include gastrointestinal discomfort (nausea, diarrhea), rash, allergic reactions, etc."
[0062] In step 105 of some embodiments, a target dialogue can be obtained by merging the target question and the target answer. The target dialogue can also be called a target dialogue tuple.
[0063] In step 106 of some embodiments, relevance matching is performed between the target dialogue and each candidate historical dialogue group to obtain a group matching degree. The group matching degree is used to characterize the relevance between the target dialogue and the candidate historical dialogue group. The group matching degree can be obtained by calculating the similarity between the text vector corresponding to the target dialogue and the text vector of the candidate historical dialogue group.
[0064] In one embodiment, reference is made to Figure 5 Step 106 may include: Step 501: Based on the keywords in the target dialogue, perform keyword matching on the candidate historical dialogue groups to obtain the second keyword matching degree; Step 502: Perform topic matching on candidate historical dialogue groups according to the topic corresponding to the target dialogue to obtain the second topic matching degree; Step 503: Based on the target answer in the target dialogue, perform question-and-answer matching on the questions in the candidate historical dialogue group to obtain the second question-and-answer matching degree; Step 504: Calculate the group matching degree based on the second keyword matching degree, the second topic matching degree, and the second question-and-answer matching degree.
[0065] In step 501, the second keyword matching degree refers to the degree of matching between the target dialogue and the candidate historical dialogue group in terms of keywords. Specifically, based on the keywords of the target dialogue, the parts containing the same keywords are searched in the historical dialogue tuples of the candidate historical dialogue group. These parts are likely to be relevant to the question because they may involve the same topic. Therefore, the second keyword matching degree can be generated through keyword matching.
[0066] In step 502, the second topic matching degree refers to the degree of matching between the target object and the candidate historical dialogue group in terms of topic dimension. Specifically, it can be determined from the historical dialogue pairs in the candidate historical dialogue group whether they involve topics related to the target dialogue. If the historical dialogue pairs involve the same or similar topics as the target dialogue, these parts can be considered potentially relevant. Therefore, the second topic matching degree can be generated through topic matching.
[0067] In step 503, the second question-answer matching degree refers to the degree of matching between the target answer and the questions in the candidate historical dialogue group in terms of the question-answer dimension. Specifically, it can be determined by checking whether the historical dialogue pairs in the candidate historical dialogue group contain question information related to the target answer; if so, they are considered relevant. Therefore, the second question-answer matching degree can be generated through question-answer matching.
[0068] In step 504, the question matching degree can be obtained by weighted summation of the second keyword matching degree, the second topic matching degree, and the second question-and-answer matching degree obtained in the previous steps.
[0069] The advantage of the embodiments of steps 501 to 504 described above is that by determining the group matching degree from the keyword dimension, topic dimension and question answer dimension, the accuracy of the group matching degree is improved, and the accuracy of grouping and organizing the dialogue data is improved.
[0070] In one embodiment, after step 504, the dialogue data processing method may further include: performing intent matching on candidate historical dialogue groups according to the intent corresponding to the target dialogue to obtain a second intent matching degree; performing keyword duplication detection on keywords in candidate historical dialogue groups according to the target dialogue to obtain a second keyword duplication degree; performing context matching on candidate historical dialogue groups according to the context corresponding to the target dialogue to obtain a second context matching degree; and updating the group matching degree according to the second intent matching degree, the second keyword duplication degree, and the second context matching degree.
[0071] The second intent matching degree refers to the degree of matching between the target question and candidate historical dialogue groups in terms of intent. Specifically, a deep learning model can be used to identify the intent of both the target question and the candidate historical dialogue groups. If a candidate historical dialogue group expresses an intent related to the target question, they are considered related. Therefore, the second intent matching degree can be generated through intent matching.
[0072] The second keyword repetition rate refers to the degree of matching between the target dialogue and candidate historical dialogue groups in terms of repetition. Specifically, it characterizes the frequency / number of times keywords from candidate historical dialogue groups are used in the target dialogue. Specifically, if keywords from candidate historical dialogue groups are cited or mentioned again in the target dialogue, it indicates that the candidate historical dialogue groups may be relevant to the target question. Therefore, after keyword duplication detection, a corresponding second keyword repetition rate is given for different candidate historical dialogue groups.
[0073] The second context matching degree refers to the degree of matching between the target dialogue and candidate historical dialogue groups in terms of context. Context can also be referred to as situation, scene, etc. Specifically, the deep learning model refers to the historical dialogue pairs of the candidate historical dialogue groups to determine which groups provide contextual descriptions, situational descriptions, or scene descriptions related to the target dialogue. Therefore, the second context matching degree can be generated through context matching.
[0074] The reference matching degree can be obtained by weighted summing the second intent matching degree, the second keyword repetition degree, and the second context matching degree obtained from the aforementioned steps. Then, the updated group matching degree can be obtained by weighted summing the reference matching degree and the group matching degree.
[0075] The advantage of the above embodiments is that by updating the group matching degree from the dimensions of intent, keyword repetition, and context, the accuracy of the group matching degree is further improved, thereby further improving the accuracy of dialogue data processing.
[0076] In step 107 of some embodiments, the candidate historical dialogue groups are updated based on the group matching degree and the target dialogue.
[0077] In one embodiment. Refer to Figure 6 Step 107 may include: Step 601: Sort the group matching degree of each historical dialogue group to obtain the maximum dialogue matching degree; Step 602: If the maximum dialogue matching degree is greater than or equal to a predetermined threshold, the target dialogue is added to the candidate historical dialogue group corresponding to the maximum dialogue matching degree. Step 603: If the maximum dialogue matching degree is less than the predetermined threshold, a new historical dialogue group is created, the target dialogue is added to the new historical dialogue group, and the new historical dialogue group is used as a candidate historical dialogue group in the historical dialogue data.
[0078] The advantage of the above embodiments is that the target dialogue can be added to the existing candidate historical dialogue group or to the newly added historical dialogue group according to the relationship between the group matching degree and the predetermined threshold, which further improves the accuracy of dialogue data grouping and organization, and thus improves the accuracy of dialogue data processing.
[0079] In summary, the present application can achieve at least the following beneficial effects: it can significantly improve the accuracy of the "answer" of the language big model, provide users with the expected answers, improve the user experience, save users a lot of time, and improve users' work efficiency.
[0080] Please see Figure 7 This application also provides a dialogue data processing apparatus, which can implement the above-described dialogue data processing method. Figure 7 This is a block diagram of the module structure of a dialogue data processing apparatus provided in an embodiment of this application. The apparatus includes: Problem acquisition module 701 is used to acquire target problems; The dialogue acquisition module 702 is used to acquire historical dialogue data based on the target question; wherein, the historical dialogue data includes candidate historical dialogue groups; The dialogue filtering module 703 is used to filter candidate historical dialogues by grouping them according to the target question to obtain the target historical context; The answer generation module 704 is used to generate the target answer based on the target question and the target historical context. Dialogue generation module 705 is used to merge the target question and target answer to obtain the target dialogue; The dialogue matching module 706 is used to perform relevance matching based on the target dialogue and candidate historical dialogues to obtain the group matching degree. The dialogue update module 707 is used to update the candidate historical dialogue groups based on the group matching degree and the target dialogue.
[0081] In one embodiment, the dialogue filtering module is further configured to: perform intent matching on candidate historical dialogue groups based on the intent corresponding to the target question to obtain a first intent matching degree; perform keyword duplication detection on keywords in candidate historical dialogue groups based on the target question to obtain a first keyword duplication degree; perform context matching on the context corresponding to the target question and candidate historical dialogue groups to obtain a first context matching degree; and update the question matching degree based on the first intent matching degree, the first keyword duplication degree, and the first context matching degree.
[0082] It should be noted that the specific implementation of this dialogue data processing device is basically the same as the specific embodiment of the dialogue data processing method described above, and will not be repeated here.
[0083] This application also provides an electronic device, which includes: a memory, a processor, a program stored in the memory and executable on the processor, and a data bus for communication between the processor and the memory. When the program is executed by the processor, it implements the aforementioned dialogue data processing method. This electronic device can be any smart terminal, including tablet computers, in-vehicle computers, etc.
[0084] Please see Figure 8 , Figure 8 The hardware structure of an electronic device according to another embodiment is illustrated. The electronic device includes: The processor 801 can be implemented using a general-purpose CPU (Central Processing Unit), microprocessor, application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of this application. The memory 802 can be implemented as a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 802 can store the operating system and other applications. When the technical solutions provided in the embodiments of this specification are implemented through software or firmware, the relevant program code is stored in the memory 802 and is called and executed by the processor 801 using the dialogue data processing method of the embodiments of this application. The 803 input / output interface is used to implement information input and output. The communication interface 804 is used to enable communication and interaction between this device and other devices. Communication can be achieved through wired means (such as USB, Ethernet cable, etc.) or wireless means (such as mobile network, WIFI, Bluetooth, etc.). Bus 805 transmits information between various components of the device (e.g., processor 801, memory 802, input / output interface 803, and communication interface 804); The processor 801, memory 802, input / output interface 803, and communication interface 804 are connected to each other within the device via bus 805.
[0085] This application embodiment also provides a storage medium, which is a computer-readable storage medium for computer-readable storage. The storage medium stores one or more programs, which can be executed by one or more processors to implement the above-described dialogue data processing method.
[0086] Memory, as a non-transitory computer-readable storage medium, can be used to store non-transitory software programs and non-transitory computer-executable programs. Furthermore, memory may include high-speed random access memory, and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid-state storage device. In some embodiments, memory may optionally include memory remotely located relative to the processor, and these remote memories can be connected to the processor via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.
[0087] The embodiments described in this application are for the purpose of more clearly illustrating the technical solutions of the embodiments of this application, and do not constitute a limitation on the technical solutions provided by the embodiments of this application. As those skilled in the art will know, with the evolution of technology and the emergence of new application scenarios, the technical solutions provided by the embodiments of this application are also applicable to similar technical problems.
[0088] Those skilled in the art will understand that the technical solutions shown in the figures do not constitute a limitation on the embodiments of this application, and may include more or fewer steps than shown, or combine certain steps, or different steps.
[0089] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.
[0090] Those skilled in the art will understand that all or some of the steps in the methods disclosed above, as well as the functional modules / units in the systems and devices, can be implemented as software, firmware, hardware, or suitable combinations thereof.
[0091] The terms “first,” “second,” “third,” “fourth,” etc. (if present) in the specification and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms “comprising” and “having,” and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0092] It should be understood that in this application, "at least one (item)" means one or more, and "more than" means two or more. "And / or" is used to describe the relationship between related objects, indicating that three relationships can exist. For example, "A and / or B" can represent three cases: only A exists, only B exists, and both A and B exist simultaneously, where A and B can be singular or plural. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship. "At least one (item) of the following" or similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one (item) of a, b, or c can represent: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, and c can be single or multiple.
[0093] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.
[0094] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0095] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0096] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes multiple instructions to cause an electronic device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing programs, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0097] The preferred embodiments of the present application have been described above with reference to the accompanying drawings, but this does not limit the scope of the claims of the present application. Any modifications, equivalent substitutions, and improvements made by those skilled in the art without departing from the scope and substance of the embodiments of the present application shall be within the scope of the claims of the present application.
Claims
1. A dialogue data processing method, characterized in that, The method includes: Identify the target problem; Historical dialogue data is obtained based on the target question; wherein, the historical dialogue data includes candidate historical dialogue groups; The candidate historical dialogue groups are filtered according to the target question to obtain the target historical context; The target answer is generated based on the target question and the target historical context. The target dialogue is obtained by merging the target question and the target answer. Based on the target dialogue and each candidate historical dialogue group, a relevance match is performed to obtain the group matching degree; The candidate historical dialogue groups are updated based on the group matching degree and the target dialogue.
2. The method according to claim 1, characterized in that, The step of filtering the candidate historical dialogue groups according to the target question to obtain the target historical context includes: The relevance matching is performed based on the target question and the candidate historical dialogue groups to obtain the question matching degree; The candidate historical dialogue groups are filtered according to the question matching degree to obtain the target historical context.
3. The method according to claim 2, characterized in that, The step of performing relevance matching based on the target question and the candidate historical dialogue groups to obtain the question matching degree includes: Based on the keywords in the target question, keyword matching is performed on the candidate historical dialogue group to obtain the first keyword matching degree; Based on the topic corresponding to the target question, the candidate historical dialogue group is matched with the topic to obtain the first topic matching degree; Based on the target question, the answers in the candidate historical dialogue group are matched to obtain the first question-answer matching degree. The question matching degree is calculated based on the first keyword matching degree, the first topic matching degree, and the first question-and-answer matching degree.
4. The method according to claim 3, characterized in that, After calculating the question matching degree based on the first keyword matching degree, the first topic matching degree, and the first question-answer matching degree, the method further includes: Based on the intent corresponding to the target question, the candidate historical dialogue groups are subjected to intent matching to obtain a first intent matching degree; Based on the target question, keyword duplication detection is performed on the keywords in the candidate historical dialogue group to obtain the first keyword duplication rate; Context matching is performed based on the context corresponding to the target question and the candidate historical dialogue grouping to obtain the first context matching degree; The question matching degree is updated based on the first intent matching degree, the first keyword repetition degree, and the first context matching degree.
5. The method according to any one of claims 1 to 4, characterized in that, The step of performing relevance matching based on the target dialogue and each candidate historical dialogue group to obtain the group matching degree includes: Based on the keywords in the target dialogue, keyword matching is performed on the candidate historical dialogue group to obtain the second keyword matching degree; Based on the topic corresponding to the target dialogue, the candidate historical dialogue group is matched with the topic to obtain the second topic matching degree; Based on the target answer in the target dialogue, the questions in the candidate historical dialogue group are matched to obtain the second question-answer matching degree. The group matching degree is calculated based on the second keyword matching degree, the second topic matching degree, and the second question-and-answer matching degree.
6. The method according to any one of claims 1 to 4, characterized in that, The step of updating the candidate historical dialogue group based on the group matching degree and the target dialogue includes: The matching degree of each of the historical dialogue groups is sorted to obtain the maximum dialogue matching degree; If the maximum dialogue matching degree is greater than or equal to a predetermined threshold, the target dialogue is added to the candidate historical dialogue group corresponding to the maximum dialogue matching degree. If the maximum dialogue matching degree is less than the predetermined threshold, a new historical dialogue group is created, the target dialogue is added to the new historical dialogue group, and the new historical dialogue group is used as a candidate historical dialogue group in the historical dialogue data.
7. The method according to any one of claims 1 to 4, characterized in that, The step of obtaining historical dialogue data based on the target question includes: In response to obtaining the target question, a dialogue identifier is assigned to the target question to obtain a target dialogue identifier; wherein, the dialogue identifier remains unchanged within a set time period; The target dialogue identifier is used to read data from a preset dialogue database to obtain a historical dialogue tuple; wherein the historical dialogue identifier corresponding to the question in the historical dialogue tuple is the same as the target dialogue identifier. The historical dialogue data is obtained by merging the various historical dialogue pairs.
8. A dialogue data processing device, characterized in that, The device includes: The problem retrieval module is used to retrieve the target problem; The dialogue acquisition module is used to acquire historical dialogue data based on the target question; wherein, the historical dialogue data includes candidate historical dialogue groups; The dialogue filtering module is used to filter the candidate historical dialogue groups according to the target question to obtain the target historical context; The answer generation module is used to generate an answer based on the target question and the target historical context, thereby obtaining the target answer; A dialogue generation module is used to merge the target question and the target answer to obtain a target dialogue. The dialogue matching module is used to perform relevance matching based on the target dialogue and the candidate historical dialogue groups to obtain the group matching degree. The dialogue update module is used to update the candidate historical dialogue group based on the group matching degree and the target dialogue.
9. An electronic device, characterized in that, The electronic device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement the dialogue data processing method according to any one of claims 1 to 7.
10. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it implements the dialogue data processing method according to any one of claims 1 to 7.
