FAQ knowledge base and question-answering system construction method and system based on combination of text representation model and large language model, and program product

By combining text representation model and large language model, FAQ sentence diagrams and expanding knowledge bases are solved, the problems of data scarcity and resource consumption of traditional FAQ systems are realized, and efficient and accurate Q&A process is achieved, and resource consumption is reduced.

CN120123477APending Publication Date: 2025-06-10HUA DATA TECH (SHANGHAI) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510200738.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-21
Publication Date
2025-06-10

AI Technical Summary

Technical Problem

Due to data scarcity and high resource consumption, traditional FAQ systems are difficult to provide fast and accurate answers, especially when facing new problems or complex situations.

Method used

By combining text representation model and large language model, FAQ sentence diagrams are built, knowledge bases are expanded, information retrieval and multi-perspective assisted information generation are achieved to achieve an efficient and accurate question-and-answer process.

Benefits of technology

It realizes efficient expansion of the FAQ knowledge base and the accuracy of the Q&A system, reduces resource consumption, improves the economic and interpretability of the system, and is suitable for multiple application fields.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120123477A_ABST
    Figure CN120123477A_ABST
Patent Text Reader

Abstract

The invention discloses an FAQ knowledge base and question-answering system construction method and system based on combination of a text representation model and a large language model and a program product, and belongs to the technical field of computers. The method comprises the steps of obtaining an existing question-answer pair; constructing an FAQ sentence graph according to the existing question and answer pairs; according to the FAQ sentence graph, constructing an FAQ knowledge base; searching the questions of the user in the FAQ knowledge base to obtain a search result; and according to the retrieval result, generating an answer. The whole FAQ knowledge base construction and question answering process is efficient and accurate, the integration degree is high, economical efficiency and interpretability are high, and the method can be popularized in multiple application fields.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and particularly to a method, system and program product for constructing an FAQ knowledge base and a question-answering system based on the combination of a text representation model and a large language model. Background Art

[0002] With the development of business and the progress of technology, users' demand for quickly and accurately obtaining information is increasing day by day. In today's enterprises and organizations, the maintenance of internal knowledge bases usually relies on limited professional personnel to create and update question-and-answer pairs. For example, in an enterprise environment, employees often need to search for information such as technical documents, operation guides, and policy regulations. An IT assistant can quickly respond to employees' technical questions through an efficient FAQ system, reducing waiting time and improving work efficiency; government departments can use the FAQ system to provide citizens with information such as policies and regulations, handling procedures, and public services, simplifying the handling process and improving service efficiency; on e-commerce platforms, customers often need to know information such as order status and return and exchange policies, and the customer service team has to handle a large number of similar consultations every day.

[0003] In these application scenarios, the answering effect of the FAQ system depends on its ability to quickly and accurately answer users' questions. Traditional FAQ systems all face the problems of data scarcity and resource consumption: the initial knowledge base often only has a small number of configured question-and-answer pairs, which cannot cover all possible questions, and even if new question-and-answer pairs are added, it is difficult to ensure their quality and coverage; due to the lack of sufficient data, traditional FAQ systems often have difficulty providing satisfactory answers, especially when facing new questions or complex situations. Although pre-training or fine-tuning a large language model can improve performance, it consumes a large amount of computing resources and requires a large amount of labeled data; using large language models with a large number of parameters (such as GPT-4o, Llama3-405B, etc.) although having powerful context summarization and generation capabilities, they occupy extremely large computing resources, and the deployment and operation costs are high.

[0004] Therefore, in the case of only a small number of configured question-and-answer pairs, it is quite necessary to construct an FAQ system that is both efficient, accurate, easy to expand and resource-saving by using effective data augmentation techniques and a lightweight large language model with a relatively small number of parameters. Summary of the Invention

[0005] The object of the present invention is to provide a method, system and program product for constructing an FAQ knowledge base and a question-answering system by combining a text representation model and a large language model. The method mainly completes the functions and related knowledge of the FAQ sentence graph construction module, the FAQ knowledge base expansion module, the information retrieval module, the multi-perspective auxiliary information generation module, and the answer generation module. The entire process of constructing the FAQ knowledge base and answering questions is efficient, accurate, highly integrated, economical and interpretable, and can be popularized in multiple application fields.

[0006] To solve the above technical problems, the present invention provides a method for constructing an FAQ knowledge base and a question-answering system by combining a text representation model and a large language model, including the following steps:

[0007] Obtain existing question-answer pairs;

