A dialogue management method, an electronic device and a computer readable storage medium

By analyzing the relationship between the current round of questions and the previous rounds of questions in the dialogue management method, and using preset function plugins to process historical answers, the problem of incomplete answers was solved and the accuracy of answers was improved.

CN121581067BActive Publication Date: 2026-04-24ZHEJIANG DAHUA TECH CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
ZHEJIANG DAHUA TECH CO LTD
Filing Date
2026-01-27
Publication Date
2026-04-24

AI Technical Summary

Technical Problem

Current dialogue methods may result in incomplete answers if they only consider the current question, and the lack of correlation analysis with historical questions leads to low accuracy.

Method used

By identifying related historical round questions from the target historical round questions and analyzing the current round questions and historical answers using preset function plugins, the target answer can be obtained.

Benefits of technology

It improves the accuracy of answers by analyzing historical and current rounds of questions through the target function plugin to obtain more complete answers.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121581067B_ABST
    Figure CN121581067B_ABST
Patent Text Reader

Abstract

The application discloses a dialogue management method, an electronic device and a computer readable storage medium. The application determines a historical round associated question associated with a current round question from a target historical round question, and the acquisition time of the target historical round question is earlier than the acquisition time of the current round question. In response to detecting that there is no answer matching the current round question in the historical answer corresponding to the historical round associated question, at least one target function plug-in is determined from a plurality of preset function plug-ins according to the current round question and the historical answer. At least one target function plug-in is called to analyze and process the current round question and the historical answer to obtain a target answer. Therefore, the accuracy of the answer is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of data processing technology, and in particular to a dialogue management method, electronic device, and computer-readable storage medium. Background Technology

[0002] Intelligent interaction is currently one of the hottest technologies, demonstrating broad application potential in various fields, from intelligent assistants in daily life to automated production in industry. Among these, intelligent assistants can provide information retrieval through dialogue, greatly improving convenience and work efficiency.

[0003] Current dialogue methods typically input questions into a large model and directly obtain answers. However, the current question may have some relationship with historical questions, and considering only the current question may lead to incomplete answers. Summary of the Invention

[0004] The main technical problem addressed by this application is to provide a dialogue management method, electronic device, and computer-readable storage medium that can improve the accuracy of answers.

[0005] To address the aforementioned technical problems, this application provides a dialogue management method, comprising: determining a historical round-related question associated with the current round question from an acquired target historical round question, wherein the acquisition time of the target historical round question is earlier than the acquisition time of the current round question; in response to detecting that there is no answer matching the current round question in the historical answers corresponding to the historical round-related question, determining at least one target functional plugin from a plurality of preset functional plugins based on the current round question and the historical answers; and invoking the at least one target functional plugin to analyze and process the current round question and the historical answers to obtain the target answer.

[0006] In one embodiment, the step of determining at least one target functional plugin from a plurality of preset functional plugins based on the current round question and the historical answers includes: extracting attributes from the current round question to obtain plugin output attributes; extracting attributes from the historical answers to obtain plugin input attributes; and determining the at least one target functional plugin from a preset functional plugin mapping table based on the plugin output attributes and the plugin input attributes, wherein the preset functional plugin mapping table includes a correspondence between preset output attributes, preset input attributes and preset functional plugins.

[0007] In one embodiment, the step of invoking the at least one target function plugin to analyze and process the current round of questions and the historical answers to obtain the target answer includes:

[0008] In response to the existence of the target function plugin, the target invocation parameters of the target function plugin are determined based on the current round question and the historical answers; the target function plugin is invoked based on the target invocation parameters to obtain the target answer output by the target function plugin.

[0009] In one embodiment, the step of determining the target invocation parameter of the target function plugin based on the current round question and the historical answers includes: performing parameter extraction processing on the current round question to obtain a first invocation parameter; performing parameter extraction processing on the historical answers to obtain a second invocation parameter; and determining the target invocation parameter based on the first invocation parameter and the second invocation parameter.

[0010] In one embodiment, the step of extracting parameters from the historical answers to obtain the second calling parameter includes: extracting attributes from the historical answers to obtain attribute information; and determining the second calling parameter from a preset parameter mapping table based on the attribute information, wherein the preset parameter mapping table includes a correspondence between preset attributes and preset calling parameters.

[0011] In one embodiment, the step of determining the historical wheel-related problem associated with the current wheel problem from the acquired target historical wheel problems includes: performing similarity calculation processing on the target historical wheel problem and the current wheel problem to obtain a problem similarity; and determining the target historical wheel problem whose problem similarity is greater than a preset similarity threshold as the historical wheel-related problem.

[0012] In one embodiment, before the step of determining the historical round-related question associated with the current round question from the acquired target historical round questions, the method further includes: in response to receiving a dialogue instruction, analyzing and processing the current round question in the dialogue instruction to obtain a question attribute of the current round question, the question attribute indicating whether the current round question is associated with a preset question; in response to the question attribute indicating that the current round question is associated with the preset question, obtaining the target historical round question from a preset historical round dialogue database according to the preset question, the preset historical round dialogue database including multiple historical round questions.

