Data processing method, system and device, storage medium and program product

By using plug-ins and user question examples in the generative large model to generate prompt words and accurately match the target plug-in, the problem of lack of knowledge in the large model is solved, and the accuracy of the answer and user experience are improved.

CN120654801APending Publication Date: 2025-09-16HANGZHOU ALICLOUD FEITIAN INFORMATION TECH CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202410301851.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-03-15
Publication Date
2025-09-16

AI Technical Summary

Technical Problem

Existing large generative models cannot accurately answer user questions due to lack of knowledge, resulting in the need for extensive model fine-tuning and hardware costs.

Method used

Expand the functionality of large models through plug-ins, generate prompt words using plug-in descriptions and user question examples, accurately match target plug-ins to answer user questions, and reduce model fine-tuning time and hardware costs.

Benefits of technology

It improves the accuracy of the big model's answers and the user's question-and-answer experience, enriches the big model's usage scenarios and scope, and solves the problem of lack of knowledge.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120654801A_ABST
    Figure CN120654801A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a data processing method, system and device, a storage medium and a program product. The method comprises the following steps: determining a user question and at least one candidate plug-in corresponding to a generative large model; the large generative model is obtained through training of a training sample; generating a first prompt word according to the user question, the plug-in description information of the at least one candidate plug-in and a user question example corresponding to the at least one candidate plug-in; inputting the first cue word into a generative large model, so that the generative large model determines a target plug-in used for answering the user question from the at least one candidate plug-in; and based on the target plug-in, generating reply information of the user question. According to the technical scheme provided by the embodiment of the invention, the expansion of large model functions can be realized on the premise of not carrying out fine tuning training.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a data processing method, system, device, storage medium, and program product. Background Art

[0002] The rapid development of artificial intelligence in recent years has attracted widespread attention, and generative large models have become one of the hot research directions.

[0003] Generative big models (hereafter referred to as big models) refer to a type of AI that can be used to create new content and ideas, including conversations, stories, images, videos, and music. Like all AI, generative AI is powered by machine learning models, which are very large models pre-trained on large amounts of data and are often called foundation models (FM). In addition to content creation, generative AI is also used to improve the quality of digital images, edit videos, rapidly build manufacturing prototypes, and enhance data using synthetic datasets.

[0004] Currently, existing large models need to be fine-tuned to address the problem of knowledge deficiency (e.g., knowledge lag). Summary of the Invention

[0005] In view of the above problems, the present application is proposed to provide a data processing method, system, device, storage medium and program product, which can more accurately answer questions that large models cannot answer due to lack of knowledge through plug-ins, saving a lot of time costs and machine hardware costs required for model fine-tuning.

[0006] In a first aspect of the present application, a data processing method based on a generative large model is provided, comprising:

[0007] Determine a user question and at least one candidate plug-in corresponding to the generative large model; the generative large model is obtained by training with training samples;

[0008] generating a first prompt word according to the user question, the plug-in description information of the at least one candidate plug-in, and the user question example corresponding to each of the at least one candidate plug-in;

[0009] Inputting the first prompt word into the generative big model, so that the generative big model determines a target plug-in for answering the user question from the at least one candidate plug-in;

[0010] Generate answer information for the user question based on the target plug-in. In one embodiment provided by the first aspect, generating a first prompt word based on the user question, the plug-in description information of the at least one candidate plug-in, and the user question example corresponding to each of the at least one candidate plug-in includes:

[0011] Obtaining the first prompt word template related to the plug-in screening task;

[0012] A first prompt word is generated according to the user question, the plug-in description information of the at least one candidate plug-in, the user question example corresponding to each of the at least one candidate plug-in, and the first prompt word template.

[0013] In an implementation provided by the first aspect, the user question examples include: manually edited user question examples and / or user question examples expanded based on the manually edited user question examples.

[0014] In an implementation provided by the first aspect, generating answer information for the user question based on the target plug-in includes:

[0015] Determining parameter values ​​of input parameters of the target plug-in from the user question using the generative big model;

[0016] Based on the parameter value of the input parameter of the target plug-in, calling the target plug-in to obtain a calling result;

[0017] Generate answer information for the user question based on the call result.

[0018] In an embodiment provided by the first aspect, determining parameter values ​​of input parameters of the target plug-in from the user question using the generative big model includes:

[0019] Obtaining a parameter extraction example of the user question example corresponding to the target plug-in; the parameter extraction example includes: a one-to-one correspondence between keywords in the user question example and input parameters of the target plug-in;

[0020] generating a second prompt word according to the user question, the user question example corresponding to the target plug-in, and the parameter extraction example of the user question example corresponding to the target plug-in;

[0021] The second prompt word is input into the generative big model, so that the parameter value of the input parameter of the target plug-in is extracted from the user question by the generative big model.

[0022] In one embodiment provided by the first aspect, generating a second prompt word according to the user question, the user question example corresponding to the target plug-in, and a one-to-one correspondence between keywords in the user question example and input parameters of the target plug-in includes:

[0023] Obtaining a second prompt word template related to the plug-in parameter extraction task;

[0024] A second prompt word is generated according to the user question, the user question example corresponding to the target plug-in, the parameter extraction example of the user question example corresponding to the target plug-in, and the second prompt word template.

[0025] In an implementation provided by the first aspect, generating answer information for the user question according to the call result includes:

[0026] Obtaining a preconfigured reply format for the target plug-in; the reply format is pre-selected from a text format and a graphic format;

[0027] The call result is processed according to the reply form to obtain reply information of the user question that satisfies the reply form.

[0028] In an implementation manner provided by the first aspect, processing the call result according to the reply form includes:

[0029] When the answer form is in text form, the user question and the call result are input into the generative big model, so that the generative big model generates answer information of the user question that satisfies the answer form;