[0008] Construct an FAQ sentence graph according to the existing question-answer pairs;

[0009] Construct an FAQ knowledge base according to the FAQ sentence graph;

[0010] Retrieve the user's question in the FAQ knowledge base to obtain a retrieval result;

[0011] Generate an answer according to the retrieval result.

[0012] Preferably, constructing an FAQ sentence graph according to the existing question-answer pairs specifically includes the following steps:

[0013] Preprocess the existing question-answer pairs to obtain preprocessed question-answer pairs;

[0014] Based on sentence graph prompting words, extract entities and relationships from the preprocessed question-answer pairs through the Qwen-7B model to construct a sentence graph;

[0015] Obtain key sentences from the sentence graph based on the minimum dominating set algorithm.

[0016] Preferably, the minimum dominating set algorithm specifically includes the following steps:

[0017] Initialization: Consider all sentences as nodes in the sentence graph and establish edges according to the entity associations between them; each node represents a sentence, and the edge represents the entities shared between two sentences, constructing an undirected graph;

[0018] Node importance calculation: Calculate the number of entities shared by each node with other nodes;

[0019] Select the initial dominating set: Select the node with the highest importance to join the dominating set, mark this node and its adjacent nodes as covered, and remove them from the sentence graph, and continue to process the remaining nodes;

[0020] Iterative screening: Repeat the above steps until all nodes are covered; the finally obtained dominating set is the minimum dominating set.

[0021] Preferably, according to the FAQ sentence graph, construct an FAQ knowledge base, which specifically includes the following steps:

[0022] Based on the prompting words, the key sentences use the Qwen-7B model to generate multi-perspective question-answer pairs to obtain extended question-answer pairs;

[0023] Based on the BGE-M3 model, perform embedding representation on the extended question-answer pairs to obtain embedding vectors;

[0024] Store the embedding vectors in the Milvus vector database as the FAQ knowledge base.

[0025] Preferably, based on the prompting words, the key sentences use the Qwen-7B model to generate multi-perspective question-answer pairs to obtain extended question-answer pairs, which specifically includes the following steps:

[0026] Generate definition-class perspective prompting words, fact-class perspective prompting words, and reason-class perspective prompting words;

[0027] Based on the Qwen-7B model, according to the definition-class perspective prompting words, fact-class perspective prompting words, reason-class perspective prompting words, and key sentences, obtain definition-class perspective question-answer pairs, fact-class perspective question-answer pairs, and reason-class perspective question-answer pairs as extended question-answer pairs.

[0028] Preferably, retrieve the user's question in the FAQ knowledge base to obtain a retrieval result, which specifically includes the following steps:

[0029] Segment and extract keywords from the user's question to obtain question keywords;

[0030] According to the question keywords, screen out candidate question-answer pairs from the question-answer pairs in the Milvus vector database;

[0031] Use the BGE-M3 model to perform embedding representation on the user's question to obtain a question vector;

[0032] Calculate the cosine similarity between the question vector and the embedding vectors in the Milvus vector database to obtain a similarity score;

[0033] According to the similarity score, select several reference question-answer pairs from the extended question-answer pairs;

[0034] According to the candidate question-answer pairs and the reference question-answer pairs, obtain the retrieval result.

[0035] Preferably, generate an answer according to the retrieval result, which specifically includes the following steps:

[0036] Generate retrieval prompt words according to the retrieval results;

[0037] Based on the Qwen-7B model, generate auxiliary information fragments according to the retrieval prompt words and reference Q&A pairs;

[0038] Generate answers according to the user's question and the auxiliary information fragments.

[0039] Preferably, generating answers according to the user's question and the auxiliary information fragments specifically includes the following steps:

[0040] Input the user's question and the auxiliary information fragments into the Qwen-7B-Chat large language model to obtain the answer.

[0041] The present invention also provides a system for constructing an FAQ knowledge base and a Q&A system by combining a text representation model and a large language model, including:

[0042] An acquisition module for acquiring existing Q&A pairs;

[0043] A sentence graph construction module for constructing an FAQ sentence graph according to the existing Q&A pairs;

[0044] A knowledge base construction module for constructing an FAQ knowledge base according to the FAQ sentence graph;

[0045] A retrieval module for retrieving the user's question in the FAQ knowledge base to obtain the retrieval result;

[0046] An answer generation module for generating an answer according to the retrieval result.