[0013] In one embodiment, before the step of obtaining the target historical round question from the preset historical round dialogue database based on the preset question, the method further includes: performing field analysis on the answers corresponding to each obtained historical round question to obtain the information entropy of each attribute in the answer corresponding to the historical round question; performing attribute filtering processing on the answer corresponding to the historical round question based on the information entropy of each attribute to obtain the historical answer corresponding to the historical round question; and determining the preset historical round dialogue database based on the historical round question and the historical answer.

[0014] To address the aforementioned technical problems, this application provides an electronic device, including a memory and a processor, wherein the memory stores program instructions, and the processor retrieves the program instructions from the memory to execute the aforementioned dialogue management method.

[0015] To address the aforementioned technical problems, this application provides a computer-readable storage medium, comprising: storing program data, which, when executed by a processor, is used to implement the aforementioned dialogue management method.

[0016] The above scheme identifies related historical round questions from the acquired target historical round questions, where the target historical round questions were acquired earlier than the current round questions. In response to the detection that no matching answer exists in the historical answers corresponding to the related historical round questions, at least one target functional plugin is selected from multiple preset functional plugins based on the current round questions and historical answers. This target functional plugin is then invoked to analyze and process the current round questions and historical answers to obtain the target answer. Therefore, when no matching answer exists in the historical answers corresponding to the related historical round questions, invoking the target functional plugin to analyze the current round questions and historical answers yields a more complete answer, improving the accuracy of the answer. Attached Figure Description

[0017] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the embodiments will be briefly described below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort, wherein:

[0018] Figure 1 This is a flowchart illustrating an exemplary embodiment of the dialogue management method shown in this application;

[0019] Figure 2 yes Figure 1 A flowchart illustrating an exemplary embodiment of step S130 in the dialogue management method is shown.

[0020] Figure 3 This is a block diagram illustrating a dialogue management device in an exemplary embodiment of this application;

[0021] Figure 4 This is a schematic diagram of the structure of an embodiment of the electronic device provided in this application;

[0022] Figure 5 This is a schematic diagram of an embodiment of the computer-readable storage medium provided in this application. Detailed Implementation

[0023] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. It is understood that the specific embodiments described herein are only for explaining this application and not for limiting it. Furthermore, it should be noted that, for ease of description, only the parts related to this application are shown in the accompanying drawings, not all structures. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0024] First, it's important to note that intelligent interaction is currently a very popular technology, demonstrating broad application potential across various fields, from smart assistants in daily life to automated production in industry. Smart assistants, in particular, can provide information retrieval through dialogue, greatly improving convenience and work efficiency. Current dialogue methods typically involve inputting a question into a large model to directly obtain an answer. However, the current question may have some relationship with historical questions; considering only the current question might lead to incomplete answers.

[0025] Based on this, this application provides a dialogue management method, an electronic device, and a computer-readable storage medium. For details, please refer to... Figure 1 , Figure 1 This is a flowchart illustrating an exemplary embodiment of a dialogue management method shown in this application.

[0026] The executing entity of a dialogue management method can be a terminal device, a server, or other processing device. The terminal device can be a computer, mobile device, terminal, computing device, in-vehicle device, etc. The executing entity of the dialogue management method can also be a dialogue management device. In some possible implementations, the dialogue management method can be implemented by a processor calling computer-readable instructions stored in memory. The executing entity of the dialogue management method can also be a big data cluster. A big data cluster is a computer system architecture formed by multiple computers connected through a network. The big data cluster can be deployed on a private cloud built with K8S (Kubernetes, a container orchestration engine).

[0027] Specifically, one dialogue management method in this embodiment includes the following steps:

[0028] Step S110: Determine the historical round related problems associated with the current round problem from the acquired target historical round problems. The acquisition time of the target historical round problems is earlier than the acquisition time of the current round problems.

[0029] The target historical round question refers to the question posed to the server or large model at a specific historical moment. As an example, the dialogue management device retrieves questions from the previous preset rounds from a preset historical round dialogue database to obtain the target historical round question. The previous preset round could be the previous 1 round or the previous 5 rounds, etc. As another example, the dialogue management device retrieves questions from the previous preset time period from the preset historical round dialogue database to obtain the target historical round question. The previous preset time period could be the previous 10 minutes or the previous 30 minutes, etc. The large model refers to a large language model capable of conducting multi-round dialogues.

[0030] In one embodiment, the target historical round question could be something like "Have you eaten today?" or "Query the basic information of all registered members in the province".

[0031] The current round question refers to the question posed to the server or large model at the current moment. For example, the current round question could be "What did you eat?", "What did the third object do today?", or "What is Zhang San's membership number?"

[0032] Historical round related problems refer to historical problems that are related to the current round problem. For example, if the target historical round problem is "query the member list" and the current round problem is "query the member number of member Zhang San", then the member Zhang San queried in the current round problem is related to the member list in the target historical round problem.

[0033] The dialogue management device identifies historical round-related questions associated with the current round question from the acquired target historical round questions. Specifically, the dialogue management device inputs the current round question and the target historical round question into a trained question association detection model and obtains the detection results output by the model; if the detection results indicate that there is an association, the corresponding target historical round question is determined to be a historical round-related question.