[0030] When the answer is in a chart form, the call result is processed using a custom chart component to obtain answer information for the user question that satisfies the answer form.

[0031] In an implementation provided in the first aspect, the custom chart component includes one or more of a table component, a picture component, a line chart component, and a pie chart component.

[0032] In an implementation provided by the first aspect, determining at least one candidate plug-in corresponding to the generative large model includes:

[0033] Vectorizing the user question to obtain a user question vector;

[0034] Obtaining a first vector of plug-in description information of a plurality of plug-ins corresponding to the generative large model and a second vector of user question examples corresponding to the plurality of plug-ins;

[0035] At least one candidate plug-in matching the user question is determined from the plurality of plug-ins according to the matching degree between the user question vector and the first vector and the matching degree between the user question vector and the second vector.

[0036] In an embodiment provided by the first aspect, after determining the parameter value of the input parameter of the target plug-in from the user question using the generative large model, the method further includes:

[0037] Determining whether there is an input parameter with an undetermined parameter value among the input parameters of the target plug-in;

[0038] If there is an input parameter with an undetermined parameter value among the input parameters of the target plug-in, generating a query question according to the input parameter with an undetermined parameter value;

[0039] Sending the query to the user;

[0040] Determine the parameter value of the input parameter whose parameter value is not determined according to the feedback information of the user in response to the inquiry question.

[0041] A second aspect of the present application provides a data processing method based on a generative large model, comprising:

[0042] Determine a medical problem and at least one candidate plug-in corresponding to the generative large model; the generative large model is trained with training samples;

[0043] generating a first prompt word according to the medical problem, the plug-in description information of the at least one candidate plug-in, and the medical problem example corresponding to each of the at least one candidate plug-in;

[0044] Inputting the first prompt word into the generative big model, so that the generative big model determines a target plug-in for answering the medical question from the at least one candidate plug-in;

[0045] Based on the target plug-in, answer information for the medical question is generated.

[0046] In an embodiment provided by the second aspect, generating answer information for the medical question based on the target plug-in includes:

[0047] Determining parameter values ​​of input parameters of the target plug-in from the medical problem using the generative big model;

[0048] Based on the parameter value of the input parameter of the target plug-in, calling the target plug-in to obtain a calling result;

[0049] Generate answer information for the medical question based on the call result.

[0050] In an embodiment provided by the second aspect, determining parameter values ​​of input parameters of the target plug-in from the user question using the generative big model includes:

[0051] Obtaining a parameter extraction example of the medical problem example corresponding to the target plug-in; the parameter extraction example includes: a one-to-one correspondence between keywords in the medical problem example and input parameters of the target plug-in;

[0052] generating a second prompt word according to the medical problem, the medical problem example corresponding to the target plug-in, and the parameter extraction example of the medical problem example corresponding to the target plug-in;

[0053] The second prompt word is input into the generative big model, so as to extract the parameter value of the input parameter of the target plug-in from the medical problem through the generative big model.

[0054] In a third aspect of the present application, a network system is provided, comprising: a configuration terminal and an operation terminal; an application related to a generative large model is run on the operation terminal; wherein,

[0055] The configuration terminal is configured to generate a configuration file for the plug-in, wherein the configuration file includes a description of the plug-in and an example of a user question corresponding to the plug-in; and send the configuration file to the execution terminal.

[0056] The running end is used to: receive the configuration file; load the plug-in for the application according to the configuration file; determine the user question and at least one candidate plug-in loaded by the application; the generative big model is trained with training samples; generate a first prompt word according to the user question, the plug-in description information of the at least one candidate plug-in, and the user question example corresponding to each of the at least one candidate plug-in; input the first prompt word into the generative big model so that the generative big model determines a target plug-in for answering the user question from the at least one candidate plug-in; and generate answer information for the user question based on the target plug-in.

[0057] The fourth aspect of the present application provides an electronic device. The electronic device includes: a memory and a processor, wherein:

[0058] The memory is used to store programs;

[0059] The processor is coupled to the memory and is configured to execute the program stored in the memory to implement any of the above methods.

[0060] In a fifth aspect of the present application, a computer-readable storage medium storing a computer program is provided, wherein the computer program can implement any of the above-described methods when executed by a computer.

[0061] In a sixth aspect of the present application, a computer program product is provided, comprising a computer program, which implements any of the above methods when executed by a processor.

[0062] In the technical solution provided by the embodiment of the present application, the functionality of the large model is expanded by adding plug-ins, enriching the usage scenarios and scope of the large model to solve the problem of lack of knowledge of the large model (for example, lack of understanding of real-time data, lack of understanding of non-public data). In addition, when matching the plug-in used to answer the user's question, not only the plug-in description information of the plug-in is considered, but also the user question example corresponding to the plug-in is considered. This helps the large model to more accurately determine when the plug-in needs to be used and which plug-in needs to be used, thereby improving the accuracy of the large model's answers and improving the user's question-answering experience. BRIEF DESCRIPTION OF THE DRAWINGS

[0063] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, a brief introduction will be given below to the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0064] Figure 1 A schematic diagram of a plug-in configuration and a plug-in calling method provided in an embodiment of the present application;

[0065] Figure 2 An example diagram of the first prompt word provided in an embodiment of the present application;

[0066] Figure 3 This is an example diagram of a first prompt word template provided in one embodiment of the present application;

[0067] Figure 4 This is an example diagram of the second prompt word provided in one embodiment of the present application;

[0068] Figure 5 This is an example diagram of a second prompt word template provided in one embodiment of the present application;

[0069] Figure 6 A flowchart of a data processing method based on a generative large model provided in one embodiment of the present application;