[0047] The present invention also provides a computer program product, which includes computer program code. When the computer program code runs on a computer, the computer is enabled to implement a method for constructing an FAQ knowledge base and a Q&A system by combining a text representation model and a large language model.

[0048] Compared with the prior art, the beneficial effects of the present invention are:

[0049] The entire process of constructing the FAQ knowledge base and answering questions in the present invention is efficient, accurate, highly integrated, economical and interpretable, and can be promoted in multiple application fields. Description of the Drawings

[0050] The following further details the specific embodiments of the present invention with reference to the drawings.

[0051] Figure 1 is the overall process schematic diagram of the present invention;

[0052] Figure 2 is a schematic diagram of an example of the sentence graph construction process;

[0053] Figure 3 is a schematic diagram of the Q&A pair expansion process example;

[0054] Figure 4 is a schematic diagram of the multi - perspective auxiliary information generation and answer generation process example. Specific implementation manners

[0055] In the following description, many specific details are set forth in order to provide a thorough understanding of the present invention. However, the present invention can be implemented in many other ways different from those described herein, and those skilled in the art can make similar extensions without departing from the connotation of the present invention. Therefore, the present invention is not limited by the specific implementations disclosed below.

[0056] The terms used in one or more embodiments of this specification are for the purpose of describing specific embodiments only and are not intended to limit one or more embodiments of this specification. The singular forms "a", "said", and "the" used in one or more embodiments of this specification and the appended claims are also intended to include the plural forms unless the context clearly dictates otherwise. It should also be understood that the term "and / or" used in one or more embodiments of this specification refers to and encompasses any and all possible combinations of one or more of the associated listed items.

[0057] It should be understood that although the terms first, second, etc. may be used in one or more embodiments of this specification to describe various information, such information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of one or more embodiments of this specification, the first may also be referred to as the second, and similarly, the second may also be referred to as the first. Depending on the context, the word "if" as used herein may be interpreted as "when" or "while" or "in response to determining".

[0058] The following further describes the present invention in detail with reference to the accompanying drawings:

[0059] The object of the present invention is to provide a method for expanding the FAQ knowledge base and constructing a Q&A system for a small number of FAQ Q&A pairs.

[0060] The technical solution adopted by the present invention to solve the technical problem, taking the consultation of an e - commerce platform as an example, the overall process of the present invention is as follows Figure 1 as shown:

[0061] 1. FAQ sentence graph construction: By identifying the shared entities between sentences, an undirected graph is formed, where each node represents a sentence and the edge represents the shared entity between sentences. The minimum dominating set algorithm is used to select a set of key sentences that cover the most information from the graph, ensuring that the new Q&A pairs generated based on this set of sentences are widely representative. The main steps are as follows:

[0062] a. Text preprocessing: Clean and standardize the existing question-answer pairs, remove redundant information, unify the format and perform sentence segmentation, and configure corresponding entity templates to support sentence entity extraction.

[0063] b. Sentence graph construction: Construct reasonable sentence graph prompt words, use the Qwen-7B large language model for entity extraction, extract shared entities, and establish entity associations between sentences. Treat each sentence as a node and the shared entities between sentences as edges to form an undirected graph.

[0064] c. Key sentence screening: Use the minimum dominating set algorithm to select a set of key sentences that cover the most information from the sentence graph. Minimize the number of sentences required for FAQ expansion while maximizing the covered information volume to ensure that the generated new question-answer pairs are widely representative.

[0065] 2. FAQ knowledge base construction: Based on the key sentences screened from the sentence graph, use the large language model to perform multi-perspective expansion of the question-answer pairs, and perform embedding representation on the question-answer pairs in the expanded FAQ knowledge base. The main steps are as follows:

[0066] a. Question-answer pair expansion: Based on the screened key sentences, configure appropriate multi-perspective prompt words, and use the Qwen-7B large language model to generate multi-perspective question-answer pairs to expand the FAQ knowledge base.

[0067] b. Construct the FAQ knowledge base index: Conduct a preliminary quality check on the newly generated question-answer pairs to ensure their rationality and accuracy, use the BGE-M3 model to perform embedding representation on the question-answer pairs, and store the embedding vectors in the Milvus vector database. When the user asks a question, the system can quickly locate the relevant question-answer pairs according to the embedding vectors to ensure the retrieval speed and accuracy.

[0068] 3. Question-answer information retrieval: According to the user's query, recall multiple most relevant reference question-answer pairs from the expanded FAQ knowledge base. Recall reference question-answer pairs from multiple perspectives through keyword extraction and semantic similarity calculation to ensure that the system can provide comprehensive and diverse answers. Finally, the system will sort the candidate question-answer pairs according to the similarity scores and select several most relevant reference question-answer pairs for the generator and reader to use. The main steps are as follows:

