Multi-label generation matching rag intelligent question and answer method, device, equipment and medium

By constructing a vector database of document text tag data and analyzing large language models, the problem of inaccurate answers in intelligent question answering systems under specific scenarios was solved, achieving more efficient information retrieval and answer generation, and improving the system's adaptability and accuracy.

CN119739838BActive Publication Date: 2026-05-12NORTHKING INFORMATION TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
NORTHKING INFORMATION TECH CO LTD
Filing Date
2025-03-03
Publication Date
2026-05-12

AI Technical Summary

Technical Problem

Existing intelligent question answering systems suffer from limitations in the accuracy and relevance of vector retrieval, which are constrained by the quality and quantity of training data. This makes it difficult to accurately understand user intent in specific application scenarios, resulting in inaccurate or irrelevant generated answers, thus limiting their application scope and effectiveness.

Method used

By constructing a vector database of document text tag data, information relevant to user needs can be quickly found. This information is then analyzed and summarized using a large language model. Combined with vector retrieval functionality, the granularity and accuracy of retrieval results are improved. By customizing data sources and data tags according to business scenarios, answers to user questions can be generated.

Benefits of technology

It improves the accuracy and adaptability of intelligent question-answering systems in specific scenarios, enabling more precise identification of user intent, rapid retrieval of relevant answers from massive amounts of data, reduced reliance on large amounts of high-quality training data, and enhanced stability and scalability of the question-answering system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119739838B_ABST
    Figure CN119739838B_ABST
Patent Text Reader

Abstract

The application discloses a multi-label generation matching RAG intelligent question and answer method and device, equipment and medium, wherein the method comprises: obtaining original text data corresponding to a target business scenario, and performing vectorization processing on the original text data to determine a to-be-processed text data set; determining a text label set corresponding to the to-be-processed text data set, and establishing a text vector database based on the text label set and the to-be-processed text data set; in the case that a to-be-processed question is received, determining a question text label and a question text vector corresponding to the to-be-processed question; determining to-be-applied text from the text vector database based on the to-be-processed question text, the question text label and the question text vector; and generating a target question answer corresponding to the to-be-processed question according to the to-be-applied text and a preset prompt word template. The above technical solution combines vector retrieval functions according to business scenario customized data sources and data labels, and significantly improves the fine granularity and accuracy of the retrieval result.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of computer technology, and in particular to a method, apparatus, device, and medium for multi-tag generation and matching of RAG intelligent question answering. Background Technology

[0002] Intelligent question answering identifies the intent in user input text, performs efficient retrieval in a vector library built from a large-scale dataset, and utilizes a large language model to comprehensively analyze and summarize user queries and retrieval results, ultimately generating answers that conform to natural language habits. The existing question answering process includes source data acquisition, data parsing and segmentation, vectorization processing, vector library construction, user query vectorization, vector search, result processing and ranking, and answer generation and output.

[0003] However, the accuracy and relevance of vector retrieval are often limited by the quality and quantity of training data, and it is difficult to adjust or customize flexibly. Traditional question answering solutions mainly rely on vector retrieval technology, which makes it impossible to accurately understand user intent in specific application scenarios, resulting in inaccurate or irrelevant answers. This limits the application scope and effectiveness of existing intelligent question answering systems. Summary of the Invention

[0004] This invention provides a multi-tag generation and matching RAG intelligent question answering method, device, equipment, and medium. By constructing a vector database of document text tag data, it quickly finds information related to user needs and uses a large language model for analysis and summarization to return answers to user questions. By customizing data sources and data tags according to business scenarios and combining vector retrieval functions, it improves the granularity and accuracy of retrieval results.

[0005] According to one aspect of the present invention, a multi-tag generation matching RAG intelligent question answering method is provided, comprising:

[0006] Obtain the original text data corresponding to the target business scenario, and perform vectorization processing on the original text data to determine the text dataset to be processed;

[0007] Determine a text tag set corresponding to the text dataset to be processed, and establish a text vector database based on the text tag set and the text dataset to be processed;

[0008] Upon receiving a problem to be processed, determine the problem text tag and problem text vector corresponding to the problem to be processed;

[0009] The text to be applied is determined from the text vector database based on the problem text to be processed, the problem text tag, and the problem text vector;

[0010] Based on the text to be applied and the preset prompt word template, generate the target question answer corresponding to the question to be processed.

[0011] According to another aspect of the present invention, a multi-tag generation matching RAG intelligent question-answering device is provided, comprising:

[0012] The text data processing module is used to acquire raw text data corresponding to the target business scenario, and to perform vectorization processing on the raw text data to determine the text dataset to be processed.

[0013] The vector database establishment module is used to determine the text tag set corresponding to the text dataset to be processed, and to establish a text vector database based on the text tag set and the text dataset to be processed.

[0014] The problem text processing module is used to determine the problem text tag and problem text vector corresponding to the problem when a problem to be processed is received;

[0015] The text to be applied determination module is used to determine the text to be applied from the text vector database based on the problem text to be processed, the problem text label, and the problem text vector;

[0016] The question-answer generation module is used to generate a target question answer corresponding to the question to be processed based on the text to be applied and the preset prompt word template.

[0017] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising:

[0018] At least one processor; and

[0019] A memory communicatively connected to the at least one processor; wherein,

[0020] The memory stores a computer program that can be executed by the at least one processor, the computer program being executed by the at least one processor to enable the at least one processor to execute the multi-tag generation matching RAG intelligent question answering method according to any embodiment of the present invention.

[0021] According to another aspect of the present invention, a computer-readable storage medium is provided, the computer-readable storage medium storing computer instructions for causing a processor to execute and implement the multi-tag generation matching RAG intelligent question answering method according to any embodiment of the present invention.