[0070] Figure 7 This is a structural block diagram of an electronic device provided in one embodiment of the present application. DETAILED DESCRIPTION

[0071] In order to enable those skilled in the art to better understand the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below based on the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments in the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.

[0072] In addition, some of the processes described in the specification, claims and the above-mentioned figures of this application include multiple operations that appear in a specific order. These operations may not be executed in the order in which they appear in this document or may be executed in parallel. The serial numbers of the operations, such as 101, 102, etc., are only used to distinguish between different operations, and the serial numbers themselves do not represent any order of execution. In addition, these processes may include more or fewer operations, and these operations may be executed in sequence or in parallel. It should be noted that the descriptions of "first", "second", etc. in this document are used to distinguish different messages, devices, modules, etc., and do not represent the order of precedence, nor do they limit "first" and "second" to be different types.

[0073] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of relevant countries and regions, and provide corresponding operation entrances for users to choose to authorize or refuse.

[0074] In an embodiment of the present application, in applications such as intelligent question-answering based on a large model, in order to achieve rapid expansion of knowledge (e.g., real-time data, non-public data), the large model application can be prompted to use a plug-in to quickly obtain answers. In this way, there is no need to fine-tune the large model based on the knowledge that the large model lacks (e.g., real-time data or non-public data), which can reduce the occupation of computing resources. It should be noted that the plug-in (also known as addin, add-in, addon or add-on, also translated as plug-in) mentioned in this article refers to a program written in accordance with a certain specification of the application program interface.

[0075] Figure 1 This is a schematic diagram of the framework of a network system provided in one embodiment of the present application. The network system includes a configuration terminal 10 and an operation terminal 20; an application related to a generative large model is running on the operation terminal 20.

[0076] The configuration terminal is configured to generate a configuration file for the plug-in, wherein the configuration file includes a description of the plug-in and an example of a user question corresponding to the plug-in; and send the configuration file to the execution terminal.

[0077] The running end is used to: receive the configuration file; load the plug-in for the application according to the configuration file; determine the user question and at least one candidate plug-in loaded by the application; the generative big model is trained with training samples; generate a first prompt word according to the user question, the plug-in description information of the at least one candidate plug-in, and the user question example corresponding to each of the at least one candidate plug-in; input the first prompt word into the generative big model so that the generative big model determines a target plug-in for answering the user question from the at least one candidate plug-in; and generate answer information for the user question based on the target plug-in.

[0078] The configuration end generates a configuration file for the plug-in for the large model. The configuration file of the plug-in includes: plug-in description information, user question examples corresponding to the plug-in (also called prompt examples), parameter extraction examples of user question examples, and pre-configured reply forms for the plug-in. Among them, the parameter extraction examples include: a one-to-one correspondence between keywords in the user question example and plug-in API input parameters. The plug-in description information may include: plug-in function description information, plug-in API, and plug-in API parameters. Among them, the parameters from the plug-in API include: input parameters (referred to as input parameters) and output parameters (referred to as output parameters). Optionally, the plug-in description information may also include: the URL (uniform resource locator) of the plug-in API.

[0079] Exemplarily, the plug-in function description information is used to describe the plug-in usage scenario / role. In other words, the plug-in function description information is used to describe in what scenarios the plug-in needs to be used and / or the information that the plug-in can provide. Generally speaking, the information returned by the API is structured information, such as: JSON. Exemplarily, the plug-in function description information is "used to provide car performance information." Exemplarily, the plug-in function description information is "used to provide company sales performance." Exemplarily, the plug-in function description information is "used to provide weather forecast information." User question examples can be one or more, and user question examples can include manually edited user question examples and user question examples expanded based on manually edited user question examples. Optionally, user question examples are expanded by replacing keywords in user question examples. Exemplarily, a manually edited user question example is "What is the price-performance ratio of the Xiaolu CT4?"; based on this user question example, the expanded user question examples include "What is the price-performance ratio of the Xiaolu CT3?" and "What is the price-performance ratio of the Xiaomo AD3?". User question examples are used to describe what kind of conversation content (i.e., user questions entered by the user) requires the use of the plug-in. For example, if the plugin's function description is "used to provide car performance information," the input parameters of the plugin API may include: car brand and car model, and the output parameter may include: car performance. For an example user question corresponding to the plugin, such as "How is the performance of the Xiaolu XT-3 car?", the keyword "Xiaolu" in this user question corresponds to the parameter "car brand," and the keyword "XT-3" corresponds to the parameter "car model." In this embodiment of the present application, the data types of the plugin API parameters may include, but are not limited to: strings, numbers, dates, times, and locations.

[0080] In this embodiment, two response formats are provided for configuration users to choose from. One is to input the plug-in results into the large model, which then references the results to answer the user's question, which can be referred to as text format. The other is to assemble / process the plug-in results based on the custom chart components in the plug-in to answer the user's question, which can be referred to as chart format. The configuration information for the response format is used to indicate the display / presentation format in which the plug-in results are provided to the user.

[0081] like Figure 1As shown, the configuration side is used to implement basic plugin management and plugin API basic information management. Plugin basic management includes plugin description configuration, user question example configuration, response format configuration, plugin lifecycle management, and task debugging. Plugin description configuration is used to configure the plugin description. API basic information includes the plugin API, its parameters, and its URL. API basic information management includes configuration of the plugin API, its parameters, and its URL. User question example configuration includes expanding user question examples based on manually edited user question examples; marking keywords in the manually edited user question examples and the expanded user question examples as plugin API input parameters, effectively establishing a correspondence between keywords and plugin API input parameters. It should be noted that if there are a sufficient number of manually edited user question examples, prompt word sample expansion is not necessary. Response format configuration involves selecting the desired response format from text and chart formats. Plugin lifecycle management includes online and offline management, multi-version management, and plugin upgrade management. Plugin debugging involves printing intermediate results and displaying interactive results. Debuggers determine whether the plugin is functioning properly based on the printed intermediate results generated during debugging and the final interactive output.

