A data analysis question-answering platform based on large models and knowledge vector bases

By using a data analysis question-answering platform based on large models and knowledge vector libraries, the semantic confusion and security issues of NL2SQL in enterprise-level databases are resolved, enabling efficient and accurate data analysis and question answering, and improving the flexibility and security of data processing.

CN120448508BActive Publication Date: 2025-10-28LU ZE TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202510940236.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-07-09
Publication Date
2025-10-28
Estimated Expiration
2045-07-09

AI Technical Summary

Technical Problem

Existing NL2SQL technology suffers from semantic confusion, high learning costs, uncontrollable performance, and data privacy and permission issues in enterprise databases, resulting in inaccurate answers, low data processing efficiency, and an inability to effectively understand complex problems.

Method used

A data analysis question-answering platform based on a large model and a knowledge vector library is adopted. The large model filters data analysis questions, identifies keywords and classifies them into indicators, dimensions and statistical periods, generates SQL query statements, and optimizes and controls security through the knowledge vector library.

Benefits of technology

It enables low-cost, high-efficiency, high-security, and high-accuracy natural language data analysis and question answering, meeting users' needs for efficient and accurate data analysis and improving the flexibility and security of data processing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120448508B_ABST
    Figure CN120448508B_ABST
Patent Text Reader

Abstract

This application discloses a data analysis question-answering platform based on a large model and a knowledge vector library, relating to the field of intelligent question answering. First, it acquires user question-answering content and analyzes it using a large model to filter out data analysis questions. Then, it identifies keywords within these questions. Using the large model and knowledge vector library, it categorizes keywords into indicators, dimensions, and statistical periods. These indicators, dimensions, and statistical periods are then converted into corresponding SQL fragments, which are concatenated to generate SQL query statements. The SQL query statements are executed to query the database and return the results. Finally, the query results are converted into structured data and displayed through a front-end user interface. This platform enables low-cost, high-efficiency, high-security, high-accuracy, and highly flexible natural language data analysis and question answering.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of intelligent question answering technology, and in particular to a data analysis question answering platform based on a large model and a knowledge vector library. Background Technology

[0002] NL2SQL (Natural Language to SQL) is a technology that automatically converts natural language questions into SQL (Structured Query Language). Users can ask questions in everyday language, and the system will translate these questions into precise SQL queries. For example, a user can enter "show the 5 products with the highest sales in the past month," and the NL2SQL system will parse this natural language and generate the corresponding SQL query.

[0003] Current NL2SQL methods directly perform lexical, syntactic, and semantic analysis on the input natural language query, then match keywords with the database's built-in table structure (schema) to generate SQL query statements. However, enterprise-level databases contain thousands or even tens of thousands of tables, and a large number of schemas can easily lead to semantic confusion. Furthermore, large models have a high learning cost for table structures. SQL written directly by large models is unoptimized, potentially resulting in a high proportion of slow queries and uncontrollable performance. Additionally, direct database operations by large models raise data privacy and access control issues. Summary of the Invention

[0004] The purpose of this application is to provide a data analysis question-answering platform based on large models and knowledge vector bases, which can achieve low-cost, high-efficiency, high-security, high-accuracy and high-flexibility natural language data analysis and question answering.

[0005] To achieve the above objectives, this application provides a data analysis question-answering platform based on a large model and a knowledge vector library, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement a data analysis question-answering method based on a large model and a knowledge vector library;

[0006] The data analysis question-answering method based on large models and knowledge vector bases includes:

[0007] Acquire user questions and answers, analyze the questions and answers using a large model, and filter out data analysis questions;

[0008] Identify keywords in data analysis problems;

[0009] Keyword classification is performed by combining a large model with a knowledge vector library, categorizing keywords into indicators, dimensions, and statistical periods.

[0010] The metrics, dimensions, and statistical periods are converted into corresponding SQL fragments, and the SQL fragments are concatenated to generate SQL query statements.

[0011] Execute an SQL query to query the database and return the query results;

[0012] The query results are converted into structured data and displayed through the front-end user interface.

[0013] Optionally, the step of acquiring user question-and-answer content and analyzing it using a large model to filter out data analysis questions specifically includes:

[0014] The system acquires user question-and-answer content and analyzes it using a large model to determine whether the question-and-answer content is a data analysis question. The large model includes DeepSeek and OpenAI. The data analysis questions include: questions involving datasets or data sources, inquiring about trends, patterns, predictions, or statistical analysis, requesting charts, visualizations, or data interpretations, and questions involving specific statistical methods or analytical techniques.

[0015] If the question and answer content is a data analysis question, output the data analysis question directly;

[0016] If the question is not a data analysis question, the user will be prompted on the front-end user interface to change it back to a data analysis question.

[0017] Optionally, the keywords in the identified data analysis questions specifically include:

[0018] Text preprocessing is performed on data analysis problems, including segmenting the text into words or phrases and removing common stop words to obtain preprocessed candidate words. ;

[0019] Analyze each candidate word The statistical features and semantic information of words, and based on the formula Calculate each candidate word Total score ;in Candidate words Case sensitivity score; Candidate words Location feature score; Candidate words Word frequency feature score; Candidate words Symbolic feature score; Candidate words Context relevance score; Candidate words The cross-sentence distribution feature score; The number of characters in a data analysis question; Candidate words Contextual pattern enhancement feature scores;

[0020] Total score Candidate words below the preset score threshold Identified as keywords .

[0021] Optionally, the candidate words Symbolic feature score The calculation formula is: ;in, The number of symbol types in the candidate words; For the first Weight of class symbols; For symbolic combination gain factor; This is the position attenuation factor.

[0022] Optionally, the candidate words Context relevance score The calculation formula is: ;in for Left and right neighbor words; point mutual information score ; yes and The joint probability of simultaneous occurrence; and They are and The probability of it appearing alone.

[0023] Optionally, the candidate words Contextual pattern enhancement feature score The calculation formula is: ;in, For exact matching scores; For fuzzy matching scores; The score is based on dynamic weighting. , and They are respectively , and The weighting coefficients.

[0024] Optionally, the step of classifying keywords using a large model in conjunction with a knowledge vector base, categorizing keywords into indicators, dimensions, and statistical periods, specifically includes:

[0025] By constructing prompt words, a large model performs the first round of predictions on keywords. Perform coarse-grained classification and generate The coarse screening candidate categories; the coarse screening candidate categories are dimensions, indicators, or statistical periods;