[0069] a. Keyword extraction and retrieval: According to the question raised by the user, use the NLTK library to tokenize the question and extract keywords. According to the extracted keywords, search for relevant question-answer pair IDs in the Milvus vector database and preliminarily screen out a batch of candidate question-answer pairs.

[0070] b. Semantic vector retrieval: Use the BGE-M3 model to embed and represent the user's question, calculate the cosine similarity between the semantic vector of the user's question and the Q&A pairs in the FAQ knowledge base, sort the candidate Q&A pairs according to the similarity scores, and select several of the most relevant reference Q&A pairs.

[0071] c. Multi-perspective recall: Integrate the recall results of keyword retrieval and semantic vector retrieval. Not only consider Q&A pairs that are highly similar to the question, but also consider Q&A pairs from different perspectives to ensure the comprehensiveness and diversity of the final answer.

[0072] 4. Multi-perspective auxiliary information generation: Based on multiple reference Q&A pairs retrieved, use the Qwen-7B large language model as a generator to generate possible answers and supplementary information from multiple perspectives. The generator will generate different answer options according to the content and context of the question, combined with the information provided by multiple reference Q&A pairs, to ensure the diversity and comprehensiveness of the answers.

[0073] 5. Answer generation: Based on the multi-perspective auxiliary information, use the Qwen-7B-Chat large language model as a reader, construct a suitable retrieval prompt template, and summarize the final answer in combination with the user's query background.

[0074] To better illustrate the technical effects of the present invention, the present invention provides the following specific embodiments to illustrate the above technical processes:

[0075] Embodiment 1. A method for constructing an FAQ knowledge base and a Q&A system by combining a text representation model and a large language model. Taking the consultation of an e-commerce platform as an example, the entire construction process of the FAQ knowledge base and the Q&A system can also be applied to other fields.

[0076] Step 1. Construction of the FAQ sentence graph

[0077] The FAQ sentence graph construction module mainly preprocesses the existing Q&A pairs and basic text resources and constructs a sentence graph for subsequent data enhancement and retrieval.

[0078] S11 Text preprocessing: Clean the existing Q&A pairs and other basic texts, remove incomplete Q&A pairs (such as those with only questions but no answers) and Q&A pairs irrelevant to the topic of the FAQ knowledge base. Ensure the effectiveness of the basic FAQ knowledge base.

[0079] S12 Sentence graph construction: In the process of constructing the sentence graph, reasonable prompt design and efficient entity extraction are key steps. To ensure the accuracy and comprehensiveness of entity extraction, the present invention uses Qwen-7B as a tool in the sentence graph construction process.

[0080] Qwen-7B is a pre-trained language model with 7 billion parameters, possessing powerful natural language understanding and generation capabilities. Compared with other large models, Qwen-7B not only performs excellently in terms of performance but also has less resource consumption, making it suitable for deployment and operation in resource-constrained environments. It has significant advantages in multiple natural language processing tasks such as named entity recognition.

[0081] Through reasonable prompt construction, the model can be guided to better complete specific tasks. The prompt is formulated according to the task to be completed in the current step. This step guides the Qwen-7B large language model to complete the extraction of entities related to the e-commerce field in the sentence by formulating the prompt. For example, in Figure 2 the entity extraction task shown, the following prompt can be designed: "Please extract all entities related to the e-commerce field from the following sentence and list them." Such a prompt can help Qwen-7B focus on entities within a specific field, such as "submit an application", "review", "process", "payment account", etc. Qwen-7B can understand the meaning of these entities based on the context and accurately identify them, avoiding situations where traditional rule-based methods may miss or misjudge.

[0082] Establish entity associations between sentences based on the extracted entities. In the present invention, each sentence is regarded as a node in the graph, and the entities shared between sentences are used as edges to form an undirected graph. Specifically, if two sentences contain the same entity, there will be an edge connecting them. As Figure 2 shown, the edges between nodes represent the entities they share. For example, A1 and A2 are connected by "submit an application" and "review"; A1 and A3 are connected by "review" and "process"; A2 and A4 are connected by "submit an application"; A1 and A5 are connected by "submit an application".

