Intelligent question and answer assisted decision-making method and system based on AI large model
By using AI big data models to identify user intent and generate SQL query statements, the problem that existing question-answering systems cannot meet the needs of diverse and complex queries is solved, and an efficient and accurate database query experience is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-31
- Publication Date
- 2026-03-27
AI Technical Summary
Existing question-and-answer systems are unable to meet the diverse and complex query needs of users, and cannot flexibly adapt to users' true intentions, resulting in inaccurate query results and low efficiency.
By using a large AI model to determine the feature vector of the query text input by the user, and generating SQL query statements through intent type matching and similarity relationships, and combining intelligent inference to perform data query, the complexity of the model is reduced to improve query efficiency and accuracy.
It improves the accuracy and efficiency of user queries, reduces the workload of manually writing SQL, lowers the operating threshold, and enables more users to easily operate complex database queries.
Smart Images

Figure CN118445398B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present disclosure belongs to the technical field of intelligent question answering, and more particularly to an intelligent question answering aided decision-making method and system based on an AI large model. BACKGROUND
[0002] In recent years, many pre-training large language models have emerged in the field of artificial intelligence, and large language models have shown great potential in the application of intelligent question answering systems. Although many large language model-driven question answering systems focus on the exploration of text knowledge fields, they are still insufficient in handling data question answering scenarios, and relevant research is relatively scarce. In actual application scenarios, user query requirements are diverse and complex, and existing question answering systems are difficult to meet the diverse and complex query demands, and cannot automatically present query results in a flexible and responsive manner. There is an urgent need for more advanced and intelligent solutions to fill this gap. SUMMARY
[0003] The purpose of the present disclosure is to provide an intelligent question answering aided decision-making method and system based on an AI large model to meet the diverse and complex query demands of users.
[0004] The first aspect of the embodiments of the present disclosure provides an intelligent question answering aided decision-making method based on an AI large model, comprising: determining a first vector corresponding to a target text, the target text being a query text input by a target user, and the first vector being a query feature vector corresponding to the target text;
[0005] Based on the matching relationship between the first vector and a plurality of intent types, an intent type of the target text is determined, the plurality of intent types including intelligent question answering and general question answering;
[0006] In response to the intent type of the target text belonging to intelligent question answering, a plurality of third vectors are determined based on the similarity relationship between the first vector and a plurality of second vectors; the plurality of second vectors include structure word vectors of a plurality of data tables, and the plurality of third vectors are vectors in the plurality of second vectors;
[0007] The plurality of third vectors are input into an intelligent reasoner to obtain a target SQL query statement, and data is queried according to the target SQL query statement; the intelligent reasoner is an AI large model obtained by low-rank adaptive adjustment of a first AI large model.
[0008] The second aspect of the embodiments of the present disclosure provides an intelligent question answering aided decision-making device based on an AI large model, comprising: a first calculation module for determining a first vector corresponding to a target text, the target text being a query text input by a target user, and the first vector being a query feature vector corresponding to the target text;
[0009] An intent determination module is configured to determine an intent type of the target text based on a matching relationship between the first vector and a plurality of intent types, the plurality of intent types including intelligent question answering and general question answering.
[0010] A second calculation module is configured to, in response to the intent type of the target text belonging to intelligent question answering, determine a plurality of third vectors based on a similarity relationship between the first vector and a plurality of second vectors, the plurality of second vectors including structure word vectors of a plurality of data tables, and the plurality of third vectors being vectors in the plurality of second vectors.
[0011] A query module is configured to input the plurality of third vectors into an intelligent reasoner to obtain a target SQL query statement, and perform data query according to the target SQL query statement, the intelligent reasoner being an AI large model obtained by performing low-rank adaptive adjustment on a first AI large model.
[0012] In a third aspect, the embodiments of the present disclosure provide an intelligent question answering assisted decision-making system based on an AI large model, which includes a memory, a processor, and a computer program stored in the memory and running on the processor, and the processor implements the steps of the intelligent question answering assisted decision-making method based on an AI large model.
[0013] In a fourth aspect, the embodiments of the present disclosure provide a computer readable storage medium, which stores a computer program, and the computer program is executed by a processor to implement the steps of the intelligent question answering assisted decision-making method based on an AI large model.
[0014] The intelligent question answering assisted decision-making method and system based on an AI large model provided by the embodiments of the present disclosure have the following beneficial effects: the AI large model system can deeply understand the problem background and query intent of the user, accurately vectorize and semantically match the natural language input by the user, ensure that the user demand can be accurately recognized even in a complex query scenario, and reduce invalid queries caused by misunderstanding. The system greatly improves the ability to quickly locate target information from a large number of database table structures by using a high-performance Chinese embedding model, thereby enhancing the efficiency and accuracy of the query. The system can automatically convert the recognized user intent into a corresponding SQL query statement, reducing the workload of manually writing SQL, predicting the data format of the query result through an intelligent reasoner, and ensuring the correctness and efficiency of SQL execution. By integrating natural language interaction and intelligent query generation functions, the present disclosure greatly improves the interaction experience between the user and the database, reduces the operation threshold, and enables a wider user group to easily master complex database query operations. BRIEF DESCRIPTION OF DRAWINGS
[0015] In order to more clearly illustrate the technical solutions in the embodiments of the present disclosure, the drawings needed to be used in the embodiments or prior art description will be briefly introduced. Obviously, the drawings in the following description only constitute some embodiments of the present disclosure, and for those skilled in the art, other drawings can also be obtained without creative labor.
[0016] Figure 1 A flowchart of an AI large model-based intelligent question answering assisted decision-making method provided by an embodiment of the present disclosure is shown in FIG. 1.
[0017] Figure 2 A SQL inference generation diagram of the AI large model-based intelligent question answering assisted decision-making method provided by an embodiment of the present disclosure is shown in FIG. 3.
[0018] Figure 3 A text vectorization diagram of the AI large model-based intelligent question answering assisted decision-making method provided by an embodiment of the present disclosure is shown in FIG. 4.
[0019] Figure 4 A specific flowchart of the AI large model-based intelligent question answering assisted decision-making method provided by an embodiment of the present disclosure is shown in FIG. 5.
[0020] Figure 5 A structural block diagram of an AI large model-based intelligent question answering assisted decision-making device provided by an embodiment of the present disclosure is shown in FIG. 6.
[0021] Figure 6 A schematic block diagram of an AI large model-based intelligent question answering assisted decision-making system provided by an embodiment of the present disclosure is shown in FIG. 7. DETAILED DESCRIPTION
[0022] In the following description, specific details are set forth in order to provide a thorough understanding of embodiments of the present disclosure. However, persons skilled in the art will understand that the present disclosure can be practiced without these specific details. In other instances, well-known structures, devices, circuits, and methods have not been described in detail in order to avoid obscuring the present disclosure.
[0023] In order to make the objects, technical solutions, and advantages of the present disclosure clearer, the following will be described with reference to the accompanying drawings through specific embodiments.
[0024] Reference is made to Figure 1 , Figure 1 A flowchart of an AI large model-based intelligent question answering assisted decision-making method provided by an embodiment of the present disclosure is shown in FIG. 1, which includes:
[0025] 101: determining a first vector corresponding to a target text, the target text being a query text input by a target user, the first vector being a query feature vector corresponding to the target text.
[0026] In the embodiment, determining the first vector corresponding to the target text can include extracting key features from the text input by the user, the key features can include vocabulary, phrases, grammatical structures and topic elements. The natural language text input by the user is analyzed and processed by using a pre-trained embedding model, and the query feature vector representing the user's immediate intention is generated in combination with the key features and the dialogue context information. The pre-trained embedding model can include BERT, GPT or Word2Vec.
[0027] For example, the user can input: “What is the weather like in A city tomorrow?” The key features can include time-“tomorrow”, place-“A city” and topic-“weather”. In combination with the dialogue context information, the user has previously inquired about the travel plan, so “the weather in A city tomorrow” may be related to the user's travel arrangement.
[0028] For example, the extracted key features are converted into numerical vectors according to the pre-trained embedding model. The pre-trained embedding model can include capturing semantic information of words and their meanings in context. For example, the words “A city”, “tomorrow” and “weather” will be converted into vectors in a high-dimensional space, and the distance between them reflects the semantic similarity. The processed text features are input into the model to generate a query feature vector expression that integrates the user input information and the dialogue context. The query feature vector can be used to quantify the user's immediate intention and serve as a basis for decision-making in subsequent dialogue processes.
[0029] For example, if the user continuously asks:
[0030] User input text: “I want to travel to A city next week.”
[0031] User input text: “What is the weather like there?”
[0032] User input text: “What is the weather like in A city tomorrow?”
[0033] Through the context information, it can be obtained that the user is concerned about the weather in A city, and this query is closely related to the user's upcoming travel plan. Therefore, the generated query feature vector not only contains the response to the “weather” query, but also implies support for “travel preparation”.
[0034] For example, the user input text is: "I want to know the sales data of last month and the comparison with the same period last year." The key features can include "sales data", "last month", "same period last year", and "comparison". In combination with the dialogue context information, if the user has previously inquired about the sales report, "sales data" is obtained as the important feature information. The key feature words are converted into query feature vectors by using a pre-trained embedding model.
[0035] From the above, in the embodiment, the key features are extracted from the user input text, the dialogue context information is combined, and the pre-trained embedding model is used to obtain the query feature vector of the user. The method can more intelligently respond to the needs of the user and provide more personalized services.
[0036] 102: Determine the intent type of the target text based on the matching relationship between the first vector and multiple intent types, and the multiple intent types include intelligent questioning and general question answering.
[0037] In the embodiment, the first vector can include the query feature vector corresponding to the target text. The intelligent questioning can include automatically answering the data query task proposed by the user based on the database, and realizing automatic query of data in a natural language environment.
[0038] For example, if the input content of the user is a question about obtaining specific data, the embodiment can classify it as an "intelligent questioning" intent type. If the input content of the user is a general question or seeks information, the embodiment can classify it as a "general question answering" intent type.
[0039] For example, the user input text is: "Query the sales data of the first quarter of 2023", and the key features "query" and "sales data" are identified as an indication of the query operation, and the key features "2023" and "first quarter" specify the time range. Using a pre-trained word embedding model such as BERT, these key features are converted into query feature vector representations. The algorithm model trained by a large amount of data analyzes the query feature vector of the user and obtains the intent type as intelligent questioning.
[0040] From the above, by accurately identifying the intent of the user, the embodiment can more quickly provide the information or services required by the user, thereby improving the user experience.
[0041] 103: In response to the intent type of the target text belonging to intelligent questioning, determine multiple third vectors based on the similarity relationship between the first vector and multiple second vectors. The multiple second vectors include the structure word vectors of multiple data tables, and the multiple third vectors are vectors in the multiple second vectors.
[0042] In this embodiment, the first vector may include the query feature vector corresponding to the target text. Multiple second vectors may be vectors stored in a word vector database. A word vector database is a tool for storing and retrieving word embeddings, capable of capturing semantic and syntactic relationships between words, thereby supporting various NLP tasks. Feature vectors refer to vectors that map words or phrases in natural language into a high-dimensional space; these vectors can capture the deep semantic and syntactic structure of the language.
[0043] In this embodiment, in response to the intent type of the target text being intelligent question counting, multiple third vectors are determined based on the similarity relationship between the first vector and multiple second vectors. The similarity relationship can be obtained by cosine similarity calculation. Cosine similarity calculation determines the directional similarity between two vectors by calculating the cosine of the angle between them.
[0044] For example, the user query feature vector is compared with all candidate objects stored in the word vector database using cosine similarity calculation. Based on threshold filtering, the N chunk word vectors with the highest semantic similarity are selected: ={ , }, 1≤i≤N. Where, This represents the i-th chunk. This represents the similarity score corresponding to the i-th chunk. The word vectors of the N chunks are used as multiple third vectors. A chunk is a part of a storage table record or index.
[0045] For example, when a user queries "apple", the database retrieves word vectors related to all fruits similar to it, such as "apple", "banana", "orange", etc., and sorts these word vectors according to similarity. Five chunk word vectors are selected as the third vector in descending order of similarity.
[0046] 104: Input multiple third vectors into the intelligent inference engine to obtain the target SQL query statement, and perform data query based on the target SQL query statement. The intelligent inference engine is an AI large model obtained by performing low-rank adaptation on the first AI large model.
[0047] In this embodiment, the intelligent inference engine is a large AI model obtained by performing low-rank adaptation on a first large AI model. The first large AI model may include the Qwen1.5-14B-Chat large model released by Alibaba Cloud. The first dataset may include Text2SQL, i.e., a text-to-SQL dataset.
[0048] Exemplarily, the open-source Spider dataset and the CHASE dataset are acquired. Based on the above two datasets, data integration and data preprocessing are performed, and the data in the dataset is converted into a JSON data format for model fine-tuning, which can include instruction, input, and output necessary fields. The instruction can be a system prompt word, which defines the role and task of the model, the input can be a description language of the SQL task consistent with human expression, and the output can be the corresponding SQL statement.
[0049] In this embodiment, the intelligent reasoner is an AI large model obtained by low-rank adaptation adjustment on a first AI large model. Low-rank adaptation is a technique that allows faster and more efficient adaptation of large language models to specific tasks or domains. Its purpose is to reduce the complexity of the model by using a low-dimensional structure to approximate the high-dimensional structure of the large model, thereby reducing the demand for computing resources and time.
[0050] Exemplarily, the Qwen1.5-14B-Chat model is fine-tuned and optimized by applying the low-rank adaptation fine-tuning technique. This can include freezing the weights of the Qwen1.5-14B-Chat base model, adding a trainable bypass matrix in each Transformer block of the base model, and the low-rank matrix can be seen as an “incremental” modification to the base model, which allows the model to learn new knowledge and features while keeping most of the original weights unchanged. The input and output dimensions of the base model are kept unchanged, and the dimension reduction matrix is superimposed with the parameters of the base model at the output. The dimension reduction matrix is initialized using a random Gaussian distribution, the dimension increase matrix is initialized using a zero matrix, and the parameters of the dimension reduction matrix and the dimension increase matrix are updated. The fine-tuned Peft module weight is fused with the base model, and the complete reasoner model for intelligent question answering is derived.
[0051] In this embodiment, a plurality of third vectors are input into the intelligent reasoner to obtain a target SQL query statement. Referring to Figure 2 , Figure 2 An SQL reasoning generation schematic diagram of an intelligent question and number auxiliary decision-making method based on an AI large model is provided for an embodiment of the present disclosure. In Figure 2 , the filtered Chunk group word vectors are sequentially combined from high to low similarity. The spliced Chunk content is restored to the original table structure information through a decoding mechanism, and the intelligent reasoner is converted into a corresponding SQL query statement through analysis and processing based on the table structure information.
[0052] From the above, it can be concluded that the use of AI large model can deeply understand the user's problem background and query intention, and through accurate vectorization processing and semantic matching of the user's input natural language, it can accurately identify the user's demand even in complex query scenarios, reducing invalid queries caused by misunderstanding. The embodiment greatly improves the ability to quickly locate target information from a large number of database table structures by using a high-performance Chinese embedding model, thereby enhancing the efficiency and accuracy of the query. The embodiment can automatically convert the recognized user intention into a corresponding SQL query statement, reducing the workload of manually writing SQL, and predicting the data format of the query result through an intelligent reasoner to ensure the correctness and efficiency of SQL execution. By integrating natural language interaction and intelligent query generation functions, the present disclosure greatly improves the interaction experience between users and databases, reduces the operation threshold, and enables a wider user group to easily master complex database query operations.
[0053] In an embodiment of the present disclosure, determining the first vector corresponding to the target text comprises:
[0054] Extracting the first feature of the target text.
[0055] Inputting the first feature and the first information into the first embedding model to obtain the first vector. The first information includes the context information of the target text.
[0056] In the embodiment, the first feature can include words, phrases, grammatical structures and theme elements. According to the first feature, in combination with the historical dialogue context information, the pre-trained embedding model is used to deeply analyze the natural language problem input by the user, and generate a vector expression representing the user's immediate intention.
[0057] Illustratively, the first embedding model can be an M3E-Base Chinese embedding model. The table structure information of the database is traversed and parsed, which can include table name and table annotation. At the same time, the name, data type and field description of each field are converted into structured data that can be processed by a machine learning model. These structured information is converted into a natural language sample description as a database table structure description dataset.
[0058] From the above, it can be concluded that the embodiment designs an adaptive segmented vectorization and index construction strategy, dynamically adjusts the Chunk size and the corresponding vector index structure for natural language descriptions of different lengths and complexities, thereby ensuring accurate capture of semantic details and efficient retrieval. Finally, all converted vector data is stored in a specially optimized vector database, and a distributed and high-performance vector search engine that can respond to natural language query requests in real time is constructed.
[0059] In an embodiment of the present disclosure, the intent type of the target text is determined based on a matching relationship between the first vector and a plurality of intent types, comprising:
[0060] The posterior probability of the first vector belonging to the intelligent question is calculated.
[0061] If the posterior probability is greater than a first threshold, the intent type of the target text is determined as the intelligent question.
[0062] In this embodiment, the first threshold is calculated by a threshold function.
[0063] For example, the user intent feature x and a set of potential intent categories y are defined
[0064]
[0065] For a given user intent feature x, the posterior probability P(y|x) of each intent category is calculated, i.e. the conditional probability of y intent under the condition of intent feature x. The category with the highest posterior probability is selected as the prediction result. When comparing the posterior probabilities of different categories, P(x) is the same for all categories, so it can usually be ignored, and only the following needs to be compared:
[0066] P(y)
[0067] In this embodiment, a feedback loop is set, i.e. after each intent recognition, the threshold function and the conditional probability of query features and intent categories can be adjusted according to the click behavior and satisfaction evaluation.
[0068] From the above, it can be seen that the embodiment constructs a dynamic intent recognition algorithm model. This algorithm serves as a basis for determining whether the user's intent belongs to the category of intelligent questions. It can capture the user's actual intent in real time and accurately map it to the corresponding information retrieval or question answering module, ensuring continuous iteration and optimization of the model and improving the accuracy of the model.
[0069] In an embodiment of the present disclosure, the AI large model-based intelligent question assisting decision-making method further comprises:
[0070] The first threshold is determined according to a first formula.
[0071] The first formula comprises:
[0072]
[0073] wherein, represents the first threshold, represents the historical dialogue text of the target user, represents the context information of the target text, indicates a model for determining the first threshold value based on a clustering algorithm and a Bayesian algorithm.
[0074] In this embodiment, the threshold function can dynamically adjust the intent matching threshold value according to the statistical characteristics of the user historical query behavior. The model for calculating the first threshold value can include using a K-means clustering algorithm to cluster the user query behavior, query content, context information, and corresponding intent labels to obtain different query behavior mode sets. For each cluster, a naive Bayesian model is established to estimate the probability relationship between different query features and user intent categories.
[0075] For example, there are two types of intents and , and the query feature vector is For a query instance , the posterior probability of belonging to each type of intent can be calculated as:
[0076]
[0077] The dynamic threshold value can be set as:
[0078] The query feature vector is classified as
[0079] That is, when the intent type corresponding posterior probability is greater than the first threshold value , the query feature vector is classified as .
[0080] From the above, it can be seen that this embodiment combines the historical dialogue text of the target user and the context information of the target text, so as to more accurately capture the personalized needs of the user and the context of the current dialogue. This personalized processing method makes the threshold setting more close to the actual user, improves the intelligence and response quality of the dialogue process. In addition, this embodiment introduces a model based on a clustering algorithm and a Bayesian algorithm to calculate the first threshold value. This method can make full use of historical data and statistical information to deeply learn and analyze the dialogue habits and intent of the user. This machine learning-based method not only improves the accuracy and efficiency of threshold calculation, but also continuously optimizes and perfects the model as the amount of data grows, thereby further improving the performance and user experience of the dialogue process.
[0081] In an embodiment of the present disclosure, based on the similarity relationship between the first vector and the plurality of second vectors, a plurality of third vectors are determined, comprising:
[0082] A similarity between the first vector and each of the second vectors is calculated to obtain a plurality of first similarities.
[0083] A first M second vectors with the largest first similarities are selected as third vectors to obtain a plurality of third vectors.
[0084] For example, a first vector converted from a text input by a user is obtained, which captures the main semantics of a query through natural language processing technology. Meanwhile, a plurality of second vectors are determined, each of which represents a specific table structure element such as a table name and a column name by cutting and vector embedding a natural language description of database table structure information. A similarity between the first vector and each of the second vectors is calculated by using a similarity calculation function such as cosine similarity and Euclidean distance. The result of the calculation is a list of similarity scores, each of which corresponds to a second vector and represents the similarity between the query content and the table structure element represented by the vector. The similarity scores are sorted to find the first M second vectors with the highest scores. The table structure elements represented by these vectors are most similar to the semantics of the query and are therefore most likely to contain the information required by the user. Finally, the M second vectors are output as third vectors. These third vectors not only represent the table structure elements most relevant to the query, but also provide key clues for subsequent database query operations. For example, the third vectors can be used as input for an intelligent reasoner to generate more accurate SQL query statements.
[0085] As can be seen from the above, the embodiment can accurately and quickly locate the database table structure information most relevant to the query, thereby improving the efficiency and accuracy of the query and providing a better experience for the user.
[0086] In an embodiment of the present disclosure, the AI large model-based intelligent question-answering assisted decision-making method further comprises:
[0087] A first data set is determined, which includes a plurality of table structure information of a database.
[0088] A second data set is determined based on the first data set, which includes natural language description data corresponding to the plurality of table structure information.
[0089] The second data set is vector embedded to obtain a plurality of second vectors.
[0090] In the embodiment, the first data set can include a plurality of table structure information. The table structure information is converted into structured data that can be processed by a machine learning model. The second data set can include a database table structure description data set.
[0091] Exemplarily, the table structure information can include table name, table annotation, name of each field, data type, and field description. The structured data is converted into natural language sample description to form a comprehensive database table structure description dataset as the second dataset.
[0092] In the embodiment, the second dataset is vector embedded to obtain a plurality of second vectors.
[0093] Exemplarily, the embodiment cuts the natural language sample in the second dataset into Chunk blocks which are logically coherent and convenient for model processing, and vector embeds the Chunk blocks to map each piece of natural language fragment into a dense vector representation in a 768-dimensional vector space.
[0094] From the above, it can be concluded that the embodiment can realize the explainability of the database table structure information, so that non-technical personnel can also understand the structure and function of the table, and at the same time, through vector processing, it provides efficient feature representation for subsequent possible data analysis, data mining and machine learning tasks, greatly improving the efficiency and accuracy of data processing.
[0095] In an embodiment of the present disclosure, the second dataset is vector embedded to obtain a plurality of second vectors, including:
[0096] The natural language description data corresponding to the plurality of table structure information is cut to obtain a plurality of Chunk blocks.
[0097] The plurality of Chunk blocks are vector embedded to obtain a plurality of second vectors.
[0098] In the embodiment, vector embedding can include converting text, image or audio data into continuous vector representation, by mapping data to points in a multi-dimensional space, so that similar data points are closer to each other, thereby capturing the semantic relationship and similarity between data.
[0099] Exemplarily, as shown in Figure 3 , Figure 3 A text vectorization schematic diagram of an AI large model-based intelligent question answering assisted decision-making method provided by an embodiment of the present disclosure. In Figure 3 , the embodiment cuts the natural language sample into Chunk blocks which are logically coherent and convenient for model processing, the granularity of the Chunk block is a sentence or a paragraph, and 25% content overlap is set between each Chunk block and the adjacent block. The 25% content overlap between the Chunk blocks can achieve 1.5% accuracy improvement. The Chunk blocks are vector embedded to map the natural language fragment into a dense vector representation in a 768-dimensional vector space.
[0100] The database table structure word vector set can be represented as: E(T)=[ , ,..., ],in This can be the word embedding vector of the m-th chunk, where m is the index, a positive integer with a lower bound of 1 and an upper bound of the number of chunks. Based on this set of word vectors, the set is divided into several segments. An index log snapshot is built for each segment, and the data and metadata are deserialized in memory to build the index.
[0101] As shown above, by segmenting natural language description data into chunks, we can more accurately identify and extract key information units from the description. These units are often closely related to specific fields or attributes in the database table structure. Furthermore, vector embedding of these chunks transforms them into numerical vector representations, which not only facilitates computer processing but also effectively captures the semantic relationships between these text units. This approach not only improves the accuracy of data processing but also better understands the user's query intent, thereby providing more precise database query services.
[0102] For example, such as Figure 4 As shown, Figure 4 This is a schematic diagram illustrating the specific process of an AI-based large-scale model-assisted decision-making method for intelligent question-and-answer queries, provided in one embodiment of this disclosure. The user inputs query text to ask a question. In this embodiment, an intent recognition algorithm determines whether the question belongs to "intelligent question-and-answer" or "general question-and-answer." When identified as "general question-and-answer," the text information is input into the intelligent inference engine to obtain the query results and display them on the page. When identified as "intelligent question-and-answer," key features are obtained through analysis using prompt word engineering and memory techniques, such as combining the user's historical query information and the context information of the dialogue. By comparing the similarity between the user's query feature vector and vectors in a word vector library, word vectors that match the user's intent are retrieved. The formation of the word vector library includes extracting information from the database table structure and converting it into corresponding text, segmenting the text into text blocks, inputting the text blocks into a Chinese embedding model for vectorization, and storing the resulting vectors in the word vector database.
[0103] The word vectors that match the user's intent are converted into corresponding table structure information. This table structure information is then input into the intelligent inference engine to generate the corresponding SQL statement and perform data queries. The intelligent inference engine can also simulate the SQL execution process based on business needs, predict data distribution characteristics, and intelligently recommend the best data visualization solutions, such as histograms, line charts, bar charts, pie charts, or tables, to help users intuitively and quickly understand the value behind the data.
[0104] An AI large model-based intelligent question answering assisted decision-making method corresponding to the above embodiment is as shown in Figure 5 Figure 5 A structural block diagram of an AI large model-based intelligent question answering assisted decision-making device provided for an embodiment of the present disclosure is shown. For ease of illustration, only parts related to the embodiments of the present disclosure are shown. Referring to Figure 5 The AI large model-based intelligent question answering assisted decision-making device 20 includes:
[0105] A first computing module 201 is configured to determine a first vector corresponding to a target text, the target text being a query text input by a target user, and the first vector being a query feature vector corresponding to the target text.
[0106] An intent judgment module 202 is configured to determine an intent type of the target text based on a matching relationship between the first vector and a plurality of intent types, the plurality of intent types including intelligent question answering and general question answering.
[0107] A second computing module 203 is configured to, in response to the intent type of the target text belonging to intelligent question answering, determine a plurality of third vectors based on a similarity relationship between the first vector and a plurality of second vectors, the plurality of second vectors including structure word vectors of a plurality of data tables, and the plurality of third vectors being vectors in the plurality of second vectors.
[0108] A query module 204 is configured to input the plurality of third vectors into an intelligent reasoner to obtain a target SQL query statement, and perform data query according to the target SQL query statement. The intelligent reasoner is an AI large model obtained by performing low-rank adaptive adjustment on a first AI large model.
[0109] In an embodiment of the present disclosure, the first computing module 201 includes:
[0110] A first vector calculation unit is configured to extract a first feature of the target text.
[0111] The first feature and first information are input into a first embedding model to obtain the first vector. The first information includes context information of the target text.
[0112] In an embodiment of the present disclosure, the intent judgment module 202 includes:
[0113] An intent calculation unit is configured to calculate a posterior probability that the first vector belongs to intelligent question answering.
[0114] If the posterior probability is greater than a first threshold value, it is determined that the intent type of the target text is intelligent question answering.
[0115] In an embodiment of the present disclosure, the AI large model-based intelligent question answering assisted decision-making device 20 further includes:
[0116] The threshold calculation module is configured to determine the first threshold according to a first formula.
[0117] The first formula comprises:
[0118]
[0119] wherein, the first threshold is represented by, the historical dialogue text of the target user is represented by, the context information of the target text is represented by, the model for calculating the first threshold is determined based on a clustering algorithm and a Bayesian algorithm.
[0120] In an embodiment of the present disclosure, the second calculation module 203 comprises:
[0121] The similarity calculation unit is configured to calculate the similarity between the first vector and each second vector, to obtain a plurality of first similarities.
[0122] The first M second vectors with the largest first similarities are selected as third vectors, to obtain a plurality of third vectors.
[0123] In an embodiment of the present disclosure, the AI large model-based intelligent question and number auxiliary decision-making device 20 further comprises:
[0124] The vector embedding module is configured to determine a first data set, and the first data set comprises a plurality of table structure information of a database.
[0125] A second data set is determined based on the first data set, and the second data set comprises natural language description data corresponding to the plurality of table structure information.
[0126] The second data set is subjected to vector embedding, to obtain a plurality of second vectors.
[0127] In an embodiment of the present disclosure, the vector embedding module comprises:
[0128] The data cutting unit is configured to cut the natural language description data corresponding to the plurality of table structure information, to obtain a plurality of Chunk blocks.
[0129] The plurality of Chunk blocks are subjected to vector embedding, to obtain a plurality of second vectors.
[0130] Referring to Figure 6 , Figure 6 FIG. 1 shows a schematic block diagram of an AI large model-based intelligent question and number auxiliary decision-making system according to an embodiment of the present disclosure. As shown in FIG. 1, the AI large model-based intelligent question and number auxiliary decision-making system 1 comprises an AI large model-based intelligent question and number auxiliary decision-making device 20 and a database 10. Figure 6The AI large model-based intelligent question answering assisted decision system 300 in the embodiment shown can include one or more processors 301, one or more input devices 302, one or more output devices 303, and one or more memories 304. The above-mentioned processors 301, input devices 302, output devices 303, and memories 304 complete mutual communication through a communication bus 305. The memory 304 is used to store a computer program, and the computer program includes program instructions. The processor 301 is used to execute the program instructions stored in the memory 304. Among them, the processor 301 is configured to invoke the program instructions to execute the functions of the modules in each of the above-mentioned device embodiments, for example Figure 3 the functions of the modules 201 to 210 shown.
[0131] It should be understood that in the embodiments of the present disclosure, the processor 301 can be a central processing unit (CPU), and the processor can also be other general-purpose processors, digital signal processors (DSPs), application specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor.
[0132] The input device 302 can include a touchpad, a fingerprint collection sensor (used to collect fingerprint information and direction information of the fingerprint of a user), a microphone, etc., and the output device 303 can include a display (LCD, etc.), a speaker, etc.
[0133] The memory 304 can include read-only memory and random access memory, and provide instructions and data to the processor 301. A part of the memory 304 can also include non-volatile random access memory. For example, the memory 304 can also store device type information.
[0134] In a specific implementation, the processor 301, the input device 302, and the output device 303 described in the embodiments of the present disclosure can execute the implementation manners described in the first and second embodiments of the AI large model-based intelligent question answering assisted decision method provided by the embodiments of the present disclosure, and can also execute the implementation manners of the AI large model-based intelligent question answering assisted decision system described in the embodiments of the present disclosure, which will not be described here.
[0135] In another embodiment of the present disclosure, a computer readable storage medium is provided, which stores a computer program. The computer program includes program instructions, which, when executed by a processor, implement all or part of the processes of the above-mentioned embodiment methods. The computer program can also instruct related hardware to complete the above-mentioned processes. The computer program can be stored in a computer readable storage medium. When the computer program is executed by the processor, the steps of the above-mentioned various method embodiments can be implemented. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or some intermediate form. The computer readable medium can include any entity or device capable of carrying the computer program code, recording medium, U disk, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signal, telecommunication signal, and software distribution medium, etc.
[0136] The computer readable storage medium can be an internal storage unit of the electronic device, such as a hard disk or a memory of the electronic device. The computer readable storage medium can also be an external storage device of the electronic device, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. Further, the computer readable storage medium can include both the internal storage unit and the external storage device of the electronic device. The computer readable storage medium is used to store the computer program and other programs and data required by the electronic device. The computer readable storage medium can also be used to temporarily store data that has been output or will be output.
[0137] Those skilled in the art can appreciate that the units and algorithm steps of the examples described in conjunction with the embodiments disclosed herein can be realized by electronic hardware, computer software or a combination of both. In order to clearly illustrate the interchangeability of hardware and software, the components and steps of the examples have been described in general terms in the above description. Whether the functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. A person skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the present disclosure.
[0138] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the electronic device and the units described above can refer to the corresponding processes in the above-mentioned method embodiments, which will not be described here.
[0139] In several embodiments provided in the present application, it should be understood that the disclosed AI large model-based intelligent question answering auxiliary decision-making system and method can be implemented in other manners. For example, the above-described apparatus embodiments are merely illustrative, for example, the division of units is merely a logical function division, and actual implementation can have another division manner, for example, a plurality of units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between the units shown or discussed can be indirect coupling or communication connection through some interfaces or units, and can also be electrical, mechanical or other forms of connection.
[0140] The units described as separate components can or can not be physically separate, and the components shown as units can or can not be physical units, i.e., can be located in one place or can be distributed to multiple network units. Part or all of the units can be selected according to actual needs to achieve the purpose of the embodiments of the present disclosure.
[0141] In addition, the functional units in each of the embodiments of the present disclosure can be integrated in one processing unit, or each unit can exist physically, or two or more units can be integrated in one unit. The integrated unit can be implemented in the form of hardware or in the form of a software functional unit.
[0142] The above is only a specific implementation of the present disclosure, but the protection scope of the present disclosure is not limited thereto, and any skilled person in the art can easily think of various equivalent modifications or replacements within the technical range disclosed in the present disclosure, and these modifications or replacements should be covered in the protection scope of the present disclosure. Therefore, the protection scope of the present disclosure should be subject to the protection scope of the claims.
Claims
1. An AI large model-based intelligent question and answer decision-making method, characterized in that, The method comprises the following steps: determining a first vector corresponding to a target text, the target text being a query text input by a target user, the first vector being a query feature vector corresponding to the target text; determining an intent type of the target text based on a matching relationship between the first vector and a plurality of intent types, the plurality of intent types including intelligent question answering and general question answering; intelligent question answering includes automatically answering a data query task proposed by a user based on a database, and automatically querying data in a natural language environment; in response to the intent type of the target text belonging to intelligent question answering, determining a plurality of third vectors based on a similarity relationship between the first vector and a plurality of second vectors; the plurality of second vectors include structure word vectors of a plurality of data tables, and the plurality of third vectors are vectors in the plurality of second vectors; inputting the plurality of third vectors into an intelligent reasoner to obtain a target SQL query statement, and performing data query according to the target SQL query statement; the intelligent reasoner is an AI large model obtained by low-rank adaptive adjustment of a first AI large model. 2.The AI large model-based intelligent question and answer decision assistance method of claim 1, wherein, The method further comprises the following steps: extracting a first feature of the target text; inputting the first feature and first information into a first embedding model to obtain the first vector; the first information includes context information of the target text. 3.The AI large model-based intelligent question and answer decision assistance method of claim 1, wherein, The method further comprises the following steps: calculating a posterior probability that the first vector belongs to intelligent question answering; if the posterior probability is greater than a first threshold value, determining that the intent type of the target text is intelligent question answering. 4.The AI large model-based intelligent question answering and decision assisting method of claim 3, wherein, The method further comprises the following steps: determining the first threshold value according to a first formula; the first formula comprises: wherein, represents a first threshold value, represents historical dialogue text of a target user, represents context information of a target text, represents a model for calculating the first threshold value determined based on a clustering algorithm and a Bayesian algorithm. 5.The AI large model-based intelligent question answering and decision assistance method of claim 1, wherein, The method further comprises the following steps: calculating the similarity between the first vector and each second vector to obtain a plurality of first similarities; selecting the first M second vectors with the largest first similarities as third vectors to obtain the plurality of third vectors. 6.The AI large model-based intelligent question answering and decision assisting method of claim 1, wherein, The method further comprises the following steps: determining a first data set, the first data set including a plurality of table structure information of a database; determining a second data set based on the first data set, the second data set including natural language description data corresponding to the plurality of table structure information; performing vector embedding on the second data set to obtain a plurality of second vectors. 7.The AI large model-based intelligent question answering and decision assisting method of claim 6, wherein, The method further comprises the following steps: cutting the natural language description data corresponding to the plurality of table structure information to obtain a plurality of Chunk groups; performing vector embedding on the plurality of Chunk groups to obtain the plurality of second vectors.
8. An AI large model-based intelligent question and answer decision support device, characterized in that, The method comprises the following steps: a first calculation module is configured to determine a first vector corresponding to a target text, the target text being a query text input by a target user, the first vector being a query feature vector corresponding to the target text; An intention determining module is configured to determine an intention type of the target text based on a matching relationship between the first vector and a plurality of intention types, the plurality of intention types including intelligent question answering and general question answering; the intelligent question answering includes automatically answering a data query task raised by a user based on a database to realize automatic query of data in a natural language environment; A second calculating module is configured to, in response to the intention type of the target text belonging to the intelligent question answering, determine a plurality of third vectors based on a similarity relationship between the first vector and a plurality of second vectors; the plurality of second vectors include structural word vectors of a plurality of data tables, and the plurality of third vectors are vectors in the plurality of second vectors; A querying module is configured to input the plurality of third vectors into an intelligent reasoner to obtain a target SQL query statement, and perform data query according to the target SQL query statement; the intelligent reasoner is an AI large model obtained by performing low-rank adaptive adjustment on a first AI large model.
9. An AI large model-based intelligent question and answer decision support system, comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that, The processor executes the computer program to implement the steps of the method according to any one of claims 1 to 7.
10. A computer-readable storage medium storing a computer program, the computer program comprising instructions that, when executed by a computer, cause the computer to perform the method of any one of claims 1 to 9. The computer program is executed by the processor to implement the steps of the method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Intelligent information query method and device based on intention recognition, equipment and medium
CN113761206A
Intelligent question and answer method and system for industry
CN117520524A