[0026] Calculate keywords The cosine similarity between the cosine similarity of the words and standard words of each category in the knowledge vector base is used to select the category with the highest cosine similarity as the candidate category for fine screening; the candidate category for fine screening can be a dimension, an index, or a statistical period.

[0027] If the candidate categories from the fine screening are the same as those from the coarse screening, then the candidate category from the fine screening or the coarse screening is determined as the keyword. The final category;

[0028] If the candidate categories for fine screening are inconsistent with those for coarse screening, then it is determined whether the cosine similarity corresponding to the candidate categories for fine screening exceeds the similarity threshold.

[0029] If the cosine similarity of the candidate categories in the fine screening exceeds the similarity threshold, the candidate categories in the fine screening are determined to be keywords. The final category; otherwise, determine the coarse-screened candidate category as keywords. The final category;

[0030] Keywords The final category output is a JSON message in JSON format; the JSON message includes dimension keywords, indicator keywords, and statistical period keywords.

[0031] Optionally, the step of converting the metrics, dimensions, and statistical periods into corresponding SQL fragments, and then concatenating these SQL fragments to generate an SQL query statement, specifically includes:

[0032] Based on a large model, intent recognition is performed on JSON messages, and dimension keywords, indicator keywords, and statistical period keywords included in the JSON messages are matched to the corresponding SQL fragments;

[0033] The SQL fragments are concatenated to generate the corresponding SQL query statement.

[0034] Optionally, the execution of the SQL query statement to query the database and return the query results specifically includes:

[0035] The large model connects to an external database toolset, executes SQL queries, drives the SQL query tools to perform queries in the database, and returns the data query results.

[0036] Optionally, the step of converting the query results into structured data and displaying it through a front-end user interface specifically includes:

[0037] The query results are transformed into structured data through semantic or structured methods and then exposed to the front-end user interface through API interfaces.

[0038] The front-end user interface renders structured data into charts for display.

[0039] According to the specific embodiments provided in this application, the following technical effects are disclosed:

[0040] This application provides a data analysis question-answering platform based on a large model and knowledge vector library, which can solve the problems of inaccurate answers, low data processing efficiency, and inability to understand complex questions in traditional data analysis question-answering platforms. It meets users' needs for efficient and accurate data analysis question-answering, and realizes low-cost, high-efficiency, high-security, high-accuracy and high-flexibility natural language data analysis and question answering. Attached Figure Description

[0041] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0042] Figure 1 This is a flowchart illustrating the method implemented by the data analysis question-answering platform based on a large model and knowledge vector library according to this application. Detailed Implementation

[0043] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0044] The purpose of this application is to propose a data analysis question answering platform based on a large model and knowledge vector library, aiming to achieve low-cost, high-efficiency, high-security, high-accuracy and high-flexibility natural language data analysis and question answering.

[0045] To make the above-mentioned objectives, features and advantages of this application more apparent and understandable, the application will be further described in detail below with reference to the accompanying drawings and specific embodiments.

[0046] This application provides a data analysis question-answering platform based on a large model and a knowledge vector base. The platform includes a memory, a processor, and a computer program stored in the memory and executable on the processor. The processor executes the computer program to implement a data analysis question-answering method based on a large model and a knowledge vector base. The method includes steps 1 to 6.

[0047] Step 1: Obtain user Q&A content and analyze it using a large model to filter out data analysis questions.

[0048] This application's data analysis question-answering platform first acquires user-described questions and answers in natural language. It then analyzes this content using a trained large-scale model, inputting data analysis-oriented questions into step 2. Furthermore, through tagged prompts and guided hints, users are encouraged to revise non-data analysis-oriented questions into data analysis-oriented ones. The goal is to ensure that only data analysis-oriented questions enter the entire data analysis process, while non-data analysis-oriented questions are rejected.

[0049] Step 1 specifically includes steps 1.1 to 1.3.

[0050] Step 1.1: Obtain the user's question and answer content, and analyze the question and answer content through a large model to determine whether the question and answer content is a data analysis question.

[0051] The Large Language Model (LLM) used in this application can be any of the commonly used large language models available today, such as DeepSeek and OpenAI. The data analysis questions refer to questions that involve datasets or data sources, inquire about trends, patterns, predictions, or statistical analysis, request charts, visualizations, or data interpretation, and involve specific statistical methods or analytical techniques. Taking e-commerce scenarios as an example, data analysis questions are similar to questions like "Please tell me the sales situation of this store in December," "Please tell me the top 10 best-selling products this year and display them in bar chart format," and "You predict which product will have the worst sales this quarter," which are used for operational analysis and store sales analysis.

[0052] Step 1.2: If the question and answer content is a data analysis question, output the data analysis question directly.

[0053] If the large model determines that the user's question and answer content is a data analysis question, it directly outputs the data analysis question to step 2. In this way, non-data analysis questions are kept out of the entire data analysis question and answer platform, and only data analysis questions are answered.

[0054] Step 1.3: If the question and answer content is not a data analysis question, then prompt the user in the front-end user interface to change the non-data analysis question back into a data analysis question.

[0055] If the large model determines that the user's question and answer content is not a data analysis question, then it will use tagged prompts and guiding suggestions to allow the user to change the non-data analysis question back into a data analysis question.

[0056] The tagged prompts provide question types and their definitions, including data extraction, statistical analysis, trend prediction, data transformation, and data modeling. This allows the large model to determine the type of input question based on these definitions. If the question falls under one of these categories, it is classified as a data analysis question.

[0057] For example, the prompt template is as follows. Statistical analysis problems are defined as problems that are solved or understood by collecting, organizing, analyzing, interpreting, and presenting data. For example, how much impact does a certain promotional activity have on sales? Larger models can then determine the appropriate approach based on the definition and examples.

[0058] Guided prompts refer to providing a description that allows the large model to compare the question with the question type and definition. For example, some question types and definitions, as well as the question entered by the user, are given in advance; and the large model is trained to say, "The above description represents a data analysis question. Please determine whether the current input question belongs to the data analysis question?" If it does not belong to the data analysis question, the user is directly informed that it does not belong to the data analysis question.

[0059] These two types of cues (labeled cues and guiding cues) are combined to form a cue template, which can then be used for large models, as shown in the following example.