[0083] S13 Key sentence screening: When constructing an efficient FAQ system, how to select the most representative sentences from a large number of question-and-answer pairs is a key issue. To solve this problem, the present invention adopts the minimum dominating set algorithm, which can select a set of key sentences that cover the most information from the sentence graph.

[0084] The minimum dominating set algorithm is a classic graph theory problem, aiming to find the smallest set of nodes in a graph such that these nodes can directly or indirectly "dominate" all other nodes in the graph. Specifically, in the sentence graph, each sentence is regarded as a node, and the entities shared between sentences are used as edges to connect these nodes. The goal of the minimum dominating set is to select the smallest number of nodes (i.e., key sentences) such that these nodes can cover all other nodes in the entire graph or at least be adjacent to them. These key sentences contain the most shared entities and can represent the core information of the entire knowledge base.

[0085] The specific steps of the minimum dominating set algorithm are:

[0086] 1. Initialization: Treat all sentences as nodes in the graph and establish edges based on the entity associations between them. Each node represents a sentence, and the edge represents the shared entity between two sentences. In this way, an undirected graph is constructed, in which each node may be connected to multiple other nodes.

[0087] 2. Node importance calculation: The importance of each node is usually measured using the node's degree. The degree of a node refers to the number of edges connected to the node, that is, the number of entities the node shares with other nodes. A node with a higher degree means that it is associated with more other sentences and is therefore more likely to become a key sentence.

[0088] 3. Select the initial dominating set: Select the node with the highest degree from the graph as part of the initial dominating set. This node and its adjacent nodes will be marked as covered, indicating that they are already "dominated" by the current dominating set. These nodes are then removed from the graph and the remaining nodes are processed.

[0089] 4. Iterative screening: Repeat the above steps, each time selecting the uncovered node with the highest degree, adding it to the dominating set, and marking its adjacent nodes as covered. This process will continue until all nodes are covered. The resulting dominating set is the minimum dominating set, which is the minimum set of nodes that covers all nodes in the entire graph.

[0090] like Figure 2 As shown, in this example, the minimum dominating set may be the following three sentences:

[0091] A1: The refund process includes four steps: application submission, review, processing, and completion. (covering "application submission", "review", "processing", "completion")

[0092] A3: After the review is passed, the refund will be processed within 3-5 working days, and the funds will be returned to your payment account. (covering "review", "processing", "payment account")

[0093] A4: If you encounter any problems after submitting your application, you can seek help through online customer service or call the customer service hotline. (covers "Submit application", "Online customer service", "Customer service hotline")

[0094] These three sentences have covered all the important entities and can therefore be used as key sentences to generate new question-answer pairs.

[0095] Step 2: FAQ knowledge base construction

[0096] Based on the key sentences obtained from the FAQ sentence graph construction step, the Qwen-7B large language model is used to expand the Q&A pairs from multiple perspectives, and the Q&A in the expanded FAQ knowledge base is semantically vector-embedded and indexed simultaneously.

[0097] S21 Q&A pair expansion: In the process of building an FAQ system, expanding the knowledge base is a key step to improve the accuracy and coverage of the system. To efficiently generate new Q&A pairs, the present invention configures appropriate prompt words based on the selected key sentences and uses the Qwen-7B large language model to generate Q&A pairs from multiple perspectives.

[0098] The prompt words are formulated in this step to complete the generation of Q&A pairs from multiple perspectives. The prompt words here are: generate Q&A pairs from three perspectives: the definition class perspective, the fact class perspective, and the reason class perspective; as Figure 3 shown.

[0099] The Qwen-7B large language model has powerful natural language understanding and generation capabilities. It can not only generate accurate and coherent answers based on the given key sentences, but also provide supplementary information from multiple perspectives to ensure that the generated Q&A pairs are widely representative and enhance the user experience.

[0100] Specifically, as Figure 3 shown, taking the key sentence "The refund process includes four steps: submitting an application, reviewing, processing, and completion" as an example, Q&A pairs are generated from the following three perspectives:

[0101] 1. Definition class perspective: Construct prompt words to guide the large language model to generate Q&A pairs from the definition class perspective, such as "Please generate a Q&A pair according to the following key sentence [key sentence], and the Q&A pair needs to conform to the following form: Q: Please explain what [term] is? A: The meaning of [term]"

[0102] 2. Fact class perspective: Construct prompt words to guide the large language model to generate Q&A pairs from the fact class perspective, such as "Please generate a Q&A pair according to [topic], and the Q&A pair needs to conform to the following form: Q: What are the facts related to [topic]? A: The facts related to [topic]"