[0022] The technical solution of this invention involves acquiring raw text data corresponding to a target business scenario, vectorizing the raw text data to determine a text dataset to be processed, and determining a text tag set corresponding to the text dataset to be processed. Based on the text tag set and the text dataset to be processed, a text vector database is established. Then, upon receiving a question to be processed, the question text tag and question text vector corresponding to the question to be processed are determined. Based on the question text to be processed, the question text tag, and the question text vector, the text to be applied is retrieved from the text vector database. Based on the text to be applied and a preset prompt word template, a target question answer corresponding to the question to be processed is generated. Based on the above technical solution, by constructing a vector library of document text tag data, information related to user needs can be quickly found, and large language models are used for analysis and summarization to return answers to user questions. Furthermore, by customizing data sources and data tags according to business scenarios and combining vector retrieval functions, the granularity and accuracy of retrieval results are improved.

[0023] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of the present invention, nor is it intended to limit the scope of the invention. Other features of the invention will become readily apparent from the following description. Attached Figure Description

[0024] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0025] Figure 1 This is a flowchart of a multi-tag generation matching RAG intelligent question answering method provided by an embodiment of the present invention;

[0026] Figure 2 This is a flowchart illustrating the process of determining a set of text tags for text data according to an embodiment of the present invention;

[0027] Figure 3 This is a flowchart of a multi-tag generation and matching RAG intelligent question answering method provided in an embodiment of the present invention;

[0028] Figure 4 This is a flowchart of a multi-tag generation matching RAG intelligent question answering method provided by an embodiment of the present invention;

[0029] Figure 5 This is a schematic diagram of the structure of a multi-tag generation and matching RAG intelligent question-answering device provided in an embodiment of the present invention;

[0030] Figure 6 This is a schematic diagram of the structure of the electronic device provided in an embodiment of the present invention. Detailed Implementation

[0031] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.

[0032] It should be noted that in the specification, claims, and accompanying drawings of this invention, the terms "first," "second," etc., are used only to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0033] Example 1

[0034] Figure 1 This is a flowchart illustrating a multi-tag generation and matching RAG intelligent question-answering method provided in an embodiment of the present invention. This embodiment is applicable to constructing a vector library of document text tag data, quickly finding information related to user needs, and using a large language model for analysis and summarization to return answers to user questions. This method can be executed by a multi-tag generation and matching RAG intelligent question-answering device, which can be implemented in hardware and / or software and can be configured in an electronic device. Figure 1 As shown, the method includes:

[0035] S110. Obtain the original text data corresponding to the target business scenario, and perform vectorization processing on the original text data to determine the text dataset to be processed.

[0036] The target business scenario can be understood as a business scenario related to user needs. Users can determine the business scenario for which a text vector database needs to be built based on their needs, such as a financial Q&A assistant or a company legal assistant. The original text data can be unprocessed text data, such as company expense reimbursement policy documents or company recruitment policy documents. The text dataset to be processed can be understood as a data set consisting of text vectors from multiple text blocks obtained after processing the original text data. It should be noted that Retrieval-augmented Generation (RAG) combines language modeling and information retrieval techniques. That is, when the model needs to generate text or answer questions, it first retrieves relevant information from the document set and then uses the retrieved information to guide text generation, thereby improving the quality and accuracy of predictions. The technical solution of this invention improves retrieval accuracy by combining RAG technology.

[0037] Specifically, relevant business data and tag data are collected and integrated in a targeted manner based on usage scenarios and user needs. Depending on the usage scenario, the required question-and-answer data files and category tags (such as travel expense reimbursement, invoice management, etc.) are collected. Furthermore, specific tag information (such as user permissions, access levels, etc.) can be collected based on user needs. It should be noted that the raw text data can include different data types, including but not limited to structured and unstructured data. File formats may include TXT, Doc, Docx, etc. The extracted raw text data is then vectorized to obtain a corresponding text dataset for processing.

[0038] Based on the above technical solution, the step of vectorizing the original text data to determine the text dataset to be processed includes: determining the text format corresponding to the original text data; extracting text content from the original text data according to the text format; segmenting the text content according to the segmentation identifier; determining each text block corresponding to the text content; and assigning a text block identifier to each text block; and determining the text dataset to be processed based on each text block and the text block identifier assigned to each text block.

[0039] The text format can be the original text data file format, including formats such as DOCX, PDF, and XLSX. The text content can be understood as the text information within the original text data. The delimiter can be a pre-set identifier used to segment the text, and can use various text symbols, such as periods and question marks, as delimiters. A text block can be a text segment that is processed as a whole after being marked. A text block identifier can be understood as an identifier used to uniquely identify a text block, such as a numeric ID.

[0040] Specifically, after text parsing, text segmentation, vectorization, and label extraction and annotation of the collected data, the text blocks, semantic vectors, and label sets are stored in a vector database for subsequent multi-path retrieval based on user questions. This serves as knowledge input for the large language model to generate answers. For example, the format of the text material is first identified, and different tools are used to identify and extract text content according to different formats. For instance, for PDF documents, PDFMiner or PyPDF2 libraries can be used for text extraction; while for Word documents, the python-docx library can be used to read the content. The system also needs to handle text information in images and tables that may exist in the document. Various text symbols (such as periods, question marks, etc.) are used as segmentation markers, and the text content is subdivided into smaller text blocks through recursive loops and dynamic segmentation strategies until the preset segmentation requirements are met. It should be noted that each segmented text block is assigned a unique identifier (ID) for subsequent processing and traceability. The final structured data format is [{"id":id_1,"data":text block_1},{"id":id_2,"data":text block_2},...,{"id":id_n,"data":text block_n}], where each element is a dictionary containing the text block ID and its content. Furthermore, pre-trained word embedding models based on supervised learning and contrastive learning (such as BERT, RoBERTa, etc.) are used to vectorize the segmented text data. Each text block can be input into the embedding model to generate a corresponding high-dimensional vector representation. This process captures the semantic information in the text. Subsequently, the generated vectors, along with text identifiers and the original text blocks, are stored in a vector database to ensure efficient retrieval and matching of relevant information in subsequent searches. The processed data structure becomes [{"id":id_1,"data":text_block_1,"vector":vector_1},{"id":id_2,"data":text_block_2,"vector":vector_2},...,{"id":id_n,"data":text_block_n,"vector":vector_n}].