[0034] Step S120: In response to detecting that there is no answer matching the current round question in the historical answers corresponding to the historical round question, at least one target function plugin is determined from multiple preset function plugins based on the current round question and the historical answers.

[0035] Historical answers refer to the responses given by the server or large model to historical rounds of related questions.

[0036] As one example, the dialogue management device inputs historical answers to related questions from previous rounds and the current round's question into a large model. The model analyzes whether the answer to the current round's question exists in the historical answers. If so, it outputs the answer; otherwise, it outputs a reason why it cannot be answered. Reasons for not being able to answer can include irrelevant knowledge or exceeding the data range. Simultaneously, it determines that there is no matching answer among the historical answers to related questions from previous rounds. As another example, the dialogue management device queries the historical answers for keywords in the current round's question. If a keyword is found, the value corresponding to that keyword is determined as the matching answer for the current round's question.

[0037] In one embodiment, the keywords of the current round of questions are "Zhang San" and "member number". If the value corresponding to both "Zhang San" and "member number" is found to be "121" from the historical answers, then "121" is determined as the answer that matches the current round of questions.

[0038] Preset function plugins refer to plugins that possess certain functionalities. For example, plugins with analytical capabilities. Preset function plugins could be plugins that analyze membership duration based on member ID, or plugins that analyze historical activity patterns based on name.

[0039] The target function plugin refers to a plugin that can analyze the answer to the current round of questions.

[0040] The dialogue management device determines at least one target functional plugin from multiple preset functional plugins based on the current round question and historical answers. As an example, the dialogue management device obtains the first keyword of the current round question and the second keyword of historical answers; it then determines at least one target functional plugin from a preset functional plugin mapping table based on the first and second keywords. The preset functional plugin mapping table includes the correspondence between preset keywords and preset functional plugins. As another example, the dialogue management device inputs historical answers and the current round question into a large model, and then determines at least one target functional plugin from the preset functional plugin mapping table using the large model.

[0041] In one embodiment, the dialogue management device loads the target historical round questions and their corresponding historical answers into the dialogue window according to role and time sequence. A large model is input through the dialogue window, and the large model analyzes whether the answer corresponding to the current round question exists in the historical answers. If it does, the target answer is output; otherwise, the target functional plugin required for the current round question is analyzed and output. The roles include system, assistant, and user. The system represents the answerer, the assistant represents the questioner, and the user represents the questioner.

[0042] Step S130: Call at least one target function plugin to analyze and process the current round of questions and historical answers to obtain the target answer.

[0043] The dialogue management device invokes at least one target function plugin to analyze and process the current round's question and historical answers to obtain the target answer. In response to the existence of multiple target function plugins, including a first function plugin and a second function plugin, where the output value of the first function plugin is the invocation parameter of the second function plugin, the device executes the first function plugin using a function call based on the target invocation parameter corresponding to the first function plugin, obtaining its output value. Based on the output value of the first function plugin, the device then executes the second function plugin using a function call to obtain the target answer.

[0044] As can be seen, by identifying the historical round-related questions associated with the current round question from the acquired target historical round questions, the acquisition time of the target historical round questions is earlier than that of the current round question. In response to the detection that no answer matching the current round question is found in the historical answers corresponding to the historical round-related questions, at least one target functional plugin is determined from multiple preset functional plugins based on the current round question and historical answers. This target functional plugin is then invoked to analyze and process the current round question and historical answers to obtain the target answer. Therefore, when no answer matching the current round question is found in the historical answers corresponding to the historical round-related questions, invoking the target functional plugin to analyze the current round question and historical answers yields a more complete answer and improves the accuracy of the answer.

[0045] The step of the dialogue management device determining at least one target functional plugin from multiple preset functional plugins based on the current round question and historical answers includes: extracting attributes from the current round question to obtain plugin output attributes; extracting attributes from historical answers to obtain plugin input attributes; and determining at least one target functional plugin from a preset functional plugin mapping table based on the plugin output attributes and plugin input attributes. The preset functional plugin mapping table includes the correspondence between preset output attributes, preset input attributes, and preset functional plugins.

[0046] The dialogue management device extracts and processes attributes from the current round's question to obtain the plugin's output attributes. Specifically, the dialogue management device uses a preset word segmentation tool to segment and tag the current round's question, obtaining multiple first words with tagged parts of speech; based on a preset part-of-speech list, it filters attribute words from these first words to obtain the plugin's output attributes. The preset word segmentation tool can be Jieba for Chinese, NLTK (Natural Language Toolkit), or Spacy for English.

[0047] The dialogue management device extracts attributes from historical answers to obtain plugin input attributes. It uses a preset word segmentation tool to segment and tag historical answers with parts of speech, resulting in multiple tagged second words. Based on a preset part-of-speech list, it filters attribute words from these tagged second words to obtain plugin input attributes. The preset part-of-speech list includes multiple nouns, such as membership duration, membership number, and purchase history. The part-of-speech list may not include object names.