[0103] 3. Reason class perspective: Construct prompt words to guide the large language model to generate Q&A pairs from the reason class perspective, such as "Please generate a Q&A pair according to [phenomenon], and the Q&A pair needs to conform to the following form: Q: Why does [phenomenon] occur? A: The reason for the occurrence of [phenomenon]"

[0104] S22 Build the FAQ knowledge base index: The quality of the newly generated question-and-answer pairs is crucial during the expansion of the FAQ knowledge base. To improve the accuracy and reliability of the system, the present invention conducts a preliminary quality check on the newly generated question-and-answer pairs to ensure their rationality and accuracy. On this basis, the present invention uses the BGE-M3 model to perform embedded representation on the question-and-answer pairs and stores the embedded vectors in the Milvus vector database. This method not only enhances the representation ability of the question-and-answer pairs but also significantly improves the retrieval speed and accuracy, ensuring that the system can quickly respond to user queries.

[0105] The BGE-M3 model is an advanced pre-trained language model. In text processing, the BGE-M3 has powerful semantic understanding and representation capabilities. For the FAQ system, BEG-M3 can convert text into high-dimensional vectors (i.e., embedded representation), enabling the similarity between different sentences to be measured by the distance between vectors, thus better supporting subsequent retrieval and matching operations and avoiding misjudgments or omissions that may occur with traditional methods.

[0106] To efficiently store and retrieve these embedded vectors, the present invention uses the Milvus vector database. Milvus is an open-source vector search engine designed specifically for the storage and retrieval of large-scale vector data. It supports multiple index structures and search algorithms and can quickly find the most similar vectors in massive data, greatly improving the retrieval efficiency. The core advantages of Milvus lie in its high performance, easy scalability, and flexible architecture, which can easily handle vector data in the millions or even billions.

[0107] Step 3: Question-and-answer information retrieval

[0108] To ensure that users can obtain comprehensive and diverse answers, after the user poses a query, the present invention recalls multiple relevant reference question-and-answer pairs from the expanded FAQ knowledge base. Through keyword extraction, semantic similarity calculation, and multi-perspective recall, the present invention can provide reference question-and-answer pairs covering different angles to ensure the comprehensiveness and accuracy of the answers. Finally, the present invention ranks the candidate question-and-answer pairs according to the similarity scores and selects several of the most relevant reference question-and-answer pairs.

[0109] S31 Keyword extraction and retrieval: When the user poses a question, the present invention first uses the natural language processing tool NLTK library to tokenize the question and extract keywords. NLTK is a powerful Python library that provides rich text processing functions, including tokenization, part-of-speech tagging, named entity recognition, etc., and is widely used in natural language processing tasks.

[0110] Such as Figure 4As shown, if the user asks "How can I get a refund?", the system will identify keywords such as "refund". Then, based on these keywords, the system searches for relevant Q&A pair IDs in the Milvus vector database and preliminarily screens out a batch of candidate Q&A pairs. This step can quickly narrow down the search scope and find potential answers related to the user's question.

[0111] S32 Semantic Vector Retrieval: The present invention uses the BGE-M3 model to perform embedded representation on the user's question, converting the question into a high-dimensional semantic vector. By calculating the cosine similarity between the semantic vector of the user's question and the Q&A pairs in the FAQ knowledge base, the candidate Q&A pairs are sorted according to the similarity scores, and several of the most relevant reference Q&A pairs are selected. This step can capture deeper semantic information and ensure that the most relevant content can be found even if the user's expression is not exactly the same as the questions in the knowledge base.

[0112] S33 Multi-Perspective Recall: To ensure the comprehensiveness and diversity of answers, this embodiment integrates the results of keyword retrieval and semantic vector retrieval, considering not only Q&A pairs highly similar to the user's question but also Q&A pairs from different perspectives. For example, in addition to directly answering the question "How to apply for a refund?", it will also recall relevant content such as "refund review process", "common questions about refunds", and "matters needing attention in refund applications".

[0113] Multi-Perspective Auxiliary Information Generation

[0114] In the multi-perspective auxiliary information generation stage of the FAQ system, the present invention combines multiple recalled reference Q&A pairs with the user's question to construct prompt words to guide the Qwen-7B large language model as a generator to generate different auxiliary information segments to help users better understand and process relevant questions.

[0115] Qwen-7B can flexibly adjust the angle and content of information according to the question and the specific context of relevant prompt words, providing more personalized and rich background support. In addition, the high efficiency and small resource occupancy of Qwen-7B enable it to quickly generate a large amount of high-quality auxiliary information under limited computing resources, further enhancing the overall Q&A performance of the FAQ system.