[0041] S120. Determine the text tag set corresponding to the text dataset to be processed, and establish a text vector database based on the text tag set and the text dataset to be processed.

[0042] The text tag set can be a dataset consisting of tags corresponding to text data. A text vector database is a database used to store text blocks, semantic vectors, and tag sets, and supports efficient querying and retrieval.

[0043] Specifically, after extracting and labeling the segmented text, the text block data is bound to its corresponding label set based on the unique ID of each text block. This adds an extra dimension of information to each data entry, helping to improve query efficiency and accuracy. The final data format is as follows: [{"id":id_1,"data":text_block_1,"vector":vector_1,"label":[label_1,label_2,...,label_n]},{"id":id_2,"data":text_block_2,"vector":vector_2,"label":[label_1,label_2,...,label_n]},...,{"id":id_n,"data":text_block_n,"vector":vector_n,"label":[label_1,label_2,...,label_n]}]. Then, a suitable vector database is selected based on project requirements, such as PostgreSQL, Elasticsearch, or a dedicated vector search engine (such as Faiss). The processed data entries are then stored in the selected vector database. By using the indexing structure and query algorithms in vector databases or vector search engines, the system can ensure that it can quickly respond to users' search requests and provide accurate results matching.

[0044] Based on the above technical solution, determining the text tag set corresponding to the text dataset to be processed includes: when there is a preset text tag set corresponding to the original text data, inputting the text dataset to be processed and the preset text tag set into a preset semantic retrieval model to obtain a candidate text tag set; inputting the candidate text tag set and the text dataset to be processed into a large language model to determine the text tag set corresponding to the text dataset to be processed.

[0045] The preset text tag set can be a pre-established tag set corresponding to the original text. This preset text tag set can be obtained by manually annotating the original text, or it can be a set of text tags obtained by processing the original text through a pre-trained semantic recognition model. The preset semantic retrieval model can be a pre-trained large language model used for retrieval based on text semantics.

[0046] Specifically, when a pre-defined set of text labels corresponding to the original text data exists, the text dataset to be processed and the pre-defined text label set are input together into a pre-defined semantic retrieval model. The pre-defined semantic retrieval model, based on the semantic similarity between text content, retrieves the most relevant labels to the text dataset from the pre-defined label set, thereby generating a candidate text label set containing labels highly relevant to the text dataset. Next, the candidate text label set and the text dataset to be processed are input into a large language model, such as GPT-4 or BERT, to determine the most accurate text labels. For example, ... Figure 2 As shown, with a pre-set candidate tag library, a pre-trained semantic retrieval model is used to initially filter question text or knowledge text fragments. The model recalls the most relevant candidate prompts from a large number of pre-set candidate tags. Subsequently, specialized tag filtering prompts are constructed, and the recalled candidate tag set along with the question text or knowledge text is input into a large language model to accurately locate the correct tag to be used. The model also supports the generation of hierarchical, multi-level tag structures, ensuring that each tag accurately reflects the core content of the document or sentence.

[0047] Based on the above technical solution, determining the text tag set corresponding to the text dataset to be processed includes: when there is no preset text tag set corresponding to the original text data, constructing tag extraction prompts corresponding to the text dataset to be processed; inputting the tag extraction prompts and the text dataset to be processed into a large language model to determine the text tag set corresponding to the text dataset to be processed.

[0048] Among them, the tag extraction prompt is a prompt used to instruct the large language model to extract tags. This tag extraction prompt can be a prompt corresponding to the target business scenario.

[0049] Specifically, in the absence of a pre-defined text tag set, tag extraction prompts are constructed. These prompts are phrases or questions relevant to the content of the text dataset and capable of guiding the large language model to generate relevant tags. For example, if the text dataset is about technology news, tag extraction prompts could include "What is the topic of this news article?" or "What technical fields are involved?" These constructed prompts, along with the text dataset, are then input into the large language model, which generates candidate tags based on the input prompts and text content. For instance, in the absence of a pre-defined text tag set corresponding to the original text data, specific tag extraction prompts are constructed and input into the large language model, combined with user-provided question text or knowledge text fragments. The large language model extracts the most relevant category and content tags based on this information. This process supports generating hierarchical, multi-level tag systems based on documents, text blocks, and even individual sentences. The extracted tags are then bound to the original question text or knowledge text block for further processing.

[0050] It should be noted that when a custom tag is detected for a specific document, custom annotation of the document data can be achieved based on the custom tag. For example, when processing data containing sensitive information, related permission management tags can be automatically generated and these tags can be accurately attached to the corresponding question text or knowledge text block ID.

[0051] S130. Upon receiving a problem to be processed, determine the problem text label and problem text vector corresponding to the problem to be processed.

[0052] Here, the problem to be processed can be a question input by the user that is related to the target business scenario. The problem text label can be understood as the text label obtained by extracting the label from the problem text to be processed. Correspondingly, the problem text vector can be the text vector corresponding to the problem text after vectorization processing.

[0053] Specifically, upon receiving a problem to be processed, a deep understanding and analysis of the problem is conducted. This involves identifying the problem's theme, key information, and problem type, and then extracting the most representative keywords or phrases. These extracted keywords are then matched against an existing tag library, selecting the most suitable tag. The problem is then cleaned (e.g., removing stop words and punctuation), segmented, stemmed, or lemmatized. Methods such as the bag-of-words model, TF-IDF, and word embeddings (e.g., Word2Vec, GloVe, BERT) are used to convert the text into feature vectors. Finally, the determined problem text tags and the generated problem text vectors are integrated to form a complete problem representation, which includes both the semantic information and numerical features of the problem. It should be noted that the above methods for processing problem text are also applicable to processing document data.

