Data processing method and device and intelligent system

By acquiring historical dialogue data during the session to generate independent semantic expression instructions, the problem of misjudgment of intent and low interaction efficiency in multi-turn dialogues of traditional intelligent systems is solved, and more accurate user intent recognition and more efficient interaction are achieved.

CN120804248APending Publication Date: 2025-10-17ZHUHAI KINGSOFT OFFICE SOFTWARE +2
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202510860894.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-25
Publication Date
2025-10-17

AI Technical Summary

Technical Problem

Traditional intelligent systems lack the ability to parse referential relationships and semantic omissions in user input commands in multi-round dialogue interaction scenarios, resulting in misjudgment of intent and inefficient interaction.

Method used

By obtaining historical conversation data during the session, independent semantic expression instructions are generated, reference ambiguity and semantic omission are eliminated, automatic context association is achieved, and the accuracy of intent recognition is improved.

Benefits of technology

It significantly improves the accuracy of intelligent systems in recognizing user intent, reduces the interaction cost of users repeatedly entering commands, and enhances the interaction efficiency and user experience in multi-turn dialogue scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120804248A_ABST
    Figure CN120804248A_ABST
Patent Text Reader

Abstract

The invention relates to a data processing method and device and an intelligent system.The method comprises the steps that in the session period, in response to a natural language instruction input by a user, historical dialogue data in the session period is obtained; generating an independent semantic expression instruction corresponding to the natural language instruction according to the historical dialogue data; and executing the independent semantic expression instruction, and obtaining a corresponding execution result. Therefore, the recognition accuracy of the intelligent system on the user intention can be remarkably improved, meanwhile, the interaction cost of the user is remarkably reduced, and the interaction efficiency and the user experience in a multi-round dialogue scene are improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of computers, and in particular to a data processing method and device and an intelligent system. BACKGROUND

[0002] In the scenario of multi-round dialogue interaction between a user and a traditional intelligent system, the context dependency problem is one of the core bottlenecks that restrict the user experience and the practicability of the intelligent system. Although the existing technology realizes preliminary dialogue state tracking through intent detection and slot filling, it still has significant defects in the processing of context, which are specifically manifested as follows:

[0003] The traditional intelligent system lacks the ability to analyze the anaphora, semantic omission, etc. in the user input instruction in multi-round dialogue. For example, when the user inputs "extract data in column A with sales exceeding 1000" in the first round and "summarize these data by month" in the second round, the traditional intelligent system cannot analyze the anaphora of "these data", which easily leads to misjudgment of the user's intent and deviates from the user's real demand; or, the user is forced to repeatedly input the complete operation object (such as "extract data in column A with sales exceeding 1000, and summarize by month"), which not only increases the interaction redundancy, but also significantly increases the user's operation complexity, thereby greatly reducing the interaction efficiency. SUMMARY

[0004] The present application provides a data processing method, device and intelligent system to solve the technical problems that the traditional intelligent system is prone to misjudgment of the user's intent, low interaction efficiency and poor user experience in the multi-round dialogue interaction scenario.

[0005] In a first aspect, the present application provides a data processing method, which comprises:

[0006] During a conversation, in response to a natural language instruction input by a user, historical dialogue data in the conversation is acquired;

[0007] According to the historical dialogue data, an independent semantic expression instruction corresponding to the natural language instruction is generated;

[0008] The independent semantic expression instruction is executed, and a corresponding execution result is acquired.

[0009] In a possible implementation, the acquisition of the historical dialogue data in the conversation comprises:

[0010] The historical dialogue data in a set historical time range in the conversation is acquired;

[0011] And / or, the historical dialogue data in a set round in the conversation is acquired.

[0012] In a possible implementation, the method further includes:

[0013] identifying a number of characters in the natural language instruction; determining the historical time range and / or the round according to the number of characters;

[0014] Alternatively, identifying a historical behavior pattern of the user during the session; determining the historical time range and / or the round according to the historical behavior pattern.

[0015] In a possible implementation, the generating, according to the historical dialogue data, of the independent semantic expression instruction corresponding to the natural language instruction includes:

[0016] identifying context-related expression data existing in the natural language instruction;

[0017] extracting, according to an expression type of the context-related expression data, a relevant object corresponding to the context-related expression data from the historical dialogue data;

[0018] rewriting the context-related expression data in the natural language instruction into the relevant object, and determining the rewritten natural language instruction as the independent semantic expression instruction.

[0019] In a possible implementation, before the generating, according to the historical dialogue data, of the independent semantic expression instruction corresponding to the natural language instruction, the method further includes:

[0020] performing correlation discrimination between the natural language instruction and the historical dialogue data;

[0021] in a case where it is determined that the natural language instruction is correlated with the historical dialogue data, performing the generating, according to the historical dialogue data, of the independent semantic expression instruction corresponding to the natural language instruction and the subsequent steps;

[0022] in a case where it is determined that the natural language instruction is not correlated with the historical dialogue data, executing the natural language instruction and obtaining a corresponding execution result.

[0023] In a possible implementation, the performing of the correlation discrimination between the natural language instruction and the historical dialogue data includes:

[0024] determining a first probability of system response under a condition of the natural language instruction and the historical dialogue data being given, and determining a second probability of system response under a condition of only the natural language instruction being given;

[0025] determining a difference between the first probability and the second probability.

[0026] determining that the natural language instruction is related to the historical dialogue data, in a case where the absolute value of the difference is greater than or equal to a preset threshold value;

[0027] determining that the natural language instruction is not related to the historical dialogue data, in a case where the absolute value of the difference is less than the preset threshold value.

[0028] In a possible implementation, the executing the independent semantic expression instruction and obtaining a corresponding execution result comprises:

[0029] determining the intent category of the user according to the independent semantic expression instruction;

[0030] determining a target downstream tool from a preset downstream tool set according to the intent category of the user;

[0031] sending the independent semantic expression instruction to the target downstream tool for execution to obtain an execution result of the target downstream tool.

[0032] In a possible implementation, the determining a target downstream tool from a preset downstream tool set according to the intent category of the user comprises:

[0033] searching a preset intent category and downstream tool correspondence set with the intent category of the user as a keyword;

[0034] in a case where a target correspondence containing the keyword is found from the correspondence set, determining a downstream tool in the target correspondence as the target downstream tool;

[0035] in a case where a target correspondence containing the keyword is not found from the correspondence set, determining a specified downstream tool as the target downstream tool.

[0036] In a possible implementation, the sending the independent semantic expression instruction to the target downstream tool for execution to obtain an execution result of the target downstream tool comprises:

[0037] generating an executable instruction corresponding to the target downstream tool according to the independent semantic expression instruction;

[0038] sending the executable instruction to the target downstream tool for execution to obtain an execution result of the target downstream tool.

[0039] In a second aspect, the present application provides an intelligent system, which comprises:

[0040] a memory management module, configured to acquire historical dialogue data in a session period in response to a natural language instruction input by a user during the session period;

[0041] a context understanding module, configured to generate an independent semantic expression instruction corresponding to the natural language instruction according to the historical dialogue data;

[0042] a downstream execution module, configured to execute the independent semantic expression instruction and acquire a corresponding execution result.

[0043] In a possible implementation, the historical dialogue data comprises a data combination of a user role, an assistant role, and a function response;

[0044] The data of the user role comprises the natural language instruction input by the user;

[0045] The data of the assistant role comprises reasoning data and action data of the intelligent system in processing the natural language instruction input by the user, wherein the reasoning data is used to show a process in which the intelligent system performs logical analysis and judgment based on a current state and context information, and the action data is used to indicate specific operations to be taken by the intelligent system and required input information;

[0046] The data of the function response comprises the execution result.

[0047] In a possible implementation, the context understanding module is trained in the following manner:

[0048] acquiring a training sample set;

[0049] performing augmentation processing on the training sample set; wherein the augmentation processing on the training sample set comprises: performing sentence rewriting on the natural language instruction in an original training sample in the training sample set, constructing a new training sample by using the sentence-rewritten natural language instruction and a training label in the original training sample, and classifying the new training sample into the training sample set;

[0050] training an initial intelligent module by using the augmented training sample set to obtain the context understanding module.

[0051] In a third aspect, the present application provides a data processing apparatus, comprising:

[0052] a historical data acquisition module, configured to acquire historical dialogue data in a session period in response to a natural language instruction input by a user during the session period;

[0053] an instruction rewriting module, configured to generate an independent semantic expression instruction corresponding to the natural language instruction according to the historical dialogue data;

[0054] an instruction execution module, configured to execute the independent semantic expression instruction and obtain a corresponding execution result.

[0055] In a possible implementation, the historical data obtaining module is specifically configured to:

[0056] obtain historical dialogue data in a set historical time range during the session;

[0057] and / or obtain historical dialogue data in a set round during the session.

