Artificial intelligence-based query processing method and apparatus, computer device, and medium
By combining inverted indexes and vector indexes in the retrieval strategy, relevant documents are filtered from the knowledge base, and answers are generated using a large language model. This solves the problem of inaccurate answer generation in existing technologies and achieves higher accuracy and relevance in query information responses.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- PING AN TECH (SHENZHEN) CO LTD
- Filing Date
- 2024-08-15
- Publication Date
- 2026-06-19
AI Technical Summary
Existing methods for answer generation using large language models suffer from the complexity and diversity of knowledge base content, as well as the ambiguity or vagueness of query statements. As a result, the retrieval process cannot ensure that it can accurately match documents that are completely relevant to the user's query every time, leading to a deviation between the retrieved documents and the user's actual needs, which affects the accuracy and relevance of subsequent answers.
The retrieval strategy employs a combination of inverted indexes and vector indexes. It retrieves a list of documents from a pre-built knowledge base, filters out specified documents through merging and sorting, constructs answers and relevance hints, generates answers using a large language model, calculates the joint score of combined information pairs, and finally returns the target answer and document with the highest joint score.
It improves the accuracy and relevance of answers to queries, ensuring that the returned answers are more precise in meeting user needs and enhancing the user experience.
Smart Images

Figure CN119166763B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the fields of artificial intelligence development technology and financial technology, and in particular to query processing methods, devices, computer equipment and storage media based on artificial intelligence. Background Technology
[0002] In today's rapidly developing fintech and artificial intelligence landscape, financial institutions are increasingly demanding efficient and accurate customer service. To enhance user experience, reduce human customer service costs, and respond quickly to customer inquiries, financial institutions are widely adopting question-and-answer systems based on large language models (such as ChatGPT). These systems typically incorporate external knowledge bases to provide intelligent answers to complex financial questions.
[0003] In existing technologies, a common approach is to use the user's query as input and first search an external knowledge base to find the most relevant documents. This step aims to leverage the richness and specialization of the knowledge base to provide foundational material for subsequent answer generation. However, while using the retrieved document content along with the user's query as prompts for a large language model (such as ChatGPT) can utilize the powerful reasoning capabilities of the large language model for answer generation, this method suffers from accuracy issues in practical applications. Due to the complexity and diversity of knowledge base content, as well as the ambiguity or vagueness of query statements, the retrieval process often struggles to ensure that a document perfectly matching the user's query is found every time. This can lead to discrepancies between the retrieved documents and the user's actual needs, thus affecting the accuracy and relevance of subsequent answers. Summary of the Invention
[0004] The purpose of this application is to propose an artificial intelligence-based query processing method, apparatus, computer device, and storage medium to address the technical problem that existing methods of answer generation using large language models often fail to guarantee a precise match of documents completely relevant to the user's query each time, due to the complexity and diversity of knowledge base content and the ambiguity or vagueness of query statements. This can lead to discrepancies between the retrieved documents and the user's actual needs, thereby affecting the accuracy and relevance of subsequent answers.
[0005] To address the aforementioned technical problems, this application provides an artificial intelligence-based query processing method, employing the following technical solution:
[0006] Obtain the query information input by the user, and retrieve the first document list corresponding to the query information from the pre-built knowledge base based on the preset inverted index retrieval strategy;
[0007] Based on a preset vector index retrieval strategy, a second list of documents corresponding to the query information is retrieved from the knowledge base.
[0008] The first text list and the second document list are merged and sorted to filter out a preset number of specified documents.
[0009] Based on the specified document and the query information, answer suggestion words are constructed, and the answer suggestion words are processed based on a preset large language model to obtain the answer corresponding to the specified document;
[0010] Based on the specified document and the query information, relevant prompt words are constructed, and the relevant prompt words are processed based on the large language model to obtain the relevance score between the specified document and the query information;
[0011] Based on the answer, the specified document, and the query information, construct corresponding combined information pairs, and calculate the joint score of the combined information pairs based on the relevance score;
[0012] Filter out the target combined information pair with the highest joint score from all the combined information pairs, and obtain the target answer and target document in the target combined information pair;
[0013] The target answer and the target document are returned to the user.
[0014] Furthermore, the step of retrieving the first document list corresponding to the query information from the pre-built knowledge base based on the preset inverted index retrieval strategy specifically includes:
[0015] The query information is segmented into words to obtain the corresponding query words;
[0016] Based on the query word segmentation, an inverted index query is performed on the knowledge base to obtain the document relevance score between the query word segmentation and each first document contained in the knowledge base;
[0017] All the first documents are sorted based on the document relevance scores to obtain the corresponding inverted index result list;
[0018] The inverted index result list is used as the first document list.
[0019] Furthermore, the step of retrieving a second list of documents corresponding to the query information from the knowledge base based on a preset vector index retrieval strategy specifically includes:
[0020] The query information is encoded based on a preset word embedding model to obtain the corresponding query vector;
[0021] Based on the query vector, a vector index query is performed on the knowledge base to obtain the similarity score between the query vector and each second document contained in the knowledge base;
[0022] All documents are sorted based on the similarity scores to obtain a list of corresponding vector index results;
[0023] The list of vector index results is used as the second document list.
[0024] Furthermore, the step of merging and sorting the first text list and the second document list to filter out a preset number of specified documents specifically includes:
[0025] The first document list and the second document list are merged to obtain the corresponding specified document list;
[0026] Get the first weight corresponding to the inverted index, and get the second weight corresponding to the vector index;
[0027] Based on the first weight and the second weight, a preset calculation formula is called to calculate the relevance score and similarity score of each third document in the specified document list, so as to obtain the comprehensive score of each third document.
[0028] Sort the third documents according to their comprehensive scores from largest to smallest to obtain the corresponding sorted list;
[0029] Select the fourth document with the highest overall score from the sorted list and use it as the designated document.
[0030] Furthermore, the step of constructing answer suggestion words based on the specified document and the query information, and processing the answer suggestion words based on a preset large language model to obtain the answer corresponding to the specified document, specifically includes:
[0031] Get the preset answer prompt template;
[0032] The specified document and the query information are input into the answer suggestion template to obtain the answer suggestion;
[0033] Invoke the large language model;
[0034] The answer prompt words are input into the large language model, the large language model processes the answer prompt words, and the large language model outputs the answer corresponding to the specified document.
[0035] Furthermore, the step of calculating the joint score of the combined information pair based on the relevance score specifically includes:
[0036] Retrieve a specific answer, a specific document, and query information contained in a specified combination of information pairs; wherein, the specified combination of information is any one of all the specified combination of information pairs;
[0037] Obtain a specified relevance score between the specific document and the query information;
[0038] Obtain the specified output probability corresponding to the specific answer;
[0039] A specified joint score is generated for the specified combination information pair based on the specified correlation score and the specified output probability.
[0040] Furthermore, the step of generating a specified joint score for the specified combined information pair based on the specified relevance score and the specified output probability specifically includes:
[0041] Obtain the preset joint computation algorithm;
[0042] The specified correlation score and the output probability are calculated and processed based on the joint calculation algorithm to obtain the corresponding calculation results;
[0043] The calculation result is used as the specified joint score for the specified combination of information pairs.
[0044] To address the aforementioned technical problems, this application also provides an artificial intelligence-based query processing device, which employs the following technical solution:
[0045] The first retrieval module is used to obtain the query information input by the user and retrieve the first document list corresponding to the query information from the pre-built knowledge base based on the preset inverted index retrieval strategy.
[0046] The second retrieval module is used to retrieve a second list of documents corresponding to the query information from the knowledge base based on a preset vector index retrieval strategy.
[0047] The filtering module is used to merge and sort the first text list and the second document list to filter out a preset number of specified documents;
[0048] The first processing module is used to construct answer suggestion words based on the specified document and the query information, and process the answer suggestion words based on a preset large language model to obtain an answer corresponding to the specified document;
[0049] The second processing module is used to construct relevance suggestion words based on the specified document and the query information, and process the relevance suggestion words based on the large language model to obtain the relevance score between the specified document and the query information;
[0050] The calculation module is used to construct corresponding combined information pairs based on the answer, the specified document, and the query information, and to calculate the joint score of the combined information pairs based on the relevance score;
[0051] The acquisition module is used to filter out the target combined information pair with the highest joint score from all the combined information pairs, and to acquire the target answer and target document in the target combined information pair;
[0052] The return module is used to return the target answer and the target document to the user.
[0053] To address the aforementioned technical problems, this application also provides a computer device that employs the following technical solution:
[0054] Obtain the query information input by the user, and retrieve the first document list corresponding to the query information from the pre-built knowledge base based on the preset inverted index retrieval strategy;
[0055] Based on a preset vector index retrieval strategy, a second list of documents corresponding to the query information is retrieved from the knowledge base.
[0056] The first text list and the second document list are merged and sorted to filter out a preset number of specified documents.
[0057] Based on the specified document and the query information, answer suggestion words are constructed, and the answer suggestion words are processed based on a preset large language model to obtain the answer corresponding to the specified document;
[0058] Based on the specified document and the query information, relevant prompt words are constructed, and the relevant prompt words are processed based on the large language model to obtain the relevance score between the specified document and the query information;
[0059] Based on the answer, the specified document, and the query information, construct corresponding combined information pairs, and calculate the joint score of the combined information pairs based on the relevance score;
[0060] Filter out the target combined information pair with the highest joint score from all the combined information pairs, and obtain the target answer and target document in the target combined information pair;
[0061] The target answer and the target document are returned to the user.
[0062] To address the aforementioned technical problems, this application also provides a computer-readable storage medium, employing the technical solution described below:
[0063] Obtain the query information input by the user, and retrieve the first document list corresponding to the query information from the pre-built knowledge base based on the preset inverted index retrieval strategy;
[0064] Based on a preset vector index retrieval strategy, a second list of documents corresponding to the query information is retrieved from the knowledge base.
[0065] The first text list and the second document list are merged and sorted to filter out a preset number of specified documents.
[0066] Based on the specified document and the query information, answer suggestion words are constructed, and the answer suggestion words are processed based on a preset large language model to obtain the answer corresponding to the specified document;
[0067] Based on the specified document and the query information, relevant prompt words are constructed, and the relevant prompt words are processed based on the large language model to obtain the relevance score between the specified document and the query information;
[0068] Based on the answer, the specified document, and the query information, construct corresponding combined information pairs, and calculate the joint score of the combined information pairs based on the relevance score;
[0069] Filter out the target combined information pair with the highest joint score from all the combined information pairs, and obtain the target answer and target document in the target combined information pair;
[0070] The target answer and the target document are returned to the user.
[0071] Compared with the prior art, the embodiments of this application have the following main advantages:
[0072] This application first obtains the query information input by the user, and retrieves a first document list corresponding to the query information from a pre-built knowledge base based on a preset inverted index retrieval strategy; and retrieves a second document list corresponding to the query information from the knowledge base based on a preset vector index retrieval strategy; then, the first document list and the second document list are merged and sorted to filter out a preset number of specified documents; then, answer prompts are constructed based on the specified documents and the query information, and the answer prompts are processed based on a preset large language model to obtain an answer corresponding to the specified document; subsequently, relevance prompts are constructed based on the specified document and the query information, and the relevance prompts are processed based on the large language model to obtain a relevance score between the specified document and the query information; further, corresponding combined information pairs are constructed based on the answer, the specified document, and the query information, and the joint score of the combined information pairs is calculated based on the relevance score; finally, the target combined information pair with the highest joint score is selected from all the combined information pairs, and the target answer and target document in the target combined information pair are obtained, and then the target answer and target document are returned to the user. In processing user-input query information, this application combines inverted index retrieval and vector index retrieval strategies to filter out a preset number of specified documents. Then, based on answer prompts, relevance prompts, and the use of a large language model, it generates an answer corresponding to the query information and evaluates the corresponding joint score. Based on the joint score, the optimal answer can be selected from multiple candidate answers and returned to the user, effectively improving the accuracy and relevance of the answer to the query information. Attached Figure Description
[0073] To more clearly illustrate the solutions in this application, the accompanying drawings used in the description of the embodiments of this application will be briefly introduced below. Obviously, the accompanying drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0074] Figure 1 This is an exemplary system architecture diagram to which this application can be applied;
[0075] Figure 2 A flowchart of an embodiment of the AI-based query processing method according to this application;
[0076] Figure 3 This is a schematic diagram of the structure of an embodiment of the AI-based query processing apparatus according to this application;
[0077] Figure 4 This is a schematic diagram of the structure of one embodiment of the computer device according to this application. Detailed Implementation
[0078] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application pertains; the terminology used herein in the specification of the application is for the purpose of describing particular embodiments only and is not intended to be limiting of the application; the terms "comprising" and "having," and any variations thereof, in the specification, claims, and foregoing drawings of this application, are intended to cover non-exclusive inclusion. The terms "first," "second," etc., in the specification, claims, or foregoing drawings of this application are used to distinguish different objects, not to describe a particular order.
[0079] In this document, the term "embodiment" means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.
[0080] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings.
[0081] like Figure 1 As shown, system architecture 100 may include terminal devices 101, 102, and 103, a network 104, and a server 105. Network 104 serves as the medium for providing communication links between terminal devices 101, 102, and 103 and server 105. Network 104 may include various connection types, such as wired or wireless communication links, or fiber optic cables, etc.
[0082] Users can use terminal devices 101, 102, and 103 to interact with server 105 via network 104 to receive or send messages, etc. Various communication client applications can be installed on terminal devices 101, 102, and 103, such as web browser applications, shopping applications, search applications, instant messaging tools, email clients, social media platform software, etc.
[0083] Terminal devices 101, 102, and 103 can be various electronic devices with displays and support web browsing, including but not limited to smartphones, tablets, e-book readers, MP3 players (Moving Picture Experts Group Audio Layer III), MP4 players (Moving Picture Experts Group Audio Layer IV), laptops, and desktop computers, etc.
[0084] Server 105 can be a server that provides various services, such as a backend server that supports the pages displayed on terminal devices 101, 102, and 103.
[0085] It should be noted that the AI-based query processing method provided in this application embodiment is generally executed by a server / terminal device, and correspondingly, the AI-based query processing device is generally set in the server / terminal device.
[0086] It should be understood that Figure 1 The number of terminal devices, networks, and servers shown is merely illustrative. Depending on implementation needs, any number of terminal devices, networks, and servers can be included.
[0087] Continue to refer to Figure 2 This document illustrates a flowchart of an embodiment of the AI-based query processing method according to this application. The order of steps in the flowchart can be changed, and some steps can be omitted, depending on different requirements. The AI-based query processing method provided in this application can be applied to any scenario requiring query processing, and thus can be applied to products in these scenarios, such as query processing in the financial and insurance fields. The AI-based query processing method includes the following steps:
[0088] Step S201: Obtain the query information input by the user, and retrieve the first document list corresponding to the query information from the pre-built knowledge base based on the preset inverted index retrieval strategy.
[0089] In this embodiment, the AI-based query processing method runs on an electronic device (e.g., Figure 1The server / terminal device shown can obtain the query information input by the user through wired or wireless connection. It should be noted that the aforementioned wireless connection methods may include, but are not limited to, 3G / 4G / 5G connections, Wi-Fi connections, Bluetooth connections, Wi-Fi connections, Zigbee connections, UWB (ultra-Width band) connections, and other currently known or future wireless connection methods. This application can be applied to the business scenario of unified search functions in financial enterprises, or it can also be applied to the business scenario of question retrieval of relevant documents. The aforementioned query information can be a question input by the user. The aforementioned knowledge base is a pre-built external knowledge base corresponding to the large language model. This knowledge base is independent of the large language model, and the knowledge base stores one piece of data per document. The specific implementation process of retrieving the first document list corresponding to the query information from the pre-built knowledge base based on the preset inverted index retrieval strategy will be further described in detail in subsequent specific embodiments of this application, and will not be elaborated upon here.
[0090] Step S202: Based on a preset vector index retrieval strategy, retrieve a second document list corresponding to the query information from the knowledge base.
[0091] In this embodiment, the specific implementation process of retrieving the second document list corresponding to the query information from the knowledge base based on the preset vector index retrieval strategy will be further described in detail in subsequent specific embodiments of this application, and will not be elaborated on here.
[0092] Step S203: Merge and sort the first text list and the second document list to filter out a preset number of specified documents.
[0093] In this embodiment, the specific implementation process of merging and sorting the first text list and the second document list to filter out a preset number of specified documents will be described in more detail in subsequent specific embodiments of this application, and will not be elaborated on here.
[0094] Step S204: Construct answer suggestion words based on the specified document and the query information, and process the answer suggestion words based on a preset large language model to obtain the answer corresponding to the specified document.
[0095] In this embodiment, the specific implementation process of constructing answer prompts based on the specified document and the query information, and processing the answer prompts based on a preset large language model to obtain the answer corresponding to the specified document will be further described in detail in subsequent specific embodiments of this application, and will not be elaborated on here.
[0096] Step S205: Construct relevant prompt words based on the specified document and the query information, and process the relevant prompt words based on the large language model to obtain the relevance score between the specified document and the query information.
[0097] In this embodiment, a relevant prompt word template can be pre-constructed according to the actual prompt word template construction requirements. Specifically, the template content of the relevant prompt word template includes: calculating the relevance between the question [q] and the document [d], with a score from 1 to 9, where a higher score indicates a higher relevance. [d]: (document text). [q]: (query text). By inputting the specified document and the query information into the corresponding positions in the relevant prompt word template, that is, inputting the specified document into the [d] position in the relevant prompt word template and inputting the query information into the [q] position in the relevant prompt word template, the relevant prompt words are obtained. Then, the large language model is called, and the relevant prompt words are input into the large language model. The large language model processes the relevant prompt words and receives the relevance score between the specified document and the query information output by the large language model. The large language model may return a score in text form or a text paragraph containing the score. Pre-written code can be called to parse this response, extract the corresponding relevance score, and store it. Additionally, if the large language model outputs the answer "Unable to answer," the relevance score is set to 0. Since the relevance score for the answer corresponding to "Unable to answer" is 0, the product is also 0, meaning the current answer should be rejected and will not be used in subsequent iterations.
[0098] Step S206: Construct corresponding combined information pairs based on the answer, the specified document, and the query information, and calculate the joint score of the combined information pairs based on the relevance score.
[0099] In this embodiment, the specific implementation process of calculating the joint score of the combined information pair based on the correlation score will be further described in detail in subsequent specific embodiments of this application, and will not be elaborated on here.
[0100] Step S207: Select the target combination information pair with the highest joint score from all the combined information pairs, and obtain the target answer and target document in the target combination information pair.
[0101] In this embodiment, the target combined information pair with the highest joint score can be selected from all the combined information pairs by traversing the joint score, and then the target answer and target document in the target combined information pair can be obtained.
[0102] Step S208: Return the target answer and the target document to the user.
[0103] In this embodiment, the target answer is taken as the final result corresponding to the query information entered by the user, and the target answer and the target document are returned to the user.
[0104] This application first obtains the query information input by the user, and retrieves a first document list corresponding to the query information from a pre-built knowledge base based on a preset inverted index retrieval strategy; and retrieves a second document list corresponding to the query information from the knowledge base based on a preset vector index retrieval strategy; then, the first document list and the second document list are merged and sorted to filter out a preset number of specified documents; then, answer prompts are constructed based on the specified documents and the query information, and the answer prompts are processed based on a preset large language model to obtain an answer corresponding to the specified document; subsequently, relevance prompts are constructed based on the specified document and the query information, and the relevance prompts are processed based on the large language model to obtain a relevance score between the specified document and the query information; further, corresponding combined information pairs are constructed based on the answer, the specified document, and the query information, and the joint score of the combined information pairs is calculated based on the relevance score; finally, the target combined information pair with the highest joint score is selected from all the combined information pairs, and the target answer and target document in the target combined information pair are obtained, and then the target answer and target document are returned to the user. In processing user-input query information, this application combines inverted index retrieval and vector index retrieval strategies to filter out a preset number of specified documents. Then, based on answer prompts, relevance prompts, and the use of a large language model, it generates an answer corresponding to the query information and evaluates the corresponding joint score. Based on the joint score, the optimal answer can be selected from multiple candidate answers and returned to the user, effectively improving the accuracy and relevance of the answer to the query information.
[0105] In some optional implementations, step S201, which involves retrieving a first list of documents corresponding to the query information from a pre-built knowledge base based on a preset inverted index retrieval strategy, includes the following steps:
[0106] The query information is segmented into words to obtain the corresponding query words.
[0107] In this embodiment, the above-mentioned word segmentation is the process of splitting the query information into independent words (or called terms), and at the same time storing the document IDs where each word appears. Specifically, word segmentation processing can be implemented through regular expressions, natural language processing libraries (such as NLTK, spaCy, etc.). Specifically, the process of building an inverted index for the knowledge base includes: 1. Initializing the data structure: Create a data structure (such as a hash table or dictionary) to store the inverted index. This structure maps terms to a list of document IDs that contain the term. Among them, read all the documents stored in the knowledge base in advance, and perform word segmentation processing on each document to split it into corresponding terms. In addition, stop words can also be removed from the documents to improve the retrieval efficiency. Specifically, those common words that are not very helpful for understanding the document content, such as "de", "shi", etc., can be removed. And perform word form reduction processing on the words, specifically reducing the words to their basic forms (stems or roots) to reduce the diversity of words and thus improve the retrieval accuracy. 2. Traversing the word segmentation results: For each document, traverse its word segmentation results. For each term, check whether it is already in the inverted index. If it is not in the inverted index, add the term to the index and initialize its corresponding list of document IDs to a list containing the current document ID. If it is in the inverted index, add the current document ID to the list of document IDs corresponding to the term. 3. Storing the inverted index: Save the built inverted index to disk or memory for subsequent retrieval use.
[0108] Based on the query word segmentation, perform an inverted index query process on the knowledge base to obtain the document relevance scores between the query word segmentation and each first document contained in the knowledge base.
[0109] In this embodiment, the process of the inverted index query process specifically includes: traversing each term in the query word segmentation. Look up the list of document IDs corresponding to each term in the inverted index of the knowledge base. For each term, collect its corresponding document IDs and calculate the relevance scores of these documents with the query information. Specifically, TF-IDF can be used to evaluate the importance of a term in a document. If a document appears in the document ID lists of multiple terms, accumulate its relevance score.
[0110] Sort all the first documents based on the document relevance scores to obtain the corresponding inverted index result list.
[0111] In this embodiment, the process of generating the inverted index result list includes: Sort all the documents according to the accumulated relevance scores. Create a list containing tuples of (document ID, accumulated score) and sort them in descending order of score, thus obtaining the above-mentioned inverted index result list.
[0112] Use the inverted index result list as the first document list.
[0113] This application performs word segmentation on the query information to obtain corresponding query words; then, based on the query words, it performs an inverted index query on the knowledge base to obtain document relevance scores between the query words and each first document contained in the knowledge base; subsequently, it sorts all the first documents based on the document relevance scores to obtain a corresponding inverted index result list; and finally, it uses the inverted index result list as the first document list. This application, by using an inverted index retrieval strategy and performing an inverted index retrieval on the knowledge base with the query information, can quickly and accurately retrieve relevant documents corresponding to the query information in the knowledge base and obtain a first document list based on keyword matching, improving the intelligence of the first document list generation and ensuring the data accuracy of the obtained first document list.
[0114] In some optional implementations of this embodiment, step S202 includes the following steps:
[0115] The query information is encoded based on a preset word embedding model to obtain the corresponding query vector.
[0116] In this embodiment, the selection of the word embedding model is not specifically limited and can be determined according to actual business needs. For example, models such as BERT, Word2Vec, and GLOWE can be used. The word vectors corresponding to the query information can be obtained by inputting the query information into the word embedding model, i.e., obtaining the query vector after encoding the query information. Specifically, the process of building a vector index for the knowledge base includes: 1. Encoding terms: Encoding each term in the document using the selected word embedding model. Specifically, the term is input into the model, and its corresponding word vector is obtained. 2. Vectorized storage: Using efficient vector search libraries such as Faiss to store the encoded word vectors. Faiss supports various index types, such as Flat Index and IVF (Inverted Flat Index with Quantization), which can be selected according to your specific needs. For document-level vectors, a vector representing the entire document is obtained by aggregating all word vectors in the document (e.g., by averaging, weighted averaging, TF-IDF weighting, etc.). These document vectors are then stored in the Faith index to obtain the corresponding vector indexes for subsequent vector similarity calculations.
[0117] Based on the query vector, a vector index query is performed on the knowledge base to obtain the similarity score between the query vector and each second document contained in the knowledge base.
[0118] In this embodiment, the vector index query processing specifically includes: using vector search libraries such as Fast, comparing the query vector with the document vectors stored in the index of the knowledge base; and calculating the similarity score between the query vector and each document vector based on vector similarity (such as cosine similarity).
[0119] All documents are sorted based on the similarity scores to obtain a corresponding list of vector index results.
[0120] In this embodiment, the process of generating the vector index result list includes: sorting the documents according to their similarity scores; and creating a list containing tuples of (document ID, similarity score), sorted in descending order of score, thereby obtaining the aforementioned vector index result list.
[0121] The list of vector index results is used as the second document list.
[0122] This application encodes the query information using a pre-defined word embedding model to obtain a corresponding query vector. Then, it performs a vector index query on the knowledge base based on the query vector to obtain a similarity score between the query vector and each second document contained in the knowledge base. Next, it sorts all documents based on the similarity scores to obtain a corresponding vector index result list. This vector index result list is then used as the second document list. This application, by using a vector index retrieval strategy and query information to perform vector index retrieval on the knowledge base, can quickly and accurately retrieve semantically similar documents from the knowledge base and obtain a second document list based on vector similarity. This improves the intelligence of the second document list generation and ensures the accuracy of the obtained second document list.
[0123] In some alternative implementations, step S203 includes the following steps:
[0124] The first document list and the second document list are merged to obtain the corresponding specified document list.
[0125] In this embodiment, the specified document list is obtained by merging the first document list and the second document list into a unified list. If a document appears in both the first document list and the second document list, all scores for that document are retained.
[0126] Get the first weight corresponding to the inverted index, and get the second weight corresponding to the vector index.
[0127] In this embodiment, the values of the first and second weights are not specifically limited and can be set according to actual business needs. Preferably, the weight of the inverted index is emphasized because words that completely repeat words in the knowledge base after query information segmentation are given first priority, followed by semantic similarity to the vector index. Therefore, the weight will favor the inverted index retrieval algorithm. For example, the first weight corresponding to the inverted index can be set to 0.6, and the second weight corresponding to the vector index can be set to 0.4.
[0128] Based on the first weight and the second weight, a preset calculation formula is used to calculate the relevance score and similarity score of each third document in the specified document list, so as to obtain the comprehensive score of each third document.
[0129] In this embodiment, the first weight corresponds to the document's relevance score, and the second weight corresponds to the document's similarity score. The calculation formula is specifically a weighted summation formula. The comprehensive score of each third document can be obtained by using the weighted summation formula to calculate the weighted sum of the relevance and similarity scores corresponding to each third document in the specified document list, based on the first and second weights.
[0130] Sort the third documents according to their overall scores from highest to lowest to obtain the corresponding sorted list.
[0131] Select the fourth document with the highest overall score from the sorted list and use it as the designated document.
[0132] In this embodiment, the specified documents can be obtained by selecting a predetermined number of documents with the highest overall scores from the sorted list. Alternatively, a list or set containing the IDs of these specified documents can be created for subsequent processing.
[0133] This application merges the first document list and the second document list to obtain a corresponding specified document list. Then, it obtains a first weight corresponding to the inverted index and a second weight corresponding to the vector index. Based on the first and second weights, it uses a preset calculation formula to calculate the relevance and similarity scores of each third document in the specified document list, obtaining a comprehensive score for each third document. Subsequently, it sorts the third documents according to their comprehensive scores from largest to smallest, obtaining a corresponding sorted list. Finally, it selects a preset number of fourth documents with the highest comprehensive scores from the sorted list and uses these fourth documents as the specified documents. This application achieves fast and accurate merging and sorting of the first text list and the second document list, while ensuring the accuracy of the obtained specified documents, by using the obtained first weight corresponding to the inverted index and the second weight corresponding to the vector index, and employing a preset calculation formula to calculate the relevance and similarity scores of each third document in the specified document list to obtain a comprehensive score for each third document, thereby selecting a preset number of fourth documents with the highest comprehensive scores as the specified documents.
[0134] In some optional implementations of this embodiment, step S204 includes the following steps:
[0135] Get the preset answer prompt template.
[0136] In this embodiment, an answer prompt template can be pre-built according to the actual prompt template construction requirements. Specifically, the template content of the answer prompt template includes: answer the question [q] from the content of document [d], and return [Unable to answer] if it cannot be answered. [d]: (document text). [q]: (query text).
[0137] The specified document and the query information are input into the answer prompt template to obtain the answer prompt.
[0138] In this embodiment, the answer prompt can be obtained by inputting the specified document and the query information into the corresponding positions in the answer prompt template, that is, by inputting the specified document into the [d] position in the answer prompt template and inputting the query information into the [q] position in the answer prompt template.
[0139] Invoke the large language model.
[0140] In this embodiment, the aforementioned large language model can specifically be ChatGPT.
[0141] The answer prompt words are input into the large language model, the large language model processes the answer prompt words, and the large language model outputs the answer corresponding to the specified document.
[0142] In this embodiment, the constructed answer prompts are submitted to a large language model, and the answers generated by the large language model for the answer prompts are collected. Furthermore, the association between the answer and the corresponding document and query information can be saved.
[0143] This application obtains a preset answer suggestion template; then inputs the specified document and the query information into the answer suggestion template to obtain the answer suggestion; subsequently, it calls the large language model; later, it inputs the answer suggestion into the large language model, processes the answer suggestion through the large language model, and receives the answer corresponding to the specified document output by the large language model. This application, based on the use of the answer suggestion template, can quickly and intelligently construct matching answer suggestion based on the specified document and the query information, improving the efficiency of answer suggestion construction. Furthermore, by using the large language model, it can quickly and accurately generate an answer corresponding to the specified document, ensuring the accuracy of the generated answer.
[0144] In some optional implementations of this embodiment, step S206, which involves calculating the joint score of the combined information pair based on the relevance score, includes the following steps:
[0145] Retrieves a specific answer, document, and query information contained in a specified combination of information pairs.
[0146] In this embodiment, the specified combination information is any one of all the combination information pairs.
[0147] Obtain a specified relevance score between the specific document and the query information.
[0148] In this embodiment, the specific relevance score between the specific document and the query information can be found from the relevance score between the specified document and the query information obtained by processing the relevance prompt words from the large language model.
[0149] Obtain the specified output probability corresponding to the specific answer.
[0150] In this embodiment, the specified output probability refers to the confidence level or probability corresponding to the large language model returning that specific answer. Specifically, it refers to the probability value of the large language model outputting a specific answer given the current query information, a specific document, and corresponding answer prompts.
[0151] A specified joint score is generated for the specified combination information pair based on the specified correlation score and the specified output probability.
[0152] In this embodiment, the specific implementation process of generating the specified joint score of the specified combination information pair based on the specified correlation score and the specified output probability will be further described in detail in subsequent specific embodiments of this application, and will not be elaborated on here.
[0153] This application obtains a specific answer, a specific document, and query information contained in a specified combination of information pairs; then obtains a specified relevance score between the specific document and the query information; subsequently obtains a specified output probability corresponding to the specific answer; and finally generates a specified joint score for the specified combination of information pairs based on the specified relevance score and the specified output probability. This application processes the specified relevance score between the specific document and the query information in the obtained specified combination of information pairs, as well as the obtained specified output probability corresponding to the specific answer, to achieve fast and accurate generation of a specified joint score for the specified combination of information pairs, ensuring the accuracy of the obtained joint score.
[0154] In some optional implementations of this embodiment, generating a specified joint score for the specified combined information pair based on the specified relevance score and the specified output probability includes the following steps:
[0155] Obtain the preset joint computation algorithm.
[0156] In this embodiment, the above-mentioned joint calculation algorithm specifically includes: Score = Pm(prc) * r_s(pqg), where, for each (answer a, document d, query information q) combined information pair, Score is the joint score, Pm(prc) is the confidence or probability corresponding to the large language model returning answer a, that is, the probability that the large language model generates the answer a, and r_s(pqg) is the relevance score between query information a and document d.
[0157] The specified correlation score and the output probability are calculated based on the joint calculation algorithm to obtain the corresponding calculation results.
[0158] In this embodiment, the corresponding calculation result can be obtained by substituting the specified correlation score and the output probability into the corresponding positions in the above-mentioned joint calculation algorithm.
[0159] The calculation result is used as the specified joint score for the specified combination of information pairs.
[0160] This application obtains a preset joint calculation algorithm; then, based on the joint calculation algorithm, it calculates the specified relevance score and the output probability to obtain the corresponding calculation result; subsequently, the calculation result is used as the specified joint score of the specified combined information pair. This application, by using a joint calculation algorithm to calculate the specified relevance score and specified output probability in a specified combined information pair, filters the responses contained in the specified combined information to evaluate their relevance and credibility, and can accurately generate the specified joint score for the specified combined information pair, effectively ensuring the accuracy of the obtained specified joint score.
[0161] It should be understood that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.
[0162] It should be emphasized that, to further ensure the privacy and security of the above-mentioned target answers, the above-mentioned target answers can also be stored in a node of a blockchain.
[0163] The blockchain referred to in this application is a novel application model of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanisms, and encryption algorithms. Essentially, a blockchain is a decentralized database, a chain of data blocks linked together using cryptographic methods. Each data block contains information about a batch of network transactions, used to verify the validity of the information (anti-counterfeiting) and generate the next block. A blockchain can include an underlying blockchain platform, a platform product service layer, and an application service layer.
[0164] The embodiments of this application can acquire and process relevant data based on artificial intelligence technology. Artificial intelligence (AI) is the theory, method, technology, and application system that uses digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, perceive the environment, acquire knowledge, and use that knowledge to obtain optimal results.
[0165] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by instructing related hardware through computer-readable instructions. These computer-readable instructions can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the methods described above. The aforementioned storage medium can be a non-volatile storage medium such as a magnetic disk, optical disk, or read-only memory (ROM), or random access memory (RAM).
[0166] It should be understood that although the steps in the flowcharts of the accompanying figures are shown sequentially as indicated by the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the accompanying figures may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily completed at the same time, but can be executed at different times, and their execution order is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the sub-steps or stages of other steps.
[0167] Further reference Figure 3 As a response to the above Figure 2 To implement the method shown, this application provides an embodiment of an artificial intelligence-based query processing device, which is similar to... Figure 2 Corresponding to the method embodiments shown, this device can be specifically applied to various electronic devices.
[0168] like Figure 3 As shown, the AI-based query processing device 300 described in this embodiment includes: a first retrieval module 301, a second retrieval module 302, a filtering module 303, a first processing module 304, a second processing module 305, a calculation module 306, an acquisition module 307, and a return module 308. Wherein:
[0169] The first retrieval module 301 is used to obtain the query information input by the user and retrieve the first document list corresponding to the query information from the pre-built knowledge base based on the preset inverted index retrieval strategy.
[0170] The second retrieval module 302 is used to retrieve a second document list corresponding to the query information from the knowledge base based on a preset vector index retrieval strategy.
[0171] The filtering module 303 is used to merge and sort the first text list and the second document list to filter out a preset number of specified documents;
[0172] The first processing module 304 is used to construct answer prompt words based on the specified document and the query information, and process the answer prompt words based on a preset large language model to obtain an answer corresponding to the specified document;
[0173] The second processing module 305 is used to construct relevance suggestion words based on the specified document and the query information, and process the relevance suggestion words based on the large language model to obtain a relevance score between the specified document and the query information.
[0174] The calculation module 306 is used to construct corresponding combined information pairs based on the answer, the specified document and the query information, and to calculate the joint score of the combined information pairs based on the relevance score;
[0175] The acquisition module 307 is used to filter out the target combined information pair with the highest joint score from all the combined information pairs, and to acquire the target answer and target document in the target combined information pair;
[0176] The return module 308 is used to return the target answer and the target document to the user.
[0177] In some optional implementations of this embodiment, the first retrieval module 301 includes:
[0178] The word segmentation submodule is used to perform word segmentation on the query information to obtain the corresponding query words;
[0179] The first query submodule is used to perform an inverted index query on the knowledge base based on the query word segmentation to obtain the document relevance score between the query word segmentation and each first document contained in the knowledge base;
[0180] The first sorting submodule is used to sort all the first documents based on the document relevance score to obtain a corresponding inverted index result list;
[0181] The first determining submodule is used to use the inverted index result list as the first document list.
[0182] In some optional implementations of this embodiment, the second retrieval module 302 includes:
[0183] The encoding submodule is used to encode the query information based on a preset word embedding model to obtain the corresponding query vector;
[0184] The second query submodule is used to perform vector index query processing on the knowledge base based on the query vector to obtain the similarity score between the query vector and each second document contained in the knowledge base;
[0185] The second sorting submodule is used to sort all documents based on the similarity score and obtain a corresponding list of vector index results.
[0186] The second determining submodule is used to use the vector index result list as the second document list.
[0187] In some optional implementations of this embodiment, the filtering module 303 includes:
[0188] The merging submodule is used to merge the first document list and the second document list to obtain the corresponding specified document list;
[0189] The first acquisition submodule is used to acquire the first weight corresponding to the inverted index and the second weight corresponding to the vector index;
[0190] The calculation submodule is used to calculate the relevance score and similarity score of each third document in the specified document list based on the first weight and the second weight, and by calling a preset calculation formula to obtain the comprehensive score of each third document.
[0191] The third sorting submodule is used to sort the third documents in descending order of their comprehensive scores to obtain the corresponding sorted list.
[0192] The filtering submodule is used to filter out a preset number of fourth documents with the highest comprehensive scores from the sorted list, and to use the fourth documents as the designated documents.
[0193] In some optional implementations of this embodiment, the first processing module 304 includes:
[0194] The second acquisition submodule is used to acquire preset answer prompt word templates;
[0195] The input submodule is used to input the specified document and the query information into the answer suggestion template to obtain the answer suggestion;
[0196] Call the submodule to invoke the large language model;
[0197] The receiving submodule is used to input the answer prompt words into the large language model, process the answer prompt words through the large language model, and receive the answer corresponding to the specified document output by the large language model.
[0198] In some optional implementations of this embodiment, the calculation module 306 includes:
[0199] The third acquisition submodule is used to acquire specific answers, specific documents and query information contained in a specified combination of information pairs; wherein, the specified combination of information is any one of the information pairs among all the combination of information pairs;
[0200] The fourth acquisition submodule is used to acquire a specified relevance score between the specific document and the query information;
[0201] The fifth acquisition submodule is used to acquire the specified output probability corresponding to the specific answer;
[0202] A generation submodule is used to generate a specified joint score for the specified combination information pair based on the specified correlation score and the specified output probability.
[0203] In some optional implementations of this embodiment, the generation submodule includes:
[0204] The acquisition unit is used to acquire a preset joint calculation algorithm;
[0205] The calculation unit is used to calculate and process the specified correlation score and the output probability based on the joint calculation algorithm to obtain the corresponding calculation result;
[0206] A determining unit is used to use the calculation result as the specified joint score of the specified combination information pair.
[0207] To address the aforementioned technical problems, embodiments of this application also provide a computer device. Please refer to [link / reference needed] for details. Figure 4 , Figure 4 This is a basic structural block diagram of the computer device in this embodiment.
[0208] The computer device 4 includes a memory 41, a processor 42, and a network interface 43 that are interconnected via a system bus. It should be noted that only the computer device 4 with components 41-43 is shown in the figure; however, it should be understood that it is not required to implement all the shown components, and more or fewer components can be implemented alternatively. Those skilled in the art will understand that the computer device described here is a device capable of automatically performing numerical calculations and / or information processing according to pre-set or stored instructions. Its hardware includes, but is not limited to, microprocessors, application-specific integrated circuits (ASICs), programmable gate arrays (FPGAs), digital digital processors (DSPs), embedded devices, etc.
[0209] The computer device can be a desktop computer, laptop, handheld computer, or cloud server, etc. The computer device can interact with the user via a keyboard, mouse, remote control, touchpad, or voice control.
[0210] The memory 41 includes at least one type of readable storage medium, including flash memory, hard disk, multimedia card, card-type memory (e.g., SD or DX memory), random access memory (RAM), static random access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, magnetic disk, optical disk, etc. In some embodiments, the memory 41 may be an internal storage unit of the computer device 4, such as the hard disk or memory of the computer device 4. In other embodiments, the memory 41 may also be an external storage device of the computer device 4, such as a plug-in hard disk, smart memory card (SMC), secure digital card (SD) card, flash card, etc. of the computer device 4. Of course, the memory 41 may also include both the internal storage unit and the external storage device of the computer device 4. In this embodiment, the memory 41 is typically used to store the operating system and various application software installed on the computer device 4, such as computer-readable instructions for query processing methods based on artificial intelligence. In addition, the memory 41 can also be used to temporarily store various types of data that have been output or will be output.
[0211] In some embodiments, the processor 42 may be a central processing unit (CPU), a controller, a microcontroller, a microprocessor, or other data processing chip. The processor 42 is typically used to control the overall operation of the computer device 4. In this embodiment, the processor 42 is used to execute computer-readable instructions stored in the memory 41 or to process data, for example, to execute computer-readable instructions of the AI-based query processing method.
[0212] The network interface 43 may include a wireless network interface or a wired network interface, which is typically used to establish communication connections between the computer device 4 and other electronic devices.
[0213] This application also provides another embodiment, namely, providing a computer-readable storage medium storing computer-readable instructions that can be executed by at least one processor to cause the at least one processor to perform the steps of the artificial intelligence-based query processing method described above.
[0214] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in the various embodiments of this application.
[0215] Obviously, the embodiments described above are only some embodiments of this application, not all embodiments. The accompanying drawings show preferred embodiments of this application, but do not limit the patent scope of this application. This application can be implemented in many different forms; rather, the purpose of providing these embodiments is to provide a more thorough and comprehensive understanding of the disclosure of this application. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art can still modify the technical solutions described in the foregoing specific embodiments, or make equivalent substitutions for some of the technical features. Any equivalent structures made using the content of this application's specification and drawings, directly or indirectly applied to other related technical fields, are similarly within the scope of patent protection of this application.
Claims
1. An artificial intelligence-based query processing method, characterized by, Includes the following steps: Obtain the query information input by the user, and retrieve the first document list corresponding to the query information from the pre-built knowledge base based on the preset inverted index retrieval strategy; Based on a preset vector index retrieval strategy, a second list of documents corresponding to the query information is retrieved from the knowledge base. The first document list and the second document list are merged and sorted to filter out a preset number of specified documents; Based on the specified document and the query information, answer suggestion words are constructed, and the answer suggestion words are processed based on a preset large language model to obtain the answer corresponding to the specified document; Based on the specified document and the query information, relevant prompt words are constructed, and the relevant prompt words are processed based on the large language model to obtain the relevance score between the specified document and the query information; Based on the answer, the specified document, and the query information, construct corresponding combined information pairs, and calculate the joint score of the combined information pairs based on the relevance score; Filter out the target combined information pair with the highest joint score from all the combined information pairs, and obtain the target answer and target document in the target combined information pair; The target answer and the target document are returned to the user; The step of calculating the joint score of the combined information pair based on the relevance score specifically includes: Retrieve a specific answer, a specific document, and query information contained in a specified combination of information pairs; wherein, the specified combination of information is any one of all the specified combination of information pairs; Obtain a specified relevance score between the specific document and the query information; Obtain the specified output probability corresponding to the specific answer; A specified joint score is generated for the specified combination information pair based on the specified correlation score and the specified output probability. 2.The AI-based query processing method of claim 1, wherein, The step of retrieving a first list of documents corresponding to the query information from a pre-built knowledge base based on a preset inverted index retrieval strategy specifically includes: The query information is segmented into words to obtain the corresponding query words; Based on the query word segmentation, an inverted index query is performed on the knowledge base to obtain the document relevance score between the query word segmentation and each first document contained in the knowledge base; All the first documents are sorted based on the document relevance scores to obtain the corresponding inverted index result list; The inverted index result list is used as the first document list. 3.The AI-based query processing method of claim 1, wherein, The step of retrieving a second list of documents corresponding to the query information from the knowledge base based on a preset vector index retrieval strategy specifically includes: The query information is encoded based on a preset word embedding model to obtain the corresponding query vector; Based on the query vector, a vector index query is performed on the knowledge base to obtain the similarity score between the query vector and each second document contained in the knowledge base; All documents are sorted based on the similarity scores to obtain a list of corresponding vector index results; The list of vector index results is used as the second document list. 4.The artificial intelligence-based query processing method of any one of claims 1 to 2, wherein, The step of merging and sorting the first document list and the second document list to filter out a preset number of specified documents specifically includes: The first document list and the second document list are merged to obtain the corresponding specified document list; Get the first weight corresponding to the inverted index, and get the second weight corresponding to the vector index; Based on the first weight and the second weight, a preset calculation formula is called to calculate the relevance score and similarity score of each third document in the specified document list, so as to obtain the comprehensive score of each third document. Sort the third documents according to their comprehensive scores from largest to smallest to obtain the corresponding sorted list; Select the fourth document with the highest overall score from the sorted list and use it as the designated document. 5.The artificial intelligence-based query processing method of claim 1, wherein, The step of constructing answer suggestion words based on the specified document and the query information, and processing the answer suggestion words based on a preset large language model to obtain the answer corresponding to the specified document, specifically includes: Get the preset answer prompt template; The specified document and the query information are input into the answer suggestion template to obtain the answer suggestion; Invoke the large language model; The answer prompt words are input into the large language model, the large language model processes the answer prompt words, and the large language model outputs the answer corresponding to the specified document. 6.The AI-based query processing method of claim 1, wherein, The step of generating a specified joint score for the specified combined information pair based on the specified relevance score and the specified output probability specifically includes: Obtain the preset joint computation algorithm; The specified correlation score and the output probability are calculated and processed based on the joint calculation algorithm to obtain the corresponding calculation results; The calculation result is used as the specified joint score for the specified combination of information pairs.
7. An artificial intelligence-based query processing apparatus, characterized by comprising: include: The first retrieval module is used to obtain the query information input by the user and retrieve the first document list corresponding to the query information from the pre-built knowledge base based on the preset inverted index retrieval strategy. The second retrieval module is used to retrieve a second list of documents corresponding to the query information from the knowledge base based on a preset vector index retrieval strategy. The filtering module is used to merge and sort the first document list and the second document list to filter out a preset number of specified documents; The first processing module is used to construct answer suggestion words based on the specified document and the query information, and process the answer suggestion words based on a preset large language model to obtain an answer corresponding to the specified document; The second processing module is used to construct relevance suggestion words based on the specified document and the query information, and process the relevance suggestion words based on the large language model to obtain the relevance score between the specified document and the query information; The calculation module is used to construct corresponding combined information pairs based on the answer, the specified document, and the query information, and to calculate the joint score of the combined information pairs based on the relevance score; The acquisition module is used to filter out the target combined information pair with the highest joint score from all the combined information pairs, and to acquire the target answer and target document in the target combined information pair; The return module is used to return the target answer and the target document to the user; The calculation module includes: The third acquisition submodule is used to acquire specific answers, specific documents and query information contained in a specified combination of information pairs; wherein, the specified combination of information is any one of the information pairs among all the combination of information pairs; The fourth acquisition submodule is used to acquire a specified relevance score between the specific document and the query information; The fifth acquisition submodule is used to acquire the specified output probability corresponding to the specific answer; A generation submodule is used to generate a specified joint score for the specified combination information pair based on the specified correlation score and the specified output probability.
8. A computer device comprising a memory and a processor, the memory storing computer-readable instructions, wherein the processor, when executing the computer-readable instructions, implements the steps of the query processing method based on artificial intelligence as described in any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-readable instructions, which, when executed by a processor, implement the steps of the query processing method based on artificial intelligence as described in any one of claims 1 to 6.