Information display method and device based on large model, equipment, medium and product
By constructing a set of candidate example pairs, matching reference example pairs according to the query type of the query question, and using a large model to generate target query statements, the problem of difficult to ensure data query efficiency and accuracy in existing technologies is solved, and intelligent and personalized data query services are realized.
Patent Information
- Application Number
- CN202510811862.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-17
- Publication Date
- 2025-09-16
AI Technical Summary
In the existing technology, data query methods based on natural language are difficult to effectively lower the user threshold, and the method of manually selecting examples is time-consuming and non-scalable, making it difficult to ensure the efficiency and accuracy of data query.
By building a set of candidate example pairs, matching reference example pairs based on the query type, using the large model to generate the target query statement, and displaying the query results, this method automatically selects the most relevant examples, reducing manual intervention and improving the accuracy and efficiency of query statement generation.
It realizes the intelligence and personalization of data query, improves the accuracy and efficiency of query statement generation and query result acquisition, adapts to query requirements of different types and complexities, and provides fast and accurate data query services.
Smart Images

Figure CN120653862A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of data processing technology, in particular to the field of artificial intelligence technology such as big models, natural language processing, and deep learning. More specifically, it relates to an information display method, device, equipment, medium, and product based on big models. Background Art
[0002] With the advent of the big data era, the demand for data query and analysis is growing. Since data query methods based on structured query statements require a high level of user expertise, natural language-based data query methods have emerged to lower the barrier to entry. Natural language-based data query methods allow users to pose queries in natural language and automatically convert them into query statements for data query and analysis. Summary of the Invention
[0003] The present disclosure provides a large model-based information display method, device, equipment, medium and product.
[0004] According to one aspect of the present disclosure, a method for displaying information based on a big model is provided, comprising: in response to receiving a query question, matching a set of target example pairs corresponding to the query type of the query question according to the query question to obtain at least one reference example pair, wherein the reference example pair is used to guide the big model to generate a query statement for the query question; calling the big model according to prompt information obtained based on the query question and the at least one reference example pair to generate a target query statement; and displaying the query result obtained by executing the target query statement.
[0005] According to another aspect of the present disclosure, an information display device based on a big model is provided, including: a matching module for, in response to receiving a query question, matching a set of target example pairs corresponding to the query type of the query question according to the query question to obtain at least one reference example pair, wherein the reference example pair is used to guide the big model to generate a query statement for the query question; a generation module for calling the big model according to prompt information obtained based on the query question and the at least one reference example pair to generate a target query statement; and a display module for displaying the query results obtained by executing the target query statement.
[0006] According to another aspect of the present disclosure, an artificial intelligence agent is provided, which is configured to execute the steps of the above method.
[0007] According to another aspect of the present disclosure, an electronic device is provided, comprising: one or more processors; and 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 method.
[0008] According to another aspect of the present disclosure, a computer-readable storage medium is provided, on which a computer program or instructions are stored. When the computer program or instructions are executed by a processor, the steps of the above method are implemented.
[0009] According to another aspect of the present disclosure, a computer program product is provided, comprising a computer program or instructions, which implement the steps of the above method when executed by a processor.
[0010] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present disclosure, nor are they intended to limit the scope of the present disclosure. Other features of the present disclosure will become readily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0011] 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:
[0012] Figure 1 The system architecture to which the information display method based on the large model can be applied according to an embodiment of the present disclosure is schematically shown;
[0013] Figure 2 Schematically shows a flow chart of a method for displaying information based on a large model according to an embodiment of the present disclosure;
[0014] Figure 3A An example schematic diagram schematically illustrates a process of constructing a set of candidate example pairs according to an embodiment of the present disclosure;
[0015] Figure 3B An example schematic diagram schematically illustrates a process of constructing a set of target example pairs according to an embodiment of the present disclosure;
[0016] Figure 4A An example schematic diagram schematically illustrates a process of determining a set of candidate example pairs according to another embodiment of the present disclosure;
[0017] Figure 4B An example schematic diagram schematically illustrates a process of determining a set of target example pairs according to another embodiment of the present disclosure;
[0018] Figure 5 An example diagram schematically illustrates a process of determining a reference example pair according to an embodiment of the present disclosure;
[0019] Figure 6 Schematically shows a block diagram of an information display device based on a large model according to an embodiment of the present disclosure;
[0020] Figure 7 Schematically shows a structural block diagram of an intelligent agent of a large model according to an embodiment of the present disclosure; and
[0021] Figure 8 A block diagram of an electronic device suitable for implementing a large model-based information presentation method according to an embodiment of the present disclosure is schematically shown. DETAILED DESCRIPTION
[0022] Hereinafter, embodiments of the present disclosure will be described with reference to the accompanying drawings. However, it should be understood that these descriptions are merely exemplary and are not intended to limit the scope of the present disclosure. In the detailed description below, 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 well-known structures and technologies are omitted to avoid unnecessary confusion of the concepts of the present disclosure.
[0023] 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 presence of the features, steps, operations, and / or components, but do not exclude the presence or addition of one or more other features, steps, operations, or components.
[0024] All terms used herein (including technical and scientific terms) 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.
[0025] When expressions such as "at least one of A, B, and C, etc." are used, they should generally be interpreted in accordance with the meaning 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.).
[0026] Because natural language-based data query methods require providing high-quality examples for large models to help them understand tasks and accurately generate query statements.
[0027] In some examples, it is also possible to not use examples or use a fixed set of examples and rely on manual selection of examples. However, manually selecting appropriate examples for each query question is time-consuming and not scalable, and a fixed set of examples cannot provide optimal support for different types of queries. Therefore, these methods are difficult to ensure the efficiency and accuracy of data query and analysis.
[0028] To this end, embodiments of the present disclosure propose a large-scale model-based information display solution. For example, in response to receiving a query, a target example pair set corresponding to the query type of the query is matched based on the query to obtain at least one reference example pair, where the reference example pair is used to guide the large-scale model in generating a query statement for the query; based on prompt information obtained based on the query and the at least one reference example pair, the large-scale model is invoked to generate a target query statement; and query results obtained by executing the target query statement are displayed.
[0029] According to the embodiments of the present disclosure, by matching reference example pairs from an example library based on the query type, the most relevant examples can be automatically and intelligently selected for each query, improving the accuracy and scalability of data queries. Furthermore, using reference example pairs to guide large models in generating query statements reduces the workload and error rate of manual example selection, adapting to query requirements of varying types and complexities, and enabling rapid and accurate responses to user natural language queries. This provides users with personalized, intelligent data query services, effectively improving the accuracy and efficiency of query statement generation and query result acquisition.
[0030] In the technical solution of the present invention, the collection, storage, use, processing, transmission, provision and disclosure of user personal information involved comply with the provisions of relevant laws and regulations and do not violate public order and good morals.
[0031] In the technical solution of the present invention, the user's authorization or consent is obtained before obtaining or collecting the user's personal information.
[0032] Figure 1 The schematic diagram shows the system architecture in which the information display method based on the large model can be applied according to the embodiment of the present disclosure. It should be noted that, Figure 1 The examples shown are merely examples of system architectures to which the embodiments of the present disclosure may be applied, to help those skilled in the art understand the technical content of the present disclosure, but do not mean that the embodiments of the present disclosure may not be used in other devices, systems, environments or scenarios.
[0033] like Figure 1As shown, the system architecture 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 as a medium for providing 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 or wireless communication links or fiber optic cables.
[0034] The user may use at least one of the first terminal device 101, the second terminal device 102, and the third terminal device 103 to interact with the server 105 via the network 104 to receive or send messages, etc. Various communication client applications may 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 as examples).
[0035] 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.
[0036] The server 105 may be a server that provides various services, such as a background management server (for example only) that supports 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 received data such as user requests, and feed back processing results (e.g., web pages, information, or data obtained or generated based on user requests) to the terminal devices.
[0037] It should be noted that the information display method based on the big model provided in the embodiment of the present disclosure can generally be executed by the server 105. Accordingly, the information display device based on the big model provided in the embodiment of the present disclosure can generally be set in the server 105. The information display method based on the big model 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 information display device based on the big model 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.
[0038] Alternatively, the information display method based on the large model provided in the embodiment of the present disclosure may also be executed by the first terminal device 101, the second terminal device 102, or the third terminal device 103, or may also be executed by other terminal devices different from the first terminal device 101, the second terminal device 102, or the third terminal device 103. Accordingly, the information display device based on the large model provided in the embodiment of the present disclosure may also be provided in the first terminal device 101, the second terminal device 102, or the third terminal device 103, or may be provided in other terminal devices different from the first terminal device 101, the second terminal device 102, or the third terminal device 103.
[0039] It should be understood that Figure 1 The number of terminal devices, networks and servers in the embodiment is merely illustrative. Any number of terminal devices, networks and servers may be provided as required.
[0040] It should be noted that the sequence numbers of the operations in the following method are only used to indicate the operation for the purpose of description, and should not be regarded as indicating the order in which the operations should be performed. Unless explicitly stated, the method does not need to be performed in the order shown.
[0041] The above describes the system architecture of the information display method based on the large model provided by the present disclosure. Figure 2 For example, the information display process based on the large model of the present disclosure is further explained.
[0042] Figure 2 The flowchart of the information display method based on the large model according to the embodiment of the present disclosure is schematically shown.
[0043] like Figure 2 As shown, the large model-based information display method 200 includes operations S210 to S230.
[0044] In operation S210, in response to receiving a query question, a set of target example pairs corresponding to the query type of the query question is matched according to the query question to obtain at least one reference example pair, wherein the reference example pair is used to guide the large model to generate a query statement for the query question.
[0045] In operation S220 , the large model is called according to the prompt information obtained based on the query question and at least one reference example to generate a target query statement.
[0046] In operation S230 , query results obtained by executing the target query statement are displayed.
[0047] Before executing the information display method provided by the present disclosure, multiple historical query questions and historical query statements corresponding to each historical query question can be obtained. Using a semantic embedding model, the historical query questions are semantically embedded to obtain the semantic features of each historical query question. For each historical query question, the semantic features corresponding to the historical query question and the historical query statement can be combined into an example pair. On this basis, the historical query questions can also be classified to obtain the query type of the historical query question, and the query type can be associated with the example pair. By collecting multiple example pairs of each of the multiple query types, a set of candidate example pairs is formed, which facilitates subsequent label retrieval and diversity screening.
[0048] In an embodiment of the present disclosure, before obtaining the user's information, the user's consent or authorization may be obtained. For example, before operation S210, a request to obtain the user's information may be issued to the user. If the user agrees or authorizes the acquisition of the user's information, operation S210 is performed.
[0049] A query question is a question posed by a user in natural language, used to express the data they wish to query. For example, a query question might be "Which month in year X did Company A have the highest total profit?" After receiving the query question, it can be categorized to determine the query type. The specific categorization method can be configured based on actual business needs and is not limited here. For example, the query type can be determined by performing intent analysis on the query question. Alternatively, a multi-level classification labeling system can be pre-set, and queries can be categorized based on this classification labeling system to determine the query type.
[0050] After obtaining the query type, a target example pair set corresponding to the query type can be determined from a pre-built set of candidate example pairs based on the query type. The target example pair set refers to a set of example pairs corresponding to the query type, screened from a pre-built example library. The target example pair set may include multiple candidate example pairs. For these candidate example pairs, a reference example pair can be determined from the multiple candidate example pairs by matching the query question with each candidate example pair.
[0051] Reference example pairs are example pairs related to the query question, which are used to guide the large model to generate query statements for the query question, that is, to help the large model better understand the task and accurately generate the target query statement. The method of determining the reference example pair can be configured according to actual business needs and is not limited here. For example, a semantic embedding model can be used to convert the query question into a semantic feature to be matched, and the semantic feature to be matched is similarly matched with the candidate semantic features in each candidate example pair to obtain a reference example pair. Alternatively, the query question can be segmented to obtain a keyword to be matched, and the keyword to be matched is similarly matched with the keyword of the candidate query question in each candidate example pair to obtain a reference example pair.
[0052] After obtaining at least one reference example pair, prompt information can be constructed based on the query question and the reference example pair. This prompt information is then fed into the large model to assist it in generating the target query statement. The prompt information can include the query question, semantic features of the reference query question in each reference example pair, and the reference query statement. This provides context and reference for the large model, enabling it to more accurately generate the target query statement that meets the user's needs. The target query statement accurately expresses the user's data query requirements and is executed in the database to retrieve the required data, generating and displaying the query results.
[0053] The method for generating the target query statement can be configured based on actual business needs and is not limited here. For example, the selected reference example pairs can be combined with the query question and the corresponding data table structure to construct enhanced prompt words. The enhanced prompt words can be input into the macro model to generate the target query statement for the query question. Alternatively, a corresponding template can be designed based on the reference query statement of the reference example pair and the semantic information of the reference query question. Specific elements of the query question can be filled into the template to form prompt information, which can then be input into the macro model to generate the target query statement.
[0054] Query results can be presented to users in a user-friendly manner. For example, based on the type and characteristics of the query results, appropriate chart types (such as bar charts, line charts, and pie charts) can be selected to present the data intuitively, helping users to more clearly understand and analyze the data. Furthermore, at least one reference example pair can be displayed alongside the query results to enhance interpretability.
[0055] After obtaining the query statement, the query statement can be executed and the query results can be displayed. The display format of the query results can be configured according to actual business needs and is not limited here. For example, the display format of the query results may include at least one of the following: table format, chart format, and text format. The table format can be used to display structured query results. The chart format may include a bar chart, a line chart, a pie chart, and a scatter chart. The bar chart is used to show the comparison of data of different categories. The line chart is used to show the trend of data changes over time. The pie chart is used to show the proportion of each part to the whole. The scatter chart is used to show the relationship between two variables. The text format is used to summarize the query results.
[0056] According to the embodiments of the present disclosure, by matching reference example pairs from an example library based on the query type, the most relevant examples can be automatically and intelligently selected for each query, improving the accuracy and scalability of data queries. Furthermore, using reference example pairs to guide large models in generating query statements reduces the workload and error rate of manual example selection, adapting to query requirements of varying types and complexities, and enabling rapid and accurate responses to user natural language queries. This provides users with personalized, intelligent data query services, effectively improving the accuracy and efficiency of query statement generation and query result acquisition.
[0057] In one embodiment, operation S210 may include the following operations: classifying the query question according to preset classification rules to obtain a query type, wherein the preset classification rule defines at least one of the keywords, semantics, and expression forms corresponding to each query type; determining a target example pair set in a set of candidate example pairs according to the query type; and matching the query question with the target example pair set to obtain at least one reference example pair.
[0058] After receiving a query, the query can be classified according to preset classification rules to obtain a query type. The preset classification rules refer to pre-set standards and bases for classifying query questions, which define at least one of the keywords, semantics, and expression forms corresponding to each query type.
[0059] Keywords are words that reflect the core query intent and content in a query and can be used to quickly and preliminarily determine the possible query type. For example, words like "sum" and "average" are often associated with statistical report queries, while words like "growth" and "downward trend" are associated with trend analysis queries. Therefore, the keyword-based preset classification rules can indicate that queries containing keywords like "rank," "top," and "most" belong to the ranking query type.
[0060] Semantics refers to the inherent meaning and logical relationships expressed by a query. Understanding the semantics of a query can more accurately determine the corresponding query type. For example, the query "What was the GDP growth rate of each province in 2023 compared to the previous year?" involves comparing and calculating data on time series, and thus falls into the category of trend analysis queries. Based on this, the pre-set semantics classification rule can classify queries with comparison and contrast semantics as belonging to the comparative analysis query type.
[0061] The expression format refers to the way and structure of query presentation, including the sentence structure of the question and the use of time and location adverbials. For example, a query expressed in a list format, such as "Please list the monthly sales figures for 2023," focuses on data presentation; while a query expressed in the form of "Analyze the company's profit trends over the past five years," is a query expressed in the form of trend analysis. Based on this, the preset classification rules based on expression format can classify queries expressed in the form of time series or trends as trend analysis queries.
[0062] For example, if the query "Which month in year B did Company A have the highest total profit?" is received, the keyword-based classification rules can identify that the query includes the word "most," and thus determine that the query belongs to the rankings category. Furthermore, the semantics-based classification rules can identify that the query has comparative semantics, and thus determine that the query belongs to the comparative analysis category.
[0063] In one example, in addition to the aforementioned classification method based on preset classification rules, machine learning-based text classification algorithms, such as support vector machines (SVMs) and naive Bayesian methods, can also be used. First, a large number of sample queries are labeled and classified, and the text features in the sample queries are extracted. Then, a classification model is trained. When a new query is input, it is classified using the trained classification model to determine the query type.
[0064] It should be noted that for the same query question, there may be one or more query types. In the case where there is more than one query type for the same query question, these query types may be of the same level or have a hierarchical relationship, which is not limited here.
[0065] After obtaining the query type, we can filter the candidate example pairs based on the query type to form the target example pair set. For example, if the query type is "ranking class", all example pairs with the "ranking class" label in the candidate example pair set will be selected as the target example pair set.
[0066] According to the embodiments of the present disclosure, query questions are classified by preset classification rules, which quickly narrows the screening range of example pairs and reduces unnecessary calculation and matching workload; the reference examples obtained by matching from the target example pair set have a high correlation with the query questions, which can provide a strong reference for generating query statements for large models, improve the quality of generated statements, reduce manual intervention, enhance the intelligence of data query, realize automatic and intelligent classification of query questions, and accurately determine the reference examples that match them, effectively improving the accuracy and efficiency of query statement generation.
[0067] In one embodiment, the query type includes an operation type and an object type. The operation type may include at least one of the following: data display type, data statistics type, data arrangement type, comparative analysis type, and trend analysis type. The object type includes at least one of the following: time type, subject type, and indicator type.
[0068] Data display types focus on presenting data in an intuitive manner, such as detailed list display and detailed view. For example, if you query "List company sales records for each month of year X," you need to display each month's sales records in list format to facilitate viewing of specific data.
[0069] Data statistics types involve statistical calculations on data, such as summation, counting, and averaging. For example, the query "Calculate the company's total sales for year X" requires summing the sales of each month.
[0070] Data sorting refers to operations related to sorting data, such as sorting by a metric in ascending or descending order, taking the top few or the top few to determine ranking, and so on. For example, the query "Sort company sales by month in year X from high to low" involves sorting monthly sales.
[0071] Comparative analysis focuses on comparing different data types, such as data from different time periods or departments, to identify differences and changes. For example, a query like "Compare the sales differences between the company's months in year X and year X" requires a comparative analysis of the data from both years.
[0072] Trend analysis involves analyzing data trends over time, such as time series analysis and growth rate calculation. For example, the query "Analyze the company's sales growth trend by month in year X" requires analyzing sales trends over time.
[0073] Time types refer to object attributes related to time, such as year, month, and quarter. For example, in the query "Query the company's profit for each month in the first quarter of year X," "each month in the first quarter of year X" is a time type.
[0074] The subject type refers to the main object subject of the query, such as company, department, employee, etc. For example, in the query "Calculate the sales of each department in year X", "each department" is the subject type.
[0075] Indicator types are quantitative indicators used to measure and describe characteristics or performance of an entity, such as sales, profit, cost, output, etc. For example, in the query "Find the top five companies in terms of sales in year X", "sales" is an indicator type.
[0076] According to the embodiments of the present disclosure, a detailed division of operation types and object types provides a basis for accurately determining query types. This division method covers a variety of common data query operations and object attributes, can meet users' diverse and complex query needs, effectively improve the performance and user experience of data table questions and answers, enable query questions to be more accurately matched to appropriate example pairs, and improve the accuracy of query statement generation.
[0077] In the embodiments of the present disclosure, the candidate example pair set may include multiple subsets divided by query type. The specific division method can be configured based on actual business needs and is not limited here. For example, the priority of the operation type may be higher than the priority of the object type. That is, the candidate example pair set may include multiple first subsets divided by operation type, and each first subset may include multiple second subsets divided by object type.
[0078] In one embodiment, determining a target example pair set from a candidate example pair set based on a query type may include the following operations: filtering multiple first subsets based on the operation type to obtain at least one target first subset; and for each target first subset, filtering multiple second subsets based on the object type to obtain a target example pair set.
[0079] Operation type refers to the type of operation related to the query. Object type refers to the type of data related to the query. By leveraging the multi-level index structure of the data table, operation type and object type serve as the two levels of the index to organize the candidate example pair set. When a query is required, the corresponding example pair is quickly located based on the operation type and object type, resulting in the target example pair set.
[0080] The first subset refers to the subsets of the candidate example pairs divided by operation type. Each first subset can correspond to a single operation type and contain multiple second subsets of different object types within that operation type. For example, for example pairs of statistical reports (operation type), second subsets based on object type can be divided into company statistical reports, department statistical reports, and so on. After obtaining the query type, the corresponding first subset can be determined from the candidate example pairs based on the operation type in the query type, resulting in the target first subset.
[0081] The second subset is a subset of the first subset divided by object type. Each second subset corresponds to an object type and contains example pairs for that operation type and object type combination. After obtaining the target first subset, the corresponding second subset can be determined within the target first subset based on the object type in the query type to obtain the target example pair set.
[0082] According to the embodiments of the present disclosure, by subdividing query types into operation types and object types, and hierarchically organizing and screening the set of candidate example pairs, the management and retrieval of example pairs are made more efficient, unnecessary search scope is reduced, and computational complexity is reduced. It can better meet the diverse and specific query needs of users, and can more accurately find example pairs that match the query questions, thereby improving the accuracy and efficiency of query statement generation.
[0083] The following will Figure 3A For example, the process of constructing the candidate example pair set of the present disclosure is further explained.
[0084] Figure 3A An example schematic diagram schematically illustrates a process of constructing a set of candidate example pairs according to an embodiment of the present disclosure.
[0085] like Figure 3A As shown in 300A, the process of constructing the candidate example pair set is described by taking the candidate query question 301 whose query type belongs to operation type 1 and object type 1 as an example.
[0086] When candidate query 301 is obtained, candidate query statement 302 corresponding to candidate query 301 is also obtained. Semantic features of candidate query 301 can be extracted using semantic embedding model 303 to obtain semantic features 304. Semantic features 304 of candidate query 301 and candidate query statement 302 are combined to form candidate example pairs 305. Since candidate query 301 belongs to object type 1, candidate example pairs 305 can be stored in second subset 3111 corresponding to object type 1.
[0087] Similarly, other candidate example pairs belonging to object type 2 can be stored in second subset 3112, ..., and other candidate example pairs belonging to object type Q can be stored in second subset 311Q, where Q is a positive integer. Based on this, since candidate query 301 also belongs to operation type 1, second subset 3111, second subset 3112, ..., and second subset 311Q can be used as first subset 311 corresponding to operation type 1.
[0088] Similarly, other candidate example pairs belonging to operation type 2 can be stored in first subset 312, ..., and other candidate example pairs belonging to operation type P can be stored in first subset 31P, where P is a positive integer. Based on this, first subset 311, first subset 312, ..., first subset 31P can be used as candidate example pair set 310.
[0089] In an embodiment of the present disclosure, when the candidate example pair set includes multiple first subsets divided according to operation type, and each first subset may include multiple second subsets divided according to object type, the following Figure 3B For example, the process of determining the target example pair set of the present disclosure is further explained.
[0090] Figure 3B An example schematic diagram schematically illustrates a process of constructing a set of target example pairs according to an embodiment of the present disclosure.
[0091] like Figure 3B As shown in 300B, candidate example pair set 310 may include a first subset 311 corresponding to operation type 1, a first subset 312 corresponding to operation type 2, ..., and a first subset 31P corresponding to operation type P. In this case, multiple first subsets may be screened based on operation type 301 to obtain target first subset 311.
[0092] The target first subset 311 may include a second subset 3111 corresponding to object type 1, a second subset 3112 corresponding to object type 2, ..., and a second subset 311Q corresponding to object type Q. In this case, multiple second subsets may be screened according to the object type 302 to obtain the target example pair set 31P.
[0093] In an embodiment of the present disclosure, the candidate example pair set may include multiple candidate example pairs that are not divided according to the query type. In one embodiment, the candidate example pair set includes multiple candidate example pairs, each candidate example pair having a corresponding operation type and object type. According to the query type, determining the target example pair set in the candidate example pair set may include the following operations: filtering each candidate example pair in the candidate example pair set according to the operation type to obtain at least one intermediate example pair; and filtering at least one intermediate example pair according to the object type to obtain the target example pair set.
[0094] Intermediate example pairs are those obtained after filtering the candidate example pairs based on operation type. The operation type of these intermediate example pairs matches the query's operation type, but the object type has not yet been filtered. These are intermediate results in the filtering process. The method for determining intermediate example pairs can be configured based on actual business needs and is not specified here.
[0095] For example, if the candidate example pair set is represented by a library, the operation type and object type are annotated for each candidate example pair when the candidate example pair set is constructed. Upon receiving a query, all example pairs with the same or similar operation types can be filtered out from the candidate example pair set based on the query's operation type, yielding intermediate example pairs. Alternatively, if the candidate example pair set is represented by a hash table, the candidate example pair set can be stored in the hash table using the operation type as the hash key. When filtering is required, the query's operation type is used as the key value to quickly find the corresponding example pair in the hash table, yielding intermediate example pairs.
[0096] After obtaining the intermediate example pairs, they can be screened again based on object type to obtain a set of target example pairs. The operation type and object type of each candidate example pair in the target example pair set match the query. The method for determining the target example pair set can be configured based on actual business needs and is not limited here.
[0097] For example, based on the intermediate example pairs, we can further filter them based on the object type of the query to obtain a target set of example pairs. Alternatively, we can construct an object type index tree, indexing and organizing the intermediate example pairs by object type to form a tree structure. When the object type of the query is given, we traverse the index tree starting from the root node and gradually locate the corresponding example pair nodes based on the object type, thus obtaining the target set of example pairs.
[0098] According to the embodiments of the present disclosure, intermediate example pairs are first obtained by screening according to the operation type, and then a target example pair set is obtained by further screening according to the object type. This step-by-step screening method gradually narrows the scope of the reference examples, so that the target example pair set finally obtained is highly relevant to the query question in both operation and object, providing a strong guarantee for the subsequent use of reference examples to generate accurate query statements, reducing the interference of irrelevant examples, and being able to accurately match reference examples to query questions, thereby improving the accuracy and efficiency of query statement generation.
[0099] The following will Figure 4A For example, the process of constructing the candidate example pair set of the present disclosure is further explained.
[0100] Figure 4A The following schematically illustrates an example process of determining a set of candidate example pairs according to another embodiment of the present disclosure.
[0101] like Figure 4A As shown, taking the candidate query question 401 of query type belonging to operation type p and object type q as an example, the process of constructing the candidate example pair set is explained.
[0102] When candidate query 401 is obtained, candidate query statements 402 corresponding to candidate query 401 are also obtained. Semantic features of candidate query 401 can be extracted using semantic embedding model 403 to obtain semantic features 404 of the candidate query. Semantic features 404 of the candidate query and candidate query statement 402 are combined to form candidate example pairs 411. Based on this, candidate example pairs 411 can be stored in candidate example pair set 410. Candidate example pair set 410 can also include candidate example pairs 412, ..., and candidate example pairs S, where S is a positive integer.
[0103] In an embodiment of the present disclosure, when the candidate example pair set includes multiple candidate example pairs that are not divided according to the query type, the following Figure 4B For example, the process of determining the target example pair set of the present disclosure is further explained.
[0104] Figure 4B An example schematic diagram schematically illustrates a process of determining a set of target example pairs according to another embodiment of the present disclosure.
[0105] like Figure 4BAs shown in 400B, candidate example pair set 410 may include candidate example pair 1, candidate example pair 2, ..., candidate example pair 41S corresponding to the operation type. In this case, the multiple candidate example pairs can be screened based on operation type 405 to obtain at least one intermediate example pair 420. For example, intermediate example pair 421, intermediate example pair 422, ..., intermediate example pair 42T can be obtained. T is a positive integer less than or equal to S. Based on this, the at least one intermediate example pair 420 can be screened based on object type 406 to obtain target example pair set 407.
[0106] In one embodiment, the reference example pairs include a reference query question and a reference query statement. Matching the query question with the set of target example pairs to obtain at least one reference example pair may include the following operations: determining the similarity between the semantic features of the query question and the semantic features of each reference query question, respectively, to obtain multiple similarities; and determining the candidate example pairs corresponding to the top N similarities among the sorted multiple similarities as the reference example pairs, where N is a positive integer.
[0107] Semantic features are abstract representations of the core meaning and key information expressed in natural language text, reflecting the text's semantic content and emphasis. For example, semantic embedding models can be used to convert natural language text into high-dimensional vectors to capture its semantic features. After obtaining the semantic features of a query, the similarity between the query's semantic features and those of each reference query can be determined. Similarity measures the degree of similarity between the query's semantic features and those of the reference queries and can be expressed as a numerical value, with larger values indicating greater similarity.
[0108] For example, a semantic embedding model can be used to convert the query question and each reference query question into high-dimensional vector representations, and then the similarity between the two vectors can be calculated. In one example, the similarity can be determined as shown in the following formula (1).
[0109] (1);
[0110] in, Representing the query problem, Characterizing reference query problems, Characterize the similarity between the query question and the reference query question, Semantic features that represent the query question, Semantic features that characterize reference query questions, Represents cosine similarity.
[0111] Alternatively, a method based on a combination of keyword matching and semantic analysis can be adopted, that is, first perform word segmentation on the query question and the reference query question to extract the keywords; then calculate the matching degree of the keywords, and use the word vector model to calculate the semantic similarity between the keywords, and obtain the final similarity by combining the keyword matching degree and the semantic similarity.
[0112] After obtaining multiple similarities, the multiple similarities can be sorted to obtain multiple sorted similarities. Based on this, the candidate example pairs corresponding to the top N similarities among the sorted multiple similarities, that is, the candidate example pairs corresponding to the top N similarities with the highest similarity, can be selected as reference example pairs. For example, if the sorted similarity values are 0.9, 0.85, 0.8, 0.75, etc., when N is 3, the three candidate example pairs corresponding to similarities of 0.9, 0.85, and 0.8 are selected as reference example pairs.
[0113] Alternatively, a cluster analysis-based method can be used to perform cluster analysis on the multiple similarities calculated, determine clusters with higher similarity, and then select a certain number of candidate example pairs from each cluster as reference example pairs. For example, after clustering the similarity values, two clusters are obtained, one with a higher similarity value (e.g., above 0.85) and the other with a lower similarity value (e.g., below 0.7). The top N candidate example pairs from the high-similarity clusters are then selected as reference example pairs.
[0114] According to the embodiments of the present disclosure, by analyzing the semantic features of reference example pairs and calculating similarities, the reference example pairs most relevant to the query question can be accurately screened out from multiple candidate example pairs, which helps to improve the accuracy and efficiency of natural language-based data query systems, can more accurately understand the user's query intentions, generate query statements that better meet user needs, improve user experience and data query performance, and provide users with more accurate and efficient data query services.
[0115] In one embodiment, the multiple similarities include n1 similarities for each query type. Determining candidate example pairs corresponding to the top N similarities among the sorted multiple similarities as reference example pairs may include the following operations: for each query type, determining candidate example pairs corresponding to the top n2 similarities among the sorted n1 similarities as reference example pairs for the query type, such that the repetition of query types covered by the reference example pairs is less than a preset repetition threshold, where n2 is less than or equal to n1, and n1 is less than N.
[0116] For each query type, a semantic similarity calculation method is used to calculate the similarity between the query question and the reference query question for each candidate example pair under that query type, resulting in n1 similarities. Alternatively, a similarity prediction model based on machine learning can be used. A model is trained to predict the similarity between the query question and the reference query question. For each query type, the query question and the reference query question under that query type are input into the model to obtain n1 similarity prediction values. n1 refers to the number of similarities set for each query type, that is, the number of similarity values calculated under each query type.
[0117] The preset repetition threshold is a pre-set parameter used to control the degree of repetition among reference pairs across different query types, ensuring diversity. n2 refers to the number of reference pairs used for screening. For each query type, the first n2 similarities selected from the sorted similarities are used to determine the reference pairs, with n2 being less than or equal to n1.
[0118] For each query type, the n1 similarities are sorted and the candidate pairs corresponding to the top n2 similarities are selected as reference pairs for that query type. By controlling the value of n2, the repetition rate of reference pairs across different query types is ensured to be below a preset repetition threshold. Alternatively, cluster analysis can be implemented to cluster the candidate pairs corresponding to the n1 similarities for each query type and select n2 pairs near the cluster center as reference pairs. The repetition rate is also monitored to ensure it remains below a preset repetition threshold.
[0119] According to the embodiments of the present disclosure, by screening the first n2 candidate example pairs corresponding to the similarity in each query type as reference example pairs and controlling the repetition, it is possible to ensure the relevance of the reference example pairs to the query questions while ensuring balanced coverage between different query types, thereby being able to more comprehensively handle various types of query questions, effectively improving the diversity and representativeness of the reference example pairs, avoiding over-reliance on example pairs of certain query types, and improving the accuracy and adaptability of query statement generation.
[0120] The following will use Figure 5 , the process of determining the reference example pairs is further explained.
[0121] Figure 5 An example diagram schematically illustrates a process of determining a reference example pair according to an embodiment of the present disclosure.
[0122] like Figure 5 As shown, in 500, the query type of the query question includes query type 1 and query type 2 as an example to illustrate the process of determining the reference example pair.
[0123] For query type 1, there may be three corresponding reference query questions, and the semantic features of the three reference query questions are semantic feature 521 of the reference query question, semantic feature 522 of the reference query question, and semantic feature 523 of the reference query question.
[0124] For each of the aforementioned semantic features, the similarity between the query's semantic feature 510 and each semantic feature can be determined. For example, similarity 5211 between the query's semantic feature 510 and the reference query's semantic feature 521, similarity 5221 between the query's semantic feature 510 and the reference query's semantic feature 522, and similarity 5231 between the query's semantic feature 510 and the reference query's semantic feature 523 can be determined.
[0125] After obtaining the similarities, the similarities can be sorted to obtain a plurality of sorted similarities. For example, if similarity 5221 is the highest among similarity 5211, similarity 5221, and similarity 5231, semantic feature 522 of the reference query question and the corresponding reference query statement 501 can be determined as reference example pair 540 of query type 1.
[0126] For query type 2, there may be 5 corresponding reference query questions, and the semantic features of the 5 reference query questions are semantic feature 531 of the reference query question, semantic feature 532 of the reference query question, semantic feature 533 of the reference query question, semantic feature 534 of the reference query question, and semantic feature 535 of the reference query question.
[0127] For each of the aforementioned semantic features, the similarity between the query's semantic feature 510 and each semantic feature can be determined. For example, similarity 5311 can be determined between the query's semantic feature 510 and the reference query's semantic feature 531, similarity 5321 can be determined between the query's semantic feature 510 and the reference query's semantic feature 532, similarity 5331 can be determined between the query's semantic feature 510 and the reference query's semantic feature 533, similarity 5341 can be determined between the query's semantic feature 510 and the reference query's semantic feature 534, and similarity 5351 can be determined between the query's semantic feature 510 and the reference query's semantic feature 535.
[0128] After obtaining each similarity, each similarity can be sorted to obtain a plurality of sorted similarities. For example, if similarity 5311, similarity 5321, similarity 5331, similarity 5331, and similarity 5351 are ranked first and second, then semantic feature 532 of the reference query question and the corresponding reference query statement 502 can be determined as reference example pair 550 of query type 2, and semantic feature 535 of the reference query question and the corresponding reference query statement 503 can be determined as reference example pair 560 of query type 2.
[0129] In one embodiment, after constructing the set of candidate example pairs, the following operations can also be performed: determining the contribution of each candidate example pair based on at least one of the frequency of use of each candidate example pair in the set of candidate example pairs and the accuracy of historical query statements generated using the candidate example pairs; and updating the set of candidate example pairs based on the contribution and a preset contribution threshold.
[0130] Frequency of use refers to the number of times each candidate example pair was selected and used to generate query statements within a preset historical period. Accuracy refers to the proportion of historical query statements generated using candidate example pairs that were correct and met user requirements.
[0131] The preset period can be configured based on actual business needs and is not limited here. For example, the preset period can be determined based on at least one of the data volume and data update frequency of the application scenario of the information display method. That is, if application scenario A has a large data volume, the preset period can be set to a shorter period; conversely, if application scenario B has a smaller data volume, the preset period can be set to a longer period; if application scenario A has a high data update frequency, the preset period can be set to a shorter period; conversely, if application scenario B has a low data update frequency, the preset period can be set to a longer period.
[0132] After periodically counting at least one of the frequency of use and accuracy of each candidate example pair, a contribution score can be calculated by comprehensively considering both the frequency of use and the accuracy of the candidate example pair. The contribution score can be used to measure the value and importance of the candidate example pair in the query generation process. The method for obtaining the contribution score can be configured based on actual business needs and is not limited here.
[0133] In one example, a weighted formula can be pre-designed to multiply the usage frequency and accuracy by their respective weight coefficients and then add them together to obtain the contribution of each candidate example pair. For example, the weighted formula is Contribution = Usage Frequency × 0.6 + Accuracy × 0.4. Assuming that a candidate example pair has a usage frequency of 100 times and an accuracy of 0.9, its contribution is 100 × 0.6 + 0.9 × 0.4 = 60 + 0.36 = 60.36.
[0134] In another example, a regression model in machine learning can be used, with usage frequency and accuracy as features and contribution as the target variable, to train the model to predict the contribution of each candidate example pair. For example, historical data including the usage frequency, accuracy, and manually annotated contribution of candidate example pairs can be collected, and a model can be trained using algorithms such as linear regression or decision tree regression. The trained model can then be used to predict the contribution of new candidate example pairs.
[0135] After obtaining the contribution of each candidate example pair, the candidate example pair set can be updated based on the contribution and a preset contribution threshold. For example, for a candidate example pair whose contribution is less than the preset contribution threshold, the candidate example pair can be deleted from the candidate example pair set; alternatively, for a candidate example pair whose contribution is greater than the preset contribution threshold, the candidate example pair can be retained in the candidate example pair set.
[0136] According to the embodiments of the present disclosure, by comprehensively considering the usage frequency and accuracy of candidate example pairs to determine their contribution, and updating the candidate example pair set based on the contribution and preset threshold, the system can automatically screen out high-quality, high-value example pairs and eliminate low-quality example pairs, which helps to continuously optimize the candidate example pair set, improve the accuracy and efficiency of query statement generation, ensure better adaptation to user needs and data changes, and enhance user experience and the intelligence level of the system.
[0137] In one embodiment, the query question is a question about a data table, and the reference example pair includes a reference query question and a reference query statement; the above operation S220 may include the following operations: based on a preset prompt template, splicing at least one reference example pair, the query question and the description information of the data table corresponding to the query question to obtain prompt information, wherein the data table corresponding to the query question is obtained by semantically matching the query question with the description information of each candidate data table; based on the prompt information, calling the big model to generate an intermediate query statement; and in response to the execution logic of the intermediate query statement and the execution logic of each reference query statement meeting the consistency condition, determining the intermediate query statement as the target query statement.
[0138] Descriptive information refers to information describing the content, structure, and fields of a data table. Preset prompt templates are pre-designed formats and structures for assembling prompt information. They specify how to combine reference example pairs, query questions, and table descriptions into prompt information. The method for assembling prompt information can be configured based on actual business needs and is not limited here.
[0139] In one example, a preset prompt template might be "Reference query question: {ref_question}, Reference query statement: {ref_query}. Now there is a query question: {question}, corresponding data table description information: {table_desc}." Based on this preset prompt template, specific content can be filled in to obtain prompt information. In another example, a method combining template filling with natural language generation can be used. For example, based on the logical structure of the preset prompt template, natural language generation technology can be used to organize the reference example pair, query question, and data table description information into a coherent and natural prompt text.
[0140] After obtaining the prompt information, the prompt information can be used to guide the large model in generating preliminary intermediate query statements. After obtaining the intermediate query statements, the execution logic of the intermediate query statements can be determined to determine whether they meet consistency conditions with the execution logic of each reference query statement. The specific content and determination method of the consistency conditions can be configured based on actual business needs and are not limited here.
[0141] In one example, the consistency condition may be similar grammatical structure, the same operation type, similar fields and tables involved, etc. In another example, the intermediate query statement and each reference query statement may be subjected to grammatical and semantic analysis to compare whether their execution logic meets the consistency condition. Alternatively, a comparison method based on a graph model may be used. The execution logic of the intermediate query statement and each reference query statement is converted into a graph structure such as an abstract syntax tree, and then the similarity of these graph structures is compared to determine whether the consistency condition is met based on the similarity.
[0142] According to the embodiments of the present disclosure, by combining the query question with the reference example pairs and data table description information, and using the preset prompt template to generate prompt information, and then calling the large model to generate the intermediate query statement, and finally determining the target query statement through the verification of the consistency conditions, the accuracy and reliability of the query statement generation can be improved, the error rate can be reduced, and the user experience can be improved. At the same time, the reference example pairs and data table information can be fully utilized to improve the understanding and processing capabilities of complex query problems.
[0143] The above are only exemplary embodiments, but are not limited thereto. Other information display methods based on large models known in the art may also be included, as long as the most relevant examples can be automatically and intelligently selected for each query question to improve the accuracy and efficiency of query statement generation and query result acquisition.
[0144] Based on the above-mentioned information display method based on a large model, the present invention also provides an information display device based on a large model. Figure 6 The device is described in detail.
[0145] Figure 6 A block diagram of a large model-based information display device according to an embodiment of the present disclosure is schematically shown.
[0146] like Figure 6 As shown, the information display device 600 based on the large model may include a matching module 610 , a generating module 620 and a display module 630 .
[0147] The matching module 610 is used to match a set of target example pairs corresponding to the query type of the query question in response to receiving the query question, and obtain at least one reference example pair, wherein the reference example pair is used to guide the large model to generate a query statement for the query question.
[0148] The generation module 620 is configured to call the large model to generate a target query statement according to prompt information obtained based on the query question and at least one reference example.
[0149] The display module 630 is used to display the query results obtained by executing the target query statement.
[0150] According to an embodiment of the present disclosure, the matching module 610 may include a classification submodule, a determination submodule, and a matching submodule.
[0151] The classification submodule is used to classify the query questions according to preset classification rules to obtain query types, wherein the preset classification rules define at least one of the keywords, semantics, and expression forms corresponding to each query type.
[0152] The first determination submodule is configured to determine a target example pair set from a candidate example pair set according to a query type.
[0153] The matching submodule is used to match the query question with the target example pair set to obtain at least one reference example pair.
[0154] According to an embodiment of the present disclosure, the query type includes an operation type and an object type, the candidate example pair set includes a first subset of each of the multiple operation types, and each first subset includes a second subset of each of the multiple object types.
[0155] According to an embodiment of the present disclosure, the first determining submodule may include a first screening unit and a second screening unit.
[0156] The first screening unit is configured to screen the plurality of first subsets according to the operation type to obtain at least one target first subset.
[0157] The second screening unit is configured to screen the plurality of second subsets for each target first subset according to the object type to obtain a target example pair set.
[0158] According to an embodiment of the present disclosure, the query type includes an object type and an operation type, the candidate example pair set includes a plurality of candidate example pairs, and each candidate example pair has a corresponding operation type and object type.
[0159] According to an embodiment of the present disclosure, the first determining submodule may include a third screening unit and a fourth screening unit.
[0160] The third screening unit is configured to screen each candidate example pair in the candidate example pair set according to the operation type to obtain at least one intermediate example pair.
[0161] The fourth screening unit is used to screen at least one intermediate example pair based on the object type to obtain a target example pair set.
[0162] According to an embodiment of the present disclosure, the reference example pair includes a reference query question and a reference query sentence.
[0163] According to an embodiment of the present disclosure, the matching submodule may include a first determining unit and a second determining unit.
[0164] The first determining unit is configured to respectively determine similarities between the semantic features of the query question and the semantic features of each reference query question to obtain multiple similarities.
[0165] The second determining unit is configured to determine candidate example pairs corresponding to top N similarities among the sorted plurality of similarities as reference example pairs, where N is a positive integer.
[0166] According to an embodiment of the present disclosure, the plurality of similarities includes n1 similarities for each query type.
[0167] According to an embodiment of the present disclosure, the second determining unit may include a determining subunit.
[0168] A determination subunit is used to determine, for each query type, the candidate example pairs corresponding to the first n2 similarities among the sorted n1 similarities as reference example pairs of the query type, so that the repetition of the query types covered by the reference example pairs is less than a preset repetition threshold, wherein n2 is less than or equal to n1, and n1 is less than N.
[0169] According to an embodiment of the present disclosure, the large model-based information display device 600 may further include a determination module and an update module.
[0170] The determination module is used to determine the contribution of each candidate example pair based on at least one of the usage frequency of each candidate example pair in the candidate example pair set and the accuracy of historical query sentences generated using the candidate example pair.
[0171] The updating module is used to update the candidate example pair set according to the contribution and the preset contribution threshold.
[0172] According to an embodiment of the present disclosure, the query question is a question directed to a data table, and the reference example pair includes a reference query question and a reference query statement.
[0173] According to an embodiment of the present disclosure, the generation module 620 may include a splicing submodule, a generation submodule, and a second determination submodule.
[0174] The splicing submodule is used to splice at least one reference example pair, a query question, and the description information of the data table corresponding to the query question based on a preset prompt template to obtain prompt information, wherein the data table corresponding to the query question is obtained by semantically matching the query question with the description information of each candidate data table.
[0175] The generation submodule is used to call the large model according to the prompt information to generate intermediate query statements.
[0176] The second determining submodule is configured to determine the intermediate query statement as a target query statement in response to the execution logic of the intermediate query statement and the execution logic of each reference query statement satisfying a consistency condition.
[0177] According to an embodiment of the present disclosure, the operation type includes at least one of the following: data display type, data statistics type, data arrangement type, comparative analysis type, and trend analysis type; the object type includes at least one of the following: time type, subject type, and indicator type.
[0178] Figure 7 The structural block diagram of the intelligent agent of the large model according to the embodiment of the present disclosure is schematically shown.
[0179] In the embodiments of the present disclosure, inspired by the von Neumann structure in modern computer theory, such as Figure 7 As shown, the AI agent 700 may include five core modules: an input module 710 , a control module 720 , a storage module 730 , a calculation module 740 and an output module 750 .
[0180] Input module 710 is responsible for receiving or perceiving information such as queries, requests, instructions, signals, or data from the outside world (e.g., users or the external environment) and converting it into a format that AI agent 700 can understand and process. Input module 710 is the primary link for AI agent 700 to interact with the outside world. It enables AI agent 700 to efficiently and accurately obtain necessary "sensory" information from the outside world and respond to this information.
[0181] In an example, the input module 710 may input the evaluation request described above.
[0182] The control module 720 is the core support for the AI agent 700's ability to handle complex tasks. During the model training phase, the control module 720 can execute the large model-based information display method described above.
[0183] In the example, the control module 720 will continuously interact with the storage module 730, the computing module 740, and / or the output module 750 during operation. However, it should be noted that in the embodiment of the present disclosure, the control module 720 acts as a single initiator to initiate communication with the storage module 730, the computing module 740, and / or the output module 750, and there is no communication coupling between the storage module 730, the computing module 740, and the output module 750.
[0184] In this example, the performance of control module 720 may be closely related to the large model underlying AI agent 700. To fully leverage the capabilities of the large model, the internal structure of control module 720 may be designed to be highly configurable and extensible to handle a variety of different tasks and requirements in real-world scenarios.
[0185] The storage module 730 may be responsible for memorizing the candidate example pair set. The candidate example pair set as above may be included in the storage module 730.
[0186] In this example, after receiving the evaluation request, the AI agent 700 may trigger the information generation process based on the large model, obtain a set of candidate example pairs from the storage module 730, and feed it back to the control module 720. The control module 720 may then pass the fed-back query results to the output module 750.
[0187] The operation module 740 can be viewed as a predefined tool library, and the tools for determining semantic features and calculating similarity as described above can be included in the operation module 740 .
[0188] In the example, when the AI agent 700 needs to process a query question, it can call the relevant tools from the operation module 740 and feed it back to the control module 720. Then, the control module 720 can use the fed-back tools to process the query question and obtain the information to be evaluated. It can be understood that although the large model has excellent language understanding and generation capabilities, it is the same as a human being. Without the help of any tools, the tasks that can be solved are very limited. When the AI agent 700 is given the ability to call tools, it can achieve tasks such as completing semantic feature determination with the help of tools for determining semantic features and completing similarity calculation with the help of tools for calculating similarity.
[0189] During the model training phase, the output module 750 may output the query results described above.
[0190] The AI agent 700 according to the embodiment of the present disclosure can simply and effectively improve the level of intelligence, and enhance flexibility and versatility.
[0191] Figure 8 A block diagram of an electronic device suitable for implementing a large-scale model-based information presentation method according to an embodiment of the present disclosure is schematically shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital assistants, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or claimed herein.
[0192] like Figure 8 As shown, device 800 includes a computing unit 801, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 802 or a computer program loaded from a storage unit 808 into a random access memory (RAM) 803. RAM 803 may also store various programs and data required for the operation of device 800. Computing unit 801, ROM 802, and RAM 803 are interconnected via a bus 804. An input / output (I / O) interface 805 is also connected to bus 804.
[0193] Various components in device 800 are connected to I / O interface 805, including an input unit 806, such as a keyboard, mouse, etc.; an output unit 807, such as various types of displays, speakers, etc.; a storage unit 808, such as a magnetic disk, optical disk, etc.; and a communication unit 809, such as a network card, modem, wireless communication transceiver, etc. The communication unit 809 allows device 800 to exchange information / data with other devices via a computer network such as the Internet and / or various telecommunication networks.
[0194] The computing unit 801 can be any general-purpose and / or specialized processing component with processing and computing capabilities. Some examples of the computing unit 801 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various specialized artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 801 performs the various methods and processes described above, such as the large-model-based information display method. For example, in some embodiments, the large-model-based information display method can be implemented as a computer software program tangibly embodied in a machine-readable medium, such as the storage unit 808. In some embodiments, part or all of the computer program can be loaded and / or installed onto the device 800 via the ROM 802 and / or the communication unit 809. When the computer program is loaded into the RAM 803 and executed by the computing unit 801, one or more steps of the large-model-based information display method described above can be performed. Alternatively, in other embodiments, the computing unit 801 can be configured to perform the large-model-based information display method by any other suitable means (e.g., via firmware).
[0195] Various embodiments of the systems and techniques described above can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), system-on-a-chip systems (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments can include being implemented in one or more computer programs that are executable and / or interpreted on a programmable system that includes at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0196] The program code for implementing the method of the present disclosure can be written in any combination of one or more programming languages. These program codes can be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device so that when the program code is executed by the processor or controller, the functions / operations specified in the flow chart and / or block diagram are implemented. The program code can be executed entirely on the machine, partially on the machine, as a stand-alone software package, partially on the machine and partially on a remote machine, or entirely on a remote machine or server.
[0197] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of machine-readable storage media may include an electrical connection based on one or more wires, 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), optical fibers, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0198] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).
[0199] The systems and techniques described herein can be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network (LAN), a wide area network (WAN), and the Internet.
[0200] A computer system may include a client and a server. The client and server are generally remote from each other and typically interact through a communication network. The client-server relationship arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The server may be a cloud server, a server in a distributed system, or a server integrated with a blockchain.
[0201] It should be understood that the various forms of the processes shown above can be used to reorder, add, or delete steps. For example, the steps described in this disclosure can be performed in parallel, sequentially, or in a different order, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved. This is not a limitation herein.
[0202] The above specific embodiments do not constitute a limitation on the scope of protection of this disclosure. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions may be made based on design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this disclosure shall be included within the scope of protection of this disclosure.
Claims
1. A method for displaying information based on a large model, comprising: In response to receiving a query question, matching a target example pair set corresponding to a query type of the query question according to the query question to obtain at least one reference example pair, wherein the reference example pair is used to guide the large model to generate a query statement for the query question; Invoking the large model according to prompt information obtained based on the query question and the at least one reference example to generate a target query statement; and Display the query results obtained by executing the target query statement.
2. The method according to claim 1, wherein The step of matching a target example pair set corresponding to a query type of the query question according to the query question to obtain at least one reference example pair includes: Classifying the query questions according to preset classification rules to obtain the query types, wherein the preset classification rules define at least one of keywords, semantics, and expression forms corresponding to each of the query types; Determining the target example pair set from the candidate example pair set according to the query type; and The query question is matched with the target example pair set to obtain the at least one reference example pair.
3. The method according to claim 2, wherein: The query type includes an operation type and an object type, the candidate example pair set includes a plurality of first subsets of the operation types, and each of the first subsets includes a plurality of second subsets of the object types; Determining the target example pair set from the candidate example pair set according to the query type includes: Filtering the multiple first subsets according to the operation type to obtain at least one target first subset; as well as For each of the target first subsets, the multiple second subsets are screened according to the object type to obtain the target example pair set.
4. The method according to claim 2, wherein: The query type includes an object type and an operation type, the candidate example pair set includes a plurality of candidate example pairs, and each candidate example pair has a corresponding operation type and an object type; Determining the target example pair set from the candidate example pair set according to the query type includes: Screening each of the candidate example pairs in the candidate example pair set according to the operation type to obtain at least one intermediate example pair; as well as The at least one intermediate example pair is screened according to the object type to obtain the target example pair set.
5. The method according to claim 2, wherein: The reference example pair includes a reference query question and a reference query sentence; The matching the query question with the target example pair set to obtain the at least one reference example pair includes: respectively determining similarities between the semantic features of the query question and the semantic features of each of the reference query questions to obtain a plurality of similarities; and The candidate example pairs corresponding to the top N similarities among the sorted similarities are determined as the reference example pairs, where N is a positive integer.
6. The method according to claim 5, wherein: The plurality of similarities include n1 similarities for each of the query types; The step of determining the candidate example pairs corresponding to the top N similarities among the sorted plurality of similarities as the reference example pairs includes: For each of the query types, the candidate example pairs corresponding to the first n2 similarities among the sorted n1 similarities are determined as reference example pairs of the query type, so that the repetition of the query types covered by the reference example pairs is less than a preset repetition threshold, where n2 is less than or equal to n1, and n1 is less than N.
7. The method according to any one of claims 2 to 6, further comprising: Determining the contribution of each candidate example pair according to at least one of a usage frequency of each candidate example pair in the candidate example pair set and an accuracy rate of a historical query sentence generated using the candidate example pair; as well as The set of candidate example pairs is updated according to the contribution and a preset contribution threshold.
8. The method according to any one of claims 1 to 6, wherein The query question is a question about a data table, and the reference example pair includes a reference query question and a reference query statement; The step of calling the large model to generate a target query statement based on the prompt information obtained based on the query question and the at least one reference example includes: Based on a preset prompt template, the prompt information is obtained by concatenating the at least one reference example pair, the query question, and description information of a data table corresponding to the query question, wherein the data table corresponding to the query question is obtained by semantically matching the query question with the description information of each candidate data table; According to the prompt information, calling the large model to generate an intermediate query statement; and In response to the execution logic of the intermediate query statement and the execution logic of each of the reference query statements satisfying a consistency condition, the intermediate query statement is determined as the target query statement.
9. The method according to claim 3 or 4, wherein: The operation type includes at least one of the following: data display type, data statistics type, data arrangement type, comparative analysis type, and trend analysis type; the object type includes at least one of the following: time type, subject type, and indicator type.
10. An information display device based on a large model, comprising: a matching module configured to, in response to receiving a query question, match a set of target example pairs corresponding to a query type of the query question according to the query question to obtain at least one reference example pair, wherein the reference example pair is used to guide the large model to generate a query statement for the query question; a generating module, configured to call the large model to generate a target query statement according to prompt information obtained based on the query question and the at least one reference example; and The display module is used to display the query results obtained by executing the target query statement.
11. An artificial intelligence agent configured to execute the method according to any one of claims 1 to 9.
12. 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 9.
13. 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 9 are implemented.
14. A computer program product comprising a computer program or instructions, 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 9 are implemented.
Citation Information
Cited By
Knowledge query method and device, computer equipment and storage medium
CN122240817A