[0058] In a possible implementation, the historical data obtaining module is further configured to:

[0059] identify a number of characters in the natural language instruction; and determine the set historical time range and / or the set round according to the number of characters;

[0060] or identify a historical behavior pattern of the user during the session; and determine the set historical time range and / or the set round according to the historical behavior pattern.

[0061] In a possible implementation, the instruction rewriting module comprises:

[0062] an identifying unit, configured to identify context-related expression data existing in the natural language instruction;

[0063] an extracting unit, configured to extract, according to an expression type of the context-related expression data, a relevant object corresponding to the context-related expression data from the historical dialogue data;

[0064] a rewriting unit, configured to rewrite the context-related expression data in the natural language instruction into the relevant object, and determine the rewritten natural language instruction as the independent semantic expression instruction.

[0065] In a possible implementation, the apparatus further comprises:

[0066] a determining module, configured to determine relevance between the natural language instruction and the historical dialogue data before the independent semantic expression instruction corresponding to the natural language instruction is generated according to the historical dialogue data;

[0067] the instruction rewriting module is configured to, in a case where it is determined that the natural language instruction is relevant to the historical dialogue data, execute the generation of the independent semantic expression instruction corresponding to the natural language instruction according to the historical dialogue data and the subsequent steps.

[0068] The instruction execution module is further configured to execute the natural language instruction and obtain a corresponding execution result in a case where it is determined that the natural language instruction is irrelevant to the historical dialogue data.

[0069] In a possible implementation, the determination module is specifically configured to:

[0070] determine a first probability that a system generates a response under a condition that the natural language instruction and the historical dialogue data are given, and determine a second probability that the system generates the response under a condition that only the natural language instruction is given;

[0071] determine a difference between the first probability and the second probability;

[0072] determine that the natural language instruction is relevant to the historical dialogue data in a case where an absolute value of the difference is greater than or equal to a preset threshold value;

[0073] determine that the natural language instruction is irrelevant to the historical dialogue data in a case where the absolute value of the difference is less than the preset threshold value.

[0074] In a possible implementation, the instruction execution module includes:

[0075] an intent identification unit configured to determine an intent category of the user according to the independent semantic expression instruction;

[0076] a tool determination unit configured to determine a target downstream tool from a preset set of downstream tools according to the intent category of the user;

[0077] an instruction execution unit configured to send the independent semantic expression instruction to the target downstream tool for execution, to obtain an execution result of the target downstream tool.

[0078] In a possible implementation, the tool determination unit is specifically configured to:

[0079] search a preset set of corresponding relationships between intent categories and downstream tools by using the intent category of the user as a keyword;

[0080] determine a downstream tool in a target corresponding relationship containing the keyword as the target downstream tool in a case where the target corresponding relationship is found from the set of corresponding relationships;

[0081] determine a specified downstream tool as the target downstream tool in a case where the target corresponding relationship containing the keyword is not found from the set of corresponding relationships.

[0082] In a possible implementation, the instruction execution unit is specifically configured to:

[0083] Generating executable instructions corresponding to the target downstream tool according to the independent semantic expression instructions;

[0084] The executable instruction is sent to the target downstream tool for execution, and an execution result of the target downstream tool is obtained.

[0085] In a fourth aspect, the present application provides an electronic device comprising: a processor and a memory, wherein the processor is configured to execute a data processing program stored in the memory to implement the data processing method described in any one of the first aspects.

[0086] In a fifth aspect, the present application provides a storage medium storing one or more programs, which can be executed by one or more processors to implement the data processing method described in any one of the first aspects.

[0087] The above-mentioned technical solution provided by the embodiment of the present application has the following advantages over the prior art: the method provided by the embodiment of the present application, by obtaining historical conversation data during the conversation in response to the natural language instructions input by the user during the conversation, and generating an independent semantic expression instruction corresponding to the natural language instruction currently input by the user based on the historical conversation data, executing the independent semantic expression instruction, and obtaining the corresponding execution result, thereby realizing automatic context association in the multi-round conversation process. This association eliminates the risks of reference ambiguity and semantic omission in the current natural language instruction by making the current natural language instruction dependent on the historical instruction visible, thereby significantly improving the intelligent system's recognition accuracy of user intentions, and at the same time significantly reducing the interaction cost of the user repeatedly entering instructions due to the intelligent system's misunderstanding or misunderstanding, avoiding redundant conversation rounds, and improving the interaction efficiency and user experience in multi-round conversation scenarios. BRIEF DESCRIPTION OF THE DRAWINGS

[0088] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0089] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0090] One or more embodiments are exemplarily illustrated by pictures in the corresponding drawings. These exemplifications do not constitute limitations on the embodiments. Elements with the same reference numerals in the drawings are represented as similar elements. Unless otherwise stated, the figures in the drawings do not constitute proportional limitations.

[0091] Figure 1 An embodiment flow chart of a data processing method provided for an embodiment of the present application is provided.

[0092] Figure 2 An embodiment flow chart of another data processing method provided for an embodiment of the present application is provided.

[0093] Figure 3 An embodiment flow chart of another data processing method provided for an embodiment of the present application is provided.

[0094] Figure 4 An embodiment flow chart of another data processing method provided for an embodiment of the present application is provided.

[0095] Figure 5 A structural schematic diagram of an intelligent system provided for an embodiment of the present application is provided.

[0096] Figure 6 An embodiment block diagram of a data processing device provided for an embodiment of the present application is provided.

[0097] Figure 7 A structural schematic diagram of an electronic device provided for an embodiment of the present application is provided. DETAILED DESCRIPTION

[0098] To make the objectives, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be described below in connection with the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative work fall within the scope of protection of the present application.

[0099] The following disclosure provides many different embodiments, or examples, for implementing different structures of the present application. For the purpose of simplicity, the components and arrangements of the various examples are described in the following detailed description. These are, of course, merely examples and are not intended to limit the application. Also, the present application can be implemented in different examples having different components and / or arrangements. Such variations would be obvious to one skilled in the art and have been included in the application described and claimed herein. Therefore, such variations are not reviewed in detail.

[0100] To solve the technical problems that the conventional intelligent system is prone to misjudge the user's intention, low in interaction efficiency and poor in user experience in the multi-round dialogue interaction scene, the present application provides a data processing method, device and intelligent system, which can significantly improve the recognition accuracy of the intelligent system for the user's intention, significantly reduce the interaction cost of the user, improve the interaction efficiency and user experience in the multi-round dialogue scene.

[0101] Figure 1 An embodiment flowchart of a data processing method provided by an embodiment of the present application. As shown in the figure, the method comprises the following steps: Figure 1

[0102] Step 101, during a conversation, historical dialogue data during the conversation is acquired in response to a natural language instruction input by a user.

[0103] The above "conversation" refers to a continuous and complete interaction process between a user and an intelligent system (such as an intelligent assistant, an intelligent robot), starting from the user actively initiating a dialogue with the intelligent system, and ending until the dialogue ends, forming a closed loop cycle. Specifically, the starting point of a conversation usually manifests as the user taking a specific operation to open a new dialogue scenario, such as starting an intelligent system application, and sending a natural language instruction to the system, or clicking on the "+ new dialogue" icon on the intelligent system interface. The termination of a conversation can be triggered by multiple conditions. One condition is that the user actively ends the current dialogue, such as the user choosing to close the intelligent system application, or clicking on the "+ new dialogue" icon on the intelligent system interface to start a new conversation. Another condition is that the user response times out, that is, the user does not input any new instruction or feedback to the system within a long period of time, and the intelligent system judges that there is no further interaction demand for the current conversation, and thus ends the conversation.

[0104] During the conversation, the natural language instruction input by the user to the intelligent system has a diversified form of expression, which can be in text form, that is, directly inputting the text content in the input box of the intelligent system interface, or in voice form, that is, expressing through a voice input device (such as a microphone). When the natural language instruction input by the user is in voice form, the intelligent system needs to use voice recognition technology to accurately convert the voice instruction into text form, so as to subsequently perform semantic understanding and processing.

[0105] Further, each round of dialogue data constitutes a basic component unit of the conversation, and records the complete information of the user and the intelligent system in one round of interaction, including but not limited to the following information:

[0106] The natural language instruction input by the user, which is a direct manifestation of the user's intention, is in text or converted text form, and clearly expresses the task that the user wants the intelligent system to complete or the information that the user wants to obtain;

[0107] The reply or feedback given by the intelligent system, which is generated by the intelligent system according to the understanding of the natural language instruction input by the user, in combination with the knowledge base and algorithm model of the intelligent system, to provide the user with a solution, an answer to a question, or a result feedback after executing a specific operation;