[0048] In one embodiment, historical answers include the membership duration of multiple objects and the corresponding numerical values, membership numbers, and the corresponding numerical values. The dialogue management device extracts attributes from the historical answers, and the resulting plug-in input attributes are the membership duration and membership number. The current round question is "Query the purchase records of object Zhang San," and the dialogue management device extracts attributes from the current round question, resulting in the purchase records as the plug-in output attribute.

[0049] The dialogue management device determines at least one target functional plugin from a preset functional plugin mapping table based on the plugin's output and input attributes. Specifically, the dialogue management device queries the preset functional plugin mapping table for preset functional plugins whose output is a plugin output attribute and whose input is a plugin input attribute. If the query is successful, the queried preset functional plugin is determined as the target functional plugin; if the query fails, the device queries the preset functional plugin mapping table for preset functional plugins whose output is a plugin output attribute and whose input is a plugin input attribute, obtaining a second functional plugin whose output is a plugin output attribute and a first functional plugin whose input is a plugin input attribute; the first functional plugin and the second functional plugin are then determined as the target functional plugins.

[0050] Based on the above embodiments, please refer to Figure 2 , Figure 2 yes Figure 1 The illustrated flowchart shows an exemplary embodiment of step S130 in the dialogue management method. Specifically, the process of invoking at least one target function plugin to analyze and process the current round of questions and historical answers to obtain the target answer in step S130 includes the following steps:

[0051] Step S210: In response to the existence of a target function plugin, determine the target call parameters of the target function plugin based on the current round of questions and historical answers.

[0052] The steps of the dialogue management device to determine the target call parameters of the target function plug-in based on the current round question and historical answers include: performing parameter extraction processing on the current round question to obtain the first call parameters; performing parameter extraction processing on the historical answers to obtain the second call parameters; and determining the target call parameters based on the first call parameters and the second call parameters.

[0053] The dialogue management device extracts parameters from the current round's question to obtain the first invocation parameter. As an example, the dialogue management device uses a named entity recognition method to filter out the first invocation parameter from the current round's question. The first invocation parameter can be time, location, and / or object name, etc. As another example, the dialogue management device inputs the current round's question into a large model and extracts the first invocation parameter from the current round's question through the large model.

[0054] The step of the dialogue management device to extract parameters from historical answers to obtain the second calling parameter includes: extracting attributes from historical answers to obtain attribute information; and determining the second calling parameter from a preset parameter mapping table based on the attribute information. The preset parameter mapping table includes the correspondence between preset attributes and preset calling parameters.

[0055] Before determining the second calling parameter from the preset parameter mapping table based on attribute information, the dialogue management device further includes: obtaining the preset parameter mapping table. As one example, the dialogue management device queries the parameter mapping table corresponding to the target function plugin from the preset plugin chain to obtain the preset parameter mapping table. As another example, the dialogue management device inputs the attribute description information from historical answers and the description information of the calling parameters of the target function plugin into a large model, extracts the parameter mapping relationship through the large model, and obtains the preset parameter mapping table.

[0056] The dialogue management device extracts attributes from historical answers to obtain attribute information; the attribute information includes multiple attributes and their corresponding values. Specifically, the dialogue management device uses an attribute-value extraction method to query each attribute and its corresponding value from historical answers to obtain attribute information. The attribute-value extraction method can locate attributes and values ​​through specific trigger words and punctuation marks, or it can obtain attribute values ​​through dependency parsing.

[0057] The dialogue management device determines the second calling parameter from the preset parameter mapping table based on the attribute information. Specifically, the dialogue management device queries the calling parameter corresponding to each attribute from the preset parameter mapping table, and determines the calling parameter and the corresponding attribute value of the attribute with a corresponding relationship as the second calling parameter.

[0058] The dialogue management device determines the target call parameter based on the first call parameter and the second call parameter. Specifically, the dialogue management device combines each of the first call parameter and each of the second call parameters into the target call parameter.

[0059] Step S220: Call the target function plugin based on the target call parameters to obtain the target answer output by the target function plugin.

[0060] The dialogue management device invokes the target function plugin based on the target invocation parameters and obtains the target answer output by the target function plugin. Specifically, the dialogue management device uses the target invocation parameters as input parameters for the target function plugin, executes the target function plugin, and obtains the target answer.

[0061] In one embodiment, the dialogue management device extracts parameters from the current round's question using a large model to obtain the first invocation parameters. The reason for not being able to answer is that when the answer is out of range, the plugin corresponding to the associated historical round is executed repeatedly to obtain the historical answers from the full dataset. ; obtain The attribute information is mapped based on a preset parameter mapping table to obtain the second calling parameter. The historical answers are batch-processed to obtain multiple second call parameter values. These second call parameters are then merged with the first call parameter to form the target call parameter. This target call parameter is then used as the input parameter for the target function plugin, and the target function plugin is executed. , and obtain the target answer.

[0062] In yet another embodiment, the dialogue management device extracts parameters from the current round's question using a large model to obtain the first invocation parameters. Get past answers The attribute information is mapped based on a preset parameter mapping table to obtain the second calling parameter. The second and first call parameters are merged into a target call parameter. If the reason for not being able to answer is that the value is out of range, the corresponding function plugin of the associated history round is executed repeatedly to obtain the full data of the associated history round. The answers in the full data are processed in batches by the code to obtain the parameter values ​​of multiple second call parameters. The parameter values ​​of each second call parameter are combined with the first call parameter to form each target call parameter. Each target call parameter is used as the input parameter of the target function plugin, and the target function plugin is executed. , and obtain the target answer.