[0060] Statistical analysis problems: Problems that require collecting, organizing, analyzing, interpreting, and presenting data to solve or understand; for example, how much impact does a certain promotional activity have on sales? {User-input question} The above description represents a data analysis problem. Please determine whether the current input question is a data analysis problem. If not, directly inform the user that it is not a data analysis problem.

[0061] Step 2: Identify keywords in data analysis questions.

[0062] Data analysis type questions require large models to convert natural semantics into warehouse external semantics, that is, to convert a natural language into a formatted message that can be understood by a computer to transmit information. According to the data warehouse modeling theory and the construction theory based on modern data中台, the natural semantics is disassembled into three layers of keywords: metrics, dimensions, and statistical periods. Among them, a metric refers to a quantifiable measure used to evaluate business performance. A dimension refers to an attribute used to describe and classify metrics. A statistical period refers to the time interval for aggregating metrics. Taking the question of asking about the sales amount of this store in the current month as an example, use step 2 to identify the keywords in the question, which are {store / current month / sales amount}, where store is the dimension, current month is the statistical period, and the metric is sales amount. This application identifies keywords by analyzing the statistical characteristics and semantic information of words in the text. The said step 2 specifically includes the following steps 2.1 to step 2.3.

[0063] Step 2.1: Perform text preprocessing on the data analysis type question, including splitting the text into words or phrases and removing common stop words, to obtain multiple candidate words after preprocessing, denoted as .

[0064] For example, for the data analysis type question "I want to know the store sales amount in the past six months", first split the sentence into words or phrases. Chinese word segmentation usually needs to借助分词工具, such as jieba, etc. For this sentence, the word segmentation result may be: I / want / to know / this / past six months / of / store / sales amount. Stop words are usually those words that appear frequently in the text but contribute little to the semantics, such as "of", "is", "in", etc. After removing these stop words, the remaining candidate words are: past six months / store / sales amount. Among them, past six months represents the time range and is the key time condition for the query, corresponding to the keyword category of "statistical period". Store: represents the main object of the query, corresponding to the keyword category of "dimension". Sales amount: represents the specific data metric for the query, corresponding to the keyword category of "metric".

[0065] Step 2.2: Analyze the word statistical characteristics and semantic information of each candidate word and calculate the total score of each candidate word according to formula (1). The lower the total score of a candidate word, the more likely it is to be a keyword such as a metric, dimension, or statistical period. ,

[0066] (1);

[0067] Among them, is the case feature score of candidate word ; is the position feature score of candidate word ; is the candidate word Word frequency feature score; Candidate words Symbolic feature score; Candidate words Context relevance score; Candidate words The cross-sentence distribution feature score; The number of characters in a data analysis question; Candidate words Contextual pattern enhancement feature scores.

[0068] For example, for the data analysis question "Please tell me the top 10 best-selling products this year and display them in a bar chart format", the sentence is first segmented into words or phrases. The word segmentation result may be: Please / tell / me / this year / products / sales / top10 / and / in / bar chart / format / display. Common Chinese stop words include "please", "tell", "me", "and", "in", "format", "display", etc. After removing these stop words, the remaining candidate words are: this year / products / sales / top10 / bar chart. Each candidate word is calculated according to formula (1). Total score For example, given the candidate words "sales volume" and "bar chart", "bar chart" has a total score of 98 and "sales volume" has a total score of 60. Therefore, "sales volume" is more likely to be an indicator, dimension, or statistical period, and "sales volume" is identified as one of the keywords.

[0069] The following section details the calculation methods for the statistical features and semantic information scores of each word in formula (1).

[0070] 2.2.1 Case Feature: Determine if candidate words begin with a capital letter (e.g., proper nouns). These words are more likely to be keywords. Candidate Words Case feature score The calculation formula is as follows:

[0071] (2);

[0072] The statistical methods for "capitalized frequency" and "non-capitalized score" are as follows. For example, in the statement "I want to know the store's sales revenue for the past six months," the candidate word "revenue" begins with a capital letter. If it appears once, its "capitalized frequency" is 1; if it appears twice, its "capitalized frequency" is 2, and so on. A "non-capitalized score" of 1 corresponds to a "capitalized frequency" of 0, because log20 is negative infinity (approximately equal to 0), so 1 + log20 ≈ 1 + 0 = 1.

[0073] 2.2.2 Position Feature: The earlier the candidate word appears for the first time in the document, the higher its importance may be. The candidate word 's position feature score is calculated as follows:

[0074] (3).

[0075] For example, for the data analysis question "Please tell me the top 10 product sales this year and display them in the form of a bar chart", the corresponding word segmentation result is: Please / tell / me / this year / product / sales / top10 / and / in the form of / bar chart / display. Then, the "total number of words in the document" corresponds to 12. After removing stop words, the remaining candidate words are: this year / product / sales / top10 / bar chart. For the candidate word "this year", its "position of the first occurrence" corresponds to 4.

[0076] 2.2.3 Word Frequency Feature: The higher the frequency of the candidate word, the more important it is. However, normalization is required to prevent bias in long texts. The candidate word 's word frequency feature score is calculated as follows:

[0077] (4);

[0078] where refers to the frequency of the candidate word appearing in the document. The "maximum word frequency in the document" refers to the maximum word frequency of all words in the entire document. For example, in a data analysis question, "sales amount" appears the most, 10 times. Then, the "maximum word frequency in the document" is 10.

[0079] 2.2.4 Symbol Feature: Accurately identify special symbols, units, or keyword suffixes (such as %, $, rate, year-on-year) in the precision recognition index, reduce their scores, and enhance the priority of keywords. The candidate word 's symbol feature score is calculated as follows:

[0080] (5);

[0081] where is the number of symbol types in the candidate word; is the weight of the th type of symbol; is the symbol combination gain factor; is the position attenuation factor. Among them, for the value, this application classifies symbols into four categories and assigns weights from high to low priority as shown in Table 1 below.

[0082] Table 1. Symbol types and their corresponding weights

[0083]

[0084] Here, KPI (Key Performance Indicator) refers to key performance indicators. ROI (Return on Investment) refers to return on investment. CTR (Click-Through Rate) refers to click-through rate.

[0085] For symbol combination gain factor The value of the score is adjusted based on whether the candidate word contains multiple symbol combinations. If the candidate word contains multiple symbol combinations, the score weight is further reduced and the priority is increased. For example, in the candidate word "year-on-year growth in number of people", "year-on-year growth" is a time comparison word among the four types of symbols mentioned above, and "number of people" is a unit symbol. Then, the candidate word with multiple symbol combinations is a symbol combination type. This type of word should be multiplied by 0.4 and then by 0.3 on the basis of the previous score, because the candidate word is more likely to be an indicator / dimension / statistical period.