[0108] ​Possible contextual information, which provides rich background support for understanding the current conversation, can cover specific options selected by the user during the conversation (for example, function items selected in the menu), intermediate results generated by the intelligent system during processing of the user's request (for example, stage values derived in the calculation task), etc. Through comprehensive analysis of these contextual information, the intelligent system can more accurately grasp the user's intention, and realize more natural and smooth conversation interaction.

[0109] The historical conversation data within the current session period refers to the conversation data occurring before the current input natural language instruction within the current session period. Here, the intelligent system responds to the natural language instruction input by the user, and does not immediately execute the natural language instruction, but acquires one or more rounds of historical conversation data within the current session period, aiming to understand the demand evolution and interaction context of the user during the entire conversation process, to provide a solid data foundation for subsequent conversation processing, intention understanding and accurate reply, thereby improving the efficiency and quality of the user's interaction with the intelligent system.

[0110] In an embodiment, an exemplary implementation of acquiring the historical conversation data within the session period includes acquiring the historical conversation data within the session period within a set historical time range.

[0111] Among them, the set historical time range is a time window with the current time point (i.e. the time point of the user's current input natural language instruction) as the cutoff time. Based on this, acquiring the historical conversation data within the set historical time range within the session period means acquiring the conversation data in the recent period of time, so as to ensure that the intelligent system can preferentially refer to the historical conversation data most close to the current conversation when processing the natural language instruction input by the user at present, which helps the intelligent system to more accurately capture the user's current intention, and avoid the interference caused by introducing too far away, which may no longer be relevant, conversation data. Moreover, by limiting the time range of the historical conversation data, the intelligent system does not need to process all the conversation records within the entire session period, thereby effectively reducing the amount of data to be processed, and further reducing the consumption of computing resources, and improving the response speed of the intelligent system.

[0112] Optionally, the specific time span of the set historical time range can be a fixed time length, such as the last 10 minutes, half an hour, etc., or a dynamically adjusted time length. Specifically, the time span of the set historical time range can be flexibly adjusted according to actual application scenarios and user needs. For example, in a complex dialogue scenario that requires in-depth understanding, the time span of the set historical time range can be appropriately increased to retain more context information; while in a scenario with high real-time requirements, the system performance can be optimized by shortening the time span of the set time range. Alternatively, an intelligent approach can be used to dynamically adjust the time span of the set historical time range according to the characteristics of the current session.

[0113] In one optional implementation, the number of characters in the natural language instruction input by the user is identified; and the set historical time range is determined according to the number of characters.

[0114] Generally speaking, the number of characters in a natural language instruction can reflect the complexity of a task to some extent. A complex task often requires more description and details, so the user may input a longer natural language instruction. The increase in task complexity means that the intelligent system may need to refer to more historical dialogue data when processing, in order to fully grasp the task background and requirements. Therefore, the time span of the set historical time range can be reasonably determined according to the number of characters as an indicator, to ensure that the intelligent system obtains sufficient and relevant context information.

[0115] For example, a quantitative fitting formula can be constructed between the number of characters and the time span of the set historical time range, then the number of characters in the natural language instruction input by the user is substituted into the quantitative fitting formula, to obtain the corresponding time span of the set historical time range, so as to determine the set historical time range with the current time point as the cut-off time point of the set historical time range. The quantitative fitting formula is, for example, a linear fitting formula, the core logic of which is that the number of characters increases by a fixed amount, and the time span also increases linearly by a fixed proportion. In addition, a basic time span is set to ensure that the intelligent system can obtain a certain amount of historical dialogue data in the case that the number of characters in the natural language instruction input by the user is relatively small, to meet the basic understanding needs. Of course, in actual applications, other forms of quantitative fitting formulas, such as piecewise function fitting formulas, can also be used, which are not limited by the embodiments of the present application.

[0116] As another optional implementation, the historical behavior pattern of the user during the session is identified; and the set historical time range is determined according to the historical behavior pattern.

[0117] Generally speaking, the historical behavior pattern of a user can reflect his current conversation demand and intention tendency to some extent. For example, when a user frequently initiates a question, it usually means that he has a strong information demand for the current discussion topic, and the problems involved may have the characteristics of multi-dimension and strong correlation. In this case, in order to accurately and comprehensively understand the user's intention, the intelligent system obtains historical conversation data in a longer time range as auxiliary reference. Sufficient historical context information helps the intelligent system to sort out the logical clues of the user's question, link the correlation between different problems, and then provide coherent and comprehensive answers to meet the user's in-depth exploration demand. On the contrary, if the user's question frequency is low during the conversation, it may indicate that his demand is relatively simple and direct, and the conversation revolves around a specific topic, without the need to trace back to too much historical information. At this time, obtaining the historical conversation data of the last one or several rounds can provide enough and relevant context information for the intelligent system to understand the current conversation background, avoid increasing the system processing burden due to the introduction of a large amount of redundant data, and ensure the efficient operation of the system.

[0118] Based on this, the time span of the historical time range can be reasonably determined according to the historical behavior pattern of the user during the conversation period. Exemplarily, a quantitative fitting formula between the historical behavior pattern (such as the question frequency) of the user and the time span of the historical time range can be constructed. Then, the historical behavior pattern (such as the question frequency) of the user during the conversation period is substituted into the quantitative fitting formula, and the corresponding time span of the historical time range is obtained, so as to determine the historical time range with the current time point as the cutoff time point of the historical time range. For example, a linear fitting formula is used, and the core logic is that the question frequency of the user increases by a fixed value, and the time span increases by a fixed proportion linearly, so as to adapt to the demand for more historical information under high question frequency. At the same time, a basic time span is set to ensure that the intelligent system can obtain a certain amount of historical conversation data under the condition that the user's question frequency is very low, and meet the basic understanding demand. Of course, in actual application, other forms of quantitative fitting formulas can also be used, such as a piecewise function fitting formula, which is not limited in the embodiments of the present application.

[0119] In another embodiment, an exemplary implementation of obtaining the historical conversation data during the conversation period includes: obtaining the historical conversation data within the set round within the conversation period.

[0120] Specifically, the historical dialogue data of the most recent set of rounds occurring during the session is acquired to ensure that the intelligent system can prioritize the historical dialogue data most relevant to the current dialogue when processing the natural language instruction input by the user, which helps the intelligent system to more accurately capture the current intent of the user and avoid interference caused by introducing dialogue data that is too far in the past and may no longer be relevant. Moreover, by limiting the time range of the historical dialogue data, the intelligent system does not need to process all dialogue records during the entire session, thereby effectively reducing the amount of data to be processed, and further reducing the consumption of computing resources and improving the response speed of the intelligent system.

[0121] Optionally, the set of rounds can be a fixed number of rounds, such as the most recent 2 rounds, 3 rounds, etc., or a dynamically adjusted number of rounds. Specifically, the set of rounds can be flexibly adjusted according to actual application scenarios and user needs. For example, in a complex dialogue scenario that requires in-depth understanding, the set of rounds can be appropriately increased to retain more context information; and in a scenario with high real-time requirements, the system performance can be optimized by shortening the set of rounds. Alternatively, an intelligent manner can be used to flexibly adjust the set of rounds according to the characteristics of the current session.

[0122] In one optional implementation, the number of characters of the natural language instruction input by the user is identified, and the set of rounds is determined according to the number of characters. In another optional implementation, the historical behavior pattern of the user during the session is identified, and the set of rounds is determined according to the historical behavior pattern.

[0123] As described above, the number of characters of the natural language instruction input by the user and the set of rounds are positively correlated, and the frequency of the user's questions and the set of rounds are also positively correlated. As for the specific manner of dynamically setting the set of rounds according to the number of characters of the natural language instruction input by the user or the historical behavior pattern of the user during the session, reference can be made to the description above, which will not be repeated here.

[0124] In yet another embodiment, the two embodiments above can be combined. Illustratively, the historical dialogue data in the session period is obtained by first obtaining historical dialogue data in a set historical time range in the session period, if the number of rounds of historical dialogue data in the set historical time range exceeds a set value, the historical dialogue data of the latest rounds (the number of rounds is the aforementioned set value) is truncated in reverse order of time; if the number of rounds of historical dialogue data in the set historical time range does not exceed the aforementioned set value, all historical dialogue data in the set historical time range is retained. In addition, in the case where the number of rounds of historical dialogue data in the set historical time range is less (for example, less than a minimum round requirement value), the time range can be automatically expanded to make up for the minimum round requirement.

[0125] In addition, the technical solutions provided by the above embodiments are only exemplary implementations of obtaining historical dialogue data in a session period. In actual applications, there can be other obtaining methods, for example, obtaining historical dialogue data of a specified number of rounds, which has semantic association with the natural language instruction currently input by the user, in reverse order of time. This means that historical dialogue data of rounds directly related to the current intention of the user is preferentially obtained, thereby ensuring that the recalled context directly serves the current user intention analysis and task execution, and avoiding noise interference of irrelevant dialogue. Illustratively, the natural language instruction currently input by the user and the historical dialogue data are semantically represented (such as converted into vectors or semantic labels), and then historical dialogue data having semantic association with the natural language instruction currently input by the user is identified by similarity matching or semantic association degree calculation. The embodiments of the present application do not limit this.

[0126] Step 102, generating an independent semantic expression instruction corresponding to the natural language instruction according to the historical dialogue data.

[0127] In the scenario of multiple rounds of dialogue in a session, the natural language instruction input by the user often has context dependence on the previous dialogue, such as pronoun reference, omitted semantic supplement, etc. For example, the natural language instruction input by the user in the first round of dialogue is "please extract all the name data in column A", and the natural language instruction input by the user in the second round of dialogue is "sort these data in alphabetical order". Among them, "these data" actually refers to the name data in column A extracted in the previous round, and the real intention of the user in the second round of dialogue is to sort the name data in column A in alphabetical order.

[0128] If the context is detached and only the current isolated sentence "sort these data in alphabetical order" is analyzed, "these data" may be misjudged as a fuzzy object introduced in the current round, rather than the name data in column A, thereby causing user intention understanding deviation.

[0129] To solve the above problems, the core goal of step 102 is to: according to the historical dialogue data, the semantic decoupling and explicit reconstruction of the natural language instruction input by the user at present, generate a complete semantic expression instruction independent of the context, in order to preserve the context coherence of the dialogue, provide unambiguous input for the subsequent user intention understanding, task execution and other downstream modules, so as to significantly improve the usability and user experience of intelligent system in multi-round dialogue scene.

[0130] For example, according to the natural language instruction input by the user in the first round of dialogue in the above example, the natural language instruction input by the user in the second round of dialogue is rewritten as an independent semantic expression instruction "please sort all the name data in column A in alphabetical order".

[0131] As to how to generate an independent semantic expression instruction corresponding to the natural language instruction according to the historical dialogue data, the detailed explanation and description are made in the following Figure 3 The specific implementation is not described here.

[0132] Step 103, execute the above independent semantic expression instruction and obtain the corresponding execution result.

[0133] After completing steps 101 and 102, and completing the generation of the independent semantic expression instruction of the natural language instruction input by the user at present, the core task of step 103 is to convert this explicit reconstruction, unambiguous context independent semantic instruction into executable system operation, and obtain the corresponding execution result.

[0134] The technical scheme provided by the embodiment of the application realizes the automatic association of context in the multi-round dialogue process by responding to the natural language instruction input by the user during the conversation, obtaining the historical dialogue data during the conversation, and generating an independent semantic expression instruction corresponding to the natural language instruction input by the user at present according to the historical dialogue data, executing the independent semantic expression instruction, and obtaining the corresponding execution result. This association eliminates the risk of reference ambiguity and semantic omission in the current natural language instruction by showing the dependence of the current natural language instruction on the historical instruction, thereby significantly improving the recognition accuracy of the intelligent system for user intention, significantly reducing the interaction cost of repeated input instructions by the user due to misunderstanding or misinterpretation of the intelligent system, avoiding redundant dialogue rounds, improving the interaction efficiency and user experience in the multi-round dialogue scene.

[0135] Figure 2 Another embodiment of the data processing method provided by the embodiment of the application is provided. Figure 2 The flowchart of the embodiment of the data processing method provided by the embodiment of the application is shown in Figure 1 The flowchart of the embodiment of the data processing method provided by the embodiment of the application is shown in

[0136] Step 201, during the session, in response to a natural language instruction input by a user, obtaining historical dialogue data during the session.

[0137] For detailed description of step 201, please refer to the relevant description in the flowchart shown in Figure 1 For detailed description of step 201, please refer to the relevant description in the flowchart shown in

[0138] Step 202, correlation between the natural language instruction and the historical dialogue data is determined; if it is determined that the natural language instruction and the historical dialogue data are correlated, step 203 is performed; if it is determined that the natural language instruction and the historical dialogue data are not correlated, step 205 is performed.

[0139] Step 203, according to the historical dialogue data, an independent semantic expression instruction corresponding to the natural language instruction is generated.

[0140] Step 204, the independent semantic expression instruction is executed, and the corresponding execution result is obtained.

[0141] Step 205, the natural language instruction is executed, and the corresponding execution result is obtained.

[0142] For the convenience of understanding, the following unified explanation and description are made for steps 202 to 205:

[0143] In the multi-round dialogue interaction scenario, there are two modes of natural language instructions input by the user: context-dependent type (such as pronoun reference, omitted semantics, task continuation, etc.) and independent instruction type (such as new task initiation, history-independent query, etc.). Accordingly, in order to avoid waste of system resources or misjudgment of intention caused by excessive analysis of irrelevant context, the present application embodiment proposes a shunting mechanism through correlation discrimination and dynamic execution, to realize the balance between accuracy and efficiency of dialogue processing, and the specific logic is as follows:

[0144] First, the correlation between the natural language instruction input by the user and the historical dialogue data is determined to identify whether the current natural language instruction depends on the information (such as operation object, task target, state constraint, etc.) in the previous dialogue. In the case where it is determined that the current natural language instruction and the historical dialogue data are correlated, an independent semantic expression instruction corresponding to the current natural language instruction is generated according to the historical dialogue data, to perform semantic completion and disambiguation on the current natural language instruction, and then the independent semantic expression instruction is executed, and the corresponding execution result is obtained. In the case where it is determined that the current natural language instruction and the historical dialogue data are not correlated, context analysis and semantic reconstruction are skipped, and the natural language instruction input by the user is directly executed, and the corresponding execution result is obtained.

[0145] By correlation discrimination to filter irrelevant context, the instruction miswriting caused by the wrong tracing of historical dialogue can be avoided, and the accuracy of intent understanding can be improved.

[0146] In an embodiment, an exemplary implementation of correlation discrimination between the current natural language instruction input by the user and the historical dialogue data includes: determining a first probability that the system generates a response under the condition of the given natural language instruction and historical dialogue data, and determining a second probability that the system generates a response under the condition of only the given natural language instruction; determining the difference between the first probability and the second probability; determining that the natural language instruction and the historical dialogue data are correlated in the case that the absolute value of the difference is greater than or equal to a preset threshold; and determining that the natural language instruction and the historical dialogue data are not correlated in the case that the absolute value of the difference is less than the preset threshold. Wherein, the system generating a response refers to that the system finally obtains an actual execution result through a series of internal processing procedures, and the actual execution result can be presented to the user in the form of text reply, operation instruction, data output, etc.

[0147] The correlation between the natural language instruction and the historical dialogue data can mean that the part of the natural language instruction lacking reference relationship can be directly or indirectly obtained according to the historical dialogue data, or the part of the natural language instruction performing semantic omission can be directly or indirectly supplemented according to the historical dialogue data, etc.

[0148] The embodiment compares the probability difference of the system response in the context-dependent scene and the independent instruction scene to determine whether the current natural language instruction depends on the historical dialogue data, so as to determine the subsequent processing strategy, i.e. whether to generate an independent semantic expression instruction.

[0149] Wherein, the first probability that the system generates a response under the condition of the given current natural language instruction and historical dialogue data reflects the confidence of the system generating a response when the current natural language instruction depends on the historical context; and the second probability that the system generates a response under the condition of only the given current natural language instruction reflects the confidence of the system generating a response when the current natural language instruction is independent of the historical context. If the absolute value of the difference between the first probability and the second probability is greater than or equal to a preset threshold, it means that the historical dialogue data significantly affects the probability of the system generating a response, so that it can be determined that the current natural language instruction and the historical dialogue data are correlated. On the contrary, if the absolute value of the difference between the first probability and the second probability is less than the preset threshold, it means that the historical dialogue data has less impact on the probability of the system generating a response, so that it can be determined that the current natural language instruction and the historical dialogue data are not correlated.

[0150] As an optional implementation, by a language model, a large language model meta artificial intelligence or a conditional random field model, in combination with historical dialogue data and semantic representation of the current natural language instruction, a conditional probability, i.e., a first probability, can be calculated and represented as the following formula (I):

[0151]

[0152] wherein y t:k represents the kth word of the tth round of dialogue, 1:k-1 represents the first k-1 words, Q t represents the current tth round of user input, R t represents the current tth round of system response.

[0153] H t-1 ={(Q1, R1), (Q2, R2),..., (Q t-1 , R t-1 )} represents the historical dialogue data of the first t-1 rounds.

[0154] Similarly, given only the current natural language instruction, a process of calculating a conditional probability, i.e., a second probability, can be represented as the following formula (II):

[0155]

[0156] The above embodiment realizes accurate quantification of the relevance between the current input natural language instruction of the user and the historical dialogue data by a probability difference discrimination mechanism, provides a reliable basis for subsequent context explicit processing or independent instruction execution, and significantly improves the intent understanding accuracy and execution efficiency of the multi-round dialogue system.

[0157] In another embodiment, an exemplary implementation of relevance discrimination between the current input natural language instruction of the user and the historical dialogue data includes: determining the similarity (such as cosine similarity, Euclidean distance, Kubo coefficient, etc.) between the natural language instruction and the historical dialogue data; in the case where the similarity is greater than or equal to a similarity threshold, determining that the natural language instruction and the historical dialogue data are relevant; in the case where the similarity is less than the similarity threshold, determining that the natural language instruction and the historical dialogue data are not relevant. In this way, the relevance between the two can be determined by the above similarity discrimination method, thereby providing a reliable basis for subsequent context explicit processing or independent instruction execution, and significantly improving the intent understanding accuracy and execution efficiency of the multi-round dialogue system.

[0158] Figure 2The flow shown can avoid instruction miswriting caused by error tracing historical dialogue, and improve the accuracy of intelligent system understanding user intent, by correlating the natural language instruction currently input by the user with the historical dialogue data, and then dynamically executing the shunting mechanism according to the correlation discrimination result.

[0159] Figure 3 An embodiment flowchart of another data processing method provided by the embodiment is shown. Figure 3 The flow shown in Figure 1 and Figure 2 Based on the flow shown, an example implementation of generating an independent semantic expression instruction corresponding to the natural language instruction currently input by the user according to the historical dialogue data is described. It includes the following steps:

[0160] Step 301, identifying context-related expression data existing in the natural language instruction currently input by the user.

[0161] Step 302, extracting a relevant object corresponding to the context-related expression data from the historical dialogue data during the current session according to the expression type of the context-related expression data.

[0162] Step 303, rewriting the context-related expression data in the natural language instruction to the relevant object, and determining the rewritten natural language instruction as an independent semantic expression instruction.

[0163] For ease of understanding, the following unified explanation and description are made for steps 301 to 303:

[0164] In general, steps 301 to 303 constitute a complete context understanding and instruction rewriting flow, aiming to eliminate the context dependence in the instruction and convert it into a semantic-independent instruction for subsequent module processing.

[0165] Specifically, step 301 is first executed, and the core goal of step 301 is to identify context-related expression data existing in the natural language instruction currently input by the user, and to complete the context dependence identification work. Optionally, by means of pronoun analysis, omission recovery, and entity co-reference resolution, etc. Natural language processing techniques, accurately locate the implicit dependent items in the current instruction that have semantic association with historical dialogue, i.e. context-related expression data.

[0166] Among them, pronoun analysis is for pronouns such as "these", "it", "the above", etc. By analyzing the semantic direction of the pronoun in the sentence and its association with the historical dialogue, the actual content it refers to is determined. For example, when "these data" appears in the instruction, the system will trace back the historical dialogue to determine which data "these" refers to.

[0167] Ellipsis recovery is to handle the ellipsis cases in the input instruction, including the completion of verbs and objects. In natural language communication, users often omit some information, and the system needs to supplement it according to the context to recover the complete semantics of the instruction.

[0168] Entity coreference resolution is to identify and resolve the same entity referred to by different expressions. In multi-turn dialogue, the same entity may appear in different forms, and the system needs to determine the association between these expressions to accurately understand the meaning of the instruction.

[0169] After identifying the context-related expression data in the user's current natural language instruction, step 302 extracts the corresponding relevant objects from the historical dialogue data during the current session according to the expression type of these data. The expression type of the context-related expression data mainly covers two cases: reference and ellipsis.

[0170] Taking the table business scenario as an example, in the table business scenario, reference also contains multiple forms, which are discussed as follows:

[0171] Table area reference: Referring to the table area corresponding to the previous input, or the new table area after operating the table. For example, after the first input "Please extract all the name data in column A", the second input "Sort these data in alphabetical order", "these data" refers to the name data in column A extracted in the previous round; if the first round performs table operations such as "Delete duplicate rows in column 3", the second round "Sort the remaining content by sales from high to low", "remaining content" refers to the new third column after operation, and the system needs to extract this area from the historical dialogue as the relevant object.

[0172] Conditional expression reference: Conditions commonly used in table queries, such as greater than a certain value, less than a certain value, containing certain text, etc., may also be referred to in multi-turn dialogue. For example, the first input "Help me mark the students with math scores greater than 90", the second input "Copy them to a new table", "them" refers to "students with math scores greater than 90", and the system needs to extract the student set corresponding to this condition expression as the relevant object.

[0173] Calculation content reference: The results of formulas and functions commonly used in tables may be omitted in the next round of questions. For example, the first input "Calculate the average English score of each student", the second input "Filter out students with scores greater than 90 from these scores", the system needs to identify that "these scores" refer to the "average English score" calculated in the previous round, and extract the calculation result as the relevant object.

[0174] Omission case: The omission expression in the table is generally the omission of table operation action and the omission of table area. For example, the first round input is "filter mobile phones and washing machines", and the second round is "only mobile phones". Here, the action expression of the first round is omitted, and the system needs to extract the area corresponding to the action "filter mobile phones" (assuming that the first round filtering result contains mobile phone related data) as the relevant object. In addition, some spoken language conjunctions such as "first", "then", "after finding these products" and the like will be removed in the next round of rewriting, and the system will also ignore these conjunctions that do not affect the semantics when extracting the relevant object.

[0175] Figure 3 The flow shown, by identifying the context-related expression data existing in the natural language instruction input by the user at present, according to the expression type of the context-related expression data, extracts the relevant object corresponding to the context-related expression data from the historical dialogue data in the current session period, rewrites the context-related expression data in the above natural language instruction into the above relevant object, and determines the rewritten natural language instruction as an independent semantic expression instruction, realizes a complete context understanding and instruction rewriting process, and can accurately eliminate the context dependence in the current natural language instruction and convert it into a semantic independent instruction for subsequent module processing.

[0176] Figure 4 Another embodiment flowchart of a data processing method provided by the embodiment of the present application. Figure 4 The flow shown in Figure 1 and Figure 2 The flow shown in the embodiment of the present application is described on the basis of the example implementation of executing an independent semantic expression instruction and obtaining the corresponding execution result. It includes the following steps:

[0177] Step 401, determining the intent category of the user according to the independent semantic expression instruction.

[0178] Step 402, determining the target downstream tool from the preset downstream tool set according to the intent category of the user.

[0179] Step 403, sending the independent semantic expression instruction to the target downstream tool for execution to obtain the execution result of the target downstream tool.

[0180] For ease of understanding, the following unified explanation and description are made for steps 401 to 403:

[0181] In general, it can be seen from the description of steps 401 to 403 that, in the technical solution provided by the embodiments of the present application, different categories of user intentions are adapted to select various downstream tools to execute corresponding independent semantic expression instructions. Here, the downstream tool refers to a tool component in the intelligent system architecture that undertakes a specific function in the subsequent processing link. The key reason for adopting such a processing strategy is that different categories of user intentions have significant differences in semantic connotation, processing requirements, and target orientation.

[0182] Specifically, first in step 401, the intention category of the user is determined according to the independent semantic expression instruction. Exemplarily, the intention category of the user is determined according to the independent semantic expression instruction in a manner driven by a machine learning model. Specifically, a large number of instruction data sets with intention category labels are collected, a neural network model is built using a deep learning framework, the neural network model is trained using the foregoing data sets, and an intention classification model is obtained. Then, when a new independent semantic expression instruction is received, features are extracted from the independent semantic expression instruction, and the extracted feature vector is input into the trained intention classification model. The intention classification model outputs probability values of each intention category according to the learned patterns and features, and selects the category with the highest probability as the final determined user intention category. Exemplarily, the intention category of the user is determined in a rule matching manner. Specifically, a series of rules are defined for each intention category, and the rule form can be diversified, such as keyword matching rules, regular expression rules, semantic pattern rules, etc. The independent semantic expression instruction is parsed in syntax and semantics, and information such as keywords, phrases, sentence structures, etc. is extracted. These information are matched with the rules in the rule base one by one, and if a rule is met, the corresponding intention category is taken as a candidate. To improve the matching accuracy, rule priorities can be set, for example, accurate matching rules are higher than fuzzy matching rules. If multiple intention categories are matched, conflict resolution is performed according to rule priorities, context information, etc., and finally an intention category that best meets the user intention category is determined.

[0183] After step 401 is executed and the intention category of the user is determined, in step 402, the target downstream tool is determined from the preset downstream tool set according to the intention category of the user. As an optional implementation manner, exemplary implementation of determining the target downstream tool from the preset downstream tool set according to the intention category of the user includes: taking the intention category of the user as a keyword to search the preset correspondence relationship set between the intention category and the downstream tool; in the case that a target correspondence relationship containing the keyword is found from the correspondence relationship set, the downstream tool in the target correspondence relationship is determined as the target downstream tool. In addition, in the case that a target correspondence relationship containing the keyword is not found from the correspondence relationship set, a specified downstream tool is determined as the target downstream tool.

[0184] In the above implementation, by constructing the correspondence set of intent categories and downstream tools, efficient and accurate mapping of intent categories to downstream tools is achieved. The correspondence set is established based on in-depth analysis of user intent and various downstream tool functions, clearly defining the downstream tools adapted to different intent categories, ensuring that when an instruction with a determined intent category is received, the corresponding downstream tool can be quickly and accurately located to perform subsequent tasks.

[0185] In addition, a general tool fallback mechanism is provided, i.e., in the case where the target correspondence relationship containing the keyword is not found from the correspondence set, the specified downstream tool is determined as the target downstream tool. This mechanism fully considers unknown intent categories or newly emerging intent types that may occur in actual business scenarios, ensuring that the intelligent system can still maintain normal operation of basic functions when facing unexpected situations, avoiding system lag or incorrect responses due to unmatched intent categories, effectively improving the robustness and fault tolerance of the system, and providing users with a more stable and reliable service experience.

[0186] Subsequently, in step 403, the independent semantic expression instruction is sent to the target downstream tool for execution, and the execution result of the target downstream tool is obtained. As an optional implementation, an exemplary implementation of sending the independent semantic expression instruction to the target downstream tool for execution to obtain the execution result of the target downstream tool includes: generating an executable instruction corresponding to the target downstream tool according to the independent semantic expression instruction, sending the executable instruction to the target downstream tool for execution, and obtaining the execution result of the target downstream tool.

[0187] From a technical principle perspective, different downstream tools often have their own unique instruction set specifications, data format requirements, and running logic. The independent semantic expression instruction, as a semanticized carrier of user's original intent, contains the core information of user's demand, but usually cannot directly adapt to the "language environment" of the target downstream tool. Therefore, according to the independent semantic expression instruction, an executable instruction corresponding to the target downstream tool is generated. This process is equivalent to converting instructions understandable by humans or internal general semantic representations of the system into a language that the target downstream tool can understand and execute.

[0188] In terms of specific implementation process, the independent semantic expression instruction is first deeply analyzed. Using natural language processing techniques such as morphological analysis, syntactic analysis, and semantic role labeling, key entities (such as operation objects, parameter values, etc.), actions (such as querying, modifying, creating, etc.), and intent-related constraints in the instruction are extracted. Then, combined with the API documentation, instruction manuals, and other materials of the target downstream tool, a rule library for instruction mapping is constructed. The rule library clearly defines the correspondence between each element in the independent semantic expression instruction and the executable instruction elements of the target downstream tool, as well as the instruction generation logic under different semantic combinations.

[0189] Based on the above analysis results and mapping rule library, executable instructions corresponding to the target downstream tool are generated. This instruction strictly follows the syntax specification and data format requirements of the target downstream tool, ensuring its smooth execution in the target downstream tool. Subsequently, the executable instruction is sent to the target downstream tool for execution through a pre-set communication interface (such as HTTP request, message queue, remote procedure call, etc.). After receiving the instruction, the target downstream tool parses and processes the instruction according to its own business logic and data processing flow, ultimately completes the corresponding task and returns the execution result.

[0190] Through the above process, the independent semantic expression instruction can be accurately and efficiently executed in the target downstream tool, thereby obtaining reliable and accurate execution results and providing users with high-quality service experience.

[0191] Finally, taking the table processing scenario as an example, to enable the intelligent system to have both table operation and data question answering capabilities, the user intent is divided into four core intent categories: table operation, content processing, data question answering, and general bottom-up, combined with the characteristics of table business.

[0192] Among them, under the table operation intent category, adaptive JavaScript code is dynamically generated according to the user's specific question to directly implement operations on the table. This category covers common table operation functions such as conditional format setting, filter condition application, and sorting rule execution, ensuring that users can efficiently complete various complex table processing tasks through natural language instructions.

[0193] The content processing intent category focuses on the user's instruction batch processing needs and can accurately extract or generate information within the specified area range according to the user's instruction. Whether it is quickly locating and extracting specific fields from large-scale table data or generating new data content according to pre-set rules, this category can provide efficient and accurate solutions to meet users' diverse data processing needs.

[0194] Under the data question answering intent category, based on the Pandas library, the conversion from user input to Python code is realized. With this feature, the system not only can complete traditional table data query tasks, but also can further expand to the fields of simple data analysis and data visualization. Through deep mining and intuitive display of table data, it provides users with more insightful data decision support.

[0195] The general bottom-up intent category is used to cover those intents that are difficult to classify clearly, and the category includes some response functions of table operation related inquiries, general question and answer functions of users, etc. Through this bottom-up mechanism, it can be ensured that the system can still provide reasonable and effective feedback when facing various complex and unknown user intents, and the stability and usability of the system are maintained.

[0196] As can be seen, by integrating diversified downstream tools in the intelligent system, the intelligent system can have both table operation and data analysis capabilities, expanding the capability range of the intelligent system. At the same time, this integration mode gives the intelligent system high flexibility and scalability, and the downstream tools have pluggable characteristics, and can be conveniently added, replaced or removed according to actual business needs and scene changes. Through this flexible plugging mechanism, the built-in table processing and data analysis capabilities can be easily migrated to a new intelligent system, so that the intelligent system can realize more table functions and improve the intelligent table system.

[0197] Figure 4 As shown in the flow, by determining the intent category of the user according to the independent semantic expression instruction, and then determining the target downstream tool from the preset downstream tool set according to the intent category of the user, sending the independent semantic expression instruction to the target downstream tool for execution, and obtaining the execution result of the target downstream tool, the correctness and stability of the instruction execution can be effectively ensured, thereby significantly improving the response speed and service quality of the intelligent system.

[0198] Figure 5 A structural schematic diagram of an intelligent system provided by an embodiment of the present application is shown in FIG. 1. Figure 5 The intelligent system shown in FIG. 1 includes a memory management module 51, a context understanding module 52, and a downstream execution module 53.

[0199] The memory management module 51, during a conversation, acquires historical dialogue data during the conversation in response to a natural language instruction input by a user.

[0200] The context understanding module 52 generates an independent semantic expression instruction corresponding to the natural language instruction according to the historical dialogue data.

[0201] The downstream execution module 53 executes the independent semantic expression instruction and acquires a corresponding execution result.

[0202] The historical conversation data includes a combination of user roles, assistant roles, and function response data. Specifically, user role data includes the natural language instructions input by the user; assistant role data includes the inference data and action data of the intelligent system when processing the natural language instructions input by the user. The inference data is used to demonstrate the process of logical analysis and judgment performed by the intelligent system based on the current state and context information; the action data indicates the specific actions to be taken by the intelligent system and the required input information; and the function response data includes the above execution results.

[0203] Specifically, the intelligent system provided in the embodiment of the present application adopts a mode that combines reasoning and action when constructing data. In this mode, not only the reasoning ideas of the output model, the selection results of the downstream tools, and the final form of the input rewriting are synchronously output, but also a feedback loop mechanism is introduced to incorporate the execution results of the tool call, so as to achieve continuous updating and optimization of the knowledge and status of the intelligent system.

[0204] To achieve this model, we employ role labels to precisely distinguish various textual content, including the four core roles of System, User, Assistant, and Function. System prompts are designed based on the principles of simplicity and efficiency, using concise phrases to summarize the task to be performed and listing all available tools, providing clear guidance for subsequent operations.

[0205] The user role represents the original text entered by the user, carrying the user's initial needs and intentions. As the carrier of the model's output, the assistant role conducts comprehensive and in-depth thinking and analysis during each round of dialogue. On the one hand, it considers and analyzes the current dialogue state, including contextual information and historical interaction records; on the other hand, it accurately selects the tools appropriate for the current needs. The output format follows the standard structure of "Thought: ***Action: ***Action Input: ***" to ensure the integrity and logic of information expression. Crucially, for each user instruction, the assistant rewrites the expression that relies on contextual information into a complete expression that is independent of contextual information, and stores it in its entirety in the "ActionInput" field, providing a reliable basis for subsequent tool calls. The function response is the response result obtained after calling the selected downstream tool based on the rewritten complete expression. It not only reflects the actual execution effect of the tool, but also provides important feedback for the knowledge update and state adjustment of the intelligent agent.

[0206] The memory management module 51 is an important component of the intelligent system construction system, including memory recording, memory management, and memory reading and splicing. In a complete round of dialogue, the content organization sequence of User-Assistant-Function is followed, all optional tools are contained in the system prompt word, and the system prompt word can be flexibly spliced before any continuous multi-round dialogue. The memory recording process will follow the time sequence to record multiple user requests (User) in the same group of dialogues, and the model output (Assistant) and tool call response (Function) of the current request will be stored in the same round of historical information, ensuring the integrity and coherence of the information. Optionally, to ensure the efficiency and rationality of memory storage, the maximum length of the storage round window is set to 5. When the storage round exceeds 5, the early dialogue record will be automatically deleted according to the time sequence, avoiding data redundancy and resource waste.

[0207] The memory management module 51 is used to accurately distinguish and independently manage the historical information of different groups of dialogues according to the user session_id. When receiving a new round of user request, the intelligent system will quickly locate and read the corresponding memory information according to the session_id. For example, the sliding window of memory reading has a maximum length of 3, that is, only the latest dialogue data of no more than 3 rounds is taken out when reading, and the system prompt word is spliced before the read dialogue data, and the current request, i.e. the natural language instruction input by the user, is spliced after all the dialogue data to form a new model input, providing rich context information support for subsequent reasoning and action.

[0208] The context understanding module 52 is the core component of the intelligent system to realize multi-round dialogue. The understanding ability of the intelligent system provided in the embodiments of the present application is embodied in the strong context decoupling and semantic reconstruction ability, which can automatically rewrite the context-related user input into context-independent independent sentences. Among them, this rewriting is not a simple text processing, but based on the deep mining of natural language semantics and the accurate grasp of the context logical relationship. Through the use of natural language processing algorithm and model architecture, the context understanding module 52 can strip the implicit association of user input with historical dialogue, extract key semantic information, and reorganize it into complete, self-consistent and independent sentences that do not depend on previous dialogue.

[0209] In this way, each downstream tool, when processing the input, no longer needs to consume a large amount of computing resources to parse the complex multi-round dialogue context, nor does it need to rely on lengthy tracking of user historical information, but only needs to focus on the semantic content and task requirements of the current input. This not only significantly reduces the complexity of multi-round dialogue understanding of downstream tools, reduces processing errors caused by context information redundancy or ambiguity, but also greatly improves the response speed and execution efficiency of the intelligent system as a whole, laying a solid foundation for building an efficient and stable intelligent dialogue system.

[0210] In an embodiment, the context understanding module 52 is trained by: obtaining a training sample set; performing augmentation processing on the training sample set; wherein the augmentation processing on the training sample set comprises: performing sentence rewriting on the natural language instructions in the original training samples in the training sample set, constructing a new training sample using the sentence-rewritten natural language instructions and the training labels in the original training samples, and classifying the new training sample into the training sample set; and training the initial intelligent module using the augmented training sample set to obtain the context understanding module 52.

[0211] The training sample set is the basic data source for training the context understanding module 52. These samples usually contain a large number of natural language instructions and corresponding training labels. Natural language instructions are user intentions expressed in natural language, such as "help me filter out records with sales greater than 1000" and "mark these records red" in a table operation scenario; the training label is the context-independent independent sentence corresponding to the instruction, such as "help me mark the records with sales greater than 1000 red". Augmentation processing is a key step to improve model performance and generalization ability, which increases the diversity and quantity of data so that the model can learn more rich language patterns and semantic features. The specific operation includes: performing sentence rewriting on the natural language instructions of the original training samples in the training sample set. There are various ways of sentence rewriting, such as changing the active and passive sentence patterns of the sentence (e.g., changing the active sentence "I modified the data" to the passive sentence "The data was modified by me"), randomly omitting information (e.g., from "Please sort cells A1 to A10" to "Sort the cells"), randomly changing the order of expression (e.g., changing "Filter first, then sort" to "Sort before filtering"), and using synonyms to replace (e.g., replacing "find" with "search"). Through sentence rewriting, a large number of new instructions with the same semantics but different expressions can be generated, thereby enriching the training data. This helps the model to learn the features of the same semantics under different expressions, improves the model's adaptability to natural language diversity, and avoids the model from having understanding bias when encountering similar but differently expressed instructions in actual application due to the single training data.

[0212] The downstream execution module 53 undertakes the responsibilities of accurately identifying user intent and downstream distribution in the intelligent system. Specifically, the downstream execution module 53 utilizes intent recognition algorithms to perform deep analysis and semantic understanding of the instructions, thereby accurately determining the category to which the user's intent belongs. After determining the category of the user's intent, the downstream execution module 53 will determine the target downstream tool from a variety of downstream tools integrated in the module according to pre-set rules and logic. The diverse downstream tools integrated in the downstream execution module 53 are the key support for its powerful functions. Different downstream tools often have their own unique instruction set specifications, data format requirements, and running logic, and can provide professional processing capabilities for different task requirements. For the specific workflow of the downstream execution module 53, please refer to the related description in the above embodiments, which will not be repeated here.

[0213] The intelligent system provided by the embodiments of the present application integrates the two core technical capabilities of context understanding and intent recognition, and realizes an intelligent system that can simultaneously operate data (such as tables) and analyze data through natural language input. In the complex scenario of processing multiple rounds of user input, the intelligent system can quickly capture the dependency relationship of the current round on the previous context, recover the key information of the previous context from ambiguous expression methods such as reference, omission, or colloquial language, thereby ensuring complete and accurate understanding of the user's instructions. After accurately identifying the user's intent, the rewritten independent sentence is distributed to the downstream tool corresponding to the user's intent, which can accurately and efficiently process the user's instructions on the one hand, and reduce the dependence of the downstream tool on the user's historical information and the difficulty of understanding complex context relationships in the multi-round dialogue scenario on the other hand, thereby significantly improving the running efficiency and stability of the entire system.

[0214] Meanwhile, the intelligent system adopts a highly flexible modular design, and the downstream tools have a pluggable feature. This feature gives the system significant flexibility and scalability, allowing it to easily adapt to changing business needs and scenarios. Whether it is adding new functions, replacing existing tools, or removing no longer used modules, it can be done conveniently and efficiently without affecting the overall operation of the system.

[0215] Through the above advantages, the intelligent system provided by the embodiments of the present application can easily implement a variety of table processing functions, reduce the technical threshold for users to process table data, and provide users with a more comprehensive and high-quality service experience.

[0216] Figure 6 An embodiment block diagram of a data processing apparatus provided by the embodiments of the present application is shown in FIG. 1. As shown in FIG. 1, the apparatus includes: Figure 6

[0217] ​The historical data obtaining module 61 is configured to obtain historical dialogue data in a session in response to a natural language instruction input by a user during the session.

[0218] The instruction rewriting module 62 is configured to generate an independent semantic expression instruction corresponding to the natural language instruction according to the historical dialogue data.

[0219] The instruction executing module 63 is configured to execute the independent semantic expression instruction and obtain a corresponding execution result.

[0220] In a possible implementation, the historical data obtaining module 61 is specifically configured to:

[0221] obtain historical dialogue data in a set historical time range in the session;

[0222] and / or obtain historical dialogue data in a set round in the session.

[0223] In a possible implementation, the historical data obtaining module 61 is further configured to:

[0224] identify a number of characters in the natural language instruction, and determine the set historical time range and / or the set round according to the number of characters;

[0225] or identify a historical behavior mode of the user in the session, and determine the set historical time range and / or the set round according to the historical behavior mode.

[0226] In a possible implementation, the instruction rewriting module 62 includes:

[0227] an identifying unit configured to identify context-related expression data present in the natural language instruction;

[0228] an extracting unit configured to extract, from the historical dialogue data, a relevant object corresponding to the context-related expression data according to an expression type of the context-related expression data;

[0229] a rewriting unit configured to rewrite the context-related expression data in the natural language instruction into the relevant object, and determine the rewritten natural language instruction as the independent semantic expression instruction.

[0230] In a possible implementation, the apparatus further includes:

[0231] a determining module configured to determine relevance between the natural language instruction and the historical dialogue data before the independent semantic expression instruction corresponding to the natural language instruction is generated according to the historical dialogue data.

[0232] The instruction rewriting module 62 is configured to, in a case where it is determined that the natural language instruction is related to the historical dialogue data, perform the following steps of generating an independent semantic expression instruction corresponding to the natural language instruction according to the historical dialogue data and the like.

[0233] The instruction execution module is further configured to, in a case where it is determined that the natural language instruction is not related to the historical dialogue data, execute the natural language instruction and obtain a corresponding execution result.

[0234] In a possible implementation, the determining module is specifically configured to:

[0235] determine a first probability of system response under a condition of the natural language instruction and the historical dialogue data, and determine a second probability of system response under a condition of only the natural language instruction;

[0236] determine a difference between the first probability and the second probability;

[0237] in a case where an absolute value of the difference is greater than or equal to a preset threshold, determine that the natural language instruction is related to the historical dialogue data;

[0238] in a case where the absolute value of the difference is less than the preset threshold, determine that the natural language instruction is not related to the historical dialogue data.

[0239] In a possible implementation, the instruction execution module 63 includes:

[0240] an intent identification unit configured to determine an intent category of the user according to the independent semantic expression instruction;

[0241] a tool determination unit configured to determine a target downstream tool from a preset set of downstream tools according to the intent category of the user;

[0242] an instruction execution unit configured to send the independent semantic expression instruction to the target downstream tool for execution, to obtain an execution result of the target downstream tool.

[0243] In a possible implementation, the tool determination unit is specifically configured to:

[0244] search a preset set of corresponding relationships between intent categories and downstream tools by using the intent category of the user as a keyword;

[0245] in a case where a target corresponding relationship containing the keyword is found from the set of corresponding relationships, determine a downstream tool in the target corresponding relationship as the target downstream tool;

[0246] In a case where a target correspondence relation containing the keyword is not found from the correspondence relation set, a specified downstream tool is determined as a target downstream tool.

[0247] In a possible implementation, the instruction execution unit is specifically configured to:

[0248] generate executable instructions corresponding to the target downstream tool according to the independent semantic expression instruction;

[0249] send the executable instructions to the target downstream tool for execution, to obtain an execution result of the target downstream tool.

[0250] As shown in Figure 7 The embodiment of the present application provides an electronic device, which comprises a processor 111, a communication interface 112, a memory 113 and a communication bus 114, wherein the processor 111, the communication interface 112 and the memory 113 complete mutual communication through the communication bus 114,

[0251] The memory 113 is used for storing a computer program.

[0252] In an embodiment of the present application, the processor 111 is used for executing the program stored in the memory 113, to realize the data processing method provided by any one of the preceding method embodiments, comprising:

[0253] During a session, in response to a natural language instruction input by a user, historical dialogue data in the session is acquired;

[0254] According to the historical dialogue data, an independent semantic expression instruction corresponding to the natural language instruction is generated;

[0255] The independent semantic expression instruction is executed, and a corresponding execution result is acquired.

[0256] The embodiment of the present application further provides a computer readable storage medium, which stores a computer program, and the computer program is executed by a processor to realize the steps of the data processing method provided by any one of the preceding method embodiments.

[0257] The device embodiments described above are only schematic, wherein the units described as separate components may or may not be physically separate, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or distributed on multiple network units. According to actual needs, part or all of the modules can be selected to realize the purpose of the embodiment scheme.

[0258] Those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus a general hardware platform, and of course can be implemented by hardware. Based on such an understanding, the technical solutions described above essentially or in other words make contributions to the related art, and can be embodied in a software product form, which can be stored in a computer readable storage medium, such as a ROM / RAM, a magnetic disk, or an optical disk, and includes a plurality of instructions to cause a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.

[0259] It is to be understood that the terminology used herein is for the purpose of describing particular example embodiments only and is not intended to be limiting. As used herein, the singular forms "a", "an" and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. The terms "comprises", "comprising", "includes", "including" and "has" are inclusive and therefore specify the presence of stated features, steps, operations, elements, and / or components, but do not preclude the presence or addition of one or more other features, steps, operations, elements, components, and / or groups thereof. The method steps, processes, and operations described herein are not to be construed as necessarily requiring their occurrence in the particular order

[0260] The above description is merely that of specific embodiments of the present application, and thus is not intended to limit the present application. Based on the general principles described herein, various modifications can be made to the embodiments by those skilled in the art. The present application is not limited to the embodiments described herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A data processing method, characterized in that: The method comprises: During a conversation, in response to a natural language instruction input by a user, obtaining historical conversation data during the conversation; generating, based on the historical conversation data, an independent semantic expression instruction corresponding to the natural language instruction; Execute the independent semantic expression instruction and obtain the corresponding execution result.

2. The method according to claim 1, characterized in that The acquiring of historical conversation data during the session includes: Obtain historical conversation data within a set historical time range during the session; And / or, obtaining historical conversation data within a set round during the conversation.

3. The method according to claim 2, characterized in that The method further comprises: Identifying the number of characters in the natural language instruction; determining the set historical time range and / or the set round according to the number of characters; Alternatively, a historical behavior pattern of the user during the session is identified; and a set historical time range and / or the set rounds are determined based on the historical behavior pattern.

4. The method according to claim 1, wherein Generating, based on the historical conversation data, an independent semantic expression instruction corresponding to the natural language instruction includes: Identifying context-related expression data present in the natural language instruction; extracting, from the historical conversation data, relevant objects corresponding to the context-related expression data according to the expression type of the context-related expression data; The context-related expression data in the natural language instruction is rewritten into the related object, and the rewritten natural language instruction is determined as an independent semantic expression instruction.

5. The method according to claim 1, wherein Before generating, based on the historical conversation data, an independent semantic expression instruction corresponding to the natural language instruction, the method further includes: Determining the relevance between the natural language instruction and the historical conversation data; If it is determined that the natural language instruction is related to the historical conversation data, performing the steps of generating an independent semantic expression instruction corresponding to the natural language instruction based on the historical conversation data and subsequent steps; When it is determined that the natural language instruction is not related to the historical conversation data, the natural language instruction is executed and a corresponding execution result is obtained.

6. The method according to claim 5, characterized in that The determining of the relevance between the natural language instruction and the historical conversation data includes: Determining a first probability that the system generates a response given the natural language instruction and the historical conversation data, and determining a second probability that the system generates a response given only the natural language instruction; determining a difference between the first probability and the second probability; If it is determined that the absolute value of the difference is greater than or equal to a preset threshold, determining that the natural language instruction is correlated with the historical conversation data; When it is determined that the absolute value of the difference is less than a preset threshold, it is determined that there is no correlation between the natural language instruction and the historical dialogue data.

7. The method according to claim 1, characterized in that The executing the independent semantic expression instruction and obtaining the corresponding execution result includes: Determining the user's intention category according to the independent semantic expression instruction; Determining a target downstream tool from a preset downstream tool set according to the user's intention category; The independent semantic expression instruction is sent to the target downstream tool for execution, and an execution result of the target downstream tool is obtained.

8. The method according to claim 7, characterized in that Determining a target downstream tool from a preset downstream tool set according to the user's intention category includes: Using the user's intent category as a keyword, searching for a set of correspondences between preset intent categories and downstream tools; In the case where a target corresponding relationship containing the keyword is found from the corresponding relationship set, determining the downstream tool in the target corresponding relationship as the target downstream tool; In the case that the target corresponding relationship containing the keyword is not found in the corresponding relationship set, the designated downstream tool is determined as the target downstream tool.

9. The method according to claim 7, characterized in that The sending the independent semantic expression instruction to the target downstream tool for execution, and obtaining the execution result of the target downstream tool, includes: Generating executable instructions corresponding to the target downstream tool according to the independent semantic expression instructions; The executable instruction is sent to the target downstream tool for execution, and an execution result of the target downstream tool is obtained.

10. An intelligent system, characterized in that: The intelligent system includes: a memory management module, which, during a conversation, responds to a natural language instruction input by a user and obtains historical conversation data during the conversation; A context understanding module generates, based on the historical conversation data, independent semantic expression instructions corresponding to the natural language instructions; The downstream execution module executes the independent semantic expression instruction and obtains the corresponding execution result.

11. The intelligent system according to claim 10, characterized in that: The historical conversation data includes a data combination of user role, assistant role, and function response; The user role data includes: natural language instructions input by the user; The assistant role data includes: the inference data and action data of the intelligent system in the process of processing the natural language instructions input by the user, wherein the inference data is used to demonstrate the process of the intelligent system performing logical analysis and judgment based on the current state and context information; the action data is used to indicate the specific operation to be taken by the intelligent system and the required input information; The function response data includes: the execution result.

12. The intelligent system according to claim 10, characterized in that: The context understanding module is trained in the following way: Obtain a training sample set; Performing an augmentation process on the training sample set; wherein the augmentation process on the training sample set includes: rewriting the natural language instructions in the original training samples in the training sample set into sentence form, constructing a new training sample using the natural language instructions after sentence form rewriting and the training labels in the original training samples, and adding the new training sample to the training sample set; The initial intelligent module is trained using the amplified training sample set to obtain the context understanding module.

13. A data processing device, characterized in that: The device comprises: A historical data acquisition module, configured to acquire historical conversation data during a conversation in response to a natural language instruction input by a user; An instruction rewriting module, configured to generate, based on the historical conversation data, an independent semantic expression instruction corresponding to the natural language instruction; The instruction execution module is used to execute the independent semantic expression instruction and obtain the corresponding execution result.

Citation Information

Patent Citations

  • Multi-round dialogue method and device based on artificial intelligence and storage medium

    CN113806508A

  • Multi-round dialogue rewriting method and device and medium

    CN115587598A

  • Method and device for improving recognition and query of valid data by artificial intelligence model

    CN119336875A

  • Context-based big language model dialogue processing method and apparatus, and electronic device

    CN119831045A