Data processing method and apparatus, device, and computer program product
By identifying and correcting the tool input parameters determined by the large language model, the problem of inaccurate tool calling parameters in the existing technology is solved, the accuracy and reliability of data processing are achieved, and the application stability of the large language model is improved.
Patent Information
- Application Number
- PCT/IB2025/050142
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2024-02-22
- Filing Date
- 2025-01-07
- Publication Date
- 2025-08-28
AI Technical Summary
When calling external tools, existing large language models cannot determine tool input parameters with high quality and accuracy, resulting in insufficient accuracy and reliability of data processing.
By obtaining the pending problem, using the preset large language model to determine the tool input parameters and parameter reasoning process, identify the parameter correctness, and correct it when errors are made, and finally using the target calling tool to process it to obtain the results corresponding to the pending problem.
It improves the accuracy of the determination of parameters required by the target calling tool, ensures the quality and effectiveness of data processing operations, and further improves the stability, reliability and practicality of large language model applications.
Smart Images

Figure IB2025050142_28082025_PF_FP_ABST
Abstract
Description
[0001] Data Processing Method, Apparatus, Device, and Computer Program Product This disclosure claims priority to Chinese patent application number 202410199582.4, filed with the China Patent Office on February 22, 2024, the entire contents of which are incorporated herein by reference. Technical Field This disclosure relates to the field of data processing technology, and more particularly to a data processing method, apparatus, device, and computer program product. Background: Large Language Models (LLMs) are essentially generative models, also known as generative large language models. With their powerful natural language processing (NLP) understanding and generation capabilities, LLMs are increasingly being applied. Specifically, in addition to being used in conversational scenarios, LLMs can also be used to solve complex problems by invoking external tools. In this case, ensuring the correctness of tool invocations and the parameters required by the tools is key to LLM models performing data processing operations using tools. SUMMARY OF THE INVENTION Embodiments of the present disclosure provide a data processing method, apparatus, device, and computer program product that can improve the accuracy of determining tool input parameters required by a target invocation tool, thereby ensuring the quality and effectiveness of data processing operations. In a first aspect, embodiments of the present disclosure provide a data processing method, comprising: obtaining a problem to be processed and a target invocation tool compatible with the problem to be processed; processing the problem to be processed using a preset large language model to obtain tool input parameters and a parameter inference process for input into the target invocation tool, wherein the target invocation tool is configured to be invoked by the large language model; identifying whether the tool input parameters are correct based on the parameter inference process; if the tool input parameters are incorrect, correcting the tool input parameters to obtain corrected parameters; and processing the corrected parameters using the target invocation tool to obtain a processing result corresponding to the problem to be processed.In a second aspect, embodiments of the present disclosure provide a data processing device, comprising: a first acquisition module for acquiring a problem to be processed and a target invocation tool compatible with the problem to be processed; a first processing module for processing the problem to be processed using a preset large language model to obtain tool input parameters and a parameter inference process for input into the target invocation tool, wherein the target invocation tool is to be invoked by the large language model; a first identification module for identifying whether the tool input parameters are correct based on the parameter inference process; the first processing module is further configured to correct the tool input parameters if the tool input parameters are incorrect to obtain corrected parameters; the first processing module is further configured to process the corrected parameters using the target invocation tool to obtain a processing result corresponding to the problem to be processed. In a third aspect, embodiments of the present disclosure provide an electronic device, comprising: a memory and a processor; wherein the memory is configured to store one or more computer instructions, and wherein the one or more computer instructions, when executed by the processor, implement the data processing method of the first aspect described above. In a fourth aspect, embodiments of the present disclosure provide a computer storage medium for storing a computer program. When executed by a computer, the computer program implements the data processing method of the first aspect. In a fifth aspect, embodiments of the present disclosure provide a computer program product, comprising: a computer program that, when executed by a processor of an electronic device, causes the processor to perform the steps of the data processing method of the first aspect. The data processing method, apparatus, device, and computer program product provided in this embodiment obtain a problem to be processed and a target invocation tool compatible with the problem to be processed; process the problem to be processed using a preset large language model to obtain tool input parameters and a parameter inference process for input into the target invocation tool; identify whether the tool input parameters are correct based on the parameter inference process; if the tool input parameters are incorrect, correct the tool input parameters to obtain corrected parameters; and then process the corrected parameters using the target invocation tool to obtain a processing result corresponding to the problem to be processed. Since the correctness of the tool input parameters can be determined after obtaining them, the accuracy of determining the tool input parameters required for the target invocation tool called by the large language model is effectively improved, thereby ensuring the quality and effectiveness of data processing operations and further improving the practicality of the method.To more clearly illustrate the embodiments of the present disclosure or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or prior art descriptions. Obviously, the drawings described below represent some embodiments of the present disclosure. Persons skilled in the art can also derive other drawings based on these drawings without inventive effort. Figure 1 is a schematic diagram illustrating the principles of a data processing method provided in an embodiment of the present disclosure; Figure 2 is a flowchart illustrating a data processing method provided in an embodiment of the present disclosure; Figure 3 is a flowchart illustrating a method for identifying whether tool input parameters are correct based on the parameter inference process provided in an embodiment of the present disclosure; Figure 4 is a schematic diagram illustrating the principles of a data processing method provided in an application embodiment of the present disclosure; Figure 5 is a schematic diagram illustrating the principles of fine-tuning an SBERT model provided in an application embodiment of the present disclosure; Figure 6 is a schematic diagram illustrating the principles of fine-tuning an LLM model provided in an application embodiment of the present disclosure; Figure 7 is a schematic diagram illustrating the structure of a data processing device provided in an embodiment of the present disclosure; and Figure 8 is a schematic diagram illustrating the structure of an electronic device corresponding to the data processing device provided in the embodiment of FIG. 7 . To further clarify the objectives, technical solutions, and advantages of the embodiments of the present disclosure, the technical solutions of the embodiments of the present disclosure will be described clearly and completely below in conjunction with the accompanying drawings. It should be understood that the described embodiments represent only a portion of the embodiments of the present disclosure, and are not exhaustive. All other embodiments devised by persons of ordinary skill in the art based on the embodiments of the present disclosure without inventive effort are within the scope of protection of the present disclosure. The terms used in the embodiments of the present disclosure are intended solely to describe specific embodiments and are not intended to limit the present disclosure. The singular forms "a," "an," "the," and "the" used in the embodiments of the present disclosure and the appended claims are intended to include the plural forms, unless the context clearly indicates otherwise. "A plurality" generally includes at least two, but does not exclude the inclusion of at least one. It should be understood that the term "and / or" as used herein is merely a term used to describe an association between associated objects, indicating that three possible relationships exist. For example, "A and / or B" can represent: A alone, A and B simultaneously, or B alone. Furthermore, the character " / " generally indicates an "or" relationship between the associated objects. Depending on the context, the words “if” and “if” as used herein may be interpreted as “when” or “when” or “in response to determining” or “in response to detecting”.Similarly, depending on the context, the phrase "if determined" or "if (a stated condition or event) is detected" can be interpreted as "when determined" or "in response to determining" or "when (a stated condition or event) is detected" or "in response to detecting (a stated condition or event)." It should also be noted that the terms "comprise," "include," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a product or system comprising a series of elements includes not only those elements but also other elements not explicitly listed, or elements inherent to such product or system. Without further limitation, an element defined by the phrase "comprising a..." does not preclude the presence of additional identical elements in the product or system comprising the element. In addition, the sequence of steps in the following method embodiments is merely an example and not a strict limitation. Definition of Terms:
[0002] Large Language Models (LLMs) are AI models designed to understand and generate human language. They are trained on large amounts of text data and can perform a wide range of tasks, including text summarization, translation, and sentiment analysis. LLMs are characterized by their massive size, containing billions of parameters, which helps them learn complex patterns in language data. These models are often based on deep learning architectures, such as Transformers, which contributes to their impressive performance on various natural language processing (NLP) tasks.
[0003] BERT (Bidirectional Encoder Representation from Transformers) is a pre-trained language representation model. It emphasizes that instead of using traditional unidirectional language models or shallow concatenation of two unidirectional language models for pre-training, it uses a new masked language model (MLM) to generate deep bidirectional language representations.
[0004] SBERT: Sentence-BERT or Siamese BERT network. The Bert model has shown its superiority in various NLP tasks. It is no exception in the semantic textual similarity task. However, due to the规定 of the BERT model, when calculating semantic similarity, two sentences need to be input into the model simultaneously for information interaction, which results in a large amount of computational overhead. The structure of the BERT model makes it neither suitable for semantic similarity search nor for unsupervised tasks such as clustering. The Sentence-BERT network structure can solve the deficiencies of the BERT model. Simply put, it借鉴 the framework of the twin network model, input different sentences into two BERT models (but these two bert models share parameters and can also be understood as the same BERT model), and obtain the sentence representation vectors of each sentence; and the finally obtained sentence representation vectors can be used for semantic similarity calculation and also for unsupervised clustering tasks.
[0005] Embedding: Mathematically, it represents a mapping (mapping), f: X->Y, that is, a function (function), where the function is injective (the so-called injective function, each Y has a unique X corresponding, and vice versa) and structure-preserving (structure preservation, for example, in the space where X belongs, X1 VX2, then after mapping, in the space where Y belongs, Y1 <Y2 similarly). Then for word embedding, it is to map the word word to another space, where this mapping has the characteristics of injective and structure-preserving. A popular translation can be considered as word embedding, that is, mapping the word in the space where X belongs to a multi-dimensional vector in the Y space, then the multi-dimensional vector is equivalent to being embedded in the space where Y belongs, one radish one pit. Word embedding is to find a mapping or function to generate an expression in a new space, and this expression is the word representation o It should be noted that there are some unclear or incorrect expressions in the original text, such as "规定" which should be a more specific term, and "借鉴" should be a more accurate description. The above translation tries to make sense of the text as much as possible based on the context.Sentence embedding involves mapping a sentence into a multidimensional vector space. Vector similarity: Sentence vector similarity compares the similarity between two sentences. This is typically achieved by calculating the cosine similarity between their sentence vectors. Cosine similarity measures the angle between two vectors in space, with values ranging from T to 1. The more similar the two vectors are (i.e., the smaller the angle), the closer their cosine similarity is to 1. The more dissimilar the two vectors are (i.e., the larger the angle), the closer their cosine similarity is to -1. When two vectors are completely perpendicular, their cosine similarity is 0.
[0006] LoRA (Low-Rank Adaptation) is a fine-tuning method based on adaptive learning. Its main concept is to adjust the model's parameters by adding a low-rank adaptation layer. To facilitate understanding of the specific implementation of the technical solution in this embodiment, the following briefly describes the relevant technologies: Large Language Models (LLMs) are essentially generative models, also known as generative large language models. With their powerful understanding and generation capabilities for NLP tasks, large language models are increasingly widely used. In addition to being applied in conversational scenarios, LLMs can be used by AI agents to call external tools. Specifically, LLMs can call external tools through application programming interfaces (APIs) to solve complex problems. Therefore, the ability of large language models to call external tools and solve complex problems has attracted considerable attention. However, before LLMs are trained and optimized, they often cannot complete tool operations with high quality and accuracy, thus failing to guarantee accurate and reliable data processing. To address the above technical issues, this embodiment provides a data processing method, apparatus, device, and computer program product. Referring to FIG. 1 , the data processing method provided in this embodiment may be executed by a data processing apparatus. It should be noted that the data processing apparatus may be implemented as any device capable of providing data processing services, such as a terminal device, a personal computer, a tablet computer, a local server, or a cloud server. In this case, when the data processing apparatus is implemented as a cloud server, the data processing method may be executed in the cloud. Several computing nodes (cloud servers) may be deployed in the cloud, each of which has processing resources such as computing and storage. In the cloud, multiple computing nodes may be organized to provide a particular service, and a single computing node may provide one or more services. The cloud may provide the service by providing a service interface, which users invoke to access the corresponding service. Service interfaces include software development kits (SDKs) and application programming interfaces (APIs). The data processing device is in communication with a client, wherein the client is used for users to perform applications to implement data processing operations. The above-mentioned client can be any computing device with a certain data transmission capability. In specific implementation, the client can be a mobile phone, a personal computer PC, a tablet computer, a setting application, etc.In addition, the basic structure of the client may include at least one processor. The number of processors depends on the configuration and type of the client. The client may also include memory, which may be volatile, such as random access memory (RAM), non-volatile, such as read-only memory (ROM), flash memory, or both. The memory typically stores an operating system (OS), one or more application programs, and may also store program data. In addition to the processing unit and memory, the client also includes some basic configurations, such as a network card chip, an I / O bus, a display component, and some peripheral devices. Optionally, some peripheral devices may include, for example, a keyboard, a mouse, a stylus, a printer, etc. Other peripheral devices are well known in the art and will not be described in detail here. A data processing device refers to a device that can provide data processing operations in a network virtual environment, typically referring to a device that utilizes a network to perform information planning and data processing operations. In physical implementation, a data processing device can be any device capable of providing computing services and performing data processing operations in response to data processing requests. For example, it can be a cluster server, a conventional server, a cloud server, a cloud host, a virtual center, etc. The data processing device primarily comprises a processor, a hard disk, memory, a system bus, etc., similar to a general-purpose computer architecture. In the above embodiment, the client establishes a network connection with the data processing device. This network connection can be a wireless or wired network connection. If the client can establish a communication connection with the data processing device, the mobile network standard can be any one of 2G (GSM), 2.5G (GPRS), 3G (WCDMA, TD-SCDMA, CDMA2000, UTMS), 4G (LTE), 4G+ (LTE+), Wi-Fi Max, 5G, 6G, etc. In an embodiment of the present disclosure, a client is used to generate or obtain pending issues. Specifically, the client may display a human-computer interaction interface, obtain an execution operation input by a user in the human-computer interaction interface, generate or obtain the pending issues based on the execution operation, and send the pending issues to a data processing device to implement data processing operations.The data processing device is used to obtain pending questions sent by the client. To perform data processing operations, after obtaining the pending questions, it can first obtain a target invocation tool that is compatible with the pending questions. Different target invocation tools correspond to different application scenarios, such as search tools, flight booking tools, hotel reservation tools, and tools for data query and calculation using the Structured Query Language (SQL). These application tools are used by the large language model to solve different technical problems. For example, a user may ask a question such as "What is the traffic congestion situation in Hangzhou today?" The LLM can invoke a tool to query the traffic congestion index and parse the parameters required by the tool, such as "Hangzhou" and "today." This allows the application tool to perform data processing based on the required parameters and return the correct parsed results. Specifically, after obtaining the problem to be processed and the target invocation tool that is compatible with the problem to be processed, the preset large language model can be used to process the problem to obtain tool input parameters and parameter inference process for input into the target invocation tool. Since the tool input parameters are determined by the large language model, and the large language model is obtained by training with training data, in actual application, the tool input parameters determined by the large language model may contain some errors. Therefore, to ensure the quality and effectiveness of data processing, after obtaining the parameter inference process and tool input parameters, the parameter inference process can be used to determine whether the tool input parameters are correct. If the tool input parameters are correct, the target invocation tool can be directly used to process the tool input parameters to obtain a processing result corresponding to the problem being processed. If the tool input parameters are incorrect, to improve data processing accuracy, the tool input parameters can be corrected to obtain corrected parameters. The target invocation tool can then be used to process the corrected parameters to obtain a processing result corresponding to the problem being processed. This effectively ensures the accuracy and reliability of determining the parameters required for the target invocation tool. This effectively improves the accuracy and reliability of data processing when the target invocation tool is invoked by a large language model to perform data processing operations, further enhancing the stability and reliability of the large language model application, and further demonstrating the practicality of this method. The following detailed description of some embodiments of the present disclosure is provided in conjunction with the accompanying drawings. The following embodiments and features may be combined unless they conflict with each other. Furthermore, the sequence of steps in the following method embodiments is provided for illustrative purposes only and is not a strict limitation.FIG2 is a flow chart of a data processing method provided by an embodiment of the present disclosure. Referring to FIG2 , this embodiment provides a data processing method. The execution subject of the method may be a data processing device. It is understood that the data processing device may be implemented as software or a combination of software and hardware. Specifically, when the data processing device is implemented as hardware, it includes but is not limited to a tablet computer, a personal computer (PC), a server, etc. When the data processing device is implemented as software, it may be installed in the electronic devices listed above. Based on the above-mentioned data processing device, the data processing method in this embodiment may include the following steps: Step S201: Obtaining a problem to be processed and a target invocation tool adapted for the problem to be processed. Step S202: Processing the problem to be processed using a preset large language model to obtain tool input parameters and a parameter inference process for input into the target invocation tool, wherein the target invocation tool is used to be called by the large language model. Step S203: Based on the parameter inference process, identifying whether the tool input parameters are correct. Step S204: Correcting the tool input parameters if the tool input parameters are incorrect. Obtain the corrected parameters. Step S205: Use the target invocation tool to process the corrected parameters to obtain a processing result corresponding to the problem to be processed. The specific implementation principles and effects of each of the above steps are described in detail below: Step S201: Obtain the problem to be processed and the target invocation tool compatible with the problem to be processed. When a user has a data processing requirement, the data processing device can obtain the problem to be processed. In some instances, the problem to be processed can be obtained through human-computer interaction. In this case, obtaining the problem to be processed can include: displaying a human-computer interaction interface, obtaining an execution operation entered by the user in the human-computer interaction interface; and obtaining the problem to be processed based on the execution operation. In other instances, the problem to be processed can be obtained not only through human-computer interaction but also through a client or a third device. In this case, obtaining the problem to be processed can include: determining a client or a third device in communication with the data processing device. The client or third device may store the problem to be processed. The client or third device actively or passively obtains the problem to be processed. This effectively ensures stable and reliable acquisition of the problem to be processed.Furthermore, to implement corresponding data processing operations for the pending problem, after obtaining the pending problem, a target invocation tool compatible with the pending problem can be obtained. Different pending problems may correspond to different target invocation tools. For example, if the pending problem is related to air ticket booking, the target invocation tool corresponding to the pending problem may be an air ticket booking tool; if the pending problem is related to information search, the target invocation tool corresponding to the pending problem may be an information search tool; if the pending problem is related to hotel reservations, the target invocation tool corresponding to the pending problem may be a hotel reservation tool, and so on. Therefore, the target invocation tool can be determined based on a preset mapping relationship. In this case, obtaining the target invocation tool compatible with the pending problem may include: obtaining a pre-configured mapping relationship table between multiple standard processing problems and each standard invocation tool; determining the standard processing problem matching the pending problem in the mapping relationship table; and then determining the standard invocation tool corresponding to the standard processing problem as the target invocation tool compatible with the pending problem. This effectively ensures the accuracy and reliability of the target invocation tool determination. In addition, the target calling tool can be determined not only through the mapping relationship table, but also through the alternative calling tools. In this case, obtaining the target calling tool that is compatible with the problem to be processed may include: obtaining a reference tool set that can be called by the large language model; determining the alternative calling tool corresponding to the problem to be processed in the reference tool set, where the number of alternative calling tools is less than the number of tools included in the reference tool set; and determining the target calling tool that is compatible with the problem to be processed among the alternative calling tools.To ensure the quality and effectiveness of data processing, a reference tool set that can be called by the large language model can be obtained. The reference tool set can include application tools that can be called in various application scenarios. Those skilled in the art can flexibly configure or adjust the application tools that can be called by the large language model based on specific application scenarios or application requirements. Since the large language model can call a large number of application tools, to improve the speed and accuracy of determining the target calling tool, alternative calling tools corresponding to the problem to be processed can be first determined from the reference tool set. The alternative calling tools can be application tools that have an associated relationship with the problem to be processed, and the number of alternative calling tools can be less than the number of tools included in the reference tool set. For example, the number of alternative calling tools can be 4, 5, or 6. In some examples, determining the alternative calling tools corresponding to the problem to be processed from the reference tool set can include: obtaining a pre-trained tool selection model and a toolset vector database. The toolset vector database includes the reference tool set that can be called by the large language model. The tool selection model can be an SBert model. Then, the tool selection model can be used to perform a preliminary matching operation between the problem to be processed and the toolset vector database. Thus, alternative call tools corresponding to the problem to be processed can be selected from the tool set vector database. After obtaining the alternative call tools, a target call tool that is compatible with the problem to be processed can be further determined from the alternative call tools. In some instances, the target call tool can be the alternative call tool with the highest matching degree among all the alternative call tools. Alternatively, the target call tool can be determined using a large language model. In this case, determining the target call tool that is compatible with the problem to be processed from the alternative call tools may include: generating tool confirmation prompt information for input into the large language model based on the problem to be processed and all the alternative call tools; and inputting the tool confirmation prompt information into the large language model to obtain the target call tool that is compatible with the problem to be processed, as output by the large language model. Specifically, in order to accurately determine the target calling tool, after obtaining the pending problem and alternative calling tools, tool confirmation prompt information for input into the large language model can be generated based on the pending problem and all alternative calling tools. The tool confirmation prompt information can be composed of the natural language of the pending problem and all alternative calling tools. The tool confirmation prompt information is used to implement the confirmation operation of the target calling tool through the large language model. For example, the tool confirmation prompt information can be "Select a tool from Tool A, Tool B, Tool C, and Tool D to determine the traffic congestion index of Hangzhou City."After generating tool confirmation prompt information for input into the large language model, the tool confirmation prompt information can be input into the large language model. The large language model can then perform a corresponding confirmation operation on the target invocation tool based on the tool confirmation prompt information. This allows the large language model to output a target invocation tool that is compatible with the problem to be processed, effectively ensuring the accuracy and reliability of the target invocation tool determination. In other examples, after determining the candidate invocation tool corresponding to the problem to be processed, the target invocation tool can be determined not only directly based on the candidate invocation tools, but also by combining with a historical database. It should be noted that the target invocation tool determined based on the historical database can be different from any candidate invocation tool, or the target invocation tool can be any one of multiple candidate invocation tools. At this point, the method in this embodiment may further include: obtaining a historical database for analyzing and processing the pending problem, the historical database including: processed problems and standard application tools compatible with the processed problems; if a processed problem matching the pending problem exists in the historical database, determining the standard application tool corresponding to the processed problem as the target invocation tool; if a processed problem matching the pending problem does not exist in the historical database, allowing the target invocation tool compatible with the pending problem to be determined from among the alternative invocation tools. To improve the accuracy and reliability of determining the target invocation tool, the target invocation tool may be determined not only from among the alternative invocation tools, but also in combination with the historical database. It should be noted that the historical database includes: processed problems that have been processed at historical moments and standard application tools compatible with the processed problems, and that the standard application tools have accurately completed the corresponding data processing operations for the processed problems.Specifically, the historical database can be obtained by collating or compiling historical data on analysis and processing of pending problems at historical moments. The historical database can be stored in a preset area. When it is necessary to determine a target invocation tool that is compatible with the pending problem, the preset area can be accessed to obtain the historical database used for analyzing and processing the pending problem. After obtaining the historical database, the pending problem and the processed problems in the historical database can be analyzed and matched. If a processed problem that matches the pending problem exists in the historical database, it means that the pending problem has been stably and correctly processed using standard application tools at a historical moment. In this case, the standard application tool corresponding to the processed problem that matches the pending problem can be directly determined as the target invocation tool. If no processed problem that matches the pending problem exists in the historical database, it means that the pending problem has not been processed at a historical moment. In this case, in order to accurately obtain a target invocation tool that is compatible with the pending problem, the target invocation tool that is compatible with the pending problem can be further determined from the alternative invocation tools. This effectively ensures the accuracy and reliability of determining the target invocation tools corresponding to different pending problems. Step S202: Using a preset large language model to process the problem to be processed, tool input parameters and parameter inference processes are obtained for input into a target invocation tool, which is intended to be invoked by the large language model. A large language model is pre-trained for implementing data processing operations. This large language model can invoke one or more application tools to solve complex problems. Specifically, the large language model training process may include: obtaining a tool selection training dataset (to enable the LLM to invoke the correct application tool) and substituting tool parameters into the training dataset (to enable the LLM to correctly identify the parameters required for invoking the tool); determining a base large language model (LLM) to be fine-tuned; and fine-tuning or training the base LLM using the tool selection training dataset and substituting tool parameters into the training dataset to obtain the preset large language model. After training and fine-tuning the large language model, the large language model can be used to perform corresponding data processing operations. For example, after obtaining the problem to be processed, the large language model can be used to perform corresponding data processing operations on the problem to be processed.During data processing using a preset large language model, the large language model can be used to determine tool input parameters for the target invocation tool, enabling the target invocation tool to perform corresponding data processing operations for the problem being processed. Specifically, to enable users to understand the process of reasoning and calculating the tool input parameters, the large language model can output not only the tool input parameters but also the parameter reasoning process corresponding to the tool input parameters. This parameter reasoning process can include the reasoning process and determination principle for the tool input parameters. It is understood that different target invocation tools require different tool input parameters, and different problems being processed and different tool input parameters may correspond to different parameter reasoning processes. In addition, different problems to be processed may correspond to different tool input parameters and different parameter reasoning processes. Therefore, it can be seen that the parameter reasoning process can have different forms of expression. Specifically, using a preset large language model to process the problem to be processed and obtaining a parameter reasoning process for input into the target calling tool may include: identifying whether the problem to be processed includes numerical parameters; when the problem to be processed includes numerical parameters, using the preset large language model to process the problem to be processed, and the obtained parameter reasoning process includes: the thinking process and parameter generation reasons corresponding to the tool input parameters; when the problem to be processed does not include numerical parameters, using the preset large language model to process the problem to be processed, and the obtained parameter reasoning process is a null value or a tool input parameter. Specifically, after obtaining the problem to be processed, the problem to be processed can be analyzed and processed. Specifically, a pre-trained machine learning model, a preset algorithm, or a preset rule can be used to analyze and process the problem to be processed to realize an identification operation on the problem to be processed. At this time, identifying whether the problem to be processed includes a numerical parameter may include: obtaining a pre-trained machine learning model, a preset algorithm, or a preset rule; and using the machine learning model, the preset algorithm, or the preset rule to analyze and process the problem to be processed to obtain an identification result of analyzing and identifying the problem to be processed. The identification result may include a first type of result that the problem to be processed includes a numerical parameter and a second type of result that the problem to be processed does not include a numerical parameter.When it is identified that the pending question includes a numerical parameter, the preset large language model is used to process the pending question. The obtained parameter reasoning process may include the thought process corresponding to the tool input parameter and the parameter generation reason. For example, if the pending question is "What will the weather be like tomorrow?" and the pending question is processed, it is determined that the "numerical parameter" included in the pending question is "tomorrow." In this case, when the large language model is used to process the pending question, not only the tool input parameters for input to the target invocation tool can be obtained, but also the parameter reasoning process corresponding to the numerical parameter can be obtained. For example, the thought process in the parameter reasoning process may be "Determined that today's date is January 30, 2024, based on today's date, it can be determined that tomorrow's date is January 31, 2024," and the parameter generation reason may be "Today is January 30, 2024, so tomorrow is January 31, 2024." For another example, when the problem to be processed is "the total sales volume of product A on a certain platform in the past three months", by analyzing and processing the problem to be processed, it can be determined that the "numerical parameters" included in the problem to be processed can be "the past three months" and "the total sales volume". At this time, when processing the problem to be processed through the large language model, not only the tool input parameters for inputting into the target calling tool can be obtained, but also the parameter reasoning process corresponding to the numerical parameters can be obtained. The parameter reasoning process may include a thinking process and a parameter generation reason. For example, the thinking process may be "the current month is January, the past three months are October, November and December, the sales volume in October is S1, the sales volume in November is S2, and the sales volume in December is S3. By summarizing the sales volume of the above three historical months, the total sales volume of the past three months is S1 + S2 + S3 = S4". The parameter generation reason may be "the sales volume in October is S1, the sales volume in November is S2, and the sales volume in December is S3. The total sales volume for the past three months is S1+S2+S3=S4”, which effectively ensures the stability and reliability of the thinking process and parameter generation reasons included in the parameter reasoning process.If the problem being processed is identified as not including numerical parameters, this indicates that the problem does not involve any calculations involving numerical parameters. Therefore, when processing the problem using the preset large language model, the obtained parameter inference process is either a null value or a tool input parameter. For example, if the problem being processed is "What is the traffic condition on Road XX?", this indicates that the problem does not involve any numerical parameter processing operations. In this case, the obtained parameter inference process can be a null value or a tool input parameter. This effectively enables the generation of parameter inference processes in different forms for different types of problems in different application scenarios. This effectively ensures the flexibility and reliability of determining the parameter inference process and facilitates the correctness identification of tool input parameters based on the parameter inference process. Step S203: Based on the parameter inference process, determine whether the tool input parameters are correct. With respect to tool input parameters, since the large language model is obtained through training or fine-tuning based on training data, errors may exist in the tool input parameters obtained when analyzing and processing the problem to be processed based on the large language model. Therefore, to ensure accurate and reliable data processing, after obtaining the parameter inference process and tool input parameters, the correctness of the tool input parameters can be identified based on the parameter inference process. In some instances, the correctness identification of the tool input parameters can be implemented using a pre-trained machine learning model. In this case, identifying whether the tool input parameters are correct based on the parameter inference process may include: obtaining a pre-trained machine learning model; inputting the parameter inference process and the tool input parameters into the machine learning model to obtain a recognition result output by the machine learning model for analyzing and identifying the tool input parameters. The recognition result may include: a first recognition result for identifying that the tool input parameters are correct; and a second recognition result for identifying that the tool input parameters are incorrect. This effectively ensures the correctness of the recognition result for identifying whether the tool input parameters are correct. In other instances, since the parameter inference process and the tool input parameters are two different parameters determined by a large language model, the parameter inference process and the tool input parameters correspond to each other. Therefore, whether the tool input parameters are correct can be identified based on the parameter inference process. Specifically, based on the parameter inference process, identifying whether the tool input parameters are correct may include: processing the parameter inference process to obtain inference input parameters that match the parameter inference process; when the inference input parameters are the same as the tool input parameters, determining that the tool input parameters are correct; when the inference input parameters are different from the tool input parameters, determining that the tool input parameters are incorrect, thereby effectively realizing the correctness of the tool input parameters can be identified based on the parameter inference process.Step S204: If the tool input parameters are incorrect, the tool input parameters are corrected to obtain corrected parameters. After the tool input parameters are verified for correctness, a recognition result of the correctness recognition operation can be obtained. Different recognition results may correspond to different data processing strategies. Specifically, if the recognition result indicates that the tool input parameters are correct, it indicates that the obtained tool input parameters are accurate. The correct tool input parameters can then be directly input into the target calling tool, allowing the target calling tool to analyze and process the tool input parameters and obtain a processing result corresponding to the problem to be processed. If the identification result indicates a tool input parameter error, this indicates that the tool input parameters obtained at this time contain errors. To ensure the accuracy and reliability of the data processing operation, the tool input parameters can be corrected to obtain corrected parameters. In some instances, this correction can be achieved using standard input parameters that match the problem to be processed. Correcting the tool input parameters to obtain corrected parameters can include: obtaining standard input parameters that match the problem to be processed. Specifically, the standard input parameters can be obtained by analyzing and processing the problem to be processed using a preset algorithm, preset rules, or a pre-trained machine learning model; then correcting the tool input parameters using the standard input parameters to obtain corrected parameters. The corrected parameters are identical to the standard input parameters, thereby stably and effectively completing the tool input parameter correction operation. Step S205: Processing the corrected parameters using the target invocation tool to obtain a processing result corresponding to the problem to be processed. After obtaining the corrected parameters, the target invocation tool can be used to directly process the corrected parameters, thereby obtaining the processing results corresponding to the problem being processed, output by the target invocation tool. This effectively ensures the accuracy and reliability of the data processing operation. Furthermore, after the target invocation tool processes the corrected parameters to obtain the processing results corresponding to the problem being processed, the obtained processing results can be further analyzed to determine whether the processing results meet user requirements. In this case, the method in this embodiment may further include: identifying whether the processing result is a null value; if the processing result is a null value, generating error information corresponding to the processing result; and inputting the error information into the large language model, so that the large language model re-determines the tool input parameters and parameter inference process for input into the target invocation tool based on the error information.Specifically, during the analysis and processing of the corrected parameters using the target invocation tool, the obtained processing results may fail to meet user requirements due to abnormal conditions. For example, the processing results obtained under abnormal operating conditions of the target invocation tool or network conditions may fail to meet user requirements. Therefore, after obtaining the processing results, the processing results can be analyzed and processed using preset values, preset algorithms, or pre-trained machine learning models to determine whether the processing results are null values. If the processing results are non-null values, it can be determined that the processing results preliminarily meet user requirements. If the processing results are null values, it indicates that the processing results do not meet user requirements. To ensure that the user is promptly informed of the abnormal processing status, an error message corresponding to the processing results can be generated and then input into the large language model. After the large language model obtains the error message, it can re-determine the tool input parameters and parameter inference process for input to the target calling tool based on the error message. This allows correct data processing operations to be performed based on the retrieved tool input parameters and parameter inference process, which facilitates obtaining processing results that meet user requirements. Furthermore, when performing data processing operations using the target calling tool, not only the impact of the tool input parameters on the data processing operation can be considered, but also the impact of the tool operating status of the target calling tool on the data processing operation. In this case, the method in this embodiment can further include: obtaining the tool operating status of the target calling tool; if the tool operating status is abnormal, displaying the target calling tool and the tool input parameters corresponding to the target calling tool on a display interface; in response to a user input correction operation on the tool input parameters, obtaining parameter correction information corresponding to the tool input parameters; and inputting the parameter correction information into the large language model, so that the large language model re-determines the tool input parameters and parameter inference process for input to the target calling tool based on the parameter correction information. Specifically, after the target calling tool is used to process the corrected parameters and obtain a processing result corresponding to the problem to be processed, whether the obtained processing result meets the user's needs is directly related to the operating status of the target calling tool. Therefore, in the process of using the target calling tool to process the corrected parameters, the tool operating status of the target calling tool is obtained. In some instances, the tool operating status can be obtained by detecting the target calling tool through a preset status identifier or a preset detection module. When the tool operating status is normal, it means that the target calling tool can perform normal data processing operations.If the tool's operating status is abnormal, it indicates that the target invocation tool is unable to perform normal data processing operations. The reasons for this inability may include any of the following: network anomalies, system anomalies, incompatibility between the target invocation tool and its input parameters, etc. To enable users to promptly understand the current operating status of the target invocation tool, the target invocation tool and its corresponding tool input parameters may be displayed on a display interface. This allows users to view the target invocation tool and its corresponding tool input parameters through the display interface and then manually test the target invocation tool and its corresponding tool input parameters to determine whether the target invocation tool and its input parameters are compatible. If a mismatch between the target calling tool and the tool input parameters is determined, the user can modify the tool input parameters through the display interface. Specifically, the user can input a modification operation for the tool input parameters through the display interface. Based on the modification operation, parameter modification information corresponding to the tool input parameters can be obtained. The parameter modification information can include at least one of the following: modified parameters obtained after the modification operation on the tool input parameters; or a modification amplitude corresponding to the modification operation on the tool input parameters. Due to the mismatch between the target calling tool and the tool input parameters, the target calling tool cannot perform normal data processing operations based on the tool input parameters. Therefore, to ensure accurate data processing operations, the parameter modification information can be input into the large language model. Based on the parameter modification information, the large language model re-determines the tool input parameters and parameter inference process for input to the target calling tool. This allows the target calling tool to perform data processing operations based on the re-determined tool input parameters and parameter inference process, effectively ensuring the stability and reliability of data processing operations.The data processing method provided in this embodiment obtains a problem to be processed and a target calling tool compatible with the problem to be processed; processes the problem to be processed using a preset large language model to obtain tool input parameters and a parameter inference process for input into the target calling tool; identifies whether the tool input parameters are correct based on the parameter inference process; and corrects the tool input parameters if they are incorrect to obtain corrected parameters. Since the correctness of the tool input parameters can be determined after obtaining them, the accuracy of determining the tool input parameters required for the target calling tool called by the large language model is effectively improved. The corrected parameters are then processed using the target calling tool to obtain a processing result corresponding to the problem to be processed, thereby ensuring the quality and effectiveness of the data processing operation and further improving the practicality of the method. FIG3 is a flow chart illustrating a method for identifying whether tool input parameters are correct based on a parameter inference process according to an embodiment of the present disclosure. Based on the above embodiment, referring to FIG3 , the tool input parameters can be identified not only using a pre-trained machine learning model but also based on preset verification rules. In this case, identifying whether the tool input parameters are correct based on the parameter inference process may include the following: Step S301: Obtaining verification rules for analyzing and identifying the tool input parameters. After obtaining the tool input parameters, in order to accurately analyze and identify the tool input parameters, the verification rules for analyzing and identifying the tool input parameters may be obtained. In some instances, the verification rules may be stored in a preset area or a third device. In this case, the verification rules for analyzing and identifying the tool input parameters can be obtained by accessing the preset area or the third device. Alternatively, in other instances, the validation rules may be obtained through human-computer interaction. In this case, obtaining the validation rules for analyzing and identifying the tool input parameters may include: displaying a human-computer interaction interface; obtaining an execution operation input by the user in the human-computer interaction interface; and obtaining the validation rules for analyzing and identifying the tool input parameters based on the execution operation. Step S302: Processing the tool input parameters, the problem to be processed, and the parameter inference process using the validation rules to obtain an identification result for the tool input parameters.Pre-configured validation rules are used to analyze and process tool input parameters, pending questions, and parameter inference processes. These validation rules may include keyword extraction rules, field retrieval rules, and the like. For example, a field retrieval rule may be: "1" for morning peak, morning, am, and between 8 and 9 a.m.; "2" for evening, evening peak, evening, and 8 p.m.; "3" for noon and midday peak; otherwise, the default value is "0." A keyword extraction rule may be: Time-related keywords in questions may include: ["morning peak," "evening," "noon," "morning," "day," "evening peak," "morning," "8-9 a.m.," "8 p.m.," "daytime," "6-7 a.m.," "8 a.m.," "afternoon," "evening"], and the like. Those skilled in the art can flexibly adjust or configure validation rules based on specific application scenarios or requirements, and this will not be elaborated upon here. After obtaining the validation rules, the validation rules can be used to process the tool input parameters, the problem to be processed, and the parameter reasoning process. In some instances, the validation rules are used to process the tool input parameters, the problem to be processed, and the parameter reasoning process to obtain an identification result for identifying the tool input parameters, which may include: using the validation rules to process the tool input parameters, the problem to be processed, and the parameter reasoning process to obtain standard input parameters that match the problem to be processed; when the standard input parameters are the same as the tool input parameters, it can be determined that the tool input parameters are correct; when the standard input parameters are different from the tool input parameters, it can be determined that the tool input parameters are incorrect, thereby obtaining an identification result for identifying the tool input parameters. In other instances, before using validation rules to process tool input parameters, the problem to be processed, and the parameter reasoning process to obtain standard input parameters that match the problem to be processed, the method in this embodiment may further include: identifying whether there is a logical error in the thinking process when the parameter reasoning process includes a thinking process corresponding to the tool input parameters; if there is a logical error in the thinking process, generating error prompt information corresponding to the parameter reasoning process; and inputting the error prompt information into the large language model so that the large language model re-processes the problem to be processed based on the error prompt information to re-obtain the tool input parameters and parameter reasoning process for input into the target calling tool.Specifically, since the parameter reasoning process is obtained based on a large language model, the thinking process included in the parameter reasoning process may contain logical errors. Therefore, in order to accurately implement data processing operations, when the parameter reasoning process includes a thinking process corresponding to the tool input parameters, it is possible to identify whether there are logical errors in the thinking process. In some instances, the operation of identifying the thinking process can be implemented through a pre-trained machine learning model, preset rules, or preset algorithm. At this time, identifying whether there are logical errors in the thinking process may include: obtaining a pre-trained machine learning model, preset rules, or preset algorithm; and using the pre-trained machine learning model, preset rules, or preset algorithm to identify the thinking process, so as to calmly obtain an identification result of the thinking process. If the recognition result indicates a logical error in the thinking process, this indicates an error in the large language model's processing operations. Consequently, the parameter inference process determined by the large language model may also contain errors. To obtain the correct parameter inference process, an error message corresponding to the parameter inference process can be generated and then input into the large language model. After the large language model obtains the error message, it can reprocess the problem to be processed based on the error message, thereby retrieving the tool input parameters and parameter inference process for input into the target invocation tool. Data processing can then be performed again based on the re-determined tool input parameters and parameter inference process, effectively ensuring the stability and reliability of the data processing operation. In this embodiment, by obtaining validation rules for analyzing and identifying tool input parameters, the validation rules can then be used to process the tool input parameters, the problem to be processed, and the parameter inference process to obtain a recognition result for the tool input parameters, effectively ensuring the stability and reliability of the data processing operation. In specific applications, referring to FIG4 , this application embodiment provides a method for improving the success rate of tool invocation by a large language model (LLM). This method can improve the accuracy of the LLM model in selecting the correct application tool from the tool library and substituting the correct tool parameters, thereby improving the LLM model's ability to invoke external tools to solve technical problems. The method in this embodiment may include the following steps: fine-tuning the retrieval model, fine-tuning the LLM model, tool invocation, and automatic parameter correction. Specifically, the following steps may be performed offline:
[0007] (1) Obtain a basic SBERT model for implementing a tool retrieval operation, perform a fine-tuning operation on the basic SBERT model, and obtain an SBERT_ft model. Specifically, referring to FIG5 , the sentence-BERT model can be used as the basic SBERT model for implementing a tool retrieval operation. In order to fine-tune the basic SBERT model, a tool retrieval training dataset for training or fine-tuning the basic SBERT model can be obtained. In order to accurately obtain the tool retrieval training dataset, a tool call question can be first generated based on a preset tool. Since the number of tool call questions is limited and the format and expression are relatively fixed, this will greatly increase the restrictions on calling the application tool. In addition, the limited number of description questions may not guarantee the quality and effect of fine-tuning the basic SBERT model. Therefore, in order to increase the amount of training data, after obtaining the tool call question, a preset generalization algorithm or a pre-trained machine learning model or neural network model can be used to generalize the tool call question to obtain a generalized question. The tool call problem can be generalized to obtain generalized questions corresponding to the tool call problem, each posed differently. The tool call problem and the generalized questions are then identified as the training problem set Q. For each problem in training problem set Q, vector search is used to select n semantically similar tools from the tool library to construct a candidate tool set. Each candidate tool in the candidate tool set can include a tool name and a tool description, and the candidate tool set often contains one correct tool. Three training triplets (q, p, n1), (q, p, n2), and (q, p, n3) are then constructed for each tool call problem. Question q is the anchor, p is the positive sample, and n1, n2, and n3 are negative samples.
[0008] "1. [LinkSpeedIndexFetch]: A road speed query tool that can obtain the average speed data for a specified road section (a specific road).
[0009] 2. AreaFlowFetch: This tool retrieves regional in-transit data, which shows the number of vehicles traveling within a specified time window.
[0010] 3. [LinkVoIumeIndexFetch]: A road traffic query tool that can obtain the traffic flow of a specific road section (a certain road).
[0011] "opt_too I": "LinkSpeedIndexFetch"}. After obtaining the tool retrieval training dataset, you can configure a loss function for fine-tuning the basic SBERT model. This loss function can be implemented as a TripletLoss function. Then, you can use the loss function and the tool retrieval training dataset to fine-tune the SBERT model, thereby stably obtaining the SBERT_ft model.
[0012] (2) Obtain a basic LLM model, perform fine-tuning on the basic LLM model, and obtain an LLM_ft model. Specifically, referring to FIG6 , the basic LLM model (qwen-7B model, qwen-14B model) is used as the basic LLM model. In order to fine-tune the basic LLM model, the training data in the training data set can be divided into two categories: a tool selection training data set and a tool parameter substitution training data set. The training data in the tool selection training data set may include: question q, four alternative tool sets, and the correct tool name; the training data in the tool parameter substitution training data set may include: question, parameter description, and correct parameter output. The basic LLM model is fine-tuned using the two sets of training data, so that the basic LLM model learns the ability to call the tool and the ability to determine the input parameters required by the tool. For example, the tool selection training data sample can be expressed as follows:
[0013] {"q" : "You are an agent who can use multiple tools to obtain data. At each step, you should choose one and only one operation from the list of valid operations: \n;
[0014] 1. [LinkDelayIndexRank]: A road congestion ranking tool that returns the top road congestion indexes in a specified area, including the most congested roads.
[0015] 2. [LinkJamDurIndexFetch]: A road congestion duration query tool that retrieves congestion duration data for a specific road section.
[0016] 3. [LinkFreqDelayRank]: A tool that ranks frequently congested road sections, providing information on frequently congested road sections within a region.
[0017] 4. [LinkSpeedIndexFetch]: This tool retrieves the average speed data for a specific road section. Where $TOOL_NAME must be one of ["Final Answer", LinkDelayIndexRank, LinkJamDurIndexFetch, LinkFreqDelayRank, LinkSpeedIndexFetch]. Select the tool that best fits your question and output $TOOL_NAME. o \n; The question is: How long was the congestion on Shuxin Road yesterday?\n",
[0018] "a" : "LinkJamDurIndexFetch"}. Substituting the parameters into the training data sample can be expressed as follows:
[0019] {"q": "Today is 20211117, you are an agent who can analyze data. Please use a JSON format to output parameters. \n; Parameters are described as follows:
[0020] Input args : { ' Link_name ' : { 'title' : Link_name ' , ' description ' : 'Name of the road being queried, Chinese name', ' type ' : 'string'}, ' dt ' : { 'title' : ' dt ' , ' description ' : 'Date of the query, format is yyyymmdcl, the default is today', 'type' : 'string'}\n; Among them, the number retrieval rule of the time_span field is: 1 for the morning rush hour, morning, am, and between 8 and 9 a.m.; 2 for the evening, evening rush hour, evening, and 8 p.m.; 3 for noon and midday peak; otherwise, the default value is 0\n; The question is: Regional traceability distribution of bus trips passing through Wenyi West Road\n; Please correct the l in Input args according to the question Assign values to fields such as ink_name and dt, and output them in json format\n",
[0021] "a": "{' I ink_name' : , Wenyi West Road', 'dt' : ' 20211117'} "} o After obtaining the tool selection training dataset and the tool parameter substitution training dataset, the basic LLM model can be trained using the LoRA fine-tuning algorithm, the tool selection training dataset, and the tool parameter substitution training dataset, so that the LLM model can learn the tool calling capability and parameter substitution capability.
[0022] (3) Cluster and summarize which tool should be called for each type of question from the historical tool call records to form a toolset vector database. In order to accurately obtain the toolset vector database, the experience of each successful tool call of the large language model can be saved first, and then the experience information of tool calls can be clustered offline regularly. Specifically, each called tool can be identified as a category, and the central vector representation of the category can be calculated for the embedded vector representations of all historical questions in each category; when a new question corresponding to the called tool is obtained, vector retrieval is used in the working set vector database. If the distance between the new question and the central vector representation is less than a preset threshold, the tool is selected in the toolset vector dataset. For the data in the toolset vector database, in order to improve the quality and effect of tool retrieval, the data in the toolset vector database can be regularly configured as vector representation information for implementing tool retrieval operations, and the data in the toolset vector dataset can be regularly optimized and configured to improve the accuracy of the retrieval tool and the recall rate of the correct tool appearing in the top n rankings.
[0023] (4) Use the SBERT_ft model to vectorize the tool name and tool description of each tool in the tool library and store them in the vector database for tool retrieval operations. The tool library includes a reference tool set that can be called by the LLM model. The reference tool set may include at least one of the following: data analysis tools, traffic management tools, retail tools, logistics and transportation tools, etc. After obtaining the reference tool set, the tool name and tool description of the application tool can be vectorized to obtain the vectorized representation information corresponding to each application tool, and the vectorized representation information corresponding to each application tool can be stored in the tool library. After the above offline steps are completed, the method for improving the success rate of LLM tool calling in this embodiment may include the following steps: Step 1: Obtain user questions. Step 2: Use the SBERT_ft model to vectorize the user questions to obtain e_question, retrieve the four tools with the closest cosine distance from the tool set vector database as too l_top4, and sort them from small to large according to the cosine distance. Specifically, after obtaining the user's question, the SBERT_ft model can be used to vectorize the user's question, thereby obtaining a vectorized representation e_question corresponding to the user's question. Then, based on the vectorized representation, a tool search operation can be performed in the tool set vector database to obtain four tools that are close to the user's question, thereby retrieving the alternative tool set too l_top4 o If the tool vector database does not contain the closest tool to the user's question, it indicates that the user's question is a new and unprocessed question. In this case, the user's question can be input into the LLM model to determine the tool to be used to analyze and process the user's question. Step 3: Obtain a historical tool call experience database and search the historical tool call experience database to see if there is a target call problem that matches the user's question. Based on the search results, determine the target call tool to solve the user's question. oWhen searching the historical tool call experience library for user questions, if there are historical questions that are highly consistent with the user questions, the tool used for the historical questions in the historical tool call experience library can be determined as the target call tool, too_selected. The target call tool can be any one of the four search tools screened by the SBERT_ft model, or the target call tool can be the application tool with the highest similarity among the first four search tools, that is, the tool ranked first in the too_top4 is selected as the target call tool, too_selected. If there are no matching known questions in the historical tool call experience library, input prompt information can be generated for asking the LLM_ft model a question. The prompt includes the user question and the too_top4 toolset. The input prompt information can then be input into the LLM_ft model, causing the LLM_ft model to select the tool from the too_top4 toolset that is most likely to solve the problem as the target call tool, too_selected. Step 4: The LLM_ft model outputs the tool inputs corresponding to the target invocation tool. Specifically, to enable the LLM_ft model to perform data processing operations using the target invocation tool, the tool inputs corresponding to the target invocation tool can be determined. Specifically, to accurately determine the tool inputs, prompts can be generated for input to the LLM_ft model. This prompt is input to the LLM_ft model, asking it to output the tool inputs required for the target invocation tool in JSON format. These tool inputs can be labeled parameter_LLM. To ensure the quality and effectiveness of data processing operations, the LLM_ft model not only outputs the tool inputs required by the target invocation tool, but also outputs the thought process corresponding to the tool inputs, which contains the rationale for parameter generation. Step 5: Automatically revise the tool inputs based on rules. Specifically, the LLM_ft model is communicated with a validator for correcting tool input parameters. After obtaining the tool input parameters, the user's questions and thinking process are input into the validator together. The validator can extract keywords based on preset rules, and then call customized functions to verify the tool input parameters determined by the LLM_ft model. When the tool input parameters are incorrect, the tool input parameters can be corrected to obtain the corrected parameters parameter_fixed; when the tool input parameters are correct, the tool input parameters can be kept unchanged.Step 6: The target calling tool processes the corrected parameters to implement data processing operations. The LLM_ft model can call the target calling tool and input the corrected parameters into the target calling tool to implement data processing operations. Specifically, the target calling tool can be too_selected, and the tool input parameter can be parameter_fixed. o For example, for the tool input parameter ' time_span ', ' description ': , the query time range: 0 represents the whole day, 1 represents the morning peak, 2 represents the evening peak, 3 represents the daily off-peak, if the question includes keywords such as ["morning peak", "evening", "noon", "morning", "day", "evening peak", "morning", "8-9 o'clock", "8 o'clock in the evening", "daytime", "6-7 o'clock", "8 o'clock", "afternoon", "evening"], the validator can automatically correct the modified parameter time_span output by the LLM_ft model. oStep 7: Tool Execution Results Verification and User Feedback. This step identifies whether the target invocation tool executes normally. If so, the data processing results output by the target invocation tool can be obtained. If the target invocation tool executes abnormally, for example, if the target invocation tool's interface reports an error, a prompt message identifying the error can be provided to the user. Based on this prompt, the user can then verify that the selected target invocation tool is correct and that the tool input parameters corresponding to the target invocation tool are correct. After receiving the user feedback, the user's feedback text can be added to the model prompt information, allowing the LLM_ft model to re-determine the target invocation tool and the tool input parameters required by the target invocation tool based on the model prompt information. Step 8: The target invocation tool outputs the data processing results. Repeat the above steps until the tool is successfully invoked and outputs the results. The data processing results are then returned to the user.The technical solution provided by this application embodiment uses the SBERT_ft model to retrieve backup call tools from a massive tool library, and then the target call tool can be determined based on the backup call tools. Specifically, the SBERT_ft model and vector retrieval can be used to perform tool selection operations, which effectively improves the recall rate and confirmation accuracy of the target call tool. There is no need to ask the large model to select the target call tool, which can significantly reduce resource consumption and improve tool retrieval efficiency. In addition, by dividing tool selection and determining tool input parameters into two steps, that is, performing model training operations as two tasks during LLM fine-tuning, the success rate and accuracy of tool calls can be significantly improved. In addition, when the tool input parameters required for the target call tool are obtained, the correctness of the tool input parameters can be identified. If there are errors or errors in the tool input parameters, the tool input parameters can be corrected based on the rule-based automatic parameter correction function, further compensating for the problem that the large model lacks understanding of specific fields and improving the accuracy of parameter substitution. In addition, when an exception occurs during data processing by the target call tool, The target invocation tool and its input parameters can be displayed to the user through a display interface, and user feedback on the target invocation tool and its input parameters can be obtained through human-computer interaction. This effectively allows manual corrections to be made when an abnormal state or operational error occurs in the LLM model data processing operation, allowing the target invocation tool and its input parameters to be re-determined. To improve the continued practicality of this technical solution, after obtaining the target invocation tool and its required tool input parameters, experience with successful data processing operations can be accumulated in a tool invocation experience library, and the retrieval model SBERT_ft and LLM model can be continuously iterated and optimized. This effectively improves the accuracy and reliability of the retrieval model and the large language model, further enhancing the practicality of this technical solution.FIG7 is a schematic structural diagram of a data processing device provided by an embodiment of the present disclosure. Referring to FIG7 , this embodiment provides a data processing device for executing the data processing method shown in FIG2 . The data processing device may include: a first acquisition module 11 for acquiring a problem to be processed and a target invocation tool compatible with the problem to be processed; a first processing module 12 for processing the problem to be processed using a preset large language model to obtain tool input parameters and a parameter inference process for input into the target invocation tool, where the target invocation tool is called by the large language model; a first identification module 13 for identifying whether the tool input parameters are correct based on the parameter inference process; the first processing module 12 is further configured to correct the tool input parameters to obtain corrected parameters if the tool input parameters are incorrect; and the first processing module 12 is further configured to process the corrected parameters using the target invocation tool to obtain a processing result corresponding to the problem to be processed. In some instances, when the first acquisition module 11 acquires a target calling tool that is compatible with the problem to be processed, the first acquisition module 11 is used to: acquire a reference tool set that can be called by the large language model; determine, from the reference tool set, alternative calling tools corresponding to the problem to be processed, where the number of alternative calling tools is less than the number of tools included in the reference tool set; and determine, from the alternative calling tools, a target calling tool that is compatible with the problem to be processed. In some instances, after determining the alternative calling tool corresponding to the problem to be processed, the first acquisition module 11 and the first processing module 12 in this embodiment are used to perform the following steps: the first acquisition module 11 is used to obtain a historical database for analyzing and processing the problem to be processed, and the historical database includes: processed problems and standard application tools that are compatible with the processed problems; the first processing module 12 is used to determine the standard application tool corresponding to the processed problem as the target calling tool if there is a processed problem that matches the problem to be processed in the historical database; the first processing module 12 is also used to allow the target calling tool that is compatible with the problem to be processed to be determined from the alternative calling tools if there is no processed problem that matches the problem to be processed in the historical database. In some examples, when the first processing module 12 determines a target calling tool that is compatible with the problem to be processed from among the alternative calling tools, the first processing module 12 is configured to: generate tool confirmation prompt information for input into the large language model based on the problem to be processed and all the alternative calling tools; and input the tool confirmation prompt information into the large language model to obtain the target calling tool that is compatible with the problem to be processed, as output by the large language model.In some instances, when the first processing module 12 uses a preset large language model to process the pending problem and obtain a parameter inference process for input into the target invocation tool, the first processing module 12 is configured to: identify whether the pending problem includes numerical parameters; if the pending problem includes numerical parameters, process the pending problem using the preset large language model, and the obtained parameter inference process includes: a thought process corresponding to the tool input parameters and a parameter generation reason; if the pending problem does not include numerical parameters, process the pending problem using the preset large language model, and the obtained parameter inference process is a null value or a tool input parameter. In some instances, when the first identification module 13 identifies whether the tool input parameters are correct based on the parameter inference process, the first identification module 13 is configured to: obtain validation rules for analyzing and identifying the tool input parameters; and process the tool input parameters, the pending problem, and the parameter inference process using the validation rules to obtain an identification result for the tool input parameters. In some instances, when the first identification module 13 uses the verification rules to process the tool input parameters, the problem to be processed, and the parameter reasoning process to obtain an identification result for identifying the tool input parameters, the first identification module 13 is used to execute: using the verification rules to process the tool input parameters, the problem to be processed, and the parameter reasoning process to obtain standard input parameters that match the problem to be processed; if the standard input parameters are the same as the tool input parameters, determining that the tool input parameters are correct; if the standard input parameters are different from the tool input parameters, determining that the tool input parameters are incorrect. In some instances, before using validation rules to process the tool input parameters, the problem to be processed, and the parameter inference process to obtain standard input parameters matching the problem to be processed, the first processing module 12 in this embodiment is further configured to: if the parameter inference process includes a thinking process corresponding to the tool input parameters, identify whether the thinking process contains a logical error; if a logical error exists in the thinking process, generate an error message corresponding to the parameter inference process; and input the error message into the large language model so that the large language model reprocesses the problem to be processed based on the error message to re-obtain the tool input parameters and parameter inference process for input into the target invocation tool. In some instances, when the first processing module 12 modifies the tool input parameters to obtain modified parameters, the first processing module 12 is configured to: obtain standard input parameters matching the problem to be processed; and modify the tool input parameters using the standard input parameters to obtain modified parameters, where the modified parameters are identical to the standard input parameters.In some examples, after the target invocation tool is used to process the corrected parameters and obtain a processing result corresponding to the problem to be processed, the first recognition module 13 and the first processing module 12 in this embodiment are used to perform the following steps: the first recognition module 13 is used to identify whether the processing result is a null value; the first processing module 12 is used to generate error prompt information corresponding to the processing result if the processing result is a null value; and the error prompt information is input into the large language model, so that the large language model re-determines the tool input parameters and parameter inference process for input into the target invocation tool based on the error prompt information. In some examples, the first acquisition module 11 and the first processing module 12 in this embodiment are configured to: First acquisition module 11 for acquiring the tool operating status of the target invocation tool; First processing module 12 for displaying the target invocation tool and the tool input parameters corresponding to the target invocation tool on a display interface if the tool operating status is abnormal; Obtaining parameter correction information corresponding to the tool input parameters in response to a user's input correction operation on the tool input parameters; Inputting the parameter correction information into a large language model so that the large language model re-determines the tool input parameters and parameter inference process for input to the target invocation tool based on the parameter correction information. The device shown in FIG7 can execute the method of the embodiments shown in FIG1-6. For portions not described in detail in this embodiment, reference is made to the relevant description of the embodiments shown in FIG1-6. The execution process and technical effects of this technical solution are described in the embodiments shown in FIG1-6 and will not be repeated here. In one possible design, the structure of the data processing device shown in FIG7 can be implemented as an electronic device, which can be a controller, a personal computer, a server, or other devices. As shown in FIG8, the electronic device can include: a first processor 21 and a first memory 22. OThe first memory 22 is used to store a program for the electronic device to execute the data processing method provided in the embodiments shown in Figures 1-6 . The first processor 21 is configured to execute the program stored in the first memory 22. The program includes one or more computer instructions. When executed by the first processor 21, the one or more computer instructions can implement the following steps: obtaining a problem to be processed and a target invocation tool compatible with the problem to be processed; processing the problem to be processed using a preset large language model to obtain tool input parameters and a parameter inference process for input into the target invocation tool, wherein the target invocation tool is configured to be invoked by the large language model; identifying whether the tool input parameters are correct based on the parameter inference process; if the tool input parameters are incorrect, correcting the tool input parameters to obtain corrected parameters; and processing the corrected parameters using the target invocation tool to obtain a processing result corresponding to the problem to be processed. Furthermore, the first processor 21 is also configured to execute all or part of the steps in the embodiments shown in Figures 1-6 . The electronic device may also include a first communication interface 23 for communicating with other devices or a communication network. In addition, embodiments of the present disclosure provide a computer storage medium for storing computer software instructions for use in an electronic device, including a program for executing the data processing methods described in the embodiments shown in Figures 1-6 . Furthermore, embodiments of the present disclosure provide a computer program product, comprising: a computer-readable storage medium storing computer instructions. When the computer instructions are executed by one or more processors, the one or more processors are caused to perform the steps of the data processing methods described in the method embodiments shown in Figures 1-6 . The apparatus embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, i.e., they may be located in one location or distributed across multiple network elements. Some or all of the modules may be selected based on actual needs to achieve the objectives of the present embodiments. Persons of ordinary skill in the art can understand and implement the present embodiments without inventive effort. Through the above description of the embodiments, persons of ordinary skill in the art can clearly understand that each embodiment can be implemented by adding a necessary general-purpose hardware platform, or alternatively, by combining hardware and software.Based on this understanding, the above technical solutions, or the portions that contribute to the prior art, can essentially be embodied in the form of computer products. The present disclosure can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROMs, optical storage, etc.) containing computer-usable program code. The present disclosure is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present disclosure. It should be understood that each process and / or block in the flowcharts and / or block diagrams, as well as combinations of processes and / or blocks in the flowcharts and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable device to generate a machine, such that the instructions, executed by the processor of the computer or other programmable device, generate means for implementing the functions specified in one or more processes in the flowcharts and / or one or more blocks in the block diagrams. These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable device to operate in a specific manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means that implement the functions specified in one or more flows in a flowchart and / or one or more blocks in a block diagram. These computer program instructions may also be loaded onto a computer or other programmable device, causing the computer or other programmable device to execute a series of operational steps to produce a computer-implemented process, such that the instructions executed on the computer or other programmable device provide steps for implementing the functions specified in one or more flows in a flowchart and / or one or more blocks in a block diagram. In a typical configuration, a computing device includes one or more processors (CPUs), input / output interfaces, network interfaces, and memory. The memory may include non-permanent storage in a computer-readable medium, random access memory (RAM), and / or non-volatile memory, such as read-only memory (ROM) or flash memory. OMemory is an example of computer-readable media. Computer-readable media includes both permanent and non-permanent, removable and non-removable media that can implement information storage using any method or technology. Information can be computer-readable instructions, data structures, program modules, or other data. Examples of computer storage media include, but are not limited to, phase-change RAM (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transmitting medium that can be used to store information that can be accessed by a computing device. As defined herein, computer-readable media does not include transitory computer-readable media, such as modulated data signals and carrier waves. Finally, it should be noted that the above embodiments are merely illustrative of the technical solutions of the present disclosure and are not intended to limit the present disclosure. Although the present disclosure has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they may modify the technical solutions described in the aforementioned embodiments or replace some of the technical features therein with equivalents. However, such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the various embodiments of the present disclosure.
Claims
Claims 1. A data processing method, comprising: Obtaining a problem to be processed and a target calling tool adapted to the problem to be processed; Processing the problem to be processed using a preset large language model to obtain tool input parameters and a parameter inference process for input into a target calling tool, wherein the target calling tool is called by the large language model; identifying whether the tool input parameters are correct based on the parameter inference process; and if the tool input parameters are incorrect, correcting the tool input parameters to obtain corrected parameters; The corrected parameters are processed using the target calling tool to obtain a processing result corresponding to the problem to be processed.
2. The method according to claim 1, wherein: Obtaining a target calling tool that is compatible with the problem to be processed includes: obtaining a reference tool set that can be called by the large language model; determining, from the reference tool set, alternative calling tools corresponding to the problem to be processed, wherein the number of the alternative calling tools is less than the number of tools included in the reference tool set; and determining, from the alternative calling tools, a target calling tool that is compatible with the problem to be processed.
3. The method according to claim 2, wherein: After determining the alternative calling tool corresponding to the problem to be processed, the method further includes: obtaining a historical database for analyzing and processing the problem to be processed, the historical database including: processed problems and standard application tools adapted to the processed problems; if there is a processed problem matching the problem to be processed in the historical database, the standard application tool corresponding to the processed problem is determined as the target calling tool; if there is no processed problem matching the problem to be processed in the historical database, it is allowed to determine the target calling tool adapted to the problem to be processed in the alternative calling tools.
4. The method according to claim 2 or 3, wherein: Determining a target calling tool that is compatible with the problem to be processed among the alternative calling tools includes: generating tool confirmation prompt information for input into the large language model based on the problem to be processed and all the alternative calling tools; and inputting the tool confirmation prompt information into the large language model to obtain the target calling tool that is compatible with the problem to be processed, as output by the large language model.
5. The method according to any one of claims 1 to 4, wherein: The problem to be processed is processed using a preset large language model to obtain a parameter reasoning process for input into the target calling tool, including: identifying whether the problem to be processed includes numerical parameters; if the problem to be processed includes numerical parameters, the problem to be processed is processed using a preset large language model, and the obtained parameter reasoning process includes: a thinking process and parameter generation reasons corresponding to the tool input parameters; if the problem to be processed does not include numerical parameters, the problem to be processed is processed using a preset large language model, and the obtained parameter reasoning process is a null value or the tool input parameter.
6. The method according to any one of claims 1 to 5, wherein: Based on the parameter reasoning process, identifying whether the tool input parameters are correct includes: obtaining a verification rule for analyzing and identifying the tool input parameters; and using the verification rule to process the tool input parameters, the problem to be processed, and the parameter reasoning process to obtain an identification result for identifying the tool input parameters.
7. The method according to claim 6, wherein: The tool input parameters, the problem to be processed and the parameter reasoning process are processed by using the verification rules to obtain an identification result of the tool input parameters, including: processing the tool input parameters, the problem to be processed and the parameter reasoning process by using the verification rules to obtain standard input parameters that match the problem to be processed; if the standard input parameters are the same as the tool input parameters, determining that the tool input parameters are correct; if the standard input parameters are different from the tool input parameters, determining that the tool input parameters are incorrect.
8. The method according to claim 7, wherein: Before using the verification rules to process the tool input parameters, the problem to be processed and the parameter reasoning process to obtain standard input parameters that match the problem to be processed, the method further includes: if the parameter reasoning process includes a thinking process corresponding to the tool input parameters, identifying whether there is a logical error in the thinking process; if there is a logical error in the thinking process, generating error prompt information corresponding to the parameter reasoning process; inputting the error prompt information into the large language model, so that the large language model re-processes the problem to be processed based on the error prompt information, so as to re-obtain the tool input parameters and parameter reasoning process for input into the target calling tool.
9. The method according to any one of claims 1 to 8, wherein: Correcting the tool input parameters to obtain corrected parameters includes: obtaining standard input parameters that match the problem to be processed; and correcting the tool input parameters using the standard input parameters to obtain corrected parameters, wherein the corrected parameters are the same as the standard input parameters.
10. The method according to any one of claims 1 to 9, wherein: After using the target calling tool to process the corrected parameters and obtain a processing result corresponding to the problem to be processed, the method also includes: identifying whether the processing result is a null value; if the processing result is a null value, generating an error prompt information corresponding to the processing result; inputting the error prompt information into the large language model, so that the large language model re-determines the tool input parameters and parameter inference process for input into the target calling tool based on the error prompt information.
11. The method according to any one of claims 1 to 10, further comprising: Acquiring a tool running state of the target calling tool; and displaying the target calling tool and tool input parameters corresponding to the target calling tool on a display interface when the tool running state is abnormal. In response to a modification operation input by a user on the tool input parameter, obtaining parameter modification information corresponding to the tool input parameter; The parameter modification information is input into the large language model, so that the large language model re-determines the tool input parameters and parameter reasoning process for input into the target calling tool based on the parameter modification information.
12. A data processing device, comprising: A first acquisition module is used to acquire a problem to be processed and a target calling tool adapted to the problem to be processed; a first processing module configured to process the problem to be processed using a preset large language model to obtain tool input parameters and parameter inference processes for inputting into a target calling tool, wherein the target calling tool is configured to be called by the large language model; The first identification module is used to identify whether the tool input parameters are correct based on the parameter reasoning process; the first processing module is also used to correct the tool input parameters if the tool input parameters are incorrect to obtain corrected parameters; the first processing module is also used to process the corrected parameters using the target calling tool to obtain a processing result corresponding to the problem to be processed.
13. An electronic device, comprising: A memory, a processor; wherein the memory is used to store one or more computer instructions, wherein the one or more computer instructions, when executed by the processor, implement the method of any one of claims 1-11 above.
14. A computer program product comprising: A computer program, when executed by a processor of an electronic device, causes the processor to perform the steps of the method according to any one of claims 1 to 11.
15. A computer storage medium for storing a computer program, wherein the computer program enables a computer to implement the steps of the method of any one of claims 1 to 11 when executed.
Citation Information
Patent Citations
Generative large language model training method and model-based search method
CN116226334A
Intelligent dialogue processing method and device, equipment and storage medium
CN116737910A
Semantic-based route solving method and device, storage medium and electronic equipment
CN116776012A
Natural language to API conversion
US20220413874A1