Data processing method and device, electronic equipment and storage medium
By determining the call information of the target tool based on the question information in the large language model and inputting it as prompt information into the model, the problem of low accuracy in generating answers of the large language model is solved, and the accuracy and efficiency of the answers are improved.
Patent Information
- Application Number
- CN202411731253.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-28
- Publication Date
- 2025-02-25
AI Technical Summary
There are problems with low accuracy in the responses generated by existing large language models, especially when deeply understanding and reasoning for complex intentions, it is difficult to accurately connect to the corresponding tools.
By determining the call information of the target tool based on the question information, and inputting the information as prompt information into the target model, it is guided to generate reply information according to certain logic.
Improve the accuracy of target tool calls and the efficiency and accuracy of target model data processing, ensuring the accuracy and relevance of reply information.
Smart Images

Figure CN119514665A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of artificial intelligence technology, and more specifically, to a data processing method, device, electronic device and storage medium. Background Art
[0002] With the rapid development of computer technology, large language models (LLMs) are being used more and more widely in various fields. For example, in the field of natural language processing, large language models can analyze user questions and provide corresponding answers.
[0003] However, the responses generated by existing large language models suffer from low accuracy. Summary of the invention
[0004] One aspect of the present disclosure provides a data processing method, including: determining calling information of a target tool based on question information; wherein the target tool is a tool related to the question information; determining prompt information based on the question information and the calling information; wherein the prompt information is used to guide a target model to generate reply information of the question information according to a certain logic; and inputting the prompt information into a target model to obtain reply information of the question information generated by the target model based on the prompt information.
[0005] According to an embodiment of the present disclosure, the calling information of the target tool is determined based on the question information, including: determining the target structured information according to the question information, the target structured information including multiple action information corresponding to the question information and content information corresponding to each action information; determining the target tool according to the target structured information, the target tool having a corresponding relationship with the action information; and obtaining the calling information of the target tool.
[0006] According to an embodiment of the present disclosure, determining target structured information based on question information includes at least one of the following: determining target structured information from multiple structured information templates based on the question information; inputting the question information into a target generation model to obtain the target structured information generated by the target generation model.
[0007] According to an embodiment of the present disclosure, determining the calling information of the target object based on the question information includes: determining the descriptive information corresponding to multiple target tasks related to the question information based on the question information; determining the target tool corresponding to the target task based on the descriptive information corresponding to the multiple target tasks; and obtaining the calling information of the target tool.
[0008] According to an embodiment of the present disclosure, the prompt information is determined according to the question information and the calling information, including: concatenating the question information and the calling information to obtain the prompt information.
[0009] According to an embodiment of the present disclosure, question information and call information are spliced to obtain prompt information, including: splicing question information, call information and target structured information to obtain prompt information, the target structured information includes multiple action information corresponding to the question information and content information corresponding to each action information, and the action information has a corresponding relationship with the target tool.
[0010] According to an embodiment of the present disclosure, prompt information is determined based on question information and call information, including: calling a target tool based on the call information to obtain response information related to the question information; and concatenating the question information and the response information to obtain prompt information.
[0011] Another aspect of the present disclosure provides a data processing device, including: a first determination module, used to determine the calling information of a target tool based on question information; wherein the target tool is a tool related to the question information; a second determination module, used to determine the prompt information according to the question information and the calling information; wherein the prompt information is used to guide the target model to generate reply information to the question information according to a certain logic; and an acquisition module, used to input the prompt information into the target model, and obtain the reply information to the question information generated by the target model based on the prompt information.
[0012] A third aspect of the present disclosure provides an electronic device, comprising: one or more processors; a memory for storing one or more computer programs, wherein the one or more processors execute the one or more computer programs to implement the steps of the above data processing method.
[0013] The fourth aspect of the present disclosure further provides a computer-readable storage medium on which a computer program or instruction is stored. When the computer program or instruction is executed by a processor, the steps of the data processing method are implemented. BRIEF DESCRIPTION OF THE DRAWINGS
[0014] The above and other objects, features and advantages of the present disclosure will become more apparent through the following description of the embodiments of the present disclosure with reference to the accompanying drawings, in which:
[0015] Figure 1 A diagram schematically illustrates an application scenario of a data processing method, device, electronic device, and storage medium according to an embodiment of the present disclosure;
[0016] Figure 2 A flowchart schematically shows a data processing method according to an embodiment of the present disclosure;
[0017] Figure 3 The schematic diagram shows a data processing method according to an embodiment of the present disclosure;
[0018] Figure 4A flowchart of determining the calling information of a target tool based on question information according to an embodiment of the present disclosure is schematically shown;
[0019] Figure 5 The schematic diagram shows the principle of determining target structured information based on question information in an embodiment of the present disclosure;
[0020] Figure 6 A flowchart of determining the calling information of a target tool based on question information according to an embodiment of the present disclosure is schematically shown;
[0021] Figure 7 A flowchart of determining calling information of a target tool based on question information according to another embodiment of the present disclosure is schematically shown;
[0022] Figure 8 A flowchart of determining calling information of a target tool based on question information according to another embodiment of the present disclosure is schematically shown;
[0023] Fig. 9 A schematic diagram of a data processing method according to another embodiment of the present disclosure is shown;
[0024] Fig.10 A schematic diagram of a data processing method according to another embodiment of the present disclosure is shown;
[0025] Fig.11 A schematic diagram of a data processing method according to another embodiment of the present disclosure is shown;
[0026] Fig.12 A flowchart of determining prompt information according to question information and call information according to another embodiment of the present disclosure is schematically shown;
[0027] Fig.13 A block diagram schematically shows a data processing device according to an embodiment of the present disclosure;
[0028] Fig.14 A block diagram of an electronic device suitable for implementing the data processing method according to an embodiment of the present disclosure is schematically shown. DETAILED DESCRIPTION
[0029] Hereinafter, embodiments of the present disclosure will be described with reference to the accompanying drawings. However, it should be understood that these descriptions are exemplary only and are not intended to limit the scope of the present disclosure. In the following detailed description, for ease of explanation, many specific details are set forth to provide a comprehensive understanding of the embodiments of the present disclosure. However, it is apparent that one or more embodiments may also be implemented without these specific details. In addition, in the following description, descriptions of known structures and technologies are omitted to avoid unnecessary confusion of the concepts of the present disclosure.
[0030] The terms used herein are only for describing specific embodiments and are not intended to limit the present disclosure. The terms "comprise", "include", etc. used herein indicate the existence of the features, steps, operations and / or components, but do not exclude the existence or addition of one or more other features, steps, operations or components.
[0031] All terms (including technical and scientific terms) used herein have the meanings commonly understood by those skilled in the art unless otherwise defined. It should be noted that the terms used herein should be interpreted as having a meaning consistent with the context of this specification and should not be interpreted in an idealized or overly rigid manner.
[0032] When using expressions such as "at least one of A, B, and C, etc.", they should generally be interpreted according to the meaning of the expression commonly understood by those skilled in the art (for example, "a system having at least one of A, B, and C" should include but is not limited to a system having A alone, B alone, C alone, A and B, A and C, B and C, and / or A, B, C, etc.).
[0033] The embodiments of the present disclosure provide a data processing method and device. Before introducing the technical solutions provided by the embodiments of the present disclosure, the related technologies involved in the present disclosure are first described.
[0034] The Large Language Model (LLM) is a natural language processing model based on deep learning, which is used to understand and generate natural language text.
[0035] In related technologies, large language models can call external functions and services in the process of generating text based on function calls. However, function calls mainly focus on executing specific tasks or queries, and usually do not have the ability to deeply understand and reason about complex intents. For some deeper hidden intents, it is difficult to accurately connect to the corresponding tools, which can easily lead to deviations in the response information generated by the large language model.
[0036] In view of this, an embodiment of the present disclosure provides a data processing method, including: determining calling information of a target tool based on question information; wherein the target tool is a tool related to the question information; determining prompt information based on the question information and the calling information; wherein the prompt information is used to guide the large model to generate reply information to the question information according to a certain logic; inputting the prompt information into the target model to obtain reply information to the question information generated by the target model based on the prompt information.
[0037] The data processing method provided by the embodiment of the present disclosure, on the one hand, analyzes the input information in advance before inputting the question information into the target model, clarifies the target tool that needs to be called when replying to the input information, and improves the accuracy of calling the target tool. On the other hand, inputting the calling information of the target tool into the target model as prompt information can enable the target model to generate more accurate reply information based on the calling information of the target tool, thereby improving the efficiency and accuracy of data processing of the target model.
[0038] Figure 1 The application scenario diagram of the data processing method, device, electronic device and storage medium according to the embodiments of the present disclosure is schematically shown.
[0039] like Figure 1 As shown, the application scenario 100 according to this embodiment may include a first terminal device 101, a second terminal device 102, a third terminal device 103, a network 104, and a server 105. The network 104 is used to provide a medium for a communication link between the first terminal device 101, the second terminal device 102, the third terminal device 103, and the server 105. The network 104 may include various connection types, such as wired, wireless communication links, or optical fiber cables, etc.
[0040] The user can use the first terminal device 101, the second terminal device 102, and the third terminal device 103 to interact with the server 105 through the network 104 to receive or send messages, etc. Various communication client applications can be installed on the first terminal device 101, the second terminal device 102, and the third terminal device 103, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, social platform software, etc. (only for example).
[0041] The first terminal device 101, the second terminal device 102, and the third terminal device 103 may be various electronic devices having display screens and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers, desktop computers, and the like.
[0042] The server 105 may be a server that provides various services, such as a background management server (only as an example) that provides support for websites browsed by users using the first terminal device 101, the second terminal device 102, and the third terminal device 103. The background management server may analyze and process the received data such as user requests, and feed back the processing results (such as web pages, information, or data obtained or generated according to user requests) to the terminal device.
[0043] It should be noted that the data processing method provided in the embodiment of the present disclosure can generally be executed by the server 105. Accordingly, the data processing device provided in the embodiment of the present disclosure can generally be set in the server 105. The data processing method provided in the embodiment of the present disclosure can also be executed by a server or server cluster that is different from the server 105 and can communicate with the first terminal device 101, the second terminal device 102, the third terminal device 103 and / or the server 105. Accordingly, the data processing device provided in the embodiment of the present disclosure can also be set in a server or server cluster that is different from the server 105 and can communicate with the first terminal device 101, the second terminal device 102, the third terminal device 103 and / or the server 105.
[0044] It should be understood that Figure 1 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to implementation requirements.
[0045] The following will be based on Figure 1 The scene described by Figure 2 to Figure 12 The data processing method of the disclosed embodiment is described in detail.
[0046] Figure 2 The flowchart of the data processing method according to the embodiment of the present disclosure is schematically shown.
[0047] Figure 3 The schematic diagram shows a principle diagram of a data processing method according to an embodiment of the present disclosure.
[0048] like Figure 2 , Figure 3 As shown, the data processing method of this embodiment includes operations S210 to S230.
[0049] In operation S210, calling information of a target tool is determined based on the question information; wherein the target tool is a tool related to the question information.
[0050] In some embodiments, in response to receiving question information input by a user, the question information is parsed, and a target tool related to the question information is determined according to the parsing result.
[0051] The target tool can be a predefined tool installed in the local system, or a tool dynamically obtained from a remote server or cloud service based on the query information. After the target tool is determined, the call information of the target tool is obtained, where the call information is a series of rules and parameters that need to be followed when the tool is correctly called to obtain the expected results.
[0052] In operation S220, prompt information is determined according to the question information and the calling information; wherein the prompt information is used to guide the target model to generate reply information to the question information according to a certain logic.
[0053] In some embodiments, prompt information is used to help the target model understand the user's intentions and needs more accurately. The prompt information determined based on the input information and the calling information of the target tool can enable the target model to accurately call the target tool and generate reply information to the question information according to a certain logic.
[0054] In operation S230, the prompt information is input into the target model, and reply information of the question information generated by the target model based on the prompt information is obtained.
[0055] In some embodiments, the constructed prompt information is input into the target model, and the target model generates reply information for the question information based on the understanding of the prompt information. The target model is one of the following: a large language model (LLM), a multimodal large model, a model capable of generating text, a model with more than 100 million adjustable parameters, a model that can output corresponding results according to input natural language instructions, a model that can convert input natural language instructions into feature sequences and infer output results according to feature sequences, and a model that can convert input information into feature sequences and infer subsequent features of feature sequences.
[0056] The data processing method provided by the disclosed embodiment determines the prompt information for input into the target model based on the call information of the target tool determined by the question information, which can effectively improve the comprehensiveness of the prompt information, so as to help the target model better understand the tasks to be performed, and improve the accuracy of the response information generated by the target model. In addition, since the prompt information contains content related to the call information of the target tool, the target model has a clearer target and path when processing the question information based on the prompt information. The target model does not need to perform complex function recognition and parameter processing, and can directly call the external tool according to the call information, which effectively improves the processing speed and efficiency of the target model, and improves the efficiency of generating response information.
[0057] Figure 4 The flowchart of determining the calling information of the target tool based on the question information according to an embodiment of the present disclosure is schematically shown.
[0058] like Figure 4 As shown, in Figure 2 , Figure 3 Based on the data processing method shown in FIG. 1 , the data processing method of this embodiment can further include operations S410 to S430 for determining the calling information of the target tool based on the question information. It should be noted that other implementation details of the data processing method of this embodiment can be found in Figure 2 The embodiment of the data processing method shown will not be described in detail here.
[0059] In operation S410, target structured information is determined according to question information, where the target structured information includes a plurality of action information corresponding to the question information and content information corresponding to each piece of action information.
[0060] In some embodiments, by analyzing the question information, structured information corresponding to the question information is determined, where the structured information may include, for example, a series of logically interrelated action information and content information corresponding to each action. These action information can be regarded as steps or processes that need to be executed to generate reply information to the question information, and the content information is a detailed description or requirement of each step or process, such as parameters and conditions for each action.
[0061] Exemplarily, the structure of the target structured information is <action> content<action> content<action> content. The action information and content information in the target structured information may be determined based on the content explicitly mentioned in the question information, or may be determined based on the content not mentioned in the question information but implied.
[0062] For example, the question information is "help me create a car wash reminder task", and the target structured information corresponding to the question information can be <tell> weather <tell> car wash location <ask> confirm. Although the question information does not contain weather, location and other content, the hidden information contained in the question information can be obtained by analyzing the question information, thereby constructing the target structured information.
[0063] In operation S420, a target tool is determined according to the target structured information, and the target tool has a corresponding relationship with the action information.
[0064] In some embodiments, the action information in the structured information is traversed, and the target tool corresponding to the action information is matched according to the specific content and requirements of each action information (such as the description information corresponding to the action). If the action information matches multiple available tools, the tool that is most suitable for performing the current action can be selected from the multiple available tools as the target tool based on factors such as the availability, efficiency, accuracy, and cost-effectiveness of the tool. The target tool can be software, hardware, system, platform, or any entity that can perform a specific task or provide a specific service.
[0065] Continuing with the example of the question information in operation S410 being "Help me create a car wash reminder task", the target tool corresponding to <tell> weather in the target structured information corresponding to the question information should be a tool that can perform weather queries, and the target tool corresponding to <tell> car wash location in the structured information should be a tool that can perform location queries.
[0066] In operation S430, call information of the target tool is acquired.
[0067] In some embodiments, after determining the target tool, the calling information of the target tool is obtained so as to call the target tool in the subsequent process. The calling information of the target tool may include, for example, the name of the tool, the required input parameters and format, the storage path / application programming interface (API), and other information.
[0068] For example, after obtaining the call information of the target information, the call information of the target tool can be verified by test calling or simulating requests to ensure the correctness and validity of the call information of the target tool. If the call information verification fails, the call information of the target tool is obtained again or another tool that can be used to execute the action information is reselected as the target tool.
[0069] The data processing method provided by the embodiment of the present disclosure determines the target tool and the calling information of the target tool based on clear target structured information, which helps to improve the accuracy of target task selection and acquisition of target task calling information.
[0070] Figure 5 The schematic diagram shows the principle of determining target structured information based on question information in an embodiment of the present disclosure.
[0071] like Figure 5 As shown, in Figure 4 Based on the data processing method shown, the data processing method of this embodiment may include determining the target structured information based on the question information: determining the target structured information from multiple structured information templates, or inputting the question information into a target generation model to obtain the target structured information generated by the target generation model.
[0072] The following combination Figure 6 , Figure 7 Respectively Figure 5 The method of determining target structured information based on question information is introduced in detail in the following.
[0073] Figure 6 The flowchart of determining the calling information of the target tool based on the question information according to an embodiment of the present disclosure is schematically shown.
[0074] like Figure 6 As shown, in Figure 4Based on the data processing method shown in FIG. 1 , determining the calling information of the target tool based on the question information in the data processing method of this embodiment may further include operations S410a to S430a. It should be noted that for other implementation details of the data processing method of this embodiment, please refer to Figure 2 The embodiment of the data processing method shown will not be described in detail here.
[0075] In operation S410a, target structured information is determined from a plurality of structured information templates according to question information.
[0076] In some embodiments, multiple structured information templates for different scenarios are predefined, and each structured information template includes multiple predefined action information and content information corresponding to each action information, which are suitable for different application scenarios. For example, application scenarios such as tourism, itinerary scheduling, vehicle maintenance, etc., all have corresponding structured information templates.
[0077] The question information is matched with multiple structured information templates respectively, and the target structured information is determined from the multiple structured information templates according to the matching results. In the specific implementation process, the question information can be matched with multiple structured information templates respectively by keyword matching, fuzzy matching, etc. For example, key subject words, attribute words, etc. (these keywords represent the information that the user wants to query) can be extracted from the question information, and the keywords in the question information are compared with the keywords of the structured information template, and the target structured information is determined according to the comparison results. Or, use NLP technology (such as word vectors, semantic similarity calculation) to calculate the semantic similarity between the question information and each structured information template to determine the target structured information. Or, according to the application scenario of the current question information, query the structured information template similar to the current application scenario in multiple structured information templates to determine the target structured information.
[0078] Continuing with the example of the question information "Help me create a car wash reminder task", the question information is matched with multiple structured information templates to obtain a structured information template suitable for the car wash scenario. The content of the structured information template is <tell> weather <tell> car wash location <ask> confirm. The structured information template is used as the target structured information template, and subsequent processing is performed based on the target structured information template.
[0079] In operation S420a, a target tool is determined according to the target structured information, and the target tool has a corresponding relationship with the action information.
[0080] In some embodiments, operation S420a is Figure 4 The operation details of operation S420 in the embodiments are the same and will not be described in detail here.
[0081] In operation S430a, call information of the target tool is obtained.
[0082] In some embodiments, operation S430a is Figure 4 The operation details of operation S430 in the embodiments are the same and will not be described again.
[0083] According to the data processing method provided by the embodiment of the present disclosure, by matching the question information with a plurality of predefined structured information templates, the target structured information can be quickly determined, which helps to improve the response speed and data processing efficiency.
[0084] Among them, the predefined structured information template can be a structured information template obtained based on a large amount of historical data and knowledge graph supplementary reasoning. It has high universality and comprehensiveness, which helps to discover hidden intentions in question information. The action information and content information contained in the target structured information determined by matching the structured information template are more comprehensive, which helps to improve the accuracy and comprehensiveness of the target tool call information acquisition.
[0085] Figure 7 The flowchart of determining the calling information of the target tool based on the question information according to another embodiment of the present disclosure is schematically shown.
[0086] like Figure 7 As shown, in Figure 4 Based on the data processing method shown in FIG. 1 , the data processing method of this embodiment can further include operations S410b to S430b for determining the calling information of the target tool based on the question information. It should be noted that other implementation details of the data processing method of this embodiment can be found in Figure 4 The embodiment of the data processing method shown will not be described in detail here.
[0087] In operation S410b, the question information is input into the target generation model to obtain target structured information generated by the target generation model.
[0088] In some embodiments, the question information is preprocessed (including removing irrelevant characters, word segmentation, annotation, etc.), and the preprocessed question information is input into the target generation model, which generates target structured information corresponding to the question information based on internal mechanisms (such as attention mechanism, Transformer structure, etc.).
[0089] The target generation model is a model obtained after training based on a large amount of training data containing question information and corresponding structured information. The target generation model can learn the preset relationship from question information to structured information.
[0090] The process of generating target structured information based on the target generation model may include, for example: converting the input question information into a vector representation, gradually generating various parts of the structured information based on the vector representation, wherein each part is generated based on the previously generated part and the overall context of the input information, and finally outputting the generated complete structured information as the target structured information. It should be noted that the process of generating the target structured information is only exemplary, and those skilled in the art may make appropriate adjustments or modifications according to actual application scenarios or actual needs, which will not be elaborated here.
[0091] In the specific implementation process, the target generation model can be obtained by training a small strategy model, such as a lightweight neural network model, a T5 model, etc. The small strategy model has the characteristics of fast calculation speed and low resource consumption. Using the small strategy model as the target generation model can effectively improve the efficiency of target structured information generation, achieve rapid response to question information, and meet real-time requirements.
[0092] Continuing with the example of the question "Help me create a car wash reminder task", if no structured information template matching the question is found, the question is input into the target generation model, and the target generation model generates target structured information corresponding to the question: <tell> weather <tell> car wash location <ask> confirm.
[0093] For example, the target structured information may also be stored as a predefined structured information template to facilitate subsequent matching of similar question information.
[0094] In operation S420b, a target tool is determined according to the target structured information, and the target tool has a corresponding relationship with the action information.
[0095] In some embodiments, operation S420b is Figure 4 The operation details of operation S420 in the embodiments are the same and will not be described in detail here.
[0096] In operation S430b, call information of the target tool is acquired.
[0097] In some embodiments, operation S430b is Figure 4 The operation details of operation S430 in the embodiments are the same and will not be described again.
[0098] The data processing method provided by the embodiment of the present disclosure generates structured information corresponding to question information based on a target generation model, has high flexibility, and can meet the needs of various scenarios.
[0099] Those skilled in the art may select a corresponding method for determining target structured information according to actual conditions, and the present disclosure does not limit this.
[0100] Figure 8 The flowchart of determining the calling information of the target tool based on the question information according to another embodiment of the present disclosure is schematically shown.
[0101] like Figure 8 As shown, in Figure 2 Based on the data processing method shown in FIG. 1 , the data processing method of this embodiment can further include operations S810 to S830 for determining the calling information of the target tool based on the question information. It should be noted that other implementation details of the data processing method of this embodiment can be found in Figure 2 The embodiment of the data processing method shown will not be described in detail here.
[0102] In operation S810 , description information corresponding to a plurality of target tasks related to the question information is determined based on the question information.
[0103] In some embodiments, by parsing the question information, the question information is broken down into multiple target tasks, and the target tasks are used to generate at least part of the content of the reply information for the question information. By executing multiple target tasks, a complete reply information for the question information can be generated. Each target task corresponds to description information, and the description information may include, for example, detailed information of the target task, which is used to characterize the completion requirements of the target task.
[0104] For example, the question information is: Please recommend me an outfit for outdoor sports tomorrow. The description information corresponding to the multiple target tasks related to the question information may include, for example, weather, outfit, etc.
[0105] In operation S820 , a target tool corresponding to the target task is determined based on the description information corresponding to the plurality of target tasks.
[0106] In some embodiments, a tool that can provide information required for the target task is matched according to the target task and its description information to obtain a target tool corresponding to the target task.
[0107] Taking operation S810 as an example, the question information is "Please recommend me an outfit for outdoor sports tomorrow" and the description information is "weather" and "outfit". The target tool corresponding to "weather" may be, for example, a local weather query software, and the target tool corresponding to "outfit" may be, for example, an online fashion website.
[0108] In operation S830, call information of the target tool is acquired.
[0109] In some embodiments, after determining the target tool, the calling information of the target tool is obtained for calling the target tool in a subsequent process, wherein the calling information of the target tool may include, for example, the name of the tool, the required input parameters and format, and the application programming interface (API).
[0110] Taking the target tool in operation S820 as an online fashion website as an example, the calling information of the target tool may include, for example, the website name, API interface information (such as API interface address, API key, etc.), request parameters (such as request path, request method, etc.), etc.
[0111] For example, after obtaining the call information of the target information, the call information of the target tool can be verified by test calling or simulating requests to ensure the correctness and validity of the call information of the target tool. If the call information verification fails, the call information of the target tool is obtained again or another tool that can be used to execute the action information is reselected as the target tool.
[0112] The disclosed embodiment can perform in-depth analysis and processing on different aspects of the question information by splitting the question information into multiple target tasks. After splitting the overall question information into multiple target tasks, these subtasks can be processed in parallel, and the calling information of the target tools corresponding to these subtasks can be determined respectively, thereby improving the efficiency of obtaining the target tool calling information.
[0113] Fig. 9 The schematic diagram of the data processing method according to another embodiment of the present disclosure is shown. It should be noted that other implementation details of the data processing method of this embodiment can be found in Figure 2 The embodiment of the data processing method shown will not be described in detail here.
[0114] Combination Fig. 9 Based on the data processing method introduced in the above embodiment, the data processing method of this embodiment determines the prompt information according to the question information and the call information, including: splicing the question information and the call information to obtain the prompt information.
[0115] In some embodiments, based on Figure 4~Figure 8 After the data processing method in any embodiment determines the calling information of the target object, it splices the question information and the calling information to form a complete and coherent prompt information, which includes the calling information of the target tool that needs to be called to answer the question information, so as to help the target model better understand the input content and guide the target model to call the target tool to generate reply information.
[0116] During the specific implementation process, after the prompt information is input into the target model, the target model can construct a corresponding query request based on the call information and the question information, send the constructed query request to the target tool respectively, receive the query results returned by the target tool, obtain response information related to the question information, and output reply information based on the response information.
[0117] The disclosed embodiment inputs the prompt information obtained by splicing the question information and the call information into the target model, which can effectively improve the efficiency of the target model in generating reply information. The target model can call the target tool according to the call information in the prompt information, without having to determine the target tool by itself, which reduces the calculation burden and response time of the target model and improves the efficiency of generating reply information. By inputting the question information and the call information of the target tool as prompt information into the target model, the generation of reply information can be increased, so that the target model calls the target tool based on the call information in the prompt information, and improves the controllability and accuracy of reply information generation.
[0118] Fig.10 The schematic diagram of the data processing method according to another embodiment of the present disclosure is shown. It should be noted that other implementation details of the data processing method of this embodiment can be found in Figure 2 The embodiment of the data processing method shown will not be described in detail here.
[0119] exist Fig. 9 On the basis of the data processing method shown, the data processing method of this embodiment determines the prompt information according to the question information and the call information, and can also include: splicing the question information, the call information and the target structured information to obtain the prompt information, the target structured information includes multiple action information corresponding to the question information and content information corresponding to each action information, and the action information has a corresponding relationship with the target tool.
[0120] In some embodiments, in addition to concatenating the question information and the call information to obtain the prompt information, the question information, the call information and the target structured information may also be concatenated together to obtain the prompt information.
[0121] The target structure information can guide the logic of the target model to generate reply information. Each action information in the target structure information corresponds to the action that the target model needs to perform when generating reply information, and the content information is the specific information corresponding to the action.
[0122] For example, in the scenario where the question information is "Help me create a car wash reminder task", the action information "Notify" in the structured information "<Notify> Weather <Notify> Car Wash Location <Ask> Confirm" indicates the action and reply tone that the target model needs to perform when generating reply information. The content information "Weather" corresponding to the action information indicates that the specific content that needs to be notified to the user is the weather.
[0123] The prompt information obtained based on the target structured information, in addition to the calling information of the target tool that the target model needs to call to generate the reply information, also gives the logic of calling the target tool. After receiving the prompt information, the target model can call the target tool according to the logic of the target structured information in the prompt information, obtain the response information related to the question information based on the target tool and output the reply information based on the response information, thereby enhancing the logic and orderliness of the reply information.
[0124] For target structured information of different question information, the relationship between each action information in the target structured information may be different. For example, in some cases, there may be an association relationship between each action information in the target structured information, and this association relationship may involve aspects such as execution order, data transfer, and state synchronization. Taking the question information "help me recommend a set of clothes for outdoor sports tomorrow" as an example, the target structured information corresponding to the question information is <tell> weather <tell> outfit, then the response information related to action information 2 (i.e. outfit information) needs to be determined based on the weather information related to action information 1.
[0125] Inputting the target structured information into the target model as part of the prompt information can enable the target model to think and answer based on the correlation between action information, thereby enhancing the accuracy and interpretability of the response information.
[0126] The prompt information obtained by splicing question information, call information and target structured information in the disclosed embodiment is relatively rich in content, which helps the target model to generate more accurate reply information according to a certain logic.
[0127] Fig.11 The schematic diagram shows a principle diagram of a data processing method according to another embodiment of the present disclosure.
[0128] Fig.12 The flowchart of determining prompt information according to question information and call information according to another embodiment of the present disclosure is schematically shown.
[0129] like Fig.11 , Fig.12 As shown, in Figure 3 Based on the data processing method shown in FIG. 1 , the data processing method of this embodiment can further include operations S2301 to S2302 in determining prompt information according to question information and call information. It should be noted that other implementation details of the data processing method of this embodiment can be found in Figure 2 The embodiment of the data processing method shown will not be described in detail here.
[0130] In operation S2301, a target tool is called based on the calling information to obtain response information related to the question information.
[0131] In operation S2302, the question information and the answer information are combined to obtain prompt information.
[0132] In some embodiments, after determining the call information of the target tool, the target tool can be called based on the call information, and the response information related to the question information can be searched in the target tool. The question information and the response information obtained from the target tool are spliced to obtain prompt information containing the response information.
[0133] For example, when it is determined that the target tool corresponding to the question information includes weather query software, the weather query software can be called based on the calling information of the target tool to obtain the weather information at a certain moment, and the weather information and the question information can be spliced to obtain prompt information containing specific answer information.
[0134] During the specific implementation process, after calling the target tool based on the calling information, the information returned by the target tool can also be pre-screened and filtered to ensure that the response information input into the target model as prompt information is information with high relevance and accuracy, thereby improving the accuracy of response information generation.
[0135] By pre-querying the response information and inputting the response information as prompt information into the target model, the disclosed embodiment can ensure, on the one hand, that the response information generated by the target model contains the specific content used to reply to the question information, thereby improving the accuracy of the response information and the relevance of the response information to the question information. On the other hand, the target model can directly perform reasoning and generate the response information based on the response information without calling the target tool, which can effectively reduce the time the target model spends processing information and improve the efficiency of generating the response information.
[0136] Fig.13 The block diagram schematically shows a data processing device according to an embodiment of the present disclosure.
[0137] like Fig.13 As shown, the data processing device includes a first determining module 1310 , a second determining module 1320 and an obtaining module 1330 .
[0138] The first determination module 1310 is used to determine the call information of the target tool based on the question information, wherein the target tool is a tool related to the question information. In one embodiment, the determination module 1310 can be used to perform the operation S210 described above, which will not be described in detail here.
[0139] The second determination module 1320 is used to determine prompt information according to the question information and the call information; wherein the prompt information is used to guide the target model to generate reply information of the question information according to a certain logic. In one embodiment, the second determination module 1320 can be used to perform the operation S220 described above, which will not be repeated here.
[0140] The acquisition module 1330 is used to input the prompt information into the target model, and obtain the reply information of the question information generated by the target model based on the prompt information. In one embodiment, the acquisition module 1330 can be used to perform the operation S230 described above, which will not be repeated here.
[0141] According to the embodiments of the present invention, any one or more of the modules, submodules, units, and subunits, or at least part of the functions of any one of them can be implemented in one module. According to the embodiments of the present invention, any one or more of the modules, submodules, units, and subunits can be split into multiple modules for implementation. According to the embodiments of the present invention, any one or more of the modules, submodules, units, and subunits can be at least partially implemented as hardware circuits, such as field programmable gate arrays (FPGAs), programmable logic arrays (PLAs), systems on chips, systems on substrates, systems on packages, application specific integrated circuits (ASICs), or can be implemented by hardware or firmware in any other reasonable way of integrating or packaging circuits, or can be implemented in any one of the three implementation methods of software, hardware, and firmware, or in any appropriate combination of any of them. Alternatively, according to the embodiments of the present invention, one or more of the modules, submodules, units, and subunits can be at least partially implemented as computer program modules, and when the computer program modules are run, the corresponding functions can be performed.
[0142] For example, any multiple of the first determination module 1310, the second determination module 1320, and the acquisition module 1330 can be combined in one module / unit / sub-unit for implementation, or any one of the modules / units / sub-units can be split into multiple modules / units / sub-units. Alternatively, at least part of the functions of one or more of these modules / units / sub-units can be combined with at least part of the functions of other modules / units / sub-units and implemented in one module / unit / sub-unit. According to an embodiment of the present disclosure, at least one of the first determination module 1310, the second determination module 1320, and the acquisition module 1330 can be at least partially implemented as a hardware circuit, such as a field programmable gate array (FPGA), a programmable logic array (PLA), a system on a chip, a system on a substrate, a system on a package, an application specific integrated circuit (ASIC), or can be implemented by hardware or firmware such as any other reasonable way of integrating or packaging the circuit, or implemented in any one of the three implementation methods of software, hardware, and firmware or in a suitable combination of any of them. Alternatively, at least one of the first determination module 1310 , the second determination module 1320 , and the obtaining module 1330 may be at least partially implemented as a computer program module, and when the computer program module is executed, a corresponding function may be performed.
[0143] It should be noted that the data processing system part in the embodiments of the present disclosure corresponds to the data processing method part in the embodiments of the present disclosure. The description of the data processing system part specifically refers to the data processing method part, which will not be repeated here.
[0144] Fig.14 A block diagram of an electronic device suitable for implementing the data processing method according to an embodiment of the present disclosure is schematically shown. Fig.14 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.
[0145] like Fig.14 As shown, the electronic device 1400 according to an embodiment of the present disclosure includes a processor 1401, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 1402 or a program loaded from a storage part 1408 to a random access memory (RAM) 1403. The processor 1401 may include, for example, a general-purpose microprocessor (e.g., a CPU), an instruction set processor and / or a related chipset and / or a dedicated microprocessor (e.g., an application-specific integrated circuit (ASIC)), etc. The processor 1401 may also include an onboard memory for caching purposes. The processor 1401 may include a single processing unit or multiple processing units for performing different actions of the method flow according to an embodiment of the present disclosure.
[0146] In RAM 1403, various programs and data required for the operation of electronic device 1400 are stored. Processor 1401, ROM 1402 and RAM 1403 are connected to each other through bus 1404. Processor 1401 performs various operations of the method flow according to the embodiment of the present disclosure by executing the program in ROM 1402 and / or RAM 1403. It should be noted that the program can also be stored in one or more memories other than ROM 1402 and RAM 1403. Processor 1401 can also perform various operations of the method flow according to the embodiment of the present disclosure by executing the program stored in the one or more memories.
[0147] According to an embodiment of the present disclosure, the electronic device 1400 may further include an input / output (I / O) interface 1405, which is also connected to the bus 1404. The electronic device 1400 may further include one or more of the following components connected to the input / output (I / O) interface 1405: an input portion 1406 including a keyboard, a mouse, etc.; an output portion 1407 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage portion 1408 including a hard disk, etc.; and a communication portion 1409 including a network interface card such as a LAN card, a modem, etc. The communication portion 1409 performs communication processing via a network such as the Internet. A drive 1410 is also connected to the input / output (I / O) interface 1405 as needed. A removable medium 1411, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 1410 as needed, so that a computer program read therefrom is installed into the storage portion 1408 as needed.
[0148] According to an embodiment of the present disclosure, the method flow according to an embodiment of the present disclosure can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a computer-readable storage medium, and the computer program contains a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 1409, and / or installed from the removable medium 1411. When the computer program is executed by the processor 1401, the above-mentioned functions defined in the system of the embodiment of the present disclosure are executed. According to an embodiment of the present disclosure, the system, equipment, device, module, unit, etc. described above can be implemented by a computer program module.
[0149] The present disclosure also provides a computer-readable storage medium, which may be included in the device / apparatus / system described in the above embodiments; or may exist independently without being assembled into the device / apparatus / system. The above computer-readable storage medium carries one or more programs, and when the above one or more programs are executed, the method according to the embodiment of the present disclosure is implemented.
[0150] According to an embodiment of the present disclosure, the computer-readable storage medium may be a non-volatile computer-readable storage medium. For example, it may include, but is not limited to: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in combination with an instruction execution system, apparatus, or device.
[0151] For example, according to an embodiment of the present disclosure, the computer-readable storage medium may include the ROM 1402 and / or the RAM 1403 described above and / or one or more memories other than the ROM 1402 and the RAM 1403 .
[0152] The embodiments of the present disclosure also include a computer program product, which includes a computer program, which contains program code for executing the method provided by the embodiments of the present disclosure. When the computer program product runs on an electronic device, the program code is used to enable the electronic device to implement the data processing method provided by the embodiments of the present disclosure.
[0153] When the computer program is executed by the processor 1401, the above functions defined in the system / device of the embodiment of the present disclosure are executed. According to the embodiment of the present disclosure, the system, device, module, unit, etc. described above can be implemented by a computer program module.
[0154] In one embodiment, the computer program may rely on tangible storage media such as optical storage devices, magnetic storage devices, etc. In another embodiment, the computer program may also be transmitted and distributed in the form of signals on a network medium, and downloaded and installed through the communication part 1409, and / or installed from the removable medium 1411. The program code contained in the computer program may be transmitted using any appropriate network medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.
[0155] According to an embodiment of the present disclosure, the program code for executing the computer program provided by the embodiment of the present disclosure can be written in any combination of one or more programming languages. Specifically, these computing programs can be implemented using high-level process and / or object-oriented programming languages, and / or assembly / machine languages. Programming languages include, but are not limited to, Java, C++, python, "C" language or similar programming languages. The program code can be executed entirely on the user computing device, partially on the user device, partially on the remote computing device, or entirely on the remote computing device or server. In the case of a remote computing device, the remote computing device can be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computing device (for example, using an Internet service provider to connect through the Internet).
[0156] The flowcharts and block diagrams in the accompanying drawings illustrate the possible implementation architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each box in the flowchart or block diagram may represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of the code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box may also occur in an order different from that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flowchart, and the combination of boxes in the block diagram or flowchart, can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions. It can be understood by those skilled in the art that the features recorded in the various embodiments of the present disclosure can be combined and / or combined in a variety of ways, even if such a combination or combination is not explicitly recorded in the present disclosure. In particular, without departing from the spirit and teaching of the present disclosure, the features described in the various embodiments of the present disclosure may be combined and / or combined in a variety of ways. All of these combinations and / or combinations fall within the scope of the present disclosure.
[0157] The embodiments of the present disclosure are described above. However, these embodiments are only for illustrative purposes and are not intended to limit the scope of the present disclosure. Although the embodiments are described above, this does not mean that the measures in the various embodiments cannot be used in combination to advantage. Without departing from the scope of the present disclosure, those skilled in the art may make a variety of substitutions and modifications, which should all fall within the scope of the present disclosure.
Claims
1. A data processing method, comprising: Determining the calling information of the target tool based on the question information; wherein the target tool is a tool related to the question information; Determine prompt information according to the question information and the call information; wherein the prompt information is used to guide the target model to generate reply information to the question information according to a certain logic; The prompt information is input into a target model to obtain reply information of the question information generated by the target model based on the prompt information.
2. The data processing method according to claim 1, wherein determining the calling information of the target tool based on the question information comprises: Determining target structured information according to the question information, wherein the target structured information includes a plurality of action information corresponding to the question information and content information corresponding to each of the action information; Determining the target tool according to the target structured information, wherein the target tool has a corresponding relationship with the action information; Obtain the calling information of the target tool.
3. The method according to claim 2, wherein determining the target structured information according to the question information comprises at least one of the following: Determining the target structured information from a plurality of structured information templates according to the question information; The question information is input into a target generation model to obtain the target structured information generated by the target generation model.
4. The data processing method according to claim 1, wherein determining the calling information of the target object based on the question information comprises: Determine, based on the question information, description information corresponding to a plurality of target tasks related to the question information; Determine the target tool corresponding to the target task based on the description information corresponding to the multiple target tasks; Obtain the calling information of the target tool.
5. The data processing method according to any one of claims 1 to 4, wherein the step of determining the prompt information according to the question information and the call information comprises: The question information and the call information are concatenated to obtain the prompt information.
6. According to the method of claim 5, the step of combining the question information and the call information to obtain the prompt information comprises: The question information, the call information and the target structured information are spliced to obtain the prompt information, wherein the target structured information includes a plurality of action information corresponding to the question information and content information corresponding to each of the action information, and the action information has a corresponding relationship with the target tool.
7. The data processing method according to claim 1, wherein determining the prompt information according to the question information and the call information comprises: Calling the target tool based on the calling information to obtain response information related to the question information; The question information and the response information are concatenated to obtain the prompt information.
8. A data processing device, comprising: A first determination module is used to determine the calling information of the target tool based on the question information; wherein the target tool is a tool related to the question information; A second determination module is used to determine prompt information according to the question information and the call information; wherein the prompt information is used to guide the target model to generate reply information of the question information according to a certain logic; The obtaining module is used to input the prompt information into a target model, and obtain reply information of the question information generated by the target model based on the prompt information.
9. An electronic device, comprising: one or more processors; a memory for storing one or more computer programs, It is characterized in that the one or more processors execute the one or more computer programs to implement the steps of the method according to any one of claims 1 to 7.
10. A computer-readable storage medium having a computer program or instruction stored thereon, characterized in that: When the computer program or instruction is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.
Citation Information
Cited By
Template creation method and device, equipment and storage medium
CN120781817A
Method, apparatus, device and storage medium for template creation
CN120781817B