[0054] S140. Determine the text to be applied from the text vector database based on the problem text to be processed, the problem text label, and the problem text vector.

[0055] The question text to be processed can be the text data of the question. The application text is the text used to construct the answer corresponding to the question.

[0056] Specifically, similarity metrics such as cosine similarity, Euclidean distance, and Manhattan distance can be used to calculate the similarity between the text vector of the problem to be processed and the text vectors in the database. Based on a pre-set similarity threshold, the text most similar to the problem can be selected. Furthermore, based on the similarity calculation, the results can be further filtered using the problem text tags. For example, if the problem tag is "machine learning algorithm," then only text in the database also labeled "machine learning algorithm" can be considered. The texts in the database can be sorted according to the similarity score and tag filtering results, and the text that best meets the requirements of the problem can be selected as the application text.

[0057] S150. Generate a target question answer corresponding to the question to be processed based on the text to be applied and the preset prompt word template.

[0058] The preset prompt template can be a pre-set prompt corresponding to the business scenario.

[0059] Specifically, depending on the usage scenario, a pre-set prompt word template is used to combine the user's question with the text to be applied to generate the corresponding answer. The text to be applied is formatted using the pre-set prompt word template to generate the target question answer corresponding to the question to be processed. It should be noted that the answer generation prompt word template, as a basic architecture, needs to be written in advance according to the specific application scenario. This template aims to accommodate the user's question and relevant text blocks retrieved from the knowledge base. By reasonably filling in these contents, a complete and structured prompt word is formed to ensure that the large language model can accurately understand and respond to the user's query needs. After the constructed answer generation prompt word is input into the large language model, based on the user's question and its related background knowledge, a comprehensive analysis is performed to generate an accurate and comprehensive answer.

[0060] Based on the above technical solution, the step of generating a target question answer corresponding to the question to be processed according to the text to be applied and the preset prompt word template includes: obtaining a preset prompt word template corresponding to the target business scenario; generating prompt words for the answer according to the preset prompt word template and the text to be applied; inputting the prompt words for the answer generation into a large language model to generate a target question answer corresponding to the question to be processed.

[0061] Specifically, appropriate preset prompt word templates are selected or constructed based on the target business scenario. These templates are typically designed based on business logic, common question types, or historical data analysis to guide the large language model in generating answers that conform to a specific format or style. For example, for a customer consultation scenario, the template might include phrases like "Based on the information provided, your answer is..." or "Regarding your question, the solution is...". The text to be applied is then combined with the preset prompt word templates to generate answer generation prompts. Key information from the text to be applied can be inserted into the corresponding positions in the template, or the text to be applied can be appropriately rewritten according to the structure and style of the template. The generated answer generation prompts are then input into the pre-trained large language model. Large language models, such as the GPT series (GPT-3, GPT-4, etc.), will generate the target question answer corresponding to the question to be processed based on the answer generation prompts.

[0062] Can be combined Figure 3 The technical solutions provided in the embodiments of the present invention will be further described, such as... Figure 3 As shown, firstly, business data is acquired based on the current usage scenario. This data is then parsed, including text parsing, document segmentation, text tag extraction and annotation, and text block vectorization. The final text blocks, vector blocks, and tag sets are stored together in a vector database. Next, the user inputs a question. The question is then segmented, tagged, and vectorized. A multi-path search is performed in the vector database to retrieve relevant text blocks. Finally, these blocks are combined with pre-set prompts and sent to a large language model to generate the final answer.

[0063] The technical solution of this invention involves acquiring raw text data corresponding to a target business scenario, vectorizing the raw text data to determine a text dataset to be processed, and determining a text tag set corresponding to the text dataset to be processed. A text vector database is established based on the text tag set and the text dataset to be processed. Upon receiving a question to be processed, question text tags and question text vectors corresponding to the question are determined. Based on the question text, the question text tags, and the question text vectors, the text to be applied is determined from the text vector database. Finally, a target question answer corresponding to the question to be processed is generated based on the text to be applied and a preset prompt word template. Based on the above technical solution, by constructing a vector library of document text tag data, information related to user needs can be quickly found. This information is then analyzed and summarized using a large language model to return an answer to the user's question. By customizing data sources and data tags according to the business scenario and combining vector retrieval functionality, the granularity and accuracy of the retrieval results are improved.

[0064] Example 2

[0065] Figure 4 This is a flowchart of a multi-tag generation and matching RAG intelligent question answering method provided by an embodiment of the present invention. This embodiment further refines the technical solution based on the above technical solution, specifically the method for determining the text to be applied from the text vector database based on the question text to be processed, the question text tags, and the question text vector. For example... Figure 4 As shown, the method includes:

[0066] S210. Calculate the relevance score between the text to be processed and each text block in the text vector database based on a preset text matching algorithm, and determine the set of text blocks to be processed corresponding to the text to be processed from the text vector database according to the relevance score.

[0067] The preset text matching algorithm can be a pre-set algorithm for calculating text similarity, such as cosine similarity, Jaccard similarity, edit distance (such as Levenshtein distance), BM25 algorithm, etc.

[0068] Specifically, using the selected text matching algorithm, the relevance score between the question text and each text block in the text vector database is calculated. The relevance score is a value between 0 and 1, representing the similarity or matching degree between two text blocks. Depending on specific needs, a threshold for the relevance score can be set; only text blocks with scores higher than this threshold will be selected. Alternatively, all text blocks can be sorted according to their relevance scores, and the top N text blocks with the highest scores can be selected as the set of text blocks to be processed. For example, specifically, text block data is retrieved from the vector database based on the user's question. The BM25 algorithm can be used for retrieval. Where: -(Q) represents the query statement; -(D) represents the document; -(q_i) represents the i-th word in the query statement; -(n) is the total number of words in the query statement; -(|D|) is the document length; -(text{avgdl}) is the average length of documents in the document set; -(IDF(q_i)) is the inverse document frequency, used to measure the importance of a word in the document set. The formula for calculating (IDF(q_i)) is: [IDF(q_i)=logleft(frac{N}{text{df}(q_i)}+1right)] where (N) is the total number of documents, (text{df}(q_i)) is the number of documents containing the word (q_i); -(f(q,D)) is the term frequency (TF), representing the number of times the i-th word appears in the document, used to measure the importance of a word in the document; -(k_1) and (b) are adjustment parameters, controlling the impact of the number of individual words in the document and the document length, respectively. The text blocks are then sorted according to the retrieval scores calculated by the above formula, and the text block ID ranking is obtained. These text blocks will serve as the basis for generating subsequent answers.