[0086] Position attenuation factor The formula for suppressing interference from symbols (such as invalid symbols at the end of paragraphs) in long-tail words is as follows:

[0087] (6).

[0088] For example, if a user enters a question but mistypes it and describes the question as "What is the growth rate of the store?", it satisfies the weighting in symbol layer weighting. However, this "rate" is at the end of the sentence. Although it is a key symbol, it is not very useful. Here, the priority of "rate" is reduced, mainly to eliminate the influence of messy text. Therefore, for effective weighting, it must first be a valid indicator / dimension / statistical period. This is inferred by comparing the document with the training dataset of relevant indicators / dimensions / statistical periods after word segmentation. Moreover, this symbol cannot appear alone, otherwise it does not meet the requirements of combined weighting. The later the position of this symbol in the document, the smaller the value calculated by formula (6) and the smaller the weighting.

[0089] 2.2.5 Relatedness: Measures the degree of association between candidate words and surrounding words, calculated using Pointwise Mutual Information (PMI). Candidate words Context relevance score The calculation formula is:

[0090] (7);

[0091] in, for The words that are next to or next to the word.

[0092] The PMI is calculated as follows:

[0093] (8);

[0094] in, yes and The joint probability of simultaneous occurrence; and They are and The probability of it appearing alone; The PMI is used to calculate the point mutual information score. PMI can effectively measure the relevance between two terms. For example, if a question frequently mentions milk powder and GMV (Gross Merchandise Volume), then the user is more likely to be asking about the GMV of milk powder.

[0095] 2.2.6 DifSentence Distribution Feature: The more times a candidate word appears in different sentences, the higher its importance. Candidate Words Cross-sentence distribution feature score The calculation formula is:

[0096] (9);

[0097] Here, "total number of sentences" refers to the total number of sentences in the document; "number of sentences that appeared" refers to the number of sentences containing candidate words. The number of sentences.

[0098] 2.2.7 PatternBoost Feature Enhancement: Identifies complex contextual patterns (such as "store dimension" or "core metric is order count") and dynamically increases their weight. For example, if a question is, "Please tell me what the store's core metric is this year: product pageviews," then since "product pageviews" is preceded by "core metric," "product pageviews" is more likely to be a metric. In other words, if a candidate word... If a keyword is explicitly marked as being related to a dimension or metric, then it is more likely to be a dimension / metric. Essentially, it's about judging the candidate word based on the features of the context. Is it a dimension / metric? Candidate keywords Contextual pattern enhancement feature score The calculation formula is:

[0099] (10).

[0100] in, For exact matching scores; For fuzzy matching scores; The score is based on dynamic weighting. , and They are respectively , and The weighting coefficients. Because in formula (1) the total score... Located in the denominator, therefore The larger the score, the higher the final total score. The smaller.

[0101] Exact matching (ExactMatch) refers to capturing fixed sentence patterns (such as "index: [candidate word]") using regular expressions. Exact match score. The calculation formula is as follows:

[0102] (11);

[0103] Here, "metric" is the English word for "indicator". If the question contains descriptions such as "metric XXX", "dimensional XXX", or "metric XXX", then these words are explicitly categorized into a certain classification pattern. In this case, the candidate word "XXX" is very likely to be an indicator or dimension. For example, for the phrase "metric order rate", the corresponding pattern is "..." "Then the "order rate" here is the indicator, which meets the indicator model."

[0104] Fuzzy matching refers to identifying contextual prompts (such as "enhance," "associate," "drive," etc.) and dynamically calculating association weights. Fuzzy matching score. The calculation formula is:

[0105] (12);

[0106] in, Candidate words A context window for the three words before and after. For example, a weight table for leading words, such as "Drive = 0.6", "Boost = 0.5", "Association = 0.4".

[0107] Dynamic weight refers to the dynamic adjustment of weights based on the pattern distribution of candidate words in a document. Dynamic weight score. The calculation formula is:

[0108] (13);

[0109] in, Indicate candidate words The frequency of occurrence in the pattern, such as "User Age" in "Dimension: User Age" in the pattern " The number of times it appears in the phrase "". Indicate candidate words Total number of times it appears throughout the document.

[0110] Step 2.3: Calculate the total score Candidate words below the preset score threshold Identified as keywords .

[0111] In formula (1), It is the number of characters in the data analysis question input by the user. It involves segmenting the text of the question into candidate words. Calculate these candidate words The total score is considered, and a lower total score is more likely to represent keywords related to indicators / dimensions / statistical periods. Therefore, the total score... Candidate words below a certain preset score threshold Identified as keywords .

[0112] Step 2 of this application involves identifying keywords in the data analysis problem. Then, in the subsequent step 3, further subdivision and classification are carried out to determine the keywords. Is it an indicator, a dimension, or a statistical period?

[0113] Step 3: Use a large model in conjunction with a knowledge vector library to classify keywords into indicators, dimensions, and statistical periods.

[0114] Step 3 specifically includes steps 3.1 to 3.6.

[0115] Step 3.1: Construct prompt words to allow the large model to perform the first round of predictions on the keywords. Perform coarse-grained classification and generate The coarse screening candidate categories; the coarse screening candidate categories are dimensions, indicators, or statistical periods.

[0116] First, prompt words are constructed to allow the large model to perform an initial prediction, and the keywords are classified in a coarse-grained manner to generate candidate categories (dimension, indicator, statistical period). The prompt word template is shown in Table 2 below.

[0117] Table 2 Prompt Word Templates

[0118]

[0119] In Table 2, DAU refers to Daily Active Users, and Q2 refers to the second quarter. Table 2 shows the constructed prompt word template. The large model classifies based on the template rules. The template provides definitions for dimensions, metrics, and statistical periods. The large model infers based on the rules, and the classification rules can be customized and added according to the scenario. For example, taking the e-commerce scenario, in "sales revenue of self-operated stores in 2024," "sales revenue" is the metric, the preceding non-time modifier "self-operated stores" is the dimension, and the time modifier "2024" is the statistical period. Thus, breaking down the sentence, if it's about sales revenue, the keyword is sales revenue, the category is the metric, and the classification reason is that as long as the defined content (quantifiable numerical measure) is matched, it belongs to the corresponding category.