[0082] A large model can correspond to one or more plug-ins. The configuration files of one or more plug-ins can be sent to the runtime for plug-in configuration. The runtime refers to the server where the large model application (i.e., the generative model application) is deployed. The runtime can load one or more plug-ins for the large model application.

[0083] After receiving the plugin configuration file, the runtime client loads it. This involves: loading the plugin for the large model application; and, based on the plugin configuration file, adding the plugin ID (a number that uniquely identifies the plugin), its description, and a sample user question to the knowledge vector library corresponding to the large model application. The knowledge vector library performs a preliminary semantic screening, identifying one or more candidate plugins that may be able to answer the user's question.

[0084] like Figure 1 As shown, the large model plug-in calling method includes the following steps:

[0085] 101. Plug-in matching and slot extraction.

[0086] Step 101 can be implemented by the following steps:

[0087] 1011. Recall K candidate plug-ins.

[0088] Wherein, K is an integer greater than or equal to 1.

[0089] 1012. Intent recognition to determine the target plug-in.

[0090] 1013. Get user question examples for the target plug-in.

[0091] 1014. Slot extraction.

[0092] In the above 1011, the operating terminal receives the user question sent by the user, matches the user question with the plug-in description information of the plug-in in the knowledge vector library and the user question example corresponding to the plug-in, and obtains K candidate plug-ins that match the user question.

[0093] In an optional embodiment, the knowledge vector library also stores a first vector of plug-in description information and a second vector of user question examples. The first vector is obtained by vectorizing the plug-in description information. The second vector is obtained by vectorizing the user question examples. Exemplarily, the vectorization can be implemented using word embedding technology. After receiving the user question, the runtime terminal can vectorize the user question to obtain a user question vector; match the user question vector with the first vector of the plug-in description information of the plug-in in the knowledge vector library to obtain a first matching degree; match the user question vector with the second vector of the user question example corresponding to the plug-in in the knowledge vector library to obtain a second matching degree; and determine the matching degree between the user question and the plug-in in the knowledge vector library based on the first matching degree and the second matching degree. Exemplarily, the sum of the first matching degree and the second matching degree can be used as the matching degree between the user question and the plug-in in the knowledge vector library. In an optional solution, one or more plug-ins whose matching degree is greater than a preset matching degree threshold can be determined as the K candidate plug-ins mentioned above. In another optional solution, the plug-ins in the knowledge vector library can be sorted according to the matching degree, and the top K candidate plug-ins are used as the recall results.

[0094] In step 1012 above, the user question, the plugin descriptions of the K candidate plugins, and the user question examples corresponding to the candidate plugins are input into the large model, so that the large model can filter the target plugin from the K candidate plugins. The number of target plugins can be one or more, and this embodiment of the application does not specifically limit this. For example, when there are two or more target plugins, the user question can be answered based on the plugin results of two or more candidate plugins.

[0095] Optionally, a first prompt word may be generated based on the user question, the plug-in description information of the K candidate plug-ins, and the user question examples corresponding to each of the K candidate plug-ins; the first prompt word is input into the large model so that the large model can filter out the target plug-in from the above K candidate plug-ins.

[0096] Optionally, a first prompt word template related to the plug-in screening task may be obtained; the first prompt word may be generated based on the user question, the plug-in description information of the K candidate plug-ins, user question examples corresponding to each of the K candidate plug-ins, and the first prompt word template. Exemplarily, the user question, the plug-in description information of at least one candidate plug-in, and the user question examples corresponding to each of the K candidate plug-ins are added to corresponding positions in the first prompt word template to obtain the first prompt word.

[0097] Figure 2 is an example of the first prompt word. Figure 3 This is an example of a first prompt word template. Generally speaking, a prompt word template includes a fixed portion and placeholders. The fixed portion can be used to describe the goal of the prompt word to be constructed and the type of task to be applied. The placeholders in the template occupy positions to be filled. Figure 3 The first prompt word template shown is "You are a plug-in screening tool. Please match the appropriate plug-in to the user's conversation context based on the plug-in description information and the user question example corresponding to the plug-in." This is also the fixed part of the prompt word template. Figure 3 In the first prompt word template shown, “**” is a placeholder.

[0098] In order to facilitate the subsequent acquisition of the corresponding prompt word template, a corresponding relationship between the prompt word template and the task type that the prompt word template can achieve can be established in advance. In this way, the corresponding prompt word template can be acquired based on the task type to be achieved.

[0099] Optionally, after the first prompt word is input into the large model, the large model may identify the intent of the user question and, based on the identified user intent, select a target plug-in that can realize the user intent from K candidate plug-ins.

[0100] The large model can be used to: identify the intent of the user question to obtain the user intent; determine the target plug-in that matches the user intent based on the matching of the user intent with the plug-in description information of the K candidate plug-ins and the matching of the user intent with the user question examples corresponding to the K candidate plug-ins. Exemplarily, the large model can determine the matching degree of the user intent with the first candidate plug-in based on the first matching degree of the user intent with the plug-in description information of the first candidate plug-in and the second matching degree of the user intent with the user question example corresponding to the first candidate plug-in; determine the target plug-in from the K candidate plug-ins based on the matching degree of the user intent with the K candidate plug-ins. The K candidate plug-ins include the first candidate plug-in.

[0101] In the above 1013, the user question example corresponding to the target plug-in can be obtained from the knowledge vector library.