[0116] Such as Figure 4 As shown, by constructing prompt words such as "Please combine the question [user question] with the reference Q&A content [Q&A pair] to generate a reference information from the [angle]", the large language model is guided to generate auxiliary information from the perspectives of process, processing time, and user support respectively.

[0117] Step Four: Answer Generation

[0118] In the final answer generation stage of the present invention, based on multi-perspective auxiliary information, the Qwen-7B-Chat large language model is used as a reader, a suitable prompt template is constructed, and combined with the multi-perspective auxiliary information generated in the previous steps, the large language model is guided to summarize and generate the final answer. By using Qwen-7B-Chat, the system can better understand the user's intention, provide more natural and user-friendly answers, and can flexibly handle various complex Q&A contexts.

[0119] As Figure 4 shown, the user asks the question "How can I get a refund?", and the multi-perspective auxiliary information is generated for the recalled Q&A pairs as the reference information for generating the final answer. A reasonable prompt is constructed, such as "Please combine the following reference information [reference information] and concisely and comprehensively answer the user's question [user question]" to guide the Qwen-7B-Chat large language model to generate the final answer.

[0120] Qwen-7B-Chat is a version specifically optimized for dialogue scenarios in the Qwen series. Compared with Qwen-7B, Qwen-7B-Chat has been trained with a large amount of dialogue data and has significant advantages in processing multi-turn conversations, context understanding, and personalized responses. It can flexibly adjust the tone, format, and content of the answer according to the specific query background of the user, ensuring that the Q&A process is accurate, fast, and also guarantees a good interaction experience.

[0121] In several embodiments provided by the present invention, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of the modules, modules, or units is only a logical function division, and there may be other division methods in actual implementation. For example, multiple units, modules, or components can be combined or integrated into another device, or some features can be ignored or not executed.

[0122] The unit may or may not be physically separated. The components shown as units may be a physical unit or multiple physical units, that is, they may be located in one place, or may be distributed to multiple different places. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0123] In addition, the functional units in each embodiment of the present invention can be integrated in a processing unit, or each unit can exist physically alone, or two or more units can be integrated in one unit. The above integrated units can be implemented in the form of hardware or in the form of software functional units.

[0124] In particular, according to the embodiments disclosed in the present invention, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product that includes a computer program carried on a computer-readable medium, and the computer program includes program code for performing the methods shown in the flowcharts. In such an embodiment, the computer program can be downloaded and installed from a network through a communication part, and / or installed from a removable medium. When the computer program is executed by a central processing unit (CPU), the above-mentioned functions defined in the method of the present invention are performed. It should be noted that the above-mentioned computer-readable medium of the present invention can be a computer-readable signal medium, a computer-readable storage medium, or any combination of the two. The computer-readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the above.

[0125] The flowcharts and block diagrams in the accompanying drawings illustrate the possible architectures, functions, and operations of systems, methods, and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagram may represent a module, a program segment, or a part of code that contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks may occur in a different order than that marked in the accompanying drawings. For example, two consecutive blocks shown may actually be executed substantially in parallel, and they may sometimes be executed in the reverse order, depending on the functions involved. It should also be noted that each block in the block diagram and / or flowchart, and the combinations of blocks in the block diagram and / or flowchart, can be implemented by a dedicated hardware-based system for performing the specified functions or operations, or can be implemented by a combination of dedicated hardware and computer instructions.

[0126] As described above, the above are only specific embodiments of the present invention, but the protection scope of the present invention is not limited thereto. Any changes or substitutions within the technical scope disclosed by the present invention should be covered by the protection scope of the present invention. Therefore, the protection scope of the present invention should be subject to the protection scope of the claims.

Claims

1. A method for constructing a FAQ knowledge base and a question-answering system based on a text representation model and a large language model, characterized in that: The following steps are involved: Get existing question-answer pairs; Construct FAQ sentence graph based on existing question-answer pairs; According to the FAQ sentence graph, build the FAQ knowledge base; Search the user's questions in the FAQ knowledge base to obtain search results; Generate answers based on the search results.