[0120] Step 3.2: Calculate keywords The cosine similarity with the standard words of each category in the knowledge vector base is used to select the category with the highest cosine similarity as the candidate category for fine screening; the candidate category for fine screening can also be a dimension, index or statistical period.

[0121] This application first constructs prompt words to allow a large model to perform an initial round of predictions on the keywords. First, coarse-grained classification is performed to generate coarsely selected candidate categories (dimensions, indicators, or statistical periods). Second, disambiguation is verified using a knowledge vector library (referred to as a vector library) of the business domain (e.g., e-commerce) to prevent classification errors in the large model. Specifically, the keywords to be classified are calculated. The cosine similarity score between the words and the standard words of each category in the vector library is used to select the category with the highest score as the candidate category for further screening.

[0122] The vector library used in this application is a database that stores words in the form of vector coordinates. Business and technical personnel maintain the company's metrics / dimensions / statistical periods and calculation methods in the vector library to build an external semantic layer. This vector library is then used by large models for metric / dimension / statistical period classification, and also for subsequent SQL fragment concatenation. In data analysis and business statistics, "calculation method" is a very important concept; it refers to the specific methods, rules, and standards used to calculate a particular metric. The calculation method ensures data consistency and accuracy, enabling effective comparison and analysis of data from different times and departments.

[0123] The external semantic layer allows business teams to directly maintain the definitions of metrics / dimensions / statistical periods in a low-code manner, improving the flexibility of data analysis. Business personnel can directly extract core elements of metrics, dimensions, and statistical periods, including calculation methods (directly fragmented into SQL through the data model) and definitions. Because data analysis problems are highly logical, this application uses an independent feature vector processing method for word segmentation vectorization to facilitate the parsing of such problems. The quantified keywords (metrics / dimensions / statistical periods) are vectorized into a vector library for use by the large model and other steps. Before performing word segmentation vectorization, it is necessary to define and model the metrics, dimensions, and statistical periods, including the following (3.2.1) to 3.2.3).

[0124] 3.2.1) Metric Definition Modeling: Model the relevant definitions of the metrics, including the metric name (in Chinese and English), the metric definition, and the calculation method. Here, the calculation method refers to the SQL fragment generated based on the current data warehouse table design and field definitions. This is used to generate the select clause of the final SQL query statement.

[0125] Here's an example of an SQL query: `select order_id from order_detail_d where shop_id = 12345`. This means extracting the "order_id" metric data for the shop ID "12345" from the data source "order_detail_d". Here, `select order_id` is the `SELECT` clause, and `where shop_id = 12345` is the `WHERE` clause.

[0126] The input format for the indicator definition is shown in Table 3 below.

[0127] Table 3 Input Format for Indicator Definitions

[0128]

[0129] Where name is the Chinese name of the defined metric, col is the English name of the corresponding metric, definition is the calculation method definition, and calculation_basis is the SQL fragment.

[0130] 3.2.2) Dimension Definition Modeling: Model the dimensions-related definitions. The dimensions limit the calculation range of the indicators. Here, we need to provide the dimension name (in Chinese and English), dimension definition and calculation method, which are used to generate the WHERE clause of the SQL query statement.

[0131] 3.2.3) Statistical Period Definition Modeling: This statistical period refers to the time dimensions used in various services, such as dates, years, and months. At the same time, the definition should also include the types of business time to be used in the service, such as the order placement time and order cancellation time in the e-commerce scenario, so as to correspond the business time with the business time in the data warehouse.

[0132] Traditional vectorization methods concatenate all metadata into a single text for vectorization. For example, all the metadata in Table 3 is concatenated into "Sales Amount sale_amt Total amount of goods sold SUM(per_gmv)" and directly vectorized. This will result in: 1) Technical features (such as field names) being overwhelmed by natural language descriptions; 2) Semantic conflicts between different attributes (such as field names using snake case naming, which has a different grammar structure from Chinese descriptions); 3) Unable to optimize weights for different query types (such as being unable to focus when users explicitly search for field names). Therefore, to improve the retrieval efficiency and accuracy, this application splits the metadata structure into four independent feature dimensions: ① Metric Name / Dimension Name / Statistical Period Name, ② Technical Field Name, ③ Calculation Caliber (SQL fragment), ④ Chinese description of the calculation caliber, and performs independent vectorization for each feature dimension. The process of tokenization and vectorization includes the following 3.2.4) to 3.2.6).

[0133] 3.2.4) The vectorization process of metric name / dimension name / statistical period name and Chinese description of the calculation caliber.

[0134] Model Selection: BAAI / bge-base-zh-v1.5 (Chinese semantic model). The input of this Chinese semantic model is the metric name, dimension name, statistical period name, or Chinese description of the calculation caliber, and the output is the corresponding vector coordinates (mathematical coordinate system). This Chinese semantic model is used to convert Chinese characters into a coordinate system for matching. For example, when inputting a word "Sales Amount", it is converted into a position in a coordinate system and matched with the position of the standard metric name "Sales Amount" in the vector library. The closer they are, the more likely the current metric name is "Sales Amount" and can be matched.

[0135] This Chinese semantic model is based on the BERT architecture, and its optimization goal is contrastive learning. Its advantage is that it can narrow the semantic distance between business terms and descriptions through contrastive learning, which is suitable for processing Chinese natural language. Its core formula is as follows:

[0136] (14);

[0137] Among them, represents the query vector, such as when the user inputs "Sales Amount". represents the positive sample, such as the standard metric name "Sales Amount". represents the A negative sample, such as other irrelevant indicators. This represents the number of negative samples. sim() calculates the cosine similarity. This represents the temperature coefficient, used to control the steepness of the distribution. This represents the loss function of the Chinese semantic model. The smaller the value, the better the model's prediction; the closer this term is to the standard metric name "sales revenue". The larger the value, the worse the model's prediction. The value is used to measure the accuracy of the coordinates generated by vectorization.

[0138] 3.2.5) Vectorization process of technical field names.

[0139] Model selection: microsoft / CodeBERT-base (code understanding model). The input to this model is the technical field name of the metric / dimension / statistical period. The technical field name is the English code for the metric name, used for database queries; for example, sales revenue corresponds to shop_pay. The output of this model is vectorized coordinates (mathematical coordinate system). This model is used to convert technical field names into a coordinate system.