[0069] S220. Based on the question text tag, filter out the text blocks to be verified that match the question text tag from the text vector database, and calculate the relevance score between the question text to be processed and the text blocks to be verified according to the preset text matching algorithm. Based on the relevance score, determine the set of text blocks to be processed corresponding to the question text to be processed from the text blocks to be verified.

[0070] The text block to be verified can be a text block that matches the problem text label and is selected from a text vector database by tag matching.

[0071] Specifically, based on the question text tag, text blocks that match the question text tag are filtered from the text vector database and used as text blocks to be verified. The relevance score between the question text to be processed and the text blocks to be verified is calculated according to a preset text matching algorithm. Then, based on the relevance score, a set of text blocks to be processed with higher relevance scores is further filtered from the text blocks to be verified. For example, the text blocks to be verified can be sorted in descending order according to the calculated relevance score, and the set of text blocks to be processed can be selected according to the sorting result based on the preset number of text blocks to be selected, and the text block ID of each text block in the set of text blocks to be processed can be obtained.

[0072] It should be noted that, in another possible implementation, the set of text blocks to be processed corresponding to the problem text tag can also be determined from the text vector database based on the number of tag matches between each text block in the text vector database and the problem text tag.

[0073] The tag matching count can be the number of tags that match the tags in the text block with the tag in the question.

[0074] Specifically, for each text block in the text vector database, the number of tag matches between it and the question text tags is calculated. For example, the set of tags carried by the text block and the question are compared to find the number of common tags. Based on the determined filtering criteria, the text blocks with the highest number of matches with the question text tags are selected from the text vector database to form a set of text blocks to be processed. For example, based on the tags of the user's question, matching tag data is retrieved from the vector database. The text blocks are sorted according to the number of matches between each text block and the user's question tags, and their ID ranking is obtained.

[0075] S230. Calculate the vector similarity between each text block in the text vector database and the problem text vector based on the vector search engine, and determine the set of text blocks to be processed corresponding to the problem text vector from the text vector database based on the vector similarity.

[0076] Vector similarity can be understood as a score representing the degree of similarity between the question text vector and the text block vector.

[0077] Specifically, using the similarity calculation functions provided by the vector search engine, such as cosine similarity, Euclidean distance, and dot product, the similarity between the question text vector and each text block vector in the text vector database is calculated. Based on a determined filtering threshold or ranking result, the text blocks most relevant to the question text vector are selected from the text vector database to form a set of text blocks to be processed. For example, the vector representation of the user's question is used to search for the semantically most similar text block vector in the vector database. The similarity between vectors is calculated using the vector retrieval engine in the database, and the results are sorted from high to low according to the similarity score, ultimately obtaining the text block ID ranking.

[0078] S240. Determine the text to be applied based on the set of text blocks to be processed.

[0079] Based on the above technical solution, determining the text to be applied based on the set of text blocks to be processed includes: determining the text block identifier corresponding to each text block in the set of text blocks to be processed, and performing deduplication processing on the set of text blocks to be processed according to the text block identifier; determining the comprehensive score of each text block in the set of text blocks to be processed after deduplication according to the comprehensive scoring algorithm, determining the target text block from the set of text blocks to be processed according to the comprehensive score; and obtaining the text to be applied from the text vector database based on the text block identifier of the target text block.

[0080] The text block identifier can be a numerical identifier corresponding to each text block in the vector database. The comprehensive scoring algorithm can be an algorithm used to determine the comprehensive matching score corresponding to each text block.

[0081] Specifically, combining the multi-path retrieval results obtained from the above steps, the set of text blocks to be processed is first deduplicated across all text block IDs in the set. Then, the RFF algorithm is used to rank the text blocks from each retrieval path. The formula for the RFF algorithm is as follows: Where: -(RRF_w(d)) represents the weighted multi-path retrieval score. -(sum_{rinR}) represents the summation of all retrieval paths (r). -(w_r) is the weight assigned to the (r)th retrieval path, used to adjust the importance of different retrieval paths in the final result. -(frac{1}{k+r(d)}) is the inverse ranking score of each retrieval path in the original RFF algorithm, where (k) is a constant, and (r(d)) represents the ranking of document (d) in the (r)th retrieval path. -(k_1in[1.2,2.0]) adjusts the text frequency scale of feature words. The larger the value of (k_1), the greater the influence of the original word frequency on the relevance; -(b) is called the document length normalization factor. The larger the value of (b), the greater the influence of the document length on the relevance. The comprehensive score of each text block is calculated using this formula, and the top K text block IDs are selected according to the preset TOP_K number, and the corresponding text content is recalled as the final retrieval result.

[0082] It should be noted that, based on the above technical solutions, in order to further optimize the quality of search results and response speed, Reranker can be selected to work before or after the RFF algorithm, depending on the needs. When Reranker is before RFF, it can be used to rearrange the search results in each search path first, and then the rearranged results of each path are sent to the RFF algorithm for comprehensive ranking. It should be noted that the configuration of Reranker before RFF is suitable for users who want to obtain more content. By applying Reranker independently on each search path, the quality of the results of each search path can be adjusted more finely.

[0083] When Reranker is used after RFF, the RFF algorithm is used to perform a comprehensive ranking of the search results for all paths. Then, after the comprehensive ranking, Reranker is used to re-rank the results after the RFF comprehensive ranking. It should be noted that the configuration of Reranker after RFF is suitable for users who want to obtain high-quality results faster. By reducing the amount of data processed by Reranker, the system response speed can be significantly improved.