[0063] As can be seen, in response to the existence of a target function plugin, the target call parameters of the target function plugin are determined based on the current round's question and historical answers. The target function plugin is then called based on these parameters, yielding the target answer output by the plugin. Therefore, by calling the target function plugin using the target call parameters determined by the current round's question and historical answers, the target answer can be obtained through the target function plugin.

[0064] The dialogue management device identifies related historical round questions from the acquired target historical round questions. As one example, the device performs similarity calculations on the target historical round questions and the current round question to obtain a question similarity score; target historical round questions with a similarity score greater than a preset similarity threshold are identified as related historical round questions. As another example, the device performs similarity calculations on the target historical round questions and the current round question to obtain a question similarity score; target historical round questions with a similarity score greater than a preset similarity threshold are identified as candidate related historical round questions; the historical answers corresponding to the candidate related historical round questions and the current round question are input into the large model to obtain related historical round questions associated with the current round question.

[0065] The dialogue management device performs similarity calculations on the target historical round questions and the current round questions to obtain question similarity. As one example, the device uses a Cross-Encoder model to jointly encode question pairs, obtaining the semantic similarity between the target historical round questions and the current round questions, thus obtaining the question similarity. As another example, the device obtains the average vector of each word vector in the current round question and the target historical round questions, respectively, to obtain the sentence vector for each question; it then calculates the cosine similarity between the sentence vector corresponding to the current round question and the sentence vector corresponding to the target historical round questions, obtaining the question similarity.

[0066] After the dialogue management device performs similarity calculation on the target historical round question and the current round question to obtain the question similarity, it further includes: in response to the absence of a target historical round question with a similarity greater than a preset similarity threshold, it determines that the current round question and the target historical round question are not related, inputs the current round question into the large model, and obtains the target answer.

[0067] As can be seen, by calculating the similarity between the target historical round problem and the current round problem, the problem similarity is obtained; target historical round problems with a similarity greater than a preset similarity threshold are identified as historical round related problems. Therefore, it is possible to filter out target historical round problems related to the current round problem, thereby reducing interference.

[0068] Before the step of determining the historical round-related questions associated with the current round question from the acquired target historical round questions, the method further includes: in response to receiving a dialogue instruction, analyzing and processing the current round question in the dialogue instruction to obtain the question attribute of the current round question, wherein the question attribute indicates whether the current round question is associated with a preset question; in response to the question attribute indicating that the current round question is associated with a preset question, obtaining the target historical round question from a preset historical round dialogue database according to the preset question, wherein the preset historical round dialogue database includes multiple historical round questions.

[0069] The steps of the dialogue management device to analyze and process the current round question in the dialogue command and obtain the question attribute of the current round question include: inputting the current round question into a preset question inheritance recognition model and obtaining the model output result; and determining the question attribute of the current round question based on the model output result.

[0070] In one embodiment, the dialogue management device trains an initial BERT (Bidirectional Encoder Representations from Transformers) model based on samples in the dialogue dataset to obtain a preset question inheritance recognition model; the current round question is input into the preset question inheritance recognition model to obtain the model output result. If the model output result is an independent question, it is determined that the current round question and the preset question are not related; if the model output result is a non-independent question, it is determined that the current round question and the preset question are related.

[0071] The dialogue management device analyzes and processes the current round question in the dialogue command to obtain the question attribute of the current round question. This includes: determining whether there are preset words in the current round question; if so, determining that there is a correlation between the current round question and the preset question corresponding to the preset words. The preset words can be the previous round question, the third person, a list, etc.

[0072] The preset questions can be questions from a previously preset time period, questions from a previously preset round, or questions for obtaining a list of names, etc.

[0073] The dialogue management device retrieves the target historical round question from the preset historical round dialogue database based on the preset question. Specifically, the dialogue management device determines the historical round question that is the same as the preset question as the target historical round question, or the dialogue management device determines the historical round question from the previous preset round as the target historical round question, or the dialogue management device determines the historical round question from the previous preset time period as the target historical round question.

[0074] In one embodiment, the dialogue management device generates a multi-turn dialogue dataset based on a large model, trains an initial BERT model based on the dialogue dataset, and obtains a preset question inheritance recognition model. The current turn question is input into the preset question inheritance recognition model to obtain the model output. If the model output is a non-independent question, the semantic similarity between the current turn question and the target historical turn question is determined by jointly encoding question pairs using a Cross-Encoder model, resulting in a question similarity score. Target historical turn questions with a similarity score greater than a preset similarity threshold are selected as candidate historical turn related questions. A prompt for the large model is constructed, consisting of descriptions of both the candidate historical turn related questions and the current turn question. The large model analyzes the candidate historical turn related questions, their corresponding answers, and the current turn question according to the prompt, obtaining historical turn related questions relevant to the current turn question. Thus, preliminary denoising of the target historical turn questions is achieved through question similarity, while precise denoising is achieved through the large model, which helps reduce computational load and improves accuracy.