[0140] This code understands that the model is based on BERT's multi-task pre-training, combining two objectives: Masked Language Modeling (MLM) and Replaced Token Detection (RTD). RTD is used to detect replaced tokens in the input, enhancing sensitivity to naming conventions. Its advantage lies in understanding naming patterns of technical fields, such as camelCase (saleAmt) and serpentine (sale_amt). The objective function of MLM is as follows:

[0141] (15);

[0142] in, Indicates from the training dataset D The input sequence (code or natural language) is sampled in the middle. M Given a set of randomly occluded token locations, each location has a probability of... p mask Selected. This represents the masked input sequence, replaced by a MASK or a random token. M The position in the middle. Position in the original input sequence The real token. This indicates that the code understands the model's predicted location. for The conditional probability. In natural language processing and programming language processing, a token refers to the smallest unit into which text or code is divided. A mask is a special masking token used to represent the masked portion of an input sequence.

[0143] 3.2.6) Vectorization process for calculating caliber (SQL fragment).

[0144] Model Selection: Microsoft / Unique SQL (SQL-specific model). This model takes SQL fragments (metrics / dimensions / statistical periods) as input and outputs corresponding vector coordinates for vectorizing SQL fragments. Its advantage lies in its ability to parse SQL syntax structures, such as aggregate functions like SUM(...) and JOIN logic, and accurately match the computational logic. This SQL-specific model employs a syntax-aware encoder based on Tree-LSTM.

[0145] (16).

[0146] in, Represents the current syntax tree node The hidden state. LSTM ( ) represents a syntax-aware encoder based on Tree-LSTM. This indicates the token embedding of a node, such as SUM or COUNT. child node The hidden state. Represents the set of child nodes of the tree. The smaller the value, the better the model's prediction results, and the closer the predicted words are to the current SQL. The larger the value, the worse the model's prediction. Used to measure the accuracy of coordinates generated by vectorization.

[0147] Of course, the above model and algorithm choices can be substituted for each other based on their advantages and algorithmic logic; model selection is not unique. The independently vectorized content is stored in the knowledge vector base as a main document, containing vectors of all dimensions and associated metadata, thus ensuring interrelationships during retrieval. The format structure of the main document is shown in Table 4 below, with the corresponding comments following the symbol " / / ".

[0148] Table 4. Format Structure of the Main Document

[0149]

[0150] Here, id is the unique ID of the document; type is the document type, indicating whether the document type is an indicator, dimension or statistical period; the various attributes in the metadata object are the definition metadata entered by the user above; and the fields with the same name in the vectors object are their corresponding vectorized coordinates.

[0151] Step 3.3: If the candidate categories for fine screening and coarse screening are the same, determine which candidate category (fine screening or coarse screening) is the keyword. The final category.

[0152] Step 3.4: If the candidate categories for fine screening are inconsistent with those for coarse screening, determine whether the cosine similarity corresponding to the candidate categories for fine screening exceeds the similarity threshold (e.g., 0.7).

[0153] Step 3.5: If the cosine similarity corresponding to the candidate categories exceeds the similarity threshold (e.g., 0.7), determine the candidate categories as keywords. The final category; otherwise, determine the coarse-screened candidate category as keywords. The final category.

[0154] If the highest cosine similarity exceeds a threshold (e.g., 0.7), the classification result from the vector library is trusted; otherwise, the classification result from the larger model is relied upon. This way, when the LLM misclassifies, the vector library's classification result can be used to cover the errors. For example, if the LLM misclassifies "quarter" as "dimension," but the vector library shows a higher similarity between "quarter" and "statistical period," and their cosine similarity exceeds 0.7, then the final category for the keyword "quarter" is determined to be "statistical period."

[0155] Step 3.6: Add keywords The final category output is a JSON message in JSON format; the JSON message includes dimension keywords, indicator keywords, and statistical period keywords. The final output after classification is a JSON message in a format similar to that shown in Table 5 below.

[0156] Table 5. JSON format of JSON messages

[0157]

[0158] In the table, atom_metric represents the metric keyword, dim represents the dimension keyword, and time_cycle represents the statistical cycle keyword.

[0159] Step 4: Convert the metrics, dimensions, and statistical periods into corresponding SQL fragments, and then concatenate the SQL fragments to generate an SQL query statement.

[0160] Combining steps 1 to 3, a data analysis problem described by natural language processing (NLP) is broken down and extracted into key elements such as indicators, dimensions, and statistical periods. These elements are then formatted into commonly used computer message transmission formats such as JSON and Map using advanced operators. Finally, the NLP problem is transformed into a mapping of these analytical dimensions and SQL fragments, which are then concatenated to generate an SQL query statement, which is output to a large model for complex multidimensional analysis. "Advanced operators" refer to operations such as calculating the average and median. Step 4 specifically includes steps 4.1 to 4.2.

[0161] Step 4.1: Based on the large model, perform intent recognition on the JSON message and match the dimension keywords, indicator keywords and statistical period keywords included in the JSON message to the corresponding SQL fragments.

[0162] First, the intent of JSON messages is identified based on the large model, matching keywords such as dimensions, metrics, and statistical periods included in the JSON message to the corresponding SQL fragments. Rule-based classification is used to categorize JSON messages, allowing the large model to automatically determine whether an incoming message is JSON. For example, if the large model is given a prompt template "Only JSON format data is allowed," then the large model will only accept JSON messages in the format shown in Table 5.

[0163] Step 4.1 requires intent recognition to convert the corresponding metric / dimension / statistical period keywords into SQL fragments. To achieve accurate matching, the weights of each dimension are dynamically adjusted. The core logic is to automatically adjust the contribution weights of different feature dimensions (business metric names, Chinese descriptions of calculation methods, technical field names, etc.) in the overall similarity calculation based on the user's query intent. The implementation principle and steps include steps 4.1.1) to 4.1.3 below.

[0164] 4.1.1) Query intent classification, query types, features and their weight assignments are shown in Table 6 below.

[0165] Table 6 Query Intent Classification Table

[0166]

[0167] 4.1.2) Intent recognition method: The intent type is determined by combining keyword regular expression matching with large model text reading.

[0168] 4.1.3) Dynamic Weight Adjustment Formula. Based on the identified intent type, the weight coefficients of each dimension vector are dynamically adjusted to calculate the overall similarity:

[0169] (17);