2. The method for constructing a FAQ knowledge base and a question-answering system based on a text representation model combined with a large language model according to claim 1, characterized in that: According to the existing question-answer pairs, a FAQ sentence graph is constructed, which specifically includes the following steps: Preprocess the existing question-answer pairs to obtain preprocessed question-answer pairs; Based on the sentence graph prompt words, the Qwen-7B model is used to extract entities and relations from the preprocessed question-answer pairs to construct a sentence graph. Based on the minimum dominating set algorithm, key sentences are obtained from the sentence graph.

3. The method for constructing a FAQ knowledge base and a question-answering system based on a text representation model combined with a large language model according to claim 2, characterized in that: The minimum dominating set algorithm specifically includes the following steps: Initialization: All sentences are considered as nodes in the sentence graph, and edges are established based on the entity associations between them; each node represents a sentence, and the edge represents the shared entity between two sentences, thus constructing an undirected graph; Node importance calculation: calculate the number of entities each node shares with other nodes; Select the initial dominating set: select the node with the highest importance to join the dominating set, mark the node and its adjacent nodes as covered, and remove them from the sentence graph, and continue to process the remaining nodes; Iterative screening: Repeat the above steps until all nodes are covered; the final dominating set is the minimum dominating set.

4. The method for constructing a FAQ knowledge base and a question-answering system based on a combination of a text representation model and a large language model according to claim 3, characterized in that: According to the FAQ sentence graph, the FAQ knowledge base is constructed, which includes the following steps: Based on the multi-angle prompt words, the key sentences use the Qwen-7B model to generate multi-angle question-answer pairs to obtain expanded question-answer pairs; Based on the BGE-M3 model, the expanded question-answer pair is embedded to obtain an embedding vector; The embedded vectors are stored in the Milvus vector database as a FAQ knowledge base.

5. The method for constructing a FAQ knowledge base and a question-answering system based on a combination of a text representation model and a large language model according to claim 4, characterized in that: Based on the multi-angle prompt words, the key sentences use the Qwen-7B model to generate multi-angle question-answer pairs to obtain expanded question-answer pairs, which specifically includes the following steps: Generate definition perspective prompt words, fact perspective prompt words and cause perspective prompt words; Based on the Qwen-7B model, according to the definition perspective prompt words, fact perspective prompt words, cause perspective prompt words and key sentences, definition perspective question and answer pairs, fact perspective question and answer pairs and cause perspective question and answer pairs are obtained as expanded question and answer pairs.

6. The method for constructing a FAQ knowledge base and a question-answering system based on a text representation model combined with a large language model according to claim 5, characterized in that: Searching the user's questions in the FAQ knowledge base to obtain search results specifically includes the following steps: Perform word segmentation and keyword extraction on the user's questions to obtain the question keywords; Based on the question keywords, candidate question-answer pairs are selected from the question-answer pairs in the Milvus vector database; Use the BGE-M3 model question to embed the user's question and obtain the question vector; Calculate the cosine similarity between the question vector and the embedded vector in the Milvus vector database to obtain a similarity score; According to the similarity scores, select several reference question-answer pairs from the expanded question-answer pairs; According to the candidate question-answer pairs and the reference question-answer pairs, the retrieval results are obtained.

7. The method for constructing a FAQ knowledge base and a question-answering system based on a combination of a text representation model and a large language model according to claim 6, characterized in that: Generate answers based on the search results, including the following steps: Generate search prompt words based on the search results; Based on the Qwen-7B model, auxiliary information fragments are generated according to the search prompt words and reference question-answer pairs; Generate answers based on the user's question and supporting information fragments.

8. The method for constructing a FAQ knowledge base and a question-answering system based on a text representation model combined with a large language model according to claim 7, characterized in that: Generate answers based on the user's question and auxiliary information fragments, which includes the following steps: The user's question and auxiliary information fragments are input into the Qwen-7B-Chat large language model to get the answer.

9. A FAQ knowledge base and question-answering system construction system based on the combination of a text representation model and a large language model, used to implement the FAQ knowledge base and question-answering system construction method based on the combination of a text representation model and a large language model as described in any one of claims 1-8, characterized in that: include: The acquisition module is used to obtain existing question-answer pairs; A sentence graph construction module is used to construct FAQ sentence graphs based on existing question-answer pairs; A knowledge base construction module is used to construct a FAQ knowledge base based on the FAQ sentence graph; A retrieval module is used to search the user's questions in the FAQ knowledge base and obtain retrieval results; The answer generation module is used to generate answers based on the retrieval results.

10. A computer program product, characterized in that The computer program product includes a computer program code, and when the computer program code is executed on a computer, the computer is enabled to implement the method according to any one of claims 1 to 8.