[0075] Before the step of retrieving the target historical round question from the preset historical round dialogue database based on the preset question, the method further includes: using a preset filtering method to filter the answers corresponding to each historical round question by attributes to obtain each retained attribute; and combining each retained attribute into the historical answer corresponding to the historical round question.

[0076] As an example, before the step of obtaining the target historical round question from the preset historical round dialogue database according to the preset question, the dialogue management device further includes: performing field analysis on the answers corresponding to each historical round question to obtain the information entropy of each attribute in the answers corresponding to the historical round question; performing attribute filtering processing on the answers corresponding to the historical round question according to the information entropy of each attribute to obtain the historical answers corresponding to the historical round question; and determining the preset historical round dialogue database based on the historical round questions and historical answers.

[0077] Information entropy can be used to assess the uncertainty or information richness of a single attribute variable, thereby indirectly measuring its "importance" or "value". If the information entropy of an attribute is high, it means that the value distribution of the attribute is relatively uniform and diverse, and may contain richer information. If the information entropy of an attribute is low, it means that the attribute is concentrated in a few values, may be constant or approximately constant, has little information content, and can be regarded as "unimportant".

[0078] The information entropy of an attribute satisfies the following formula:

[0079]

[0080] In the above formula, Representational attributes Information entropy Representational attributes Value The probability of.

[0081] The dialogue management device performs attribute filtering on the answers to historical rounds of questions based on the information entropy of each attribute, thus obtaining the historical answers to the historical rounds of questions. Specifically, the dialogue management device retains attributes whose information entropy is greater than or equal to a preset information entropy threshold as reserved attributes, and combines these reserved attributes to form the historical answers to the historical rounds of questions.

[0082] It should be noted that if the answer to the historical round problem is continuous data, then the continuous data is binned and discretized, and then the information entropy of each discrete data is calculated.

[0083] Among them, the preset information entropy threshold It can be . If n can be the number of attribute values ​​or the number of bins, then the attribute is considered unimportant and should be deleted. The remaining retained attribute fields are then combined to obtain the historical answer.

[0084] The dialogue management device determines a preset historical dialogue database based on historical round questions and answers. Specifically, the dialogue management device stores historical round questions and answers into the preset database to obtain the preset historical dialogue database.

[0085] As another example, the dialogue management device filters the answers to historical round questions based on a pre-configured list of reserved attributes in the client settings, obtaining each attribute in the answers to historical round questions that exists in the reserved attribute list; these attributes are then combined to form the historical answers to the historical round questions. This allows for the self-configuration of reserved attributes in the answers.

[0086] As another example, the dialogue management device obtains the historical function plugins in each historical round of dialogue; obtains the historical call parameters of each historical function plugin; determines the attributes in the historical call parameters with a frequency greater than or equal to a preset frequency threshold as attributes to be retained; searches for the attributes to be retained in the answers corresponding to the questions in each historical round, and obtains each retained attribute; and sets each retained attribute as the historical answer corresponding to the question in the historical round.

[0087] In one embodiment, the dialogue management device acquires historical call parameters of historical function plugins in each historical round of dialogue, and counts the hit frequency of each attribute in each historical call parameter; when the total number of attributes exceeds a preset sample size threshold, the device analyzes the object's attribute preferences based on the hit frequency of each attribute, and selects the attributes preferred by the object as attributes to be retained. For example, if the hit frequency of an attribute is F, if... If the attribute is true, it will not be retained; otherwise, it will be determined that the attribute is to be retained. The lowest frequency value to retain for the attribute.

[0088] Before the step of retrieving the target historical round question from the preset historical round dialogue database based on the preset question, the method further includes: using a preset filtering method to filter the answers corresponding to each historical round question by attributes to obtain each retained attribute; and combining each retained attribute into the historical answer corresponding to the historical round question.

[0089] In one embodiment, the dialogue management device obtains a first retained attribute, a second retained attribute, and a third retained attribute through a first filtering method, a second filtering method, and a third filtering method, respectively; one of the first retained attribute, the second retained attribute, and the third retained attribute is used as the historical answer corresponding to the historical round question; or, the union of two or three of the first retained attribute, the second retained attribute, and the third retained attribute is used as the historical answer corresponding to the historical round question. The first filtering method involves performing field analysis on the obtained answers corresponding to each historical round question to obtain the information entropy of each attribute in the answers corresponding to the historical round question; and performing attribute filtering processing on the answers corresponding to the historical round question based on the information entropy of each attribute to obtain the first retained attribute. The second filtering method involves filtering the answers corresponding to the historical round question according to a preset reserved attribute list configured by the client to obtain each attribute in the answers corresponding to the historical round question that exists in the reserved attribute list, thus obtaining the second retained attribute. The third filtering method involves obtaining the historical function plugins in each historical round dialogue; obtaining the historical call parameters of each historical function plugin; determining the attributes in the historical call parameters with a frequency greater than or equal to a preset frequency domain threshold as attributes to be retained; and searching for the attributes to be retained in the answers corresponding to each historical round question to obtain the third retained attribute.