[0170] in, DThis represents a set of dimensions, such as business metric names, Chinese descriptions of calculation methods, and technical field names. Indicates the dimension below the current intent The weight, . Indicates query In dimensions vector with vectors in the library The cosine similarity is used. This way, regardless of whether the extracted keywords are metric (dimension) names, specific calculation method descriptions, or English terms, they can be matched with corresponding SQL fragments.

[0171] Taking an example of inquiring about the store's monthly sales, the company's business and technical staff maintain their own metrics / dimensions / statistical periods in a database (knowledge vector library) for use throughout the process. Here, employees maintain the definition of sales, the total order amount, and the corresponding SQL fragment SUM(order_amt) used to query the data source. The larger model first filters user questions to determine if they are data analysis questions, such as asking about the weather; these types of questions are removed. Keywords from data analysis questions are extracted; in this case, "store," "month," and "sales." Initially, "store" is categorized as a dimension, "month" as the statistical period, and "sales" as the metric. This is then further confirmed by connecting the knowledge vector library. Finally, a JSON message is output.

[0172] {

[0173] "Indicator": "Sales Revenue"

[0174] "Dimension": "Store"

[0175] "Statistical period": "Current month"

[0176] }

[0177] The JSON message is retrieved and the corresponding SQL fragments and information for the corresponding metrics / dimensions / statistical periods are queried from the vector library. The output is a JSON message containing SQL fragments, as shown in Table 7. The symbol "#" is followed by the corresponding comment.

[0178] Table 7 JSON messages containing SQL fragments

[0179]

[0180] In the olap object, atom_metric, dim, and time_cycle correspond to the SQL fragments transformed from the metrics, dimensions, and statistical periods mentioned above. dims are the metadata field names involved in the aggregation calculation. table in the source object is the data source (i.e., the data table). The large model does not generate SQL throughout the entire process; instead, it only recognizes user semantics and concatenates SQL fragments. This avoids the illusion created by the large model directly generating SQL, thus improving the accuracy of data analysis.

[0181] Step 4.2: Concatenate the SQL fragments to generate the corresponding SQL query statement.

[0182] Using the prompts shown in Table 8 (the following prompts are for logical reference only), the JSON message shown in Table 7 can be restored to an SQL query statement (referred to as an SQL statement).

[0183] Table 8. SQL statement generation prompt templates

[0184]

[0185] The indicator clause, operator clause, dimension clause, and target table are obtained from the JSON message containing SQL fragments, and are then completed into the SQL format shown in Table 8. The SQL fragment corresponding to the indicator clause represents the grouping conditions; the SQL fragment corresponding to the operator clause represents the calculation logic of the indicator; and the SQL fragment corresponding to the dimension clause represents the filtering conditions. The target table refers to the data source of the query data. The dataset / data source is each company's own business data; for example, for an e-commerce company, it's order details data, product information data, etc., and the accessed data source contains all such operational data of the company. The completion operation involves filling the determined SQL fragments into the SQL format shown in Table 8; for example, filling "dim" from the JSON message into "group by" will match. SQL query statements generated in this way have a small and regular context of prompt word templates, resulting in a small number of tokens generated from the final text.

[0186] Step 5: Execute the SQL query statement to query the database and return the query results.

[0187] Large-scale models connect to external database toolsets, execute SQL queries, and drive these tools to search the database, returning the results. Existing large-scale model development frameworks already include built-in database toolset integration capabilities; these operations can be configured through the framework itself, allowing different external toolsets to be configured based on the different databases used by different business systems.

[0188] For example, concatenating the SQL fragments from the JSON message shown in Table 7 into the following SQL query: `select sum(shop_gmv) from order_detail_d where shop_id = 100039454 and date_sub(2025-01-01) and '2025-01-01' group by shop_id`. Using this SQL query to query the database will produce a data metric (e.g., 100000) for display on the front-end user interface. This metric represents the sales amount, and its output format is:

[0189] {

[0190] Sales revenue: 100,000

[0191] }

[0192] Step 6: Convert the query results into structured data and display them through the front-end user interface.

[0193] The query results are transformed into structured data through semantic or structuring methods. Specifically, by using dimensions, indicators, and statistical periods, the query results are semantically or structurally converted into concrete structured data, which is then exposed to the front-end user interface via API for data analysis and display. The front-end user interface can render the structured data into charts and other formats for display. Depending on the use case, the data query results can be organized into different data formats (such as data reports, data dashboards, etc.) for external presentation. For example, if the query result is "sales revenue is 300,000, a year-on-year increase of 30%", the front-end user interface can display different formats such as pie charts and bar charts based on the business requirements.

[0194] In other words, the entire workflow of the data analysis Q&A platform in this application can be summarized as follows: Filtering data analysis questions from user-described Q&A content in natural language → Extracting keywords from data analysis questions → Categorizing keywords, grouping dimensions together, grouping indicators together, and grouping statistical periods together → Querying the corresponding knowledge vector library to obtain the user-maintained calculation methods (SQL fragments) → Concatenating the SQL fragments in sequence to form an SQL query statement → Executing the SQL query statement to query the business database → Converting the query results into structured data through the program and exposing them to the front-end user interface through the interface → The front-end user interface rendering the structured data into charts such as tables and pie charts for display.

[0195] This application presents a data analysis question-answering platform based on a large model and knowledge vector library, primarily used for data analysis and querying across various business domains to achieve intelligent question answering. For example, in the e-commerce field, it's used for operational analysis and store sales analysis. Before using this platform, developers needed to manually write code to query relevant metrics for business personnel to analyze. After using this platform, users no longer need developers; they only need to ask questions (input), such as "What was the sales volume of this store this month?", and the platform will automatically output the relevant sales metrics.

[0196] This application's data analysis question-answering platform implements a low-cost, highly secure, highly accurate, and highly flexible natural language data analysis method. By connecting to an external knowledge vector library, questions are transformed into structured JSON messages containing commonly used multi-dimensional analysis terms such as metrics, dimensions, and statistical periods. These JSON messages are then converted into SQL statements for querying via the knowledge vector library. Large models do not need to ingest excessive amounts of useless schema content, reducing token consumption. Furthermore, pre-mapped metric SQL fragments improve the accuracy of query results.