[0102] In step 1014 above, the user question, the user question example corresponding to the target plug-in, and the parameter extraction example corresponding to the user question example of the target plug-in can be input into the large model, so that the large model can extract the parameter values ​​of each API input parameter of the target plug-in from the user question. The parameter extraction example includes: a one-to-one correspondence between the keywords in the user question example and the input parameters of the target plug-in.

[0103] The process of extracting the parameter values ​​of each API parameter of the target plug-in from the user question is also the process of slot extraction. In other words, each API parameter of the plug-in is equivalent to the slot to be filled.

[0104] It should be noted that a plug-in generally has multiple API parameters. For example, a plug-in has multiple API input parameters and one or more API output parameters.

[0105] Optionally, a second prompt word is generated based on the user question, the user question example corresponding to the target plug-in, and the parameter extraction example of the user question example corresponding to the target plug-in; the second prompt word is input into the generative big model so that the parameter value of the input parameter of the target plug-in is extracted from the user question by the generative big model.

[0106] Exemplarily, a second prompt word template related to the plugin parameter extraction task is obtained; a second prompt word is generated based on the user question, the user question example corresponding to the target plugin, the parameter extraction example of the user question example corresponding to the target plugin, and the second prompt word template. Exemplarily, the user question, the user question example corresponding to the target plugin, and the parameter extraction example of the user question example corresponding to the target plugin are filled into corresponding positions in the second prompt word target to obtain the second prompt word.

[0107] Figure 4 is an example of the second prompt word; Figure 5 This is an example of the second prompt word template. Figure 5 The second prompt word template in the prompt word template is "You are an API parameter extraction tool. Please extract parameters from the user's conversation context based on a parameter extraction example." This is also the fixed part of the prompt word template; Figure 5 The “**” in the second prompt word template is a placeholder.

[0108] By configuring the corresponding prompt word template, it can help improve the rationality of prompt word construction and help large models complete tasks accurately.

[0109] In this embodiment, the user question example corresponding to the target plug-in and the parameter extraction example of the user question example corresponding to the target plug-in are input into the large model, which helps to improve the accuracy of slot extraction of the large model.

[0110] 102. Slot replenishment.

[0111] The user question input by the user may lack parameter values ​​of some API parameters of the target plug-in (hereinafter referred to as API parameters to be supplemented), so slot supplementation is required.

[0112] In one feasible method, slot filling can be performed by asking the user. Specifically, a query question can be generated based on the parameters to be supplemented of the target plug-in; the query question is sent to the user, and feedback information from the user regarding the query question is received; and parameter values ​​of the parameters to be supplemented are determined based on the feedback information.

[0113] For example, if the plugin's function description is "used to provide car performance information," the relevant plugin API's input parameters may include: car brand and car model, and the output parameter may include: car performance. The user's question is "How is the performance of Xiaolu's car?", where the parameter value of the car brand parameter is "Xiaolu." The user's question lacks a parameter value for the car model. Therefore, the user can be asked the question "Which model of the Xiaolu brand would you like to know about its performance?". If the user replies "XT-3" to this question, the parameter value of the car model parameter can be determined to be "XT-3."

[0114] 103. API call.

[0115] Generates and sends an API request based on the target plugin's API input and its parameter values.

[0116] Generates and sends an API request based on the target plug-in's API input parameters and their parameter values, as well as the target plug-in's API output parameters.

[0117] Optionally, an API request is generated and sent based on the target plug-in's API input parameters and their parameter values, the target plug-in's API output parameters, and the plug-in's URL. For example, the target plug-in's API input parameters and their parameter values, and the target plug-in's API output parameters can be concatenated at the end of the plug-in's URL to generate the API request.

[0118] 104. Generate reply information.

[0119] The running end waits for receiving the request result (ie, plug-in result) corresponding to the API request. Exemplarily, the running end may asynchronously wait for receiving the request result corresponding to the API request.

[0120] The runtime can process the plug-in results according to the response format configured in the configuration file to obtain response information that meets the response format. When the response format configured in the configuration file is text, the plug-in results are input into the macro model, so that the macro model generates response information that meets the response format. Optionally, the user question and the plug-in results can be input into the macro model, so that the macro model can output the answer information for the user question based on the plug-in results. It should be noted that after the user question and the plug-in results are input into the macro model, the macro model uses its own reasoning capabilities to infer the answer information for the user question.

[0121] When the response format configured in the configuration file is a chart, the plug-in results can be processed / assembled based on a custom chart component to obtain response information that meets the response format. Custom chart components may include but are not limited to table components, image components, line chart components, and pie chart components. Among them, the table component refers to a component that can present the plug-in results in table form; the image component refers to a component that can present the plug-in results in image form; the line chart component refers to a component that can present the plug-in results in line chart form; and the pie chart component refers to a component that can present the plug-in results in pie chart form.

[0122] In actual applications, users can choose the response form that meets their needs according to their actual needs, which can improve the user experience and ensure that the final answer information is within a controllable range.

[0123] It should be noted that if no suitable plug-in is matched to answer the user's question, a third prompt word is generated based on the user's question and input into the macro model, allowing the macro model to answer the user's question. Alternatively, a third prompt word can be generated based on the user's question and a third prompt word template. The third prompt word is input into the macro model to obtain an output result for the macro model in response to the third prompt word; the output result is determined as the answer to the user's question.

[0124] It should be noted that the fixed portion of the third prompt word template is different from the fixed portion of the first and second prompt word templates. In other words, the description of the prompt word's target and the type of task it applies to in the third prompt word is different from the description of the prompt word's target and the type of task it applies to in the first and second prompt words.

[0125] In addition, the operating terminal can provide online conversation capabilities. The large model plug-in calling method provided in the embodiment of the present application also involves a client. The client is used to provide a dialogue interface (e.g., a chat interface with a robot) to the user, receive user questions input by the user through the dialogue interface, display the query questions sent by the operating terminal, and receive the user's feedback information in response to the query questions.