[0090] After the dialogue management device calls at least one target function plugin to analyze and process the current round of questions and historical answers to obtain the target answer, it also includes: displaying the target answer in pages.

[0091] In one embodiment, the content displayed for the target answer can be: "Currently, m data entries were found, with data details as: [{JSON data of object 1}, ..., {JSON data of object m}]"; or, "Currently, 1000 data entries were found, with some data details as [{JSON data of object 1}, ..., {JSON data of object 9}]". Considering the limitations of front-end data display and large model context, this system recommends a page size of 9, with the first 100 pages of data retained and any data exceeding that size discarded.

[0092] The dialogue management device also includes: using a preset filtering method to filter the target answer to obtain the current answer corresponding to the current round question; and storing the current answer corresponding to the current round question in a preset historical round dialogue database.

[0093] In one embodiment, the steps of the dialogue management device executing the target function plugin include: specifying the target function plugin to be invoked in the current round of dialogue using the @plugin name method, extracting the corresponding plugin parameter key-value pairs using a large model based on the information description of the target function plugin's target invocation parameters, executing the plugin using the function_call method to obtain the target answer, returning the target answer to the front end for display in a paginated manner, and storing the current round question and the target answer in a preset historical round dialogue database.

[0094] Traditional multi-turn dialogue methods primarily employ context management techniques, such as truncation, resampling, and summary generation, when processing massive amounts of information in long text dialogues. However, in refined management scenarios, existing context management techniques struggle to achieve a balance between comprehensive coverage of detailed knowledge points. For instance, a historical turn question might query vehicle passage details for a jurisdiction, potentially returning tens of millions of object data points. Directly maintaining this object data within a large model context window would exceed its size; conversely, extracting and trunculating key information from this object data might result in the loss of crucial details, hindering accurate answers to subsequent refined questions. Therefore, this application reduces the likelihood of losing important information by filtering the answers to each historical turn question based on their attributes. In addition, this application identifies historical round-related questions associated with the current round question from the acquired target historical round questions, detects that there is no answer matching the current round question in the historical answers corresponding to the historical round-related questions, and determines the reason why it cannot be answered. Based on the current round question and historical answers, it identifies at least one target functional plugin from multiple preset functional plugins, thereby enabling the massive data flow of historical rounds to the current round, realizing massive data flow, while taking into account the continuity and effectiveness of multi-round dialogue in large models, and reducing the requirements for understanding small-parameter large models.

[0095] Figure 3 This is a block diagram illustrating a dialogue management device in an exemplary embodiment of this application. Figure 3 As shown, the exemplary dialogue management device 300 includes: a historical round-related question determination module 310, a target function plug-in determination module 320, and a target answer acquisition module 330. Specifically:

[0096] The historical wheel association problem determination module 310 is used to determine the historical wheel association problems associated with the current wheel problem from the acquired target historical wheel problems. The acquisition time of the target historical wheel problem is earlier than the acquisition time of the current wheel problem.

[0097] The target functional plugin determination module 320 is used to determine at least one target functional plugin from multiple preset functional plugins in response to detecting that there is no answer matching the current round question in the historical answers corresponding to the historical round associated questions.

[0098] The target answer acquisition module 330 is used to call at least one target function plugin to analyze and process the current round of questions and historical answers to obtain the target answer.

[0099] In this exemplary dialogue management device, a related historical round question is determined from the acquired target historical round questions, where the historical round questions were acquired earlier than the current round question. In response to detecting that no matching answer exists in the historical answers corresponding to the related historical round question, at least one target functional plugin is determined from multiple preset functional plugins based on the current round question and the historical answers. The at least one target functional plugin is invoked to analyze and process the current round question and the historical answers to obtain the target answer. Therefore, when no matching answer exists in the historical answers corresponding to the related historical round question, analyzing the current round question and the historical answers by invoking the target functional plugin yields a more complete answer, improving the accuracy of the answer.

[0100] The functions of each module can be found in the implementation examples of the dialogue management method, and will not be repeated here.

[0101] To implement the dialogue management method of the above embodiments, this application proposes another electronic device, please refer to [link / reference needed]. Figure 4 , Figure 4 This is a schematic diagram of the structure of an embodiment of the electronic device provided in this application.

[0102] Electronic device 400 includes memory 401 and processor 402, wherein memory 401 and processor 402 are coupled together.

[0103] The memory 401 is used to store program data, and the processor 402 is used to execute the program data to implement the dialogue management method of the above embodiment.

[0104] In this embodiment, processor 402 can also be referred to as a CPU (Central Processing Unit). Processor 402 may be an integrated circuit chip with signal processing capabilities. Processor 402 can also be a general-purpose processor, digital signal processor, application-specific integrated circuit, field-programmable gate array or other programmable logic device, discrete gate or transistor logic device, or discrete hardware component. The general-purpose processor can be a microprocessor, or processor 402 can be any conventional processor, etc.

[0105] This application also provides a computer-readable storage medium, such as Figure 5 As shown, the computer-readable storage medium 500 is used to store program data 501, which, when executed by a processor, is used to implement the dialogue management method as described in the method embodiments of this application.