[0084] Based on the above technical solutions, the Reranker used in these solutions is further explained, including: Statistical Reranker (RFF), which recalculates all results by aggregating candidate result lists from multiple sources and using a weighted score of multi-way recall or a reverse ranking fusion (RRF) algorithm. The formula is: [\text{NewScore}(d)=\sum_{r\inR}w_r' \cdot \frac{1}{k'+r'(d)} ] where: - ( w_r') is the weight assigned to the (r)th retrieval path. -(k' ) is a constant, and ( r'(d)) represents the ranking of document (d) after Reranker processing. It should be noted that the calculation of statistical Reranker is not complex, it is efficient, and it is suitable for traditional search systems that are sensitive to latency.

[0085] Furthermore, it can also include a Reranker based on a deep learning model (Cross-encoderReranker), which uses a specially trained neural network to analyze the relevance between questions and documents, scoring the semantic similarity between them. The formula is: [\text{NewScore}(d)=f(\text{Query},d)] where: -(f) is a trained deep learning model, the input is the query ((\text{Query})) and the document ((d)), and the output is a score representing relevance. It should be noted that the score generally depends only on the text content of the question and the document, not on the document's score or relative position in the recall results. It is suitable for both single-path and multi-path recall. By selecting and configuring the above two Reranker modules, users can flexibly adjust the performance and quality of the retrieval system according to their actual needs.

[0086] The technical solution provided by this invention significantly improves the accuracy and adaptability of the system by combining traditional vector retrieval technology with diverse text tagging mechanisms. Firstly, by introducing a multi-layered text tagging system, the system can classify and label data more precisely, covering not only explicit features such as keywords and domain identifiers, but also implicit information such as permission levels and semantic categories. This multi-dimensional tagging mechanism enables the system to more accurately identify user intent when processing queries in specific domains and quickly retrieve highly relevant answer candidate sets from massive amounts of data. Furthermore, by introducing diverse text tags, more accurate retrieval and matching can be achieved even on limited datasets, thereby alleviating the dependence on large amounts of high-quality training data to some extent. Based on the above technical solution, the stability and scalability of the question-answering system are improved, and the search for internal data is faster and more accurate, and it is also easy to extend to different application scenarios.

[0087] Example 3

[0088] Figure 5 This is a schematic diagram of the structure of a multi-tag generation and matching RAG intelligent question-answering device provided in an embodiment of the present invention. Figure 5 As shown, the device includes: a text data processing module 510, a vector database establishment module 520, a question text processing module 530, a text to be applied determination module 540, and a question answer generation module 550, wherein...

[0089] The text data processing module 510 is used to acquire raw text data corresponding to the target business scenario, and to perform vectorization processing on the raw text data to determine the text dataset to be processed.

[0090] The vector database establishment module 520 is used to determine the text tag set corresponding to the text dataset to be processed, and to establish a text vector database based on the text tag set and the text dataset to be processed.

[0091] The problem text processing module 530 is used to determine the problem text tag and problem text vector corresponding to the problem when a problem to be processed is received;

[0092] The text to be applied determination module 540 is used to determine the text to be applied from the text vector database based on the problem text to be processed, the problem text label, and the problem text vector;

[0093] The question-answer generation module 550 is used to generate a target question answer corresponding to the question to be processed based on the text to be applied and the preset prompt word template.

[0094] Based on the above technical solution, the vector database establishment module is used to input the text dataset to be processed and the preset text tag set into a preset semantic retrieval model to obtain a candidate text tag set when a preset text tag set corresponding to the original text data exists; and to input the candidate text tag set and the text dataset to be processed into a large language model to determine the text tag set corresponding to the text dataset to be processed.

[0095] Based on the above technical solution, the vector database establishment module is used to construct tag extraction prompts corresponding to the text dataset to be processed when there is no preset text tag set corresponding to the original text data; and input the tag extraction prompts and the text dataset to be processed into a large language model to determine the text tag set corresponding to the text dataset to be processed.

[0096] Based on the above technical solution, the text to be applied determination module is used to calculate the relevance score between the problem text to be processed and each text block in the text vector database based on a preset text matching algorithm, and determine the set of text blocks to be processed corresponding to the problem text to be processed from the text vector database according to the relevance score; filter out the text blocks to be verified that match the problem text tags from the text vector database based on the problem text tags, and calculate the relevance score between the problem text to be processed and the text blocks to be verified according to the preset text matching algorithm, and determine the set of text blocks to be processed corresponding to the problem text to be processed from the text blocks to be verified based on the relevance score; calculate the vector similarity between each text block in the text vector database and the problem text vector based on the vector search engine, and determine the set of text blocks to be processed corresponding to the problem text vector from the text vector database according to the vector similarity; and determine the text to be applied based on the set of text blocks to be processed.

[0097] Based on the above technical solution, the text to be applied determination module is used to determine the text block identifier corresponding to each text block in the text block set to be processed, and to perform deduplication processing on the text block set to be processed according to the text block identifier; to determine the comprehensive score of each text block in the text block set to be processed after deduplication according to the comprehensive scoring algorithm, and to determine the target text block from the text block set to be processed according to the comprehensive score; and to obtain the text to be applied from the text vector database based on the text block identifier of the target text block.

[0098] Based on the above technical solution, the text data processing module is used to determine the text format corresponding to the original text data, extract text content from the original text data according to the text format; segment the text content according to the segmentation identifier, determine each text block corresponding to the text content, and assign a text block identifier to each text block; and determine the text dataset to be processed based on each text block and the text block identifier assigned to each text block.

[0099] Based on the above technical solution, the question-answer generation module is used to obtain a preset prompt word template corresponding to the target business scenario, generate prompt words for the answer based on the preset prompt word template and the determined text to be applied, and input the answer-generated prompt words into the large language model to generate a target question answer corresponding to the question to be processed.