[0126] Figure 6 The flowchart of the data processing method based on the generative large model provided in one embodiment of the present application is as follows. Figure 1 The running end in. Figure 6 As shown, the method includes:

[0127] 201. Determine a user question and at least one candidate plug-in corresponding to the generative big model.

[0128] The generative large model is obtained through training with training samples.

[0129] 202. Generate a first prompt word according to the user question, the plug-in description information of the at least one candidate plug-in, and the user question example corresponding to each of the at least one candidate plug-in.

[0130] 203. Input the first prompt word into the generative big model, so that the generative big model determines a target plug-in for answering the user question from the at least one candidate plug-in.

[0131] 204. Generate answer information for the user question based on the target plug-in.

[0132] In 201 above, in one embodiment, multiple plug-ins corresponding to the large model (i.e., multiple plug-ins already loaded by the large model application) may be used as the at least one candidate plug-in. In another embodiment, the multiple plug-ins corresponding to the large model may be preliminarily screened to obtain the at least one candidate plug-in. A specific implementation of the preliminarily screened method will be described in detail in the following embodiments.

[0133] The training process of the above-mentioned generative large model can be referred to the existing technology, and the embodiments of this application do not make specific limitations on this.

[0134] In the above 202, the first prompt word is used to prompt the large model to filter out a target plug-in that can answer the user question from at least one candidate plug-in based on the plug-in description information of the at least one candidate plug-in and the user question example corresponding to the at least one candidate plug-in.

[0135] Optionally, the user question examples include: manually edited user question examples and / or user question examples expanded based on the manually edited user question examples.

[0136] The specific implementation of the above steps 202 to 203 can be found in the corresponding contents of the above embodiments, which will not be repeated here.

[0137] In the above 204, in one embodiment, the parameter value of the input parameter of the target plug-in is determined according to the user question; the target plug-in is called according to the parameter value of the input parameter of the target plug-in to obtain the calling result; and the reply information is generated according to the calling result.

[0138] In the technical solution provided by the embodiment of the present application, the functionality of the large model is expanded by adding plug-ins, enriching the usage scenarios and scope of the large model to solve the problem of lack of knowledge of the large model (for example, lack of understanding of real-time data, lack of understanding of non-public data). In addition, when matching the plug-in used to answer the user's question, not only the plug-in description information of the plug-in is considered, but also the user question example corresponding to the plug-in is considered. This helps the large model to more accurately determine when the plug-in needs to be used and which plug-in needs to be used, thereby improving the accuracy of the large model's answers and improving the user's question-answering experience.

[0139] Optionally, the above 204 may specifically include the following steps:

[0140] 2041. Determine parameter values ​​of input parameters of the target plug-in from the user question using the generative big model.

[0141] 2042. Call the target plug-in based on the parameter value of the input parameter of the target plug-in to obtain a call result.

[0142] 2043. Generate answer information for the user question based on the call result.

[0143] In the above 2041, in one embodiment, a fourth prompt word can be generated based on the user question and the input parameters of the target plug-in; the fourth prompt word is used to prompt the large model to extract the parameter value of the input parameter of the target plug-in from the user question; the fourth prompt word is input into the large model so that the large model performs the corresponding task.

[0144] In another embodiment, a second prompt word can be generated based on the user question, the user question example corresponding to the target plug-in, and the parameter extraction example of the user question example corresponding to the target plug-in; the second prompt word is used to prompt the large model to extract the parameter values ​​of the input parameters of the target plug-in from the user question based on the user question example corresponding to the target plug-in and the one-to-one correspondence between the keywords in the user question example and the input parameters of the target plug-in. In one feasible solution, the above-mentioned "using the generative large model to determine the parameter values ​​of the input parameters of the target plug-in from the user question" in 2041 can be implemented using the following steps:

[0145] S11. Obtain a parameter extraction example of a user question example corresponding to a target plug-in.

[0146] The parameter extraction example includes: a one-to-one correspondence between keywords in the user question example and input parameters of the target plug-in.

[0147] S12: Generate a second prompt word according to the user question, the user question example corresponding to the target plug-in, and the parameter extraction example of the user question example corresponding to the target plug-in.

[0148] S13: Input the second prompt word into the generative big model, so that the generative big model extracts the parameter value of the input parameter of the target plug-in from the user question.

[0149] The specific implementation of the above steps S11 to S13 can be found in the corresponding contents of the above embodiments, which will not be repeated here.

[0150] To facilitate the reuse of prompt words and improve the accuracy of prompt word construction, corresponding prompt word templates can be set in advance for different task types. In an optional embodiment, a second prompt word template related to the plug-in parameter extraction task can be obtained; based on the user question, the user question example corresponding to the target plug-in, the parameter extraction example of the user question example corresponding to the target plug-in, and the second prompt word template, a second prompt word is generated.

[0151] In the above 2042, based on the parameter value of the input parameter of the target plug-in, an API request is generated and sent to call the target plug-in to obtain the call result.

[0152] For the specific calling process, please refer to the corresponding content in the above embodiments.

[0153] Optionally, the step of “generating a first prompt word according to the user question, the plugin description information of the at least one candidate plugin, and the user question example corresponding to each of the at least one candidate plugin” in 202 above may be implemented by the following steps:

[0154] 2021. Get the first prompt word template related to the plug-in screening task.

[0155] 2022. Generate a first prompt word according to the user question, the plug-in description information of the at least one candidate plug-in, the user question example corresponding to each of the at least one candidate plug-in, and the first prompt word template.

[0156] The specific implementation of the above steps 2021 and 2022 can be found in the corresponding contents of the above embodiments, which will not be repeated here.