[0106] The methods involved in the dialogue management method embodiments of this application, when implemented as software functional units and sold or used as independent products, can be stored in a device, such as 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 several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) or processor 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 program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0107] The above description is merely an embodiment of this application and does not limit the patent scope of this application. Any equivalent structural or procedural transformations made using the content of this application's specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of this application.

Claims

1. A dialogue management method, characterized in that, The method includes: From the acquired target historical problems, determine the historical problems associated with the current problem, wherein the acquisition time of the target historical problems is earlier than the acquisition time of the current problem; In response to detecting that there is no answer matching the current round question in the historical answers corresponding to the historical round question, at least one target function plugin is determined from a plurality of preset function plugins based on the current round question and the historical answers; The at least one target function plugin is invoked to analyze and process the current round of questions and the historical answers to obtain the target answer; The step of determining at least one target functional plugin from multiple preset functional plugins based on the current round question and the historical answers includes: The attributes of the current round problem are extracted and processed to obtain the plugin output attributes; The attributes of the historical answers are extracted and processed to obtain the plugin input attributes; The at least one target functional plugin is determined from a preset functional plugin mapping table based on the plugin output attributes and the plugin input attributes. The preset functional plugin mapping table includes the correspondence between preset output attributes, preset input attributes and the preset functional plugins. The step of determining the at least one target functional plugin from a preset functional plugin mapping table based on the plugin output attribute and the plugin input attribute includes: querying the preset functional plugin from the preset functional plugin mapping table for a preset functional plugin whose output is the plugin output attribute and whose input is the plugin input attribute; if the query is successful, the queried preset functional plugin is determined as the target functional plugin; if the query fails, querying the preset functional plugin from the preset functional plugin mapping table for a preset functional plugin whose output is the plugin output attribute and whose input is the plugin input attribute, to obtain a second functional plugin whose output is the plugin output attribute and a first functional plugin whose input is the plugin input attribute; and determining the first functional plugin and the second functional plugin as the target functional plugin.

2. The method according to claim 1, characterized in that, The step of calling the at least one target function plugin to analyze and process the current round of questions and the historical answers to obtain the target answer includes: In response to the existence of a target function plugin, the target invocation parameters of the target function plugin are determined based on the current round question and the historical answers; The target function plugin is invoked based on the target invocation parameters to obtain the target answer output by the target function plugin.

3. The method according to claim 2, characterized in that, The step of determining the target invocation parameters of the target function plugin based on the current round question and the historical answers includes: The current round problem is processed to extract parameters, resulting in the first calling parameters; The historical answers are processed to extract parameters, resulting in the second call parameters; The target call parameters are determined based on the first call parameters and the second call parameters.

4. The method according to claim 3, characterized in that, The step of extracting parameters from the historical answers to obtain the second calling parameters includes: Attributes are extracted from the historical answers to obtain attribute information; The second calling parameter is determined from a preset parameter mapping table based on the attribute information. The preset parameter mapping table includes the correspondence between preset attributes and preset calling parameters.

5. The method according to claim 1, characterized in that, The step of determining the historical round-related problems associated with the current round problem from the acquired target historical round problems includes: The similarity between the target historical round problem and the current round problem is calculated to obtain the problem similarity. The target historical round problem whose similarity to the problem is greater than a preset similarity threshold is identified as the historical round associated problem.

6. The method according to claim 1, characterized in that, Prior to the step of determining the associated historical round problem related to the current round problem from the acquired target historical round problems, the method further includes: In response to receiving a dialogue instruction, the current round question in the dialogue instruction is analyzed and processed to obtain the question attribute of the current round question. The question attribute indicates whether the current round question is related to a preset question. In response to the problem attribute indicating that the current round problem is associated with the preset problem, the target historical round problem is obtained from the preset historical round dialogue database according to the preset problem. The preset historical round dialogue database includes multiple historical round problems.

7. The method according to claim 6, characterized in that, Before the step of retrieving the target historical round question from the preset historical round dialogue database based on the preset question, the method further includes: Based on the obtained answers to the questions in each historical round, field analysis is performed to obtain the information entropy of each attribute in the answers to the questions in each historical round; Based on the information entropy of each attribute, the answers corresponding to the historical round questions are filtered by attribute to obtain the historical answers corresponding to the historical round questions. The preset historical round dialogue database is determined based on the historical round questions and the historical answers.

8. An electronic device, characterized in that, include: A memory and a processor, wherein the memory stores program instructions, and the processor retrieves the program instructions from the memory to perform the method as claimed in any one of claims 1-7.

9. A computer-readable storage medium, characterized in that, include: The system stores program data, which, when executed by a processor, is used to implement the method as described in any one of claims 1-7.

Citation Information

Patent Citations

  • Large model plug-in calling method and device, electronic equipment and storage medium

    CN118132164A

  • Plug-in calling method and device, equipment and storage medium

    CN119088919A

  • Langchain-based intelligent interactive Agent system and implementation method

    CN119646123A

  • A method and system for processing multi-turn dialogues

    CN119783687A