[0100] The technical solution of this invention involves acquiring raw text data corresponding to a target business scenario, vectorizing the raw text data to determine a text dataset to be processed, and determining a text tag set corresponding to the text dataset to be processed. A text vector database is established based on the text tag set and the text dataset to be processed. Then, when a question to be processed is received, question text tags and question text vectors corresponding to the question to be processed are determined. Based on the question text to be processed, the question text tags, and the question text vectors, the text to be applied is determined from the text vector database. A target question answer corresponding to the question to be processed is generated according to the determined text to be applied and a preset prompt word template. Based on the above technical solution, by constructing a vector database of document text tag data, information related to user needs can be quickly found, and large language models are used for analysis and summarization to return answers to user questions. By customizing data sources and data tags according to business scenarios and combining vector retrieval functions, the granularity and accuracy of retrieval results are improved. Furthermore, this invention supports customizing data sources and data tags according to different business scenarios and, combined with efficient vector retrieval functions, significantly improves the granularity and accuracy of retrieval results.

[0101] The multi-tag generation and matching RAG intelligent question answering device provided in the embodiments of the present invention can execute the multi-tag generation and matching RAG intelligent question answering method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.

[0102] Example 4

[0103] Figure 6 A schematic diagram of an electronic device 10, which can be used to implement embodiments of the present invention, is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices (e.g., helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the invention described and / or claimed herein.

[0104] like Figure 6As shown, the electronic device 10 includes at least one processor 11 and a memory, such as a read-only memory (ROM) 12 or a random access memory (RAM) 13, communicatively connected to the at least one processor 11. The memory stores computer programs executable by the at least one processor. The processor 11 can perform various appropriate actions and processes based on the computer program stored in the ROM 12 or loaded into the RAM 13 from storage unit 18. The RAM 13 can also store various programs and data required for the operation of the electronic device 10. The processor 11, ROM 12, and RAM 13 are interconnected via a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.

[0105] Multiple components in electronic device 10 are connected to I / O interface 15, including: input unit 16, such as keyboard, mouse, etc.; output unit 17, such as various types of displays, speakers, etc.; storage unit 18, such as disk, optical disk, etc.; and communication unit 19, such as network card, modem, wireless transceiver, etc. Communication unit 19 allows electronic device 10 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.

[0106] Processor 11 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. Processor 11 performs the various methods and processes described above, such as the RAG intelligent question answering method for multi-label generation matching.

[0107] In some embodiments, the multi-tag generation matching RAG smart question answering method can be implemented as a computer program tangibly contained in a computer-readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program can be loaded and / or installed on electronic device 10 via ROM 12 and / or communication unit 19. When the computer program is loaded into RAM 13 and executed by processor 11, one or more steps of the multi-tag generation matching RAG smart question answering method described above can be performed. Alternatively, in other embodiments, processor 11 can be configured to perform the multi-tag generation matching RAG smart question answering method by any other suitable means (e.g., by means of firmware).

[0108] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), payload-programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.

[0109] Computer programs used to implement the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when executed by the processor, the computer programs cause the functions / operations specified in the flowcharts and / or block diagrams to be performed. The computer programs may be executed entirely on a machine, partially on a machine, or as a standalone software package, partially on a machine and partially on a remote machine, or entirely on a remote machine or server.

[0110] In the context of this invention, a computer-readable storage medium can be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, apparatus, or device. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination thereof. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.

[0111] To provide interaction with a user, the systems and techniques described herein can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the electronic device. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).

[0112] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as data servers), or middleware components (e.g., application servers), or frontend components (e.g., user computers with graphical user interfaces or web browsers through which users can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., communication networks). Examples of communication networks include local area networks (LANs), wide area networks (WANs), blockchain networks, and the Internet.

[0113] A computing system can include clients and servers. Clients and servers are generally located far apart and typically interact through communication networks. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. The server can be a cloud server, also known as a cloud computing server or cloud host, which is a hosting product within the cloud computing service system to address the shortcomings of traditional physical hosts and VPS services, such as high management difficulty and weak business scalability.

[0114] It should be understood that the various forms of processes shown above can be used, with steps reordered, added, or deleted. For example, the steps described in this invention can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution of this invention can be achieved, and this is not limited herein.

[0115] The specific embodiments described above do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.

Claims

1. A multi-tag generation and matching RAG intelligent question answering method, characterized in that, include: Obtain the original text data corresponding to the target business scenario, and perform vectorization processing on the original text data to determine the text dataset to be processed; Determine a text tag set corresponding to the text dataset to be processed, and establish a text vector database based on the text tag set and the text dataset to be processed. The text vector database is used to store text blocks, semantic vectors and tag sets. Upon receiving a problem to be processed, determine the problem text tag and problem text vector corresponding to the problem to be processed; Based on the problem text to be processed, the problem text tags, and the problem text vector, a set of text blocks to be processed is determined from the text vector database. Based on the set of text blocks to be processed, the text to be applied is determined. The set of text blocks to be processed includes a set of text blocks to be processed determined based on text matching, a set of text blocks to be processed determined based on tag retrieval, and a set of text blocks to be processed determined based on vector retrieval. Generate a target question answer corresponding to the question to be processed based on the text to be applied and the preset prompt word template; The determination of the text tag set corresponding to the text dataset to be processed includes: When a preset text tag set corresponding to the original text data exists, the text dataset to be processed and the preset text tag set are input into a preset semantic retrieval model to obtain a candidate text tag set. The preset semantic retrieval model retrieves the tags most relevant to the text dataset to be processed from the preset text tag set based on the semantic similarity between text content to generate the candidate text tag set. The candidate text tag set and the text dataset to be processed are input into the large language model. The constructed tags are used to filter prompt words to determine the text tag set corresponding to the text dataset to be processed. The text tag set has a hierarchical and multi-level tag structure. In the absence of a preset text tag set corresponding to the original text data, tag extraction prompts are constructed that correspond to the text dataset to be processed. The tag extraction prompts are phrases or questions that are related to the content of the text dataset to be processed and can guide the large language model to generate relevant tags. Input the extracted tag prompts and the text dataset to be processed into a large language model to determine the text tag set corresponding to the text dataset to be processed. The step of determining the text to be applied based on the set of text blocks to be processed includes: Determine the text block identifier corresponding to each text block in the set of text blocks to be processed, and perform deduplication processing on the set of text blocks to be processed according to the text block identifier; The comprehensive score of each text block in the deduplicated text block set is determined according to the comprehensive scoring algorithm, and the target text block is determined from the text block set according to the comprehensive score. The text to be applied is obtained from the text vector database based on the text block identifier of the target text block; The set of text blocks to be processed, determined based on tag retrieval, is determined through the following steps: For each text block in the text vector database, calculate the number of common tags between the tag set carried by the text block and the tags of the question text; Based on the established filtering criteria, the text blocks with the highest number of corresponding tag matches are selected from the text vector database to form the set of text blocks to be processed.

