Data processing method and device, chip, computer readable storage medium and computer program product
By introducing a case scoring mechanism, comprehensively considering semantic similarity and quality to select cases, constructing multiple prompts and conducting two rounds of reasoning, the problem of inaccurate output of large models in existing technologies is solved, and the accuracy and reliability of the results are improved.
Patent Information
- Application Number
- CN202410537767.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-29
- Publication Date
- 2025-10-31
AI Technical Summary
In existing technologies, recall cases are constructed based solely on semantic similarity to create prompts, resulting in insufficient accuracy of large model inference results, requiring multiple iterations and adjustments to meet the target.
A case scoring mechanism is introduced, which comprehensively considers the semantic similarity and quality of the cases and the input data, selects multiple cases to construct multiple prompts, and selects the best result through two rounds of reasoning.
It improves the accuracy and reliability of the output results of large models by constructing multiple inference paths through multiple cases, reducing the number of iterations and improving the accuracy and reliability of the results.
Smart Images

Figure CN120875012A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of artificial intelligence (AI), and more particularly to methods, apparatus, computer-readable storage media, and computer program products for data processing in the field of artificial intelligence. Background Technology
[0002] Large models, also known as foundation models, are machine learning models with a large number of parameters and complex structures. They are capable of processing massive amounts of data and performing various complex tasks, such as natural language processing, computer vision recognition, and speech recognition. With the rapid development of large model technology and the diversity and complexity of its applications, the accuracy of its output has gradually become a hot topic of concern in the industry.
[0003] In traditional technologies, prompts are typically used to preprocess the input data of large models obtained through natural language processing, guiding them to generate more accurate and targeted outputs. Commonly used prompt techniques include zero-shot learning, one-shot learning, and few-shot learning. In practice, one-shot or few-shot methods are primarily used to construct prompts. Since constructing prompts using one-shot or few-shot methods requires input sample cases, recall techniques can be employed to extract the cases most relevant to the user input data from a large pool of cases, in conjunction with a case library. Currently, recall techniques mainly employ embedding recall methods, which determine recall cases based on the semantic similarity between the cases and the user input data. Prompts are then constructed based on these recall cases, and the prompts with high semantic similarity to the current user input data from the case library are used as the data to be processed by the large model to complete inference.
[0004] However, in real-world business scenarios, the above method, which relies solely on semantic similarity between cases in the case library and the input data to identify recalled cases, may result in recalled cases failing to reflect the actual business meaning, thus affecting the accuracy of the inference results. During the large model's inference process, only one prompt is used at a time to determine the data to be processed. If the large model's processing result based on the data is unsatisfactory, another prompt is used to determine new data to be processed, and the large model re-determines a new processing result based on the new data. This process iterates until the processing result meets the requirements. Therefore, using the recalled cases as sample cases to construct the prompt may reduce the accuracy of the large model's inference results. Summary of the Invention
[0005] This application provides a data processing method, apparatus, chip, computer-readable storage medium, and computer program product. It introduces a case scoring mechanism to score cases in a case library. This mechanism, in addition to scoring the similarity between cases and input data, also considers case quality, specifically adding a recall score based on one or more of the case's accuracy or importance. Subsequently, based on this recall score, N cases are selected, which are used to construct a prompt. This prompt guides a large model to generate specific inference results. By improving the accuracy or importance of the cases in this application, the accuracy and reliability of the prompts constructed from these cases are improved, thereby enhancing the accuracy and reliability of the large model's output results. Multiple prompts are constructed from multiple cases. In the first round of inference, each prompt, after being input into the large model, has a different inference path. In the second round of inference, the optimal inference result is obtained from these different inference paths, and the final inference result is determined from multiple optimal inference results. Therefore, two rounds of inference improve the accuracy of the large model's inference results.
[0006] Firstly, this application provides a data processing method, characterized by comprising: acquiring input data, the input data including user query content; filtering multiple cases based on the input data values, the multiple cases including cases that are identical to or have a similarity threshold with the user's query content, wherein the similarity of the query content is determined based on semantic similarity; determining a recall score for the multiple cases based on a case scoring mechanism, the case scoring mechanism including scoring the semantic similarity and case quality of the multiple cases, the semantic similarity being the similarity between the case and the input data, the case quality including one or more of accuracy or importance; filtering N cases from the multiple cases based on the recall score, the N cases being used to construct a prompt, the prompt being used to guide a large model to generate a specific inference result for the input data, where N is a positive integer. By constructing N prompts for the large model, outputting N inference results, and then selecting the best inference result from the N inference results, the accuracy of the model is improved. Since each prompt is constructed based on recalled cases, further selection improves the accuracy of the prompt.
[0007] In one possible implementation, the method further includes: constructing M prompts based on the N cases, where M is a positive integer, and the N cases contain identical question content or have a question content similarity reaching a threshold; analyzing the M prompts using a large model to obtain M*K inference results, where each of the M prompts corresponds to K inference results, and K is a positive integer; and analyzing the M*K inference results to obtain a target inference result, which is selected from the M*K inference results. By constructing M prompts based on the N cases and analyzing the M*K inference results, multiple inference paths are provided, thereby improving the accuracy of the model output.
[0008] In one possible implementation, analyzing the M*K inference results to obtain the target inference result includes: analyzing the K inference results corresponding to each prompt in the M*K inference results to obtain M inference results corresponding to the M prompts, where each of the M inference results is selected from the K inference results corresponding to each prompt; and analyzing the M inference results to obtain the target inference result. Obtaining the M inference results corresponding to the M prompts from the M*K inference results constitutes the first round of inference in the large model, while obtaining the target inference result from the M inference results constitutes the second round of inference in the large model. These two rounds of inference improve the accuracy of the model's output.
[0009] In one possible implementation, analyzing the K inference results corresponding to each prompt among the M*K inference results to obtain M inference results corresponding to the M prompts includes: voting on the K inference results corresponding to each prompt using a majority voting rule to obtain the M inference results. By using a voting mechanism to select inference results during the first round of inference, the accuracy of the inference results is improved.
[0010] In one possible implementation, analyzing the M second inference results to obtain the target inference result includes: voting on the M inference results using the majority voting rule to obtain the target inference result. The majority voting rule enables efficient and rapid selection of the inference result, thereby further improving the accuracy of the model output.
[0011] In one possible implementation, the method further includes updating the accuracy of cases in the case library based on the target inference results. Since accuracy is a component of case quality, updating the accuracy of the case library is equivalent to updating the case quality of the case library, thereby affecting the case recall score. By continuously updating and optimizing the case recall score, the accuracy of the generated case guidance prompt is improved, further enhancing the output accuracy of the large model.
[0012] In one possible implementation, the step of filtering multiple cases in the case library based on the recall score to obtain N cases includes: recalling cases in the case library based on the recall score to obtain recalled cases; sorting the recalled cases based on their recall scores to obtain a sorting result; and filtering the N cases based on the sorting result. By scoring cases for recall and selecting cases with high scores to construct the prompt, the accuracy of the generated prompt is improved, thereby improving the accuracy of the model.
[0013] In one possible implementation, the step of recalling cases in the case library based on the recall score to obtain recalled cases includes: recalling cases in the case library whose recall scores exceed a preset value to obtain the recalled cases.
[0014] Secondly, this application provides a data processing apparatus, comprising: an acquisition module for acquiring input data, the input data including user-generated questions; a scoring module for scoring multiple cases in a case library based on the input data using a case scoring mechanism to obtain a recall score for the multiple cases, the case scoring mechanism including scoring the semantic similarity and case quality of the multiple cases, the semantic similarity being the similarity between the case and the input data, and the case quality including one or more of the case's accuracy or importance; and a filtering module for filtering the multiple cases in the case library based on the recall score to obtain N cases, the N cases being used to construct a prompt, the prompt being used to guide a large model to generate a specific inference result for the input data, and N being a positive integer.
[0015] In one possible implementation, the device further includes: a construction module, configured to construct M prompts based on the N cases, where M is a positive integer; an analysis module, configured to analyze the M prompts using a large model to obtain M*K inference results, where each of the M prompts corresponds to K inference results, where K is a positive integer; the analysis module is further configured to analyze the M*K inference results to obtain a target inference result, which is selected from the M*K inference results; and an output module, configured to output the target inference result to a client for visualization.
[0016] In one possible implementation, the analysis module is specifically used to: analyze the K inference results corresponding to each prompt in the M*K inference results to obtain M inference results corresponding to the M prompts, wherein each of the M inference results is obtained by filtering from the K inference results corresponding to each prompt; and analyze the M inference results to obtain the target inference result.
[0017] In one possible implementation, the analysis module is specifically used to: vote on the K inference results corresponding to each prompt using a majority voting rule to obtain the M inference results.
[0018] In one possible implementation, the analysis module is specifically used to: vote on the M inference results using the majority voting rule to obtain the target inference result.
[0019] In one possible implementation, the filtering module is specifically used to: recall cases in the case library according to the recall score to obtain recalled cases; sort the recalled cases according to the recall score of the recalled cases to obtain a sorting result of the recalled cases; and filter the N cases according to the sorting result.
[0020] In one possible implementation, the filtering module is specifically used to: recall cases in the case library whose recall scores exceed a preset value, thereby obtaining the recalled cases.
[0021] In one possible implementation, the apparatus further includes an update module for updating the accuracy of cases in the case library based on the target inference result.
[0022] Thirdly, this application provides a computer device, the computing device including at least one computing device, each device including a processor and a memory: the processor is coupled to the memory; the memory is used to store a program; the processor is used to execute the program in the memory, such that it performs the operational steps of the method in the first aspect or any possible implementation of the first aspect.
[0023] Fourthly, this application also provides a computer device cluster, which includes multiple computer devices as described in the third aspect. Each computer device includes a processor, a memory, a communication interface, and a bus. The processor, memory, and communication interface are connected via the bus and communicate with each other. The memory stores computer execution instructions. When the processor is running, the processor executes the computer execution instructions in the memory to utilize the hardware resources of the computer device to perform the operation steps of the method described in the first aspect or any possible implementation of the first aspect.
[0024] Fifthly, this application provides a chip system including a processor and a power supply circuit, the power supply circuit being used to supply power to the processor, and the processor being used to execute the operation steps of the method in the first aspect or any possible implementation of the first aspect.
[0025] In a sixth aspect, this application provides a computer-readable storage medium, including a computer program stored thereon, which, when executed by a processor, implements the operation steps of the method described in the first aspect or any possible implementation of the first aspect.
[0026] In a seventh aspect, this application provides a computer program product, which includes computer-readable instructions stored therein, which, when executed by a processor, implement the operation steps of the method described in the first aspect or any possible implementation of the first aspect.
[0027] Based on the implementation methods provided in the above aspects, this application can be further combined to provide more implementation methods. Attached Figure Description
[0028] Figure 1 This application provides an architecture diagram of a data processing system.
[0029] Figure 2 This application provides a flowchart illustrating the steps of a data processing method.
[0030] Figure 3 This application provides a schematic diagram of the structure of a data processing computing device. Detailed Implementation
[0031] To address the issue of inaccurate output from large models, this application introduces a case scoring mechanism to evaluate cases in a case library. This mechanism considers not only the similarity between a case and the input data but also case quality, specifically by adding a recall score based on one or more of the case's accuracy or importance. Based on this recall score, N cases are selected to construct a prompt, which guides the large model to generate specific inference results. This application's implementation considers the accuracy or importance of cases, improving the accuracy and reliability of the prompts constructed from these cases, thereby enhancing the accuracy and reliability of the large model's output. Furthermore, this application constructs multiple prompts from multiple cases, each with a different inference path, improving the accuracy of the inference results through two rounds of inference.
[0032] The technical solution provided in this application will be explained below with reference to the accompanying drawings.
[0033] Figure 1 This is a system architecture diagram of an applicable scenario for a data processing method provided in this application. For example... Figure 1As shown, the structure may include a client 100, a database 200, a data processing system 300, and a storage system 400. Communication connections exist between the client 100, the database 200, the data processing system 300, and the storage system 400, which can be wired or wireless; this application does not specify a particular connection. The number of clients 100 and storage systems 400 establishing communication connections with the data processing system 300 can be one or more. Figure 1 The example provided is a client 100 and a storage system 400; however, this application does not impose any specific limitations.
[0034] Client 100 is used to realize human-computer interaction and can be deployed on terminal devices, including personal computers, smartphones, wearable devices, handheld processing devices, tablets, mobile laptops, augmented reality (AR) devices, virtual reality (VR) devices, all-in-one handheld consoles, wearable devices, in-vehicle devices, smart conferencing devices, smart advertising devices, smart home appliances, etc. Smart home appliances can be robot vacuum cleaners, robot mops, etc., without specific limitations here.
[0035] In specific implementations, the client can be software or an application running on a terminal device or computing device controlled by the user, such as a personal computer (PC) client, a World Wide Web (web) client accessed through a browser, an application (APP) client running on a mobile terminal, or a console on a cloud platform. This application does not impose any specific limitations.
[0036] In practical implementation, Client 100 is applied to fields with data analysis and query needs, such as data processing, data analysis, data mining, data exploration, and data querying. These include, but are not limited to, the biomedical field (e.g., epidemiological research, drug development), the financial field (risk assessment, market forecasting), the economics field (e.g., accounting, taxation, funds), the social media field (personalized recommendations, advertising targeting, sentiment analysis), and the sales field (pricing strategies, inventory management, customer relationship management). It can also be applied to many other fields with data processing needs, which will not be listed here.
[0037] Optionally, client 100 can be a client for implementing data analysis functions. The type of client 100 and the type of user vary across different data analysis fields. For example, in the biomedical field, client 100 can be bioinformatics tools, statistical analysis software, etc., used to process and analyze biological data such as genomes, proteomes, and gene expression. In the social media field, client 100 can be data mining tools, social media analysis platforms, etc., used to discover public opinion trends, user interactions, and sentiment analysis from social media data. In the financial field, client 100 can be financial modeling tools, risk analysis tools, financial analysis tools, etc., used for market analysis, portfolio optimization, and risk management. In the sales field, client 100 can be inventory management tools, pricing analysis tools, etc., used for optimizing inventory, supply chain analysis, and formulating product pricing strategies. It should be understood that the above examples are for illustrative purposes only and this application does not impose specific limitations.
[0038] Optionally, the client 100 can be a standalone client specifically designed for data analysis functions, or it can be a data analysis function module or plugin within comprehensive software, such as the data analysis and query modules within data mining software, or the financial analysis assistant and data query assistant in commonly used enterprise (office automation, OA) clients. This application does not impose any specific limitations.
[0039] Optionally, client 100 can also be a cloud platform client, such as a cloud platform console. Specifically, it can be a web-based console or an application programming interface (API) based console; this application does not impose any specific limitations. This console can provide data analysis-related cloud services to management users, who can obtain access to the data processing system 300 provided in this application by purchasing cloud services.
[0040] Database 200, data processing system 300, and storage system 400 can be deployed on computing devices or clusters of computing devices. Computing devices include bare metal servers (BMS), virtual machines, containers, or edge computing devices. BMS refers to a general-purpose physical server, such as an ARM server or an x86 server. A virtual machine refers to a complete computer system simulated by software, possessing full hardware system functionality and running in a completely isolated environment. Any task that can be performed on a physical computer can also be performed in a virtual machine. When creating a virtual machine on a computing device, a portion of the physical machine's hard drive and memory capacity is used as the virtual machine's hard drive and memory capacity. Each virtual machine has an independent basic input / output system (BIOS), hard drive, and operating system, and can be operated like a physical machine. A container is a portable software unit that combines an application and all its dependencies into a single software package. This package is not limited by the underlying host operating system, eliminating the need to build complex environments and simplifying the application development and deployment process. Edge computing devices are devices that are closer to the data source and end user, featuring low latency and high bandwidth, such as intelligent routers and edge servers. The computing device cluster may include multiple of the aforementioned computing devices, such as a data center, and this application does not specifically limit it. The storage system 400 may also be deployed in a storage array, such as a redundant array of independent disks (RAID), network-attached storage (NAS), storage area network (SAN), etc., and this application does not specifically limit it.
[0041] Optionally, the database 200 and the data processing system 300 may be deployed in the same computing device as the storage system 300, or in different computing devices within the same computing device cluster, or in computing devices and storage arrays within the same computing device cluster, or in different computing device clusters. This application does not make any specific limitations.
[0042] Optionally, the data processing system 300 and the client 100 may be deployed in the same or different computing device clusters. For example, the client 100 may be deployed on a terminal device in a first computing device cluster, and the data processing system 300 may be deployed on a computing device in a second computing device cluster. Alternatively, the client 100 and the data processing system 300 may be deployed in the same computing device cluster. It should be understood that the above examples are for illustration only and are not specifically limited in this application.
[0043] Optionally, the database 200 and the data processing system 300 may be deployed in the same or different computing device clusters. For example, the database may be deployed on a storage device in a first computing device cluster, and the data processing system 300 may be deployed on a computing device in a second computing device cluster; or the database 200 and the data processing system 300 may be deployed in the same computing device cluster. It should be understood that the above examples are for illustration and are not specifically limited in this application.
[0044] Optionally, database 200 can be deployed within data processing system 300 and is a module within data processing system 300; database 200 can also be deployed outside of data processing system 300 and is not a device or module within data processing system 300. It should be understood that... (The rest of the text is missing.) Figure 1 This application is for illustrative purposes only and does not impose any specific limitations.
[0045] Optionally, the database 200 and the storage system 400 may be deployed in the same or different computing device clusters, or in different storage arrays of the same computing device cluster, or in computing devices and storage arrays of the same computing device cluster, or independently. This application does not make any specific limitations.
[0046] Optionally, the data processing system 300 can access data, code, etc., in the storage system 400, and can also store output data in the storage system 400. The storage system 400 can be set up within the data processing system, or it can be set up independently, or it can be set up in other network entities; there can be one or multiple storage systems.
[0047] Furthermore, Figure 1 The data processing system 300 can be further divided into one or more unit modules, for example, such as Figure 1 As shown, the data processing system 300 includes an acquisition module 310, a scoring module 320, a filtering module 330, a construction module 340, an analysis module 350, and an output module 360. It should be understood that... Figure 1 This is an exemplary division method. The client 100, database 200, data processing system 300, and storage system 300 may also include more or fewer units, and this application does not make any specific limitations.
[0048] The functions of each module in the data processing system 300 are explained below.
[0049] First, the functions of the acquisition module 310, the scoring module 320, and the filtering module 330 will be explained.
[0050] The acquisition module 310 is used to acquire input data, which includes the user's question content.
[0051] Optionally, the acquisition module 310 acquires input data from the client 100, which is the user's question.
[0052] For example, the user query read by module 310 from the client is: "Company X donated a refrigerator to a local middle school to recognize the school's positive performance in the Arbor Day activities. Please analyze the asset use of this action?" It should be understood that the above example is for illustrative purposes and this application does not impose any specific limitations.
[0053] It should be noted that the professional fields involved in the questions can be law or finance, and there are no restrictions here.
[0054] The scoring module 320 is used to score multiple cases in the case library based on the input data using a case scoring mechanism to obtain recall scores for multiple cases. The case scoring mechanism includes scoring the semantic similarity and case quality of multiple cases. Semantic similarity is the similarity between the case and the input data, and case quality includes one or more of the case's accuracy or importance.
[0055] It should be understood that a case refers to a set of textual information consisting of input data and output information. A single case may include one input data and one output information. For example, a case may be a user's question and the answer output by the data processing system in response to the user's question; the question and the answer together constitute a case.
[0056] It should be understood that a case library refers to a collection of multiple cases, and in specific implementations, a database can be used to store the collection of the aforementioned multiple cases.
[0057] Optionally, the case library can utilize a vector database to store multiple cases, where information is stored in vector form. Depending on the complexity and detail of the data, the vectors can be multi-dimensional, with the dimensionality varying greatly, from a few to thousands. Case texts are converted into vectors using learning models, word embeddings, or feature extraction techniques and stored in the vector database as the case library.
[0058] Optionally, based on the input data, a case scoring mechanism is used to score multiple answers in the case library corresponding to the question content, thereby obtaining a recall score for the multiple answers. The case scoring mechanism can comprehensively evaluate the recall score of each case based on semantic similarity, the accuracy of the question answer, and the importance of the case.
[0059] Specifically, the formula (1) used in the case scoring mechanism is as follows:
[0060] s i =α·distance i+β·hitrate i +γ·importance i Formula (1)
[0061] Where distance i Semantic similarity refers to the similarity between the case and the input data; hitrate i Let be the accuracy of the answer in the i-th case, and be the importance. i The scores generated by the large model represent the importance of the case. i hitrate i importance i They have weight values α, β, and γ, respectively.
[0062] For example, the acquisition module 310 reads a user question from the client: "Company X donated a refrigerator to a local middle school to commend the school's positive performance in the Arbor Day activities. Please analyze the asset use of this behavior?" Then, the scoring module 320, based on the question, queries the case library for all answers related to the question. These answers include: "Organization H donated a batch of books to a local school; the asset use of this behavior is to motivate students," "Association H collected donations to a local primary school to help repair its dormitories; the asset use of this behavior is to support the middle school," and "Merchant H gave away its own refrigerator as a gift to its members; the asset use of this behavior is to promote the company's products," etc. Then, multiple answers are scored using a case scoring mechanism to obtain the recall scores for these multiple answers. For example, the recall scores for the multiple answers might be 99, 90, and 78, respectively. It should be understood that the above examples are for illustrative purposes only and this application does not impose specific limitations.
[0063] It should be understood that the scoring module provides a standard evaluation mechanism for scoring cases in the case library or vector database to obtain the score values of multiple answers to the same question. This helps to efficiently and directly understand the quality of each answer and lays the groundwork for efficient case selection.
[0064] The filtering module 330 is used to filter multiple cases in the case library according to the recall score to obtain N cases. The N cases are used to construct a prompt, which is used to guide the large model to generate a specific inference result for the input data. N is a positive integer.
[0065] Optionally, the filtering module 330 recalls cases in the case library based on the recall score to obtain recalled cases; sorts the recalled cases based on the recall score to obtain a sorting result; and filters out the N cases based on the sorting result.
[0066] Optionally, the filtering module 330 recalls cases in the case library whose recall scores exceed a preset value, thereby obtaining the recalled cases.
[0067] Optionally, the filtering module 330 uses cases with recall scores greater than a threshold to construct a prompt based on the recall score.
[0068] For example, a user might ask, "Company X donated a refrigerator to a local middle school to recognize its positive performance during Arbor Day. What is the asset purpose of this action?" Corresponding answers include, "The asset purpose of this action is to motivate students," "The asset purpose of this action is to donate to the middle school," and "The asset purpose of this action is to promote the company's products." The recall scores for these multiple answers are 99, 90, and 78, respectively. Since all of these recall scores are greater than the threshold of 60, each of these answers can be used to construct a prompt. This prompt guides the large model to generate specific inference results based on the input data, where N is a positive integer.
[0069] It should be understood that the screening module 330 can accurately screen multiple cases in the case library based on the recall score, obtain cases that meet the quality requirements, and improve the accuracy and efficiency of case selection.
[0070] In summary, the data processing system 300 provided in this application obtains user queries from the client through the acquisition module 310, extracts multiple cases corresponding to the user's queries from the case library, and uses a case scoring mechanism to recall and score these cases, obtaining score values. This process provides a reliable scoring mechanism that comprehensively considers case similarity, importance, and accuracy, comprehensively evaluating the similarity and quality of cases, efficiently and accurately scoring each case, and finally, the filtering module 330 selects high-quality cases based on their scores, improving the efficiency and accuracy of case recall.
[0071] The following describes the construction module 340, the analysis module 350, and the output module 360.
[0072] Module 340 is used to construct M prompts based on the N cases, where M is a positive integer;
[0073] Optionally, N and M can be the same value, or M can be less than N.
[0074] Optionally, when the filtering module 330 obtains N cases, the construction module 340 constructs prompts for each of the N cases. For example, N can be equal to 10, and M can also be equal to 10, constructing prompts for each of the 10 cases, for a total of 10 prompts. Alternatively, N can be equal to 10, and M can be equal to 20, with each case corresponding to 2 prompts.
[0075] For example, the prompt message could be: "You are an intelligent assistant. Please refer to the relevant regulations and given examples to make a judgment. Here is your question: {question}, you can refer to the following examples: {examples}, and the relevant regulations: {rules}." It should be understood that the above examples are for illustration only and this application does not impose any specific limitations.
[0076] It should be understood that the prompt information helps the analysis module 350 to further understand the recalled cases. It not only helps to understand the user's question in the case, but also helps the analysis module 350 to reason about the answers in the case that correspond to the user's question. This helps to evaluate the quality of the answers and improve the accuracy and effectiveness of the recall technology.
[0077] Analysis module 350 is used to analyze the M prompts through a large model to obtain M*K inference results, where each of the M prompts corresponds to K inference results, and K is a positive integer;
[0078] The analysis module 350 is further configured to analyze the M*K inference results to obtain a target inference result, which is obtained by filtering from the M*K inference results.
[0079] Optionally, the K inference results corresponding to each prompt in the M*K inference results are analyzed to obtain M inference results corresponding to the M prompts, where each of the M inference results is selected from the K inference results corresponding to each prompt; the target inference result is obtained by analyzing the M inference results.
[0080] Optionally, a majority voting rule is used to vote on the K inference results corresponding to each prompt to obtain the M inference results.
[0081] Optionally, the majority voting rule is used to vote on the M inference results to obtain the target inference result.
[0082] For example, the analysis module actually performs two rounds of majority voting. The first round aims to obtain M inference results; the second round aims to select the target inference result from these M results. Typically, there is only one target inference result. For instance, a case is input into a large model, and the model performs inference analysis on the case and its corresponding prompt, resulting in K inference results for that case. Then, a majority vote is held on these K inference results, and the target inference result is selected from them. Similarly, if M cases are input into a large model, and the model performs inference analysis on the M cases and their corresponding prompts, resulting in M*K inference results for the M cases, a majority vote is held on these M*K inference results, and the target inference result is selected from them.
[0083] Optionally, the majority voting method can be based on the principle of majority rule, where the most frequent reasoning result is taken as the target reasoning result. For example, if the first reasoning result is A, the second reasoning result is B, and so on, and the Kth reasoning result is A, then according to the majority voting rule (minority follows majority), the final result is A.
[0084] For example, Case 1, combined with prompt 1 and input into the large model, yields K inference results corresponding to Case 1; similarly, Case 2, combined with prompt 2 and input into the large model, yields K inference results corresponding to Case 2. The user input questions in Case 1 and Case 2 are identical or their similarity reaches a threshold. The phasing speed between multiple question contents is calculated based on their semantic similarity. This process continues, with each case obtaining multiple inference results through the large model, resulting in K inference results per case. In the first round of majority voting, these K inference results are analyzed and filtered to obtain the majority-voted inference result for each case. If there are N cases, then N inference results will be obtained. The second round of majority voting selects the target inference result from these N results. Typically, there is only one target inference result.
[0085] It should be understood that the analysis module analyzes multiple cases corresponding to questions with the same or similarity reaching a threshold. Each case corresponds to a different prompt, so the analysis process not only combines the help and hints of the prompt but also obtains different types and content of hint information. This allows for the consideration of multiple different hint information to arrive at multiple inference results for questions with the same or similarity reaching the threshold. Combined with a voting mechanism, the inference results output by the analysis module after the cases are processed are more accurate. Furthermore, in this application, the analysis process is more thorough and accurate due to the two rounds of voting.
[0086] The output module 360 is used to output the target reasoning result to the client for visualization display.
[0087] In specific implementation, the content displayed by the output module 360 to the client 100 can be:
[0088] Q: Company X donated a refrigerator to a local high school in recognition of the school's positive performance during Arbor Day activities. Please analyze the asset purpose of this action.
[0089] A: According to the relevant regulations, this act of donating the refrigerator to others is a charitable act, which is an act of using assets for external donation. Therefore, the purpose of the asset is external donation.
[0090] The examples above are for illustrative purposes only and are not intended to be specific limitations in this application.
[0091] In summary, the construction module 340 constructs multiple prompts for multiple cases with identical or similar question content reaching the threshold, thereby improving the large model's ability to understand the cases and increasing the accuracy of inference results under different prompts. The analysis module 350, by setting up two rounds of majority voting, not only improves the accuracy of inference results under different prompts but also improves the accuracy of inference results under prompts with identical or similar content reaching the threshold.
[0092] The functions of each module in the data processing system 300 have been introduced above. In order to iterate and update the accuracy of the model's output and further improve the model's accuracy, the data processing system 300 may also include an update module 370. The functions of the update module 370 will be explained below.
[0093] Update module 370 is used to update the accuracy of cases in the case library based on the target reasoning results.
[0094] Optionally, the update module is also used to update the cases in the case library based on the target inference result, storing the target inference result in the case library. For example, if the input model's question is "What is this?", and the original answer in the case library is "This is an apple", after the various modules provided in this application understand the input question and output the target inference result as "This is a red apple", the update module is used to store the target inference result in the case library. That is, there are two sets of question-answer pairs in the case library: the first set of cases is "What is this?" "This is an apple"; the second set of cases is "What is this?" "This is a red apple". Both sets of cases will be stored in the case library.
[0095] As an example, the original answer is "This is an apple," with an original accuracy of 0.9. After large-scale model inference, the target inference result is "This is a red apple." In this case, the accuracy of the original answer will be reduced from 0.9 to 0.7; correspondingly, the accuracy of "This is a red apple" will be 0.95. The content and corresponding accuracy of these two sets of cases will be stored in the case library.
[0096] For example, the output module outputs the target inference result, and the corresponding case has already been scored for accuracy in the scoring module using a scoring mechanism. If the original accuracy of the case corresponding to the target inference result is 0.8, then the accuracy of the case can be improved to 0.95 after being updated by a more detailed module. Alternatively, the answer in the original case can be replaced with the answer in the inference result to update the answer content of the case. The above examples are for illustration only, and this application does not impose any specific limitations.
[0097] It should be understood that the update module updates the content in the case library and also updates the accuracy of the case library. After multiple iterations and updates, the data in the case library will become more accurate.
[0098] It should be understood that the acquisition module 310, the scoring module 320, the filtering module 330, the construction module 340, the analysis module 350, the output module 360, and the update module 370 can all be implemented in software or in hardware.
[0099] A module, as an example of a software functional unit, can include code running on a computing instance. A computing instance can include at least one of a physical host (computing device), a virtual machine, or a container. Furthermore, the aforementioned computing instance can be one or more. For example, module A can include code running on multiple hosts / virtual machines / containers. It should be noted that the multiple hosts / virtual machines / containers used to run the code can be distributed within the same region or in different regions. Further, the multiple hosts / virtual machines / containers used to run the code can be distributed within the same availability zone (AZ) or in different AZs, each AZ comprising one or more geographically proximate data centers. Typically, a region can include multiple AZs.
[0100] For multiple modules, the multiple hosts / virtual machines / containers used to run the code for each module can be distributed within the same Virtual Private Cloud (VPC) or across multiple VPCs. Typically, a VPC is set up within a region. Communication between two VPCs within the same region, as well as between VPCs in different regions, requires a communication gateway to be set up within each VPC to achieve interconnection between VPCs.
[0101] As an example of a hardware functional unit, a module can include at least one computing device, such as a server. Alternatively, module A can be implemented using a central processing unit (CPU), an application-specific integrated circuit (ASIC), or a programmable logic device (PLD). The PLD can be implemented using a complex programmable logical device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL), a data processing unit (DPU), a neural network processing unit (NPU), a system-on-chip (SoC), an offload card, an accelerator card, or any combination thereof.
[0102] For multiple modules, the computing devices corresponding to each module can be distributed in the same region or in different regions. The multiple computing devices included in module A can be distributed in the same Availability Zone (AZ) or in different AZs. Similarly, the multiple computing devices included in module A can be distributed in the same VPC or in multiple VPCs. These multiple computing devices can be any combination of computing devices such as servers, ASICs, PLDs, CPLDs, FPGAs, GALs, DPUs, NPUs, SoCs, offloading cards, and accelerator cards.
[0103] The above text combined Figure 1 The data processing system provided in this application has been described in detail. The following will combine... Figure 2 This application describes the data processing method provided.
[0104] Figure 2 This is a flowchart illustrating the steps of a data processing method provided in this application. This method is applicable to, for example... Figure 1 In the data processing system shown, such as Figure 2 As shown, the method includes the following steps:
[0105] Step S301: Obtain input data, which includes the user's question content.
[0106] For example, user input data includes the user's question, such as, "Company X donated a refrigerator to a local middle school to recognize the school's positive performance in the Arbor Day activities. Please analyze the asset use of this action?" It should be understood that the above example is for illustrative purposes and this application does not impose any specific limitations.
[0107] It should be noted that the professional fields involved in the questions can be law or finance, and there are no restrictions here.
[0108] Step S302: Based on the input data, a case scoring mechanism is used to score multiple cases in the case library that have the same or similar question content that reaches a threshold, and the recall scores of the multiple cases are obtained.
[0109] The case scoring mechanism includes scoring the semantic similarity and case quality of the multiple cases. The semantic similarity is the similarity between the case and the input data, and the case quality includes one or more of the case's accuracy or importance.
[0110] It should be understood that a case refers to a set of textual information consisting of input data and output information; one input data and one output information together constitute a case. For example, a case can be a user's question and the answer output by the data processing system in response to the user's question; the question and the answer together constitute a case.
[0111] Optionally, the case study library is a vector database, which stores information in vector form. Depending on the complexity and detail of the data, the vectors can be multi-dimensional, with the dimension varying greatly, ranging from a few to thousands. Case texts are converted into vectors using learning models, word embeddings, or feature extraction techniques and stored in the vector database as the case study library.
[0112] Optionally, the system uses a case scoring mechanism to score multiple answers in the case library that correspond to the question content based on the input data, thereby obtaining recall scores for the multiple answers.
[0113] Optionally, the formula (1) used in the case scoring mechanism is:
[0114] s i =α·distance i +β·hitrate i +γ·importance i Formula (1)
[0115] Where distance i Semantic similarity refers to the similarity between the case and the input data; hitrate i Let be the accuracy of the answer in the i-th case, and be the importance. i The scores generated by the large model represent the importance of the case. i hitrate i importance i They have weight values α, β, and γ, respectively.
[0116] For example, if the user's question obtained in the above steps is, "Company X donated a refrigerator to a local middle school to commend the school's positive performance in the Arbor Day activities. Please analyze the asset use of this behavior?", then step S302 searches the case database for all answers related to the question. For example, answers might include, "Organization H donated a batch of books to a local school; the asset use of this behavior is to motivate students," "Association H collected donations to a local primary school to help renovate its dormitories; the asset use of this behavior is to support the middle school," or "Merchant H gave away its own refrigerator as a gift to its members; the asset use of this behavior is to promote the company's products," etc. Then, multiple answers are scored using a case scoring mechanism to obtain recall scores for the multiple answers. For example, the recall scores for the multiple answers might be 99, 90, and 78, respectively. It should be understood that the above examples are for illustrative purposes only and this application does not impose specific limitations.
[0117] It should be understood that step S302 provides a standard evaluation mechanism for scoring cases in the case library (or vector database) to obtain the score values of multiple answers corresponding to questions with the same or similarity reaching a threshold. This is beneficial for efficiently and directly understanding the quality of each answer and improving the quality of case selection.
[0118] Step S303: Based on the recall score, filter multiple cases in the case library to obtain N cases.
[0119] The N cases are used to construct a prompt, which guides the large model to generate specific inference results based on the input data, where N is a positive integer.
[0120] Optionally, step S303 involves recalling cases from the case library based on the recall score to obtain recalled cases; sorting the recalled cases based on the recall score to obtain a sorting result; and selecting the N cases based on the sorting result.
[0121] Optionally, step S303 involves recalling cases in the case library whose recall scores exceed a preset value, thereby obtaining the recalled cases.
[0122] Optionally, in step S303, cases with recall scores greater than a threshold are used to construct a prompt based on the recall score.
[0123] As an example, a user asks, "Company X donated a refrigerator to a local middle school to recognize its positive performance during Arbor Day activities. Please analyze the asset use of this action?" Corresponding answers include "The asset use of this action is to motivate students," "The asset use of this action is to donate to the middle school," and "The asset use of this action is to promote the company's products." The recall scores for these multiple answers are 99, 90, and 78, respectively. All of these recall scores are greater than the threshold (or preset value) of 60. Therefore, each of these answers can be used to construct a prompt, which guides the large model to generate a specific inference result based on the input data. Here, N is a positive integer.
[0124] It should be understood that step S303 can accurately filter multiple cases in the case library based on the recall score, obtain cases that meet the quality requirements, and improve the accuracy and efficiency of case selection.
[0125] In summary, the data processing method provided in this application involves steps S301, S302, and S303. By obtaining the user's question content, multiple cases corresponding to the user's question content are extracted from the case library. A case scoring mechanism is then used to recall and score these multiple cases, obtaining a score value. This data processing method provides a reliable scoring mechanism that comprehensively considers case similarity, importance, and accuracy, comprehensively evaluating the similarity and quality of cases. It efficiently and accurately scores each case, and finally, the filtering module 330 selects high-quality cases based on their scores, improving the efficiency and accuracy of case recall.
[0126] The above describes the process by which the data processing system selects high-quality cases based on a stabilization mechanism. The following section will further combine... Figure 2 Steps S304, S305, S306, and S307 illustrate the process of obtaining the target inference result by constructing multiple prompts and performing multiple rounds of voting.
[0127] Step S304: Based on N cases, construct M prompts, where M is a positive integer, and the questions in the N cases are identical.
[0128] Optionally, N and M can be the same value, or N can be less than M.
[0129] Optionally, if N cases are obtained in step S304, the construction module 340 constructs prompts for each of the N cases, or in other words, constructs prompts based on the content of the cases. Here, N can be equal to 10, and M can also be equal to 10, constructing prompts for each of the 10 cases, for a total of 10 prompts. Alternatively, N can be equal to 10, and M can be equal to 20, with each case corresponding to 2 prompts.
[0130] As an example, the constructed prompt message could be: "You are an intelligent assistant. Please refer to the relevant regulations and given examples to make a judgment. Here is your question: {question}, you can refer to the following examples: {examples}, and the relevant regulations: {rules}." The "examples: {examples}" in the prompt message correspond to the examples obtained in step S304 and are used to construct the prompt message. It should be understood that the above example is for illustration only and this application does not impose any specific limitations.
[0131] It should be understood that the prompt information helps step S304 to further understand the recalled cases. It not only helps to understand the user's question in the case, but also helps to reason about the answers in the case that correspond to the user's question in subsequent steps S304. It helps to evaluate the quality of the answers and improve the accuracy and effectiveness of the recall technology.
[0132] Step S305 analyzes the M prompts using a large model to obtain M*K inference results, where each of the M prompts corresponds to K inference results, and K is a positive integer;
[0133] As an example, if M prompts (where M is a positive integer) are input into a large model, the model will enhance its semantic understanding of each prompt and output the corresponding inference result. Since each prompt input to the large model corresponds to K inference results, a total of M*K inference results will be obtained. By analyzing the large model using multiple prompts, multiple inference results are output, improving the accuracy of the model's output.
[0134] Step S306 analyzes the M*K inference results to obtain the target inference result, which is selected from the M*K inference results.
[0135] Optionally, step S306 includes the following specific process:
[0136] Step S3061: Analyze the K inference results corresponding to each prompt in the M*K inference results to obtain the M inference results corresponding to the M prompts.
[0137] Each of the M inference results is selected from the K inference results corresponding to each prompt.
[0138] Step S3062 analyzes the M inference results to obtain the target inference result.
[0139] Optionally, in step S3061, a majority voting rule is used to vote on the K inference results corresponding to each prompt to obtain the M inference results.
[0140] Optionally, in step S3062, the majority voting rule is used to vote on the M inference results to obtain the target inference result.
[0141] As an example, Case 1, combined with prompt 1 and input into the large model, yields K inference results corresponding to Case 1. Similarly, Case 2, combined with prompt 2 and input into the large model, yields K inference results corresponding to Case 2. The user input questions in Case 1 and Case 2 are identical, or the similarity between the user input questions stored in Case 1 and Case 2 reaches a threshold. This process continues, with each case obtaining multiple inference results through the large model, resulting in K inference results per case. In the first round, majority voting analyzes and filters these K inference results to obtain the majority-voted inference result for each case. If there are N cases, then N inference results will be obtained. The second round of majority voting selects the target inference result from these N inference results. Typically, there is one and only one target inference result.
[0142] As an example, steps S305 and S306 can obtain the target inference result through two rounds of majority voting. Specifically, the purpose of the first round of majority voting is to obtain M inference results; the purpose of the second round of majority voting is to obtain the target inference result from the M inference results. Generally speaking, there is one and only one target inference result. For example, a case is input into a large model, and the large model performs inference analysis on the case and its corresponding prompt, obtaining K inference results corresponding to this case. Then, a majority vote is performed on these K inference results, and the target inference result is selected from the K inference results. Similarly, if M cases are input into a large model, and the large model performs inference analysis on the M cases and their corresponding prompts, obtaining M*K inference results corresponding to the M cases, a majority vote is performed on these M*K inference results, and the target inference result is selected from the M*K inference results.
[0143] Optionally, the majority voting method can be based on the principle of majority rule, where the most frequent reasoning result is taken as the target reasoning result. For example, if the first reasoning result is A, the second reasoning result is B, and so on, and the Kth reasoning result is A, then according to the majority voting rule (minority follows majority), the final result is A.
[0144] Alternatively, the majority voting method can also involve inputting the inference result corresponding to each example into a voter. The voter is an ensemble learning model that follows the principle of majority rule. As an example, the voter votes on the inference results and selects the best inference result in any one or more of the following ways:
[0145] (1) Absolute majority voting method: The result of more than half of the votes is taken as the reasoning result;
[0146] (2) Relative majority voting method: The voting result with the most votes is used as the reasoning result;
[0147] (3) Weighted voting method: Input the case into multiple voting machines, assign corresponding weights to the results of each vote, and take the voting result with the highest weighted average as the reasoning result.
[0148] It should be understood that steps S305 and S306 analyze multiple cases corresponding to questions with the same or similarity reaching a threshold. Each case corresponds to a different prompt, so the analysis process not only combines the help and hints of the prompt, but also obtains different types and content of hint information. This allows for multiple inference results to be obtained after considering various different hint information for questions with the same or similarity reaching the threshold. Combined with a voting mechanism, the inference results output after the cases are processed by the analysis module are more accurate. Furthermore, because this application involves two rounds of voting, the analysis process is more thorough and accurate.
[0149] Step S307: Output the target inference result to the client for visualization.
[0150] In a specific implementation, the displayed content could be:
[0151] Q: Company X donated a refrigerator to a local high school in recognition of the school's positive performance during Arbor Day activities. Please analyze the asset purpose of this action.
[0152] A: According to the relevant regulations, this act of donating the refrigerator to others is a charitable act, which is an act of using assets for external donation. Therefore, the purpose of the asset is external donation.
[0153] The examples above are for illustrative purposes only and are not intended to be specific limitations in this application.
[0154] As one possible implementation, step S308 is also included, which updates the accuracy of cases in the case library based on the target reasoning results.
[0155] The execution order of steps S308 and S307 is not limited here.
[0156] Optionally, step S308 may also include updating the contents of the case library by adding the target inference result to the case library.
[0157] For example, step S308 outputs the target inference result. The case corresponding to the target inference result has already been scored for its accuracy during recall scoring. If the original accuracy of the case corresponding to the target inference result is 0.8, then the accuracy of the case after the more detailed module update can be improved to 0.95. Alternatively, the answer in the original case can be replaced with the answer in the inference result to update the answer content of the case. The above examples are for illustration only and are not intended to be specific.
[0158] It should be understood that step S308 updates the content in the case library and also updates the accuracy of the case library. After multiple iterations and updates, the data in the case library will become more accurate.
[0159] In summary, the data processing method provided in this application offers a standard evaluation mechanism for scoring cases in a case library (or vector database). This mechanism obtains score values for multiple answers corresponding to questions with the same or similarity reaching a threshold, facilitating efficient and direct understanding of the quality of each answer and improving the quality of case selection. By using recall scoring to filter multiple cases in the case library, cases meeting quality requirements are obtained, improving the accuracy and efficiency of case selection. By obtaining user questions, multiple cases corresponding to the user's questions are extracted from the case library, and a case scoring mechanism is used to recall and score these cases, obtaining score values. This data processing method provides a reliable scoring mechanism that comprehensively considers case similarity, importance, and accuracy, comprehensively evaluating case similarity and quality, efficiently and accurately scoring each case. Finally, the filtering module 330 selects high-quality cases based on their scores, improving the efficiency and accuracy of case recall. The prompts help step S304 to further understand the recalled cases. This not only helps in understanding the user's question content in the case, but also facilitates subsequent reasoning in step S304 regarding the answers corresponding to the user's question content. It helps evaluate the quality of the answers and improves the accuracy and effectiveness of the recall technology. By analyzing multiple cases corresponding to questions with the same or similarity reaching a threshold, each case corresponds to a different prompt. This allows the analysis process to not only combine the help and hints from the prompts, but also to obtain different types and content of prompts. This enables multiple inference results to be obtained after considering various different prompts for questions with the same or similarity reaching the threshold. Combined with a voting mechanism, the inference results output after the case is processed by the analysis module are more accurate. Furthermore, the two rounds of voting in this application make the analysis process more thorough and accurate. Updating the case library also allows for updating the accuracy of the case library. After multiple iterations and updates, the data in the case library will become more accurate.
[0160] This application also provides a computing device 100. For example... Figure 3 As shown, the computing device 100 includes a bus 102, a processor 104, a memory 106, and a communication interface 108. The processor 104, the memory 106, and the communication interface 108 communicate with each other via the bus 102. The computing device 100 can be a server or a terminal device. It should be understood that this application does not limit the number of processors and memories in the computing device 100.
[0161] Bus 102 can be a Peripheral Component Interconnect Express (PCIe) bus, an Extended Industry Standard Architecture (EISA) bus, a Unified Bus (Ubus or UB), a Compute Express Link (CXL), a Cache Coherent Interconnect for Accelerators (CCIX), etc. The Unified Bus is also known as the Lingqu Bus. Buses can be divided into address buses, data buses, control buses, etc. For ease of representation, Figure 3 The bus 104 may be represented by a single line, but this does not mean that there is only one bus or one type of bus. The bus 104 may include a path for transmitting information between various components of the computing device 100 (e.g., memory 106, processor 104, communication interface 108).
[0162] The processor 104 may include any one or more of the following computing devices: central processing unit (CPU), graphics processing unit (GPU), microprocessor (MP) or digital signal processor (DSP), ASIC, FPGA, CPLD, NPU, SoC, offload card, accelerator card, etc.
[0163] Memory 106 may include volatile memory, such as random access memory (RAM). Processor 104 may also include non-volatile memory, such as read-only memory (ROM), flash memory, hard disk drive (HDD), or solid state drive (SSD). Furthermore, memory 106 may also be implemented using storage class memory (SCM), phase change memory (PCM), or other types of storage media.
[0164] It is worth noting that the same type of storage medium can be configured in the same computing device to realize the function of memory 106, or two or more types of storage media can be configured to realize the function of memory 106. This application does not limit this.
[0165] The memory 106 stores executable program code, which the processor 104 executes to implement the functions of the aforementioned acquisition module 310, scoring module 320, filtering module 330, construction module 340, analysis module 350, output module 360, and update module 370, thereby realizing the data processing method. In other words, the memory 106 stores instructions for executing the method.
[0166] The communication interface 103 uses transceiver modules such as, but not limited to, network interface cards and transceivers to enable communication between the computing device 100 and other devices or communication networks.
[0167] It should be understood that the computing device 100 provided in this application may correspond to the data processing system 300 in this application, and may correspond to the execution of the application. Figure 2 The corresponding entities in the method shown, and the above and other operations and / or functions of each module in the computing device 100, are respectively implemented to achieve Figure 2 The corresponding process of the method shown will not be elaborated here for the sake of brevity.
[0168] This application also provides a chip system including a processor and a power supply circuit, wherein the power supply circuit supplies power to the processor, and the processor performs implementation... Figure 2 The corresponding processes of each method are described below. For the sake of brevity, they will not be elaborated here. The processor can be implemented using a GPU, or it can be implemented using computing units such as a DPU, NPU, XPU, SoC, offloading card, or accelerator card.
[0169] This application also provides a computing device cluster. The computing device cluster includes at least one such... Figure 3 The computing device 100 shown can be a server, such as a central server, an edge server, or a local server in a local data center. In some embodiments, the computing device can also be a terminal device such as a desktop computer, a laptop computer, or a smartphone.
[0170] The computing device cluster includes at least one computing device 100. The memory 106 of one or more computing devices 100 in the computing device cluster may store the same memory for implementing, etc. Figure 2 The instructions for the corresponding flow of the method shown.
[0171] In some possible implementations, the memory 106 of one or more computing devices 100 in the computing device cluster may also store information for implementing, for example... Figure 2 The instructions of the corresponding flow of the method shown. In other words, a combination of one or more computing devices 100 can jointly execute instructions for implementing, as described above. Figure 2 The instructions for the corresponding flow of the method shown.
[0172] In some possible implementations, one or more computing devices in a computing device cluster can be connected via a network. This network can be a wide area network (WAN) or a local area network (LAN), etc.
[0173] It should be noted that the memory 106 in different computing devices 100 within the computing device cluster can store different instructions, each used to implement, for example... Figure 1 The illustrated device has some of the functions. That is, the instructions stored in the memory 106 in different computing devices 100 can implement the functions of one or more of the following modules: acquisition module 310, scoring module 320, filtering module 330, construction module 340, analysis module 350, output module 360, and update module 370.
[0174] This application also provides a computer-readable storage medium. The computer-readable storage medium can be any available medium capable of being stored by a computing device, or a data storage device such as a data center containing one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid-state drive). The computer-readable storage medium includes instructions that instruct the computing device to perform a data processing method, or instruct the computing device to perform a data processing method.
[0175] This application also provides a computer program product containing instructions. The computer program product may be a software or program product containing instructions, capable of running on a computing device or stored on any usable medium. When the computer program product is run on at least one computing device, it causes the at least one computing device to perform a data processing method.
[0176] The above embodiments can be implemented, in whole or in part, by software, hardware, firmware, or any other combination thereof. When implemented using software, the above embodiments can be implemented, in whole or in part, as a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded or executed on a computer, all or part of the processes or functions described in the embodiments of this application of the present invention are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more sets of available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium. A semiconductor medium can be a solid-state disk (SSD).
[0177] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the protection scope of the technical solutions of the embodiments of the present invention.
Claims
1. A data processing method, characterized in that, include: Obtain input data, including the user's question content; Multiple cases are filtered based on the input data values, including cases that are the same as or have a similarity to the user's question content that reaches a threshold; The recall score of the multiple cases is determined according to the case scoring mechanism, which includes scoring the semantic similarity and case quality of the multiple cases. The semantic similarity is the similarity between the case and the input data, and the case quality includes one or more of the following: accuracy or importance. Based on the recall score, N cases are selected from the plurality of cases. The N cases are used to construct a prompt, which is used to guide the large model to generate a specific inference result for the input data. N is a positive integer.
2. The method according to claim 1, characterized in that, The method further includes: Based on the N cases, construct M prompts, where M is a positive integer, and the N cases have the same question content or the similarity of the question content of the N cases reaches a threshold. By analyzing the M prompts using a large model, M*K inference results are obtained, where each of the M prompts corresponds to K inference results, and K is a positive integer. The M*K inference results are analyzed to obtain the target inference result, which is selected from the M*K inference results.
3. The method according to claim 2, characterized in that, The analysis of the M*K inference results to obtain the target inference result includes: Analyze the K inference results corresponding to each prompt in the M*K inference results to obtain M inference results corresponding to the M prompts. Each of the M inference results is obtained by filtering from the K inference results corresponding to each prompt. The target reasoning result is obtained by analyzing the M reasoning results.
4. The method according to claim 3, characterized in that, The step involves analyzing the K inference results corresponding to each prompt in the M*K inference results to obtain M inference results corresponding to the M prompts, including: The majority voting rule is used to vote on the K inference results corresponding to each prompt, resulting in the M inference results.
5. The method according to any one of claims 3 or 4, characterized in that, The analysis of the M second reasoning results to obtain the target reasoning result includes: The target inference result is obtained by voting on the M inference results using the majority voting rule.
6. The method according to claim 3, characterized in that, The method further includes updating the accuracy of cases in the case library based on the target reasoning results.
7. The method according to any one of claims 1 to 6, characterized in that, The process involves filtering multiple cases in the case library based on the recall score to obtain N cases, including: Based on the recall score, cases in the case library are recalled to obtain recalled cases; Based on the recall scores of the recalled cases, the recalled cases are sorted to obtain the sorting results of the recalled cases; Based on the sorting results, the N cases are selected.
8. The method according to claim 7, characterized in that, The step of recalling cases in the case library based on the recall score to obtain recalled cases includes: The cases in the case library whose recall scores exceed the preset value are recalled to obtain the recalled cases.
9. A data processing apparatus, characterized in that, include: The acquisition module is used to acquire input data, which includes the user's question content; The scoring module is used to score multiple cases in the case library based on the input data using a case scoring mechanism to obtain the recall score of the multiple cases. The case scoring mechanism includes scoring the semantic similarity and case quality of the multiple cases. The semantic similarity is the similarity between the case and the input data, and the case quality includes one or more of the case's accuracy or importance. The filtering module is used to filter multiple cases in the case library according to the recall score to obtain N cases. The N cases are used to construct a prompt, which is used to guide the large model to generate a specific inference result for the input data. N is a positive integer.
10. The apparatus according to claim 9, characterized in that, The device further includes: A construction module is used to construct M prompts based on the N cases, where M is a positive integer; The analysis module is used to analyze the M prompts through a large model to obtain M*K inference results, where each of the M prompts corresponds to K inference results, and K is a positive integer; The analysis module is also used to analyze the M*K inference results to obtain a target inference result, which is obtained by filtering from the M*K inference results. The output module is used to output the target inference result to the client for visualization display.
11. The apparatus according to claim 10, characterized in that, The analysis module is specifically used for: Analyze the K inference results corresponding to each prompt in the M*K inference results to obtain M inference results corresponding to the M prompts. Each of the M inference results is obtained by filtering from the K inference results corresponding to each prompt. The target reasoning result is obtained by analyzing the M reasoning results.
12. A chip system, characterized in that, The chip system includes a processor and a power supply circuit, the power supply circuit being used to supply power to the processor, the processor being used to perform the operation steps of the method as described in any one of claims 1 to 8.
13. A computer device, characterized in that, The computing device includes a processor and a memory, which are connected via a bus and communicate with each other. The memory stores computer execution instructions. When the computing device is running, the processor executes the computer execution instructions in the memory to perform the operation steps of any of the methods described in claims 1 to 8 using the hardware resources in the computing device.
14. A computing device cluster, characterized in that, It includes at least one computing device, each computing device including a processor and memory; The processor of the at least one computing device is configured to execute instructions stored in the memory of the at least one computing device to cause the cluster of computing devices to perform the operational steps of the method as described in any one of claims 1 to 8.
15. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the operational steps of the method as described in any one of claims 1 to 8.
16. A computer program product, characterized in that, The computer program product stores computer-readable instructions that, when executed by a processor, implement the operational steps of the method as described in any one of claims 1 to 8.