[0197] This application's data analysis question-answering platform significantly reduces the context required for large model imports, lowering costs in terms of token count. If data analysis needs change, it can be quickly and flexibly expanded without requiring excessive manpower for maintenance. Furthermore, after reading the database, it directly concatenates SQL fragments by mapping indicators to them, enabling precise targeting and improving query accuracy and speed. Moreover, by directly authenticating the indicator semantic layer (knowledge vector base), it ensures the security of data queries.

[0198] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by hardware related to computer program instructions. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments described above. Any reference to memory or other media in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory may include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory may include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM).

[0199] It should be noted that the information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of the relevant data must comply with relevant regulations.

[0200] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0201] This document uses specific examples to illustrate the principles and implementation methods of this application. The descriptions of the above embodiments are only for the purpose of helping to understand the methods and core ideas of this application. Furthermore, those skilled in the art will recognize that, based on the ideas of this application, there will be changes in the specific implementation methods and application scope. Therefore, the content of this specification should not be construed as a limitation of this application.

Claims

1. A data analysis question-answering platform based on a large model and a knowledge vector base, characterized in that, include: The memory, the processor, and the computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement a data analysis question answering method based on a large model and a knowledge vector base; The data analysis question-answering method based on large models and knowledge vector bases includes: Acquire user questions and answers, analyze the questions and answers using a large model, and filter out data analysis questions; Identify keywords in data analysis problems; Keyword classification is performed by combining a large model with a knowledge vector library, categorizing keywords into indicators, dimensions, and statistical periods. The metrics, dimensions, and statistical periods are converted into corresponding SQL fragments, and the SQL fragments are concatenated to generate SQL query statements. Execute an SQL query to query the database and return the query results; The query results are converted into structured data and displayed through the front-end user interface; The keywords identified in the data analysis problem specifically include: Text preprocessing is performed on data analysis problems, including segmenting the text into words or phrases and removing common stop words to obtain preprocessed candidate words. ; Analyze each candidate word The statistical features and semantic information of words, and based on the formula Calculate each candidate word Total score ;in Candidate words Case sensitivity score; Candidate words Location feature score; Candidate words Word frequency feature score; Candidate words Symbolic feature score; Candidate words Context relevance score; Candidate words The cross-sentence distribution feature score; The number of characters in a data analysis question; Candidate words Contextual pattern enhancement feature scores; Total score Candidate words below the preset score threshold Identified as keywords ; The method of keyword classification using a large model and a knowledge vector base categorizes keywords into indicators, dimensions, and statistical periods, specifically including: By constructing prompt words, a large model performs the first round of predictions on keywords. Perform coarse-grained classification and generate The coarse screening candidate categories; the coarse screening candidate categories are dimensions, indicators, or statistical periods; Calculate keywords The cosine similarity between the cosine similarity of the words and standard words of each category in the knowledge vector base is used to select the category with the highest cosine similarity as the candidate category for fine screening; the candidate category for fine screening can be a dimension, an index, or a statistical period. If the candidate categories from the fine screening are the same as those from the coarse screening, then the candidate category from the fine screening or the coarse screening is determined as the keyword. The final category; If the candidate categories for fine screening are inconsistent with those for coarse screening, then it is determined whether the cosine similarity corresponding to the candidate categories for fine screening exceeds the similarity threshold. If the cosine similarity of the candidate categories in the fine screening exceeds the similarity threshold, the candidate categories in the fine screening are determined to be keywords. The final category; otherwise, determine the coarse-screened candidate category as keywords. The final category; Keywords The final category output is a JSON message in JSON format; the JSON message includes dimension keywords, indicator keywords, and statistical period keywords.

2. The data analysis question-answering platform based on a large model and knowledge vector base according to claim 1, characterized in that, The process of acquiring user question-and-answer content and analyzing it using a large model to filter out data analysis questions specifically includes: The system acquires user question-and-answer content and analyzes it using a large model to determine whether the question-and-answer content is a data analysis question. The large model includes DeepSeek and OpenAI. The data analysis questions include: questions involving datasets or data sources, inquiring about trends, patterns, predictions, or statistical analysis, requesting charts, visualizations, or data interpretations, and questions involving specific statistical methods or analytical techniques. If the question and answer content is a data analysis question, output the data analysis question directly; If the question is not a data analysis question, the user will be prompted on the front-end user interface to change it back to a data analysis question.

3. The data analysis question-answering platform based on a large model and knowledge vector base according to claim 1, characterized in that, The candidate words Symbolic feature score The calculation formula is: ;in, The number of symbol types in the candidate words; For the first Weight of class symbols; For symbolic combination gain factor; This is the position attenuation factor.

4. The data analysis question-answering platform based on a large model and knowledge vector base according to claim 1, characterized in that, The candidate words Context relevance score The calculation formula is: ;in for Left and right neighbor words; point mutual information score ; yes and The joint probability of simultaneous occurrence; and They are and The probability of it appearing alone.

5. The data analysis question-answering platform based on a large model and knowledge vector base according to claim 1, characterized in that, The candidate words Contextual pattern enhancement feature score The calculation formula is: ;in, For exact matching scores; For fuzzy matching scores; The score is based on dynamic weighting. , and They are respectively , and The weighting coefficients.

6. The data analysis question-answering platform based on a large model and knowledge vector base according to claim 1, characterized in that, The process of converting metrics, dimensions, and statistical periods into corresponding SQL fragments, and then concatenating these SQL fragments to generate an SQL query statement, specifically includes: Based on a large model, intent recognition is performed on JSON messages, and dimension keywords, indicator keywords, and statistical period keywords included in the JSON messages are matched to the corresponding SQL fragments; The SQL fragments are concatenated to generate the corresponding SQL query statement.

7. The data analysis question-answering platform based on a large model and knowledge vector base according to claim 6, characterized in that, The execution of the SQL query statement to query the database and return the query results specifically includes: The large model connects to an external database toolset, executes SQL queries, drives the SQL query tools to perform queries in the database, and returns the data query results.

8. The data analysis question-answering platform based on a large model and knowledge vector base according to claim 7, characterized in that, The process of converting query results into structured data and displaying it through a front-end user interface specifically includes: The query results are transformed into structured data through semantic or structured methods and then exposed to the front-end user interface through API interfaces. The front-end user interface renders structured data into charts for display.

Citation Information

Patent Citations

  • Search engine based on parameter

    CN101122915A

  • Automatic topic annotation method based on YAKE! Keyword extraction

    CN117349591A

  • Text-to-structured query language statement generation method, system and equipment

    CN118820285A