2. The method according to claim 1, characterized in that, Based on the question text to be processed, the question text tag, and the question text vector, a set of text blocks to be processed is determined from the text vector database, including: The relevance score between the text to be processed and each text block in the text vector database is calculated based on a preset text matching algorithm, and the set of text blocks to be processed corresponding to the text to be processed is determined from the text vector database according to the relevance score. Based on the question text tag, the text block to be verified that matches the question text tag is filtered from the text vector database, and the relevance score between the question text to be processed and the text block to be verified is calculated according to the preset text matching algorithm. Based on the relevance score, the set of text blocks to be processed corresponding to the question text to be processed is determined from the text block to be verified. The vector similarity between each text block in the text vector database and the question text vector is calculated using a vector search engine. Based on the vector similarity, a set of text blocks to be processed corresponding to the question text vector is determined from the text vector database.

3. The method according to claim 1, characterized in that, The step of vectorizing the original text data to determine the text dataset to be processed includes: Determine the text format corresponding to the original text data, and extract the text content from the original text data according to the text format; The text content is segmented according to the segmentation identifier to determine each text block corresponding to the text content, and a text block identifier is assigned to each text block. The text dataset to be processed is determined based on each text block and the text block identifier assigned to each text block.

4. The method according to claim 1, characterized in that, The step of generating a target question answer corresponding to the question to be processed based on the text to be applied and a preset prompt word template includes: Obtain a preset prompt word template corresponding to the target business scenario, and generate prompt words for the answer based on the preset prompt word template and the text to be applied; The answer-generating prompts are input into a large language model to generate the target question answer corresponding to the question to be processed.

5. A multi-tag generation and matching RAG intelligent question-answering device, characterized in that, include: The text data processing module is used to acquire raw text data corresponding to the target business scenario, and to perform vectorization processing on the raw text data to determine the text dataset to be processed. The vector database establishment module is used to determine the text tag set corresponding to the text dataset to be processed, and to establish a text vector database based on the text tag set and the text dataset to be processed. The text vector database is used to store text blocks, semantic vectors and tag sets. The problem text processing module is used to determine the problem text tag and problem text vector corresponding to the problem when a problem to be processed is received; The text to be applied determination module is used to determine a set of text blocks to be processed from the text vector database based on the text to be processed, the text tags, and the text vectors, and to determine the text to be applied based on the set of text blocks to be processed. The set of text blocks to be processed includes a set of text blocks to be processed determined based on text matching, a set of text blocks to be processed determined based on tag retrieval, and a set of text blocks to be processed determined based on vector retrieval. The question-answer generation module is used to generate a target question answer corresponding to the question to be processed based on the text to be applied and the preset prompt word template; The vector database establishment module is used to, when a preset text tag set corresponding to the original text data exists, input the text dataset to be processed and the preset text tag set into a preset semantic retrieval model to obtain a candidate text tag set. The preset semantic retrieval model, based on the semantic similarity between text content, retrieves the tags most relevant to the text dataset to be processed from the preset text tag set to generate the candidate text tag set. The candidate text tag set and the text dataset to be processed are then input into a large language model, and a text tag set corresponding to the text dataset to be processed is determined through constructed tag filtering prompts. The text tag set has a hierarchical, multi-level tag structure. When no preset text tag set corresponding to the original text data exists, tag extraction prompts corresponding to the text dataset to be processed are constructed. These tag extraction prompts are phrases or questions related to the content of the text dataset to be processed and capable of guiding the large language model to generate relevant tags. The tag extraction prompts and the text dataset to be processed are then input into the large language model to determine the text tag set corresponding to the text dataset to be processed. The text to be applied determination module is used to determine the text block identifier corresponding to each text block in the text block set to be processed, and to perform deduplication processing on the text block set to be processed according to the text block identifier; to determine the comprehensive score of each text block in the text block set to be processed after deduplication according to the comprehensive scoring algorithm, and to determine the target text block from the text block set to be processed according to the comprehensive score; and to obtain the text to be applied from the text vector database based on the text block identifier of the target text block. The set of text blocks to be processed, determined based on tag retrieval, is determined through the following steps: For each text block in the text vector database, calculate the number of common tags between the tag set carried by the text block and the tags of the question text; Based on the established filtering criteria, the text blocks with the highest number of corresponding tag matches are selected from the text vector database to form the set of text blocks to be processed.

6. An electronic device, characterized in that, The electronic device includes: At least one processor; and A memory communicatively connected to the at least one processor; wherein, The memory stores a computer program that can be executed by the at least one processor, the computer program being executed by the at least one processor to enable the at least one processor to perform the multi-tag generation matching RAG intelligent question answering method according to any one of claims 1-4.

7. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions that cause a processor to execute the RAG intelligent question-answering method for multi-tag generation and matching as described in any one of claims 1-4.