[0157] Optionally, the above method may further include:

[0158] 205. Obtain a preconfigured reply format for the target plug-in.

[0159] The reply form is pre-selected from a text form and a chart form. Exemplarily, the reply form is configured to be selected by the user from a text form and a chart form.

[0160] 206. Process the call result according to the reply format to obtain reply information for the user question that satisfies the reply format.

[0161] In the embodiment of the present application, two reply forms are provided to the user, so that the user can choose the reply method according to actual needs.

[0162] Optionally, the above step 206 of “processing the call result according to the reply format to obtain reply information for the user question that satisfies the reply format” may include:

[0163] When the answer is in text form, the user question and the call result are input into the generative big model, so that the generative big model generates answer information for the user question;

[0164] When the reply is in the form of a chart, the call result is processed using a custom chart component to obtain reply information for the user question.

[0165] The custom chart component includes one or more of a table component, a picture component, a line chart component and a pie chart component.

[0166] The following provides a preliminary method for screening multiple plug-ins for large models:

[0167] 207. Vectorize the user question to obtain a user question vector;

[0168] 208. Obtain a first vector of plug-in description information of a plurality of plug-ins corresponding to the generative large model and a second vector of user question examples corresponding to the plurality of plug-ins;

[0169] 209. Determine, from the plurality of plug-ins, the at least one candidate plug-in that matches the user question based on the matching degree between the user question vector and the first vector and the matching degree between the user question vector and the second vector.

[0170] The specific implementation of the above steps 207 to 209 can refer to the corresponding content in the above embodiments.

[0171] Optionally, after determining the parameter value of the input parameter of the target plug-in according to the user question, the method further includes:

[0172] 210. Determine whether any input parameter of the target plug-in has an undetermined value;

[0173] 211. If there are input parameters with undetermined parameter values ​​among the input parameters of the target plug-in, generate a query question based on the input parameters with undetermined parameter values;

[0174] 212. Send the inquiry question to the user;

[0175] 213. Determine the parameter value of the input parameter whose parameter value is not determined according to the feedback information of the user in response to the inquiry question.

[0176] In this implementation, the problem of user questions lacking necessary information is solved by asking questions.

[0177] It should be noted that for any steps not fully described in detail in the methods provided in the embodiments of the present application, reference may be made to the corresponding contents in the aforementioned embodiments, and no further elaboration is required here. Furthermore, in addition to the aforementioned steps, the methods provided in the embodiments of the present application may also include some or all of the other steps in the aforementioned embodiments, for which reference may be made to the corresponding contents in the aforementioned embodiments, and no further elaboration is required here.

[0178] The technical solution provided by the embodiment of the present application can be applied to the fields of medical care, e-commerce, etc. In one embodiment, the above user question is specifically a medical question; the above user question example is specifically a medical question example.

[0179] Figure 7 FIG. 1 shows a schematic diagram of the structure of an electronic device provided by an embodiment of the present application. Figure 7As shown, the electronic device includes a memory 1101 and a processor 1102. The memory 1101 can be configured to store various other data to support operations on the electronic device. Examples of such data include instructions for any application or method operating on the electronic device. The memory 1101 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read only memory (EEPROM), erasable programmable read only memory (EPROM), programmable read only memory (PROM), read only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.

[0180] The memory 1101 is used to store programs;

[0181] The processor 1102 is coupled to the memory 1101 and is configured to execute the program stored in the memory 1101 to implement the methods provided in the above method embodiments.

[0182] Further, if Figure 7 As shown, the electronic device also includes: a communication component 1103, a display 1104, a power component 1105, an audio component 1106 and other components. Figure 7 Only some components are shown schematically, which does not mean that the electronic device only includes Figure 7 Components shown.

[0183] Accordingly, an embodiment of the present application further provides a computer-readable storage medium storing a computer program, which, when executed by a computer, can implement the steps or functions of the methods provided in the above-mentioned method embodiments.

[0184] An embodiment of the present application also provides a computer program product, including a computer program, which, when executed by a processor, can implement the steps or functions of the methods provided in the above-mentioned method embodiments.

[0185] The device 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 units. Some or all of the modules may be selected based on actual needs to achieve the objectives of the present embodiment. Persons of ordinary skill in the art will be able to understand and implement the present invention without inventive effort.

[0186] Through the description of the above embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus a necessary general hardware platform, or of course, by hardware. Based on this understanding, the above technical solution, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. The computer software product can be stored in a computer-readable storage medium, such as ROM (Read Only Memory) / RAM (Random Access Memory), a disk, an optical disk, etc., and includes a number of instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or certain parts of the embodiments.

[0187] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application.

Claims

1. A data processing method based on a generative large model, characterized in that: include: Determine a user question and at least one candidate plug-in corresponding to the generative large model; The generative large model is obtained by training with training samples; generating a first prompt word according to the user question, the plug-in description information of the at least one candidate plug-in, and the user question example corresponding to each of the at least one candidate plug-in; Inputting the first prompt word into the generative big model, so that the generative big model determines a target plug-in for answering the user question from the at least one candidate plug-in; Based on the target plug-in, answer information for the user question is generated.

2. The method according to claim 1, characterized in that Generating a first prompt word according to the user question, the plug-in description information of the at least one candidate plug-in, and the user question example corresponding to each of the at least one candidate plug-in includes: Obtaining the first prompt word template related to the plug-in screening task; A first prompt word is generated according to the user question, the plug-in description information of the at least one candidate plug-in, the user question example corresponding to each of the at least one candidate plug-in, and the first prompt word template.

3. The method according to claim 1, characterized in that Generating answer information for the user question based on the target plug-in, including: Determining parameter values ​​of input parameters of the target plug-in from the user question using the generative big model; Based on the parameter value of the input parameter of the target plug-in, calling the target plug-in to obtain a calling result; Generate answer information for the user question based on the call result.

4. The method according to claim 3, characterized in that Determining parameter values ​​of input parameters of the target plug-in from the user question using the generative big model includes: Obtaining a parameter extraction example of the user question example corresponding to the target plug-in; the parameter extraction example includes: a one-to-one correspondence between keywords in the user question example and input parameters of the target plug-in; generating a second prompt word according to the user question, the user question example corresponding to the target plug-in, and the parameter extraction example of the user question example corresponding to the target plug-in; The second prompt word is input into the generative big model, so that the parameter value of the input parameter of the target plug-in is extracted from the user question by the generative big model.

5. The method according to claim 4, characterized in that Generating a second prompt word according to the user question, the user question example corresponding to the target plug-in, and the parameter extraction example of the user question example corresponding to the target plug-in includes: Obtaining a second prompt word template related to the plug-in parameter extraction task; A second prompt word is generated according to the user question, the user question example corresponding to the target plug-in, the parameter extraction example of the user question example corresponding to the target plug-in, and the second prompt word template.

6. The method according to claim 3, characterized in that Generate answer information for the user's question based on the call result, including: Obtaining a preconfigured reply form for the target plug-in; the reply form is pre-selected from a text form and a custom chart component chart form; The call result is processed according to the reply form to obtain reply information of the user question that satisfies the reply form.

7. The method according to claim 6, characterized in that Processing the call result according to the reply format to obtain reply information for the user question that satisfies the reply format includes: When the answer form is in text form, the user question and the call result are input into the generative big model, so that the generative big model generates answer information of the user question that satisfies the answer form; When the answer is in a chart form, the call result is processed using a custom chart component to obtain answer information for the user question that satisfies the answer form.

8. The method according to claim 1, characterized in that Also includes: Vectorizing the user question to obtain a user question vector; Obtaining a first vector of plug-in description information of a plurality of plug-ins corresponding to the generative large model and a second vector of user question examples corresponding to the plurality of plug-ins; At least one candidate plug-in matching the user question is determined from the plurality of plug-ins according to the matching degree between the user question vector and the first vector and the matching degree between the user question vector and the second vector.

9. The method according to claim 3, characterized in that After determining the parameter values ​​of the input parameters of the target plug-in from the user question using the generative big model, the method further includes: Determining whether there is an input parameter with an undetermined parameter value among the input parameters of the target plug-in; If there is an input parameter with an undetermined parameter value among the input parameters of the target plug-in, generating a query question according to the input parameter with an undetermined parameter value; Sending the query to the user; Determine the parameter value of the input parameter whose parameter value is not determined according to the feedback information of the user in response to the inquiry question.

10. A data processing method based on a generative large model, characterized in that: include: determining a medical problem and at least one candidate plug-in corresponding to the generative large model; The generative large model is obtained by training with training samples; generating a first prompt word according to the medical problem, the plug-in description information of the at least one candidate plug-in, and the medical problem example corresponding to each of the at least one candidate plug-in; Inputting the first prompt word into the generative big model, so that the generative big model determines a target plug-in for answering the medical question from the at least one candidate plug-in; Based on the target plug-in, answer information for the medical question is generated.

11. The method according to claim 10, characterized in that Generating answer information for the medical question based on the target plug-in, including: Determining parameter values ​​of input parameters of the target plug-in from the medical problem using the generative big model; Based on the parameter value of the input parameter of the target plug-in, calling the target plug-in to obtain a calling result; Generate answer information for the medical question based on the call result.

12. The method according to claim 11, characterized in that Determining parameter values ​​of input parameters of the target plug-in from the medical problem using the generative big model includes: Obtaining a parameter extraction example of the medical problem example corresponding to the target plug-in; the parameter extraction example includes: a one-to-one correspondence between keywords in the medical problem example and input parameters of the target plug-in; generating a second prompt word according to the medical problem, the medical problem example corresponding to the target plug-in, and the parameter extraction example of the medical problem example corresponding to the target plug-in; The second prompt word is input into the generative big model, so as to extract the parameter value of the input parameter of the target plug-in from the medical question through the generative big model.

13. A network system, characterized in that: include: Configuration end and operation end; The operating terminal runs an application related to the generative large model; wherein, The configuration terminal is configured to generate a configuration file for the plug-in, wherein the configuration file includes a description of the plug-in and an example of a user question corresponding to the plug-in; and send the configuration file to the execution terminal. The running end is used to: receive the configuration file; load the plug-in for the application according to the configuration file; determine the user question and at least one candidate plug-in loaded by the application; the generative big model is trained with training samples; generate a first prompt word according to the user question, the plug-in description information of the at least one candidate plug-in, and the user question example corresponding to each of the at least one candidate plug-in; input the first prompt word into the generative big model so that the generative big model determines a target plug-in for answering the user question from the at least one candidate plug-in; and generate answer information for the user question based on the target plug-in.

14. An electronic device, characterized in that: include: memory and a processor, wherein The memory is used to store programs; The processor is coupled to the memory, and is configured to execute the program stored in the memory to implement the method according to any one of claims 1 to 12.

15. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a computer, the method according to any one of claims 1 to 12 can be implemented.

16. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the method according to any one of claims 1 to 12 is implemented.

Citation Information

Patent Citations

  • Knowledge question and answer method, device and equipment and storage medium

    CN116561278A

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

    CN117112065A

  • Method, device and equipment for intelligently acquiring information and storage medium

    CN117312641A

  • Information processing method and device based on large language model, equipment and storage medium

    CN117521675A

  • Model training method and device, plug-in prediction method and device, equipment, medium and product

    CN117668560A