FAQ generation method and system, electronic equipment and storage medium
Patent Information
- Application Number
- CN202411762838.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-03
- Publication Date
- 2025-04-25
AI Technical Summary
The existing FAQ generation methods are prone to unknown references and incomplete answers in the process of information extraction, resulting in the generated question-and-answer correctness and comprehensiveness.
The three-stage method is adopted: first, the problem generation model is used to extract initial problem information from the product document; second, the product name is completed based on the large language model to generate complete problem information and generate complete problem information; finally, through retrieval and enhanced generation technology, a high-quality FAQ is generated to form a high-quality FAQ.
Through the completion and retrieval of large language models, the application of generation technology has been greatly improved, ensuring that the problem is expressed clearly, the information is complete, and the answers are comprehensive and accurate.
Smart Images

Figure CN119884335A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the fields of artificial intelligence, natural language processing and information extraction technology, and in particular to a method for generating FAQs (Frequently Asked Questions), a system for generating FAQs, an electronic device and a computer-readable storage medium. Background Art
[0002] With the development of artificial intelligence and natural language processing technologies, the popularity of intelligent customer service systems has led to an increasing focus on automated FAQ extraction tasks. This technology provides users with efficient and accurate question-and-answer services by extracting question-and-answer pairs from product documents or manuals. The essence of FAQ generation is information extraction, so it often faces challenges such as information loss and inaccurate positioning. The main FAQ extraction methods currently include pipeline-based question-and-answer generation and one-stop question-and-answer extraction methods.
[0003] 1. Pipeline-based question-answer pair generation method
[0004] The pipeline-based FAQ generation method breaks down the product document into several segments, extracts the segments one by one as answers, and then generates corresponding questions based on the answers. This method is modular and is divided into two independent stages: answer extraction and question generation.
[0005] 2. One-stop question-answer pair extraction method
[0006] The one-stop approach integrates answer extraction and query generation into an end-to-end model, and improves the extraction effect through joint optimization. This method considers both the loss function of answer extraction and the loss function of query generation in the optimization objective, thereby improving the quality of question-answer pair generation.
[0007] The above FAQ extraction method often encounters the following problems in practical applications:
[0008] Unclear reference: The generated query is prone to ambiguous references that lack contextual information, especially when noun phrases are omitted in the document or the product name is unclear. The main reason is that the guidance of contextual information is ignored, and the query may be unclear or lack complete information.
[0009] Incomplete answers: Since only a single fragment of the document is taken as the answer, it is unable to cover the distributed information in the document, resulting in a one-sided or incomplete answer. Summary of the invention
[0010] In view of the above problems, embodiments of the present invention are proposed to provide a method for generating FAQs, a system for generating FAQs, an electronic device and a computer-readable storage medium that overcome the above problems or at least partially solve the above problems.
[0011] In order to solve the above problems, an embodiment of the present invention discloses a method for generating FAQs, the method comprising:
[0012] Use the question generation model to extract initial question information from product documents;
[0013] Based on the large language model, the initial question information is supplemented with the product name corresponding to the product document to obtain complete question information;
[0014] Generate answer information for the complete question information by using retrieval enhancement generation technology;
[0015] Generate the FAQ of the product document according to the complete question information and the answer information.
[0016] Optionally, the step of completing the product name corresponding to the product document for the initial question information based on the large language model to obtain complete question information includes:
[0017] Determining whether the product name exists in the initial question information based on the large language model;
[0018] In the case that the product name does not exist in the initial question information, the product name is completed to obtain the complete question information.
[0019] Optionally, the step of completing the product name corresponding to the product document for the initial question information based on the large language model to obtain complete question information includes:
[0020] Inputting the prompt word information including the initial question information and the product name into the large language model, and outputting the complete question information;
[0021] The prompt word information includes: input requirement information, output format information, and judgment rule information.
[0022] Optionally, the step of inputting the prompt word information including the initial question information and the product name into the large language model and outputting the complete question information comprises:
[0023] Input the prompt word information including the initial question information and the product name into the large language model, and output the complete question information including the following key information:
[0024] The first key is an integer, used to indicate whether the initial question information contains the product name;
[0025] The second key is a string, which is used to represent the complete question information after completing the product name.
[0026] Optionally:
[0027] If the initial question information includes the product name, the second key is an empty string, and the complete question information is the initial question information.
[0028] Optionally, generating answer information for the complete question information by using a search enhancement generation technology includes:
[0029] Retrieving a collection of document fragments containing answer content of the complete question information in the knowledge base;
[0030] Filtering search results from the document fragment collection;
[0031] The complete question information and the retrieval results are input into an answer generation model, and the answer information is output.
[0032] Optionally, filtering out the search results from the document fragment set includes:
[0033] Convert the complete question information into a question vector;
[0034] Reading the document vector of each document fragment in the document fragment set from the knowledge base;
[0035] Calculating the similarity between the question vector and each of the document vectors;
[0036] The document fragments are arranged in descending order according to the similarities, and a plurality of the document fragments with the highest order are extracted as the search results.
[0037] The embodiment of the present invention also discloses a system for generating FAQs, the system comprising:
[0038] An initial question information extraction module is used to extract initial question information from product documents using a question generation model;
[0039] A product name completion module, used to complete the product name corresponding to the product document for the initial question information based on a large language model to obtain complete question information;
[0040] An answer information generation module, used to generate answer information for the complete question information by using a search enhancement generation technology;
[0041] The FAQ generation module is used to generate the FAQ of the product document according to the complete question information and the answer information.
[0042] Optionally, the product name completion module includes:
[0043] A product name determination module, used for determining whether the product name exists in the initial question information based on the large language model;
[0044] The complete question determination module is used to complete the product name to obtain the complete question information when the product name does not exist in the initial question information.
[0045] Optionally, the product name completion module is used to input the prompt word information including the initial question information and the product name into the large language model, and output the complete question information;
[0046] The prompt word information includes: input requirement information, output format information, and judgment rule information.
[0047] Optionally, the product name completion module is used to input the prompt word information including the initial question information and the product name into the large language model, and output the complete question information including the following key information:
[0048] The first key is an integer, used to indicate whether the initial question information contains the product name;
[0049] The second key is a string, which is used to represent the complete question information after completing the product name.
[0050] Optionally: if the initial question information includes the product name, the second key is an empty string, and the complete question information is the initial question information.
[0051] Optionally, the answer information generating module includes:
[0052] A document fragment retrieval module is used to retrieve a document fragment set containing the answer content of the complete question information in the knowledge base;
[0053] A retrieval result screening module, used to screen out retrieval results from the document fragment collection;
[0054] The answer information output module is used to input the complete question information and the search results into the answer generation model and output the answer information.
[0055] Optionally, the search result screening module includes:
[0056] A question vector conversion module, used to convert the complete question information into a question vector;
[0057] A document vector reading module, used for reading the document vector of each document fragment in the document fragment set from the knowledge base;
[0058] A similarity calculation module, used to calculate the similarity between the question vector and each of the document vectors;
[0059] The retrieval result determination module is used to arrange the document fragments in descending order according to the similarity, and extract a plurality of document fragments with the highest order as the retrieval results.
[0060] An embodiment of the present invention also discloses an electronic device, comprising: one or more processors; and one or more computer-readable storage media having instructions stored thereon, which, when executed by the one or more processors, enables the electronic device to execute a method for generating FAQs as described above.
[0061] The embodiment of the present invention further discloses a computer-readable storage medium, wherein the computer program stored in the storage medium enables a processor to execute the method for generating FAQ as described above.
[0062] The embodiments of the present invention include the following advantages:
[0063] The embodiment of the present invention provides a solution for generating FAQs for frequently asked questions. The solution uses a question generation model to extract initial question information from a product document. Then, the product name corresponding to the product document is supplemented for the initial question information based on a large language model to obtain complete question information. Next, answer information is generated for the complete question information through retrieval enhancement generation technology. Finally, the FAQ of the product document is generated based on the complete question information and the answer information.
[0064] Compared with the existing technical solutions, the FAQ generation solution proposed in the embodiment of the present invention achieves significant improvements in many aspects by innovatively decoupling the question and answer generation process using a three-stage method (the first stage extracts the query from the product document, the second stage uses a large language model to complete the product name for the query, and the third stage uses RAG technology to generate the answer).
[0065] First, in order to solve the technical problem of unclear question expression, a large language model was introduced to complete the product name, which effectively overcame the problem of unclear reference in the background technology. By fully understanding and utilizing the overall context information of the product document, it is possible to accurately identify and supplement the missing product names in the question, ensuring that the generated question expression is accurate and the information is complete. This improvement makes the questions in the FAQ clearer and more specific, avoiding the ambiguous reference phenomenon caused by omitting key information, and significantly improving the practical value of the question and answer pair.
[0066] Secondly, in response to the common problem of incomplete answers in background technologies, we have made innovative improvements by using retrieval enhancement generation technology. Unlike the limitation of traditional methods that only capture a single document fragment as an answer, retrieval enhancement generation technology can intelligently obtain and integrate relevant information from multiple locations in the document. This comprehensive processing mechanism of multi-source information makes the generated answers more comprehensive and accurate. It can not only identify and collect relevant information scattered throughout the document, but also effectively integrate and optimize this information through intelligent generation technology, and finally provide users with complete and valuable answers.
[0067] From the perspective of system architecture, modular design realizes the organic combination of question generation, name completion and answer generation. It not only improves the stability and maintainability of the system, but also facilitates the subsequent function expansion and optimization. The coordination between various functional modules forms an efficient processing flow, which comprehensively improves the processing capacity and output quality of the entire FAQ generation system. BRIEF DESCRIPTION OF THE DRAWINGS
[0068] Figure 1 is a flowchart of a method for generating FAQ according to an embodiment of the present invention;
[0069] Figure 2 It is a flowchart of the steps of a three-stage product document FAQ extraction method based on RAG according to an embodiment of the present invention;
[0070] Figure 3 is a structural block diagram of a FAQ generation system according to an embodiment of the present invention;
[0071] Figure 4 is a structural block diagram of an electronic device according to an embodiment of the present invention;
[0072] Figure 5 It is a structural block diagram of a computer-readable storage medium according to an embodiment of the present invention. DETAILED DESCRIPTION
[0073] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below with reference to the accompanying drawings and specific embodiments.
[0074] In order to solve the problems of unclear reference and incomplete answers existing in the existing FAQ generation technology, an embodiment of the present invention proposes a FAQ generation scheme. The scheme first uses a question generation model to extract initial question information from a product document, and then introduces a large language model to complete the corresponding product name for the initial question information based on the context of the product document, thereby obtaining complete question information. Next, the scheme adopts retrieval enhancement generation technology to generate comprehensive answer information for the complete question information by retrieving and integrating multiple related information in the document. Finally, a high-quality product document FAQ is formed based on the generated complete question information and answer information. The scheme effectively improves the generation quality of FAQ through the organic combination of question generation, product name completion, and retrieval enhancement generation technologies, making the generated question and answer pairs more accurate, complete and practical.
[0075] Reference Figure 1 , shows a flowchart of a method for generating FAQ according to an embodiment of the present invention. The method for generating FAQ is applied to a system for generating FAQ (referred to as the system for short), and the method for generating FAQ may specifically include the following steps:
[0076] Step 101: extract initial question information from product documents using a question generation model.
[0077] In an embodiment of the present invention, the core of this step is to extract initial question information from product documents through a question generation model. The initial question information can be regarded as a summary or conclusion of the key content in the product document, which is usually generated in natural language and has a certain semantic structure. The question generation model usually adopts a pre-trained natural language processing model, combined with special task fine-tuning to ensure that the generated questions are relevant to the document content. In a specific implementation, the question generation model extracts information-intensive content from the document, such as titles, paragraph topic sentences or high-frequency keywords, and generates relevant questions based on the logical relationship of the context. This process usually involves the following steps:
[0078] Document fragmentation: Breaking long documents into smaller segments, such as paragraphs or sentences, so that they can be processed one by one.
[0079] Key content identification: Identify content in the document that may be helpful to users, such as function descriptions, usage instructions, or precautions.
[0080] Templated question generation: Generate preliminary question information based on key content, usually based on common question templates (such as "How to...?", "Is it possible to...?").
[0081] For example, suppose the product documentation contains the following content: "The device supports multiple interfaces, including USB-C, HDMI, and 3.5mm headphone jack." The question generation model will extract the keyword "the device supports multiple interfaces" and generate the initial question information: "What interfaces does the device support?"
[0082] Step 102: Based on the large language model, the product name corresponding to the product document is completed for the initial question information to obtain complete question information.
[0083] In an embodiment of the present invention, after the initial question information is generated, there may be a problem of insufficient information, such as failure to clearly mention a specific product name or other context-related information. This step uses a large language model (LLM) to complete the product name or other key details for the initial question information in combination with the document context, thereby generating complete question information. The large language model is good at understanding context and generating natural language, so it can achieve efficient and accurate supplementation in question completion. For example, when the initial question information lacks a specific product name, the large language model will refer to the background information of the document to add relevant content. The process usually includes the following operations:
[0084] Context matching: Use a large language model to compare the initial question information with the document content to determine the contextual information related to the question.
[0085] Completion generation: Generate complete questions containing supplementary information through a large language model, converting ambiguous expressions into clear questions.
[0086] For example, suppose the initial question is: "Which interfaces are supported?" The document content is:
[0087] "[Device name] supports multiple interfaces, including USB-C, HDMI, and 3.5mm headphone jack." The complete question message after completion is: "What interfaces does [Device name] support?"
[0088] Step 103: Generate answer information for the complete question information by using retrieval enhancement generation technology.
[0089] In an embodiment of the present invention, after the generation of complete question information is completed, answer information needs to be generated for it. This step uses the Retrieval Augmented Generation (RAG) technology, combined with the question-answer generation model and the retrieval module, to achieve the generation of answer information through document content retrieval and answer generation. The retrieval module extracts fragments related to the question from the product document, and inputs these contents as context into the question-answer generation model to generate more accurate answers. This technology can effectively integrate distributed information in the document to ensure the completeness and accuracy of the answer. The specific process includes the following steps:
[0090] Question matching: Locate the content fragment in the document that is closest in semantics to the complete question information through retrieval-augmented generation technology.
[0091] Information integration: Organize, filter and remove duplicates from multiple retrieved contents to ensure the coherence of the answers.
[0092] Generate answers: Combine the retrieved context and use the question-answering generation model to generate natural language answers.
[0093] For example, the complete question information: "What interfaces does [device name] support?" The retrieval module extracts the document content: "This device supports multiple interfaces, including USB-C, HDMI, and 3.5mm headphone jack." Generate the answer: "The interfaces supported by [device name] are USB-C, HDMI, and 3.5mm headphone jack."
[0094] Step 104: Generate a FAQ of the product documentation based on the complete question information and answer information.
[0095] In an embodiment of the present invention, after generating complete question information and corresponding answer information, these question and answer pairs are integrated to form the FAQ of the product document. This step mainly involves the storage, formatting and optimization of the question and answer pairs to ensure that the FAQ content structure is clear, the expression is accurate, and it is suitable for users to directly query and use. In FAQ generation, the quality and readability of the FAQ can also be improved by filtering redundant information, classifying and sorting questions, etc. The main operations include:
[0096] Format Q&A pairs: Combine complete questions and answers into a uniformly formatted FAQ entry.
[0097] Deduplication and classification: Check the generated question-answer pairs, remove duplicates, and classify them according to topics or functions.
[0098] Optimize user experience: Add tags, keywords, or related content to each question and answer pair to facilitate users' quick retrieval and understanding.
[0099] For example, the complete question information is: "What interfaces does [device name] support?" The answer information is: "The interfaces supported by [device name] are USB-C, HDMI, and 3.5mm headphone jack." Generate FAQ entries: Q: What interfaces does the device support? A: The interfaces supported by the device are USB-C, HDMI, and 3.5mm headphone jack.
[0100] The embodiment of the present invention provides a solution for generating FAQs for frequently asked questions. The solution uses a question generation model to extract initial question information from a product document. Then, the product name corresponding to the product document is supplemented for the initial question information based on a large language model to obtain complete question information. Next, answer information is generated for the complete question information through retrieval enhancement generation technology. Finally, the FAQ of the product document is generated based on the complete question information and the answer information.
[0101] Compared with the existing technical solutions, the FAQ generation solution proposed in the embodiment of the present invention achieves significant improvements in many aspects by innovatively decoupling the question and answer generation process using a three-stage method (the first stage extracts the query from the product document, the second stage uses a large language model to complete the product name for the query, and the third stage uses RAG technology to generate the answer).
[0102] First, in order to solve the technical problem of unclear question expression, a large language model was introduced to complete the product name, which effectively overcame the problem of unclear reference in the background technology. By fully understanding and utilizing the overall context information of the product document, it is possible to accurately identify and supplement the missing product names in the question, ensuring that the generated question expression is accurate and the information is complete. This improvement makes the questions in the FAQ clearer and more specific, avoiding the ambiguous reference phenomenon caused by omitting key information, and significantly improving the practical value of the question and answer pair.
[0103] Secondly, in response to the common problem of incomplete answers in background technologies, we have made innovative improvements by using retrieval enhancement generation technology. Unlike the limitation of traditional methods that only capture a single document fragment as an answer, retrieval enhancement generation technology can intelligently obtain and integrate relevant information from multiple locations in the document. This comprehensive processing mechanism of multi-source information makes the generated answers more comprehensive and accurate. It can not only identify and collect relevant information scattered throughout the document, but also effectively integrate and optimize this information through intelligent generation technology, and finally provide users with complete and valuable answers.
[0104] From the perspective of system architecture, modular design realizes the organic combination of question generation, name completion and answer generation. It not only improves the stability and maintainability of the system, but also facilitates the subsequent function expansion and optimization. The coordination between various functional modules forms an efficient processing flow, which comprehensively improves the processing capacity and output quality of the entire FAQ generation system.
[0105] In an exemplary embodiment of the present invention, an implementation method of completing the product name corresponding to the product document for the initial question information based on the large language model to obtain the complete question information is: based on the large language model, determine whether there is a product name in the initial question information; if the product name does not exist in the initial question information, complete the product name to obtain the complete question information.
[0106] In the FAQ generation process, in order to ensure that the generated questions have clear semantic expressions and can accurately reflect the content of the document, the initial question information needs to be completed. The focus of this implementation is to determine whether the product name exists in the initial question information, and to use the large language model to complete it when it is missing. This process solves the common problems of ambiguous reference and incomplete information in generating questions, thereby generating question information with higher semantic clarity.
[0107] In actual application, the large language model has excellent semantic understanding capabilities. It can identify whether the product name is explicitly mentioned in the initial question information by analyzing the text structure, semantic features, and contextual relationships. For example, for the question "What interfaces are supported?" the large language model can identify that the question does not mention the product name through contextual comparison and analysis, and thus determine that it needs to be completed. On the contrary, if the question is stated as "What interfaces does [device name] support?" it will be recognized as containing the product name and does not need to be completed.
[0108] When the product name is missing from the initial question information, the large language model will complete the question based on the document context. The completion process mainly includes the following two aspects:
[0109] 1. Extract document background information: The large language model will retrieve the product name corresponding to the question from the previous text or related paragraphs of the product document. For example, if the document topic is clearly "Smart Speaker X100", the large language model will extract the name as the completion content.
[0110] 2. Natural language generation: Based on the extracted background information, the large language model generates complete question information including the product name. For example, "What interfaces are supported?" will be completed as "What interfaces does the smart speaker X100 support?" The generated question is not only semantically clear, but also seamlessly combines the context.
[0111] For example, product documentation:
[0112] "Smart Speaker X100 Product Manual
[0113] Function description (one or more paragraphs) ......
[0115] Part name (one or more paragraphs) ......
[0117] Connection method (one paragraph or multiple paragraphs)
[0118] The device supports multiple connection methods, including Bluetooth 5.0, Wi-Fi, and wired connection modes. ”
[0119] Since local attention is too high when extracting questions, it is easy to lose global information. The initial question information extracted is "What connection methods does the device support?" After the large language model analyzes the initial question information, it is found that the product name ("Smart Speaker X100") is not clearly mentioned in the question, so it needs to be completed. The complete question information after completion is "What connection methods does the Smart Speaker X100 support?".
[0120] The embodiment of the present invention avoids the problem of ambiguous reference caused by lack of context in the generated question by judging whether there is a product name and completing it. When reading FAQ, users no longer need to guess the object referred to by the question, which greatly improves the clarity of the question. After completing the product name, the generated question has a more complete semantic expression, which is convenient for users to quickly understand and use. For example, in the FAQ matching application scenario of the question-answering system, a question-answering library involves 100 products, among which there are 20 products whose FAQs contain the question "Which interfaces does the product name support?". If the user's question is "Which interfaces does the smart speaker X100 support?", then the FAQs of the above 20 products may be matched, and the FAQs of these 20 products will affect the accuracy of the answer to the user's question. As a result, the completion of the question from "Which interfaces are supported?" to "Which interfaces does the smart speaker X100 support?" not only makes the question more targeted, but also improves the professionalism and credibility of the question-answering content. The completed question information is closer to the user's actual questioning habits and can directly reflect the user's potential questions when using the product. Clear question formats reduce the burden on users to search and understand, thereby enhancing the user experience.
[0121] In an exemplary embodiment of the present invention, an implementation method of completing the product name corresponding to the product document for the initial question information based on the large language model to obtain the complete question information is: inputting the prompt word information including the initial question information and the product name into the large language model, and outputting the complete question information; wherein the prompt word information includes: input requirement information, output format information, and judgment rule information.
[0122] In this implementation, the input items include initial question information and product name prompt information. The prompt information is a guide for the large language model, which can help the large language model generate results that better meet user needs. The prompt information usually includes the following categories of content:
[0123] 1. Input requirement information: Clearly indicate that the large language model needs to complete the initial question information input, especially the product name. For example, prompt "Complete the missing product name".
[0124] 2. Output format information: Specify the format of the generated results to ensure that the output conforms to the common form of question-answer pairs. For example, "Please generate a complete and natural question."
[0125] 3. Judgment rule information: used to guide the large language model to determine whether the initial question information already contains the product name, and complete it if it is missing. For example, "If the question does not mention the product name, please complete the product name."
[0126] In actual application, through the judgment rules in the prompt word information, the large language model will first analyze the initial question information to determine whether the product name has been mentioned. If the product name has been mentioned, the initial question information can be output directly; if not, the large language model will complete it according to the requirements in the prompt word information. If the initial question information does not contain the product name, the large language model will generate the product name based on the context of the document and the prompt word information. For example, if the product discussed in the document is "Smart Speaker X100", the large language model will complete "Smart Speaker X100" into the initial question information. By inputting requirement information and outputting format information, the generated complete question information has clear semantic expression, meets user needs, and conforms to the common FAQ format.
[0127] For example, suppose the product document describes a device called "Smart Speaker X100" and details the functions and interface types it supports. Initial question information: "What interfaces are supported?" Prompt word information: Input requirement information: "Complete the missing product name." Output format information: "Please generate a complete, natural and fluent question that conforms to the FAQ question and answer format." Judgment rule information: "If the product name is not mentioned in the question, complete the product name." During the processing, the initial question information "What interfaces are supported?" did not mention the product name, and the judgment rule information required the product name to be completed. The large language model identifies "Smart Speaker X100" as the product name from the document content and completes it in the question. According to the output format requirements in the prompt word information, the generated question is: "What interfaces does the smart speaker X100 support?" The complete question information after completion: "What interfaces does the smart speaker X100 support?"
[0128] The embodiment of the present invention guides the large language model to complete the product name, and the generated questions can accurately reflect the specific characteristics of the product, thereby improving the semantic clarity of the questions. In many scenarios, the lack of product names in user questions may lead to vague understanding. The large language model is used to complete the questions to ensure that the questions are clear and complete. The use of prompt word information allows the system to flexibly respond to different needs. If the initial question information already contains the product name, the question can be output directly; if not, the complete question information is obtained through the completion step. The guidance of the prompt word information makes this process highly adaptive and can be automatically adjusted in different documents or problem scenarios. The use of prompt word information reduces the need for manual intervention. Through predefined rules, the system can automatically determine and generate appropriate question formats, significantly improving the efficiency of FAQ generation. Especially when the content of product documents is huge, automated completion and question generation can effectively reduce time costs.
[0129] In an exemplary embodiment of the present invention, prompt word information including initial question information and product name is input into a large language model, and an implementation method of outputting complete question information is as follows: prompt word information including initial question information and product name is input into a large language model, and a complete question information including the following key information is output:
[0130] The first key is an integer that indicates whether the initial question information contains a product name; if the product name exists, a value (such as 1) is returned; if the product name is missing, another value (such as 0) is returned. This key helps to further understand the status of the initial question information and determine whether completion is required.
[0131] The second key is a string representing the complete question information after completing the product name. Regardless of whether the initial question information contains a product name, the large language model will generate a complete and clear question-answering question with an appropriate product name.
[0132] In actual application, the initial question information is the original question asked by the user (such as "What functions are supported?"), and the prompt word information contains instructions to the large language model to guide it to generate accurate and complete questions. The prompt word information usually includes: whether the rules for completing the product name need to be followed, the format requirements for generation, etc. After the initial question information and the prompt word information are passed to the large language model, the large language model first determines whether the initial question information contains the product name. If there is no product name, the large language model completes the product name based on the context and prompt information, and generates the complete question information. The complete question information contains two key information:
[0133] The first key: indicates whether the initial question information contains a product name. If the product name exists, output 1; if it is missing, output 0.
[0134] Second key: Output the complete question information after completing the product name. For example, if the initial question information is "What functions are supported?" and the document discusses "Smart Speaker X100", the generated complete question is "What functions does the Smart Speaker X100 support?".
[0135] For example, suppose there is a product document discussing a smart speaker named "Smart Speaker X100". The following are examples of input and output.
[0136] Initial question message: "What interfaces are supported?"
[0137] Prompt word information:
[0138] Enter the requirement information: "Check if there is a product name in the question, if not, complete it."
[0139] Output format information: "Output a result containing two fields, the first field is an integer and the second field is a string."
[0140] During the processing, the initial question information "What interfaces are supported?" does not explicitly mention the product name, so the large language model determines that the product name is missing and prepares to complete it. The large language model extracts "Smart Speaker X100" from the product document as the completed product name and generates the question: "What interfaces does the Smart Speaker X100 support?" The output of the large language model is:
[0141] The first key: Product Name is missing, so the output is 0.
[0142] The second key: The generated complete question information is "What interfaces does the smart speaker X100 support?"
[0143] The embodiment of the present invention provides clear feedback by returning an integer (indicating whether the product name exists) and a string (indicating complete question information). This not only helps developers and users understand the status of the generated questions, but also serves as a basis for further processing. If the product name exists, the user does not need to worry about the completion process; if it is missing, it can be automatically completed. In practical applications, the structure of product documents may vary, including different product names or multiple product models. Through the context understanding ability of the large language model, various document structures can be flexibly processed to adapt to different text formats. In some cases, the document may clearly indicate the product name, while in other scenarios, the product name may need to be completed by reasoning. The output contains information of two key values, which is easy to integrate into the existing FAQ generation system. Developers can easily process the generation of question and answer pairs based on these two output fields. In addition, since the output result structure is clear, this method can be easily extended to a variety of application scenarios. By outputting complete questions containing formatting, the format of the generated questions is ensured to be consistent, and the problem of irregular format caused by manual editing or system generation problems is avoided. This not only improves the quality of the question and answer system, but also improves the standardization of the content.
[0144] In an exemplary embodiment of the present invention, if the initial question information contains a product name, the second key is an empty string, and the complete question information is the initial question information. This implementation process is performed based on whether the initial question information contains a product name. If the initial question information already contains a product name, the generated complete question information is the initial question information itself, and the second key (i.e., the field containing the complete question information) is an empty string. The core of this method is to determine whether the product name needs to be completed, and when completion is not required, directly retain the initial question information to maintain the efficiency and accuracy of the system.
[0145] The embodiment of the present invention avoids unnecessary completion operations by directly returning the question when the initial question information already contains the product name. This not only reduces the consumption of computing resources, but also greatly improves processing efficiency. In particular, in the FAQ generation system, when automatically processing questions, it can quickly determine whether they need to be modified, thereby saving time. If the initial question information already contains the product name, then the initial question information can be directly returned, thus avoiding additional judgment and modification work. This simplified process not only improves the system response speed, but also reduces unnecessary model reasoning and computing burdens.
[0146] In an exemplary embodiment of the present invention, an implementation method of generating answer information for complete question information through retrieval enhancement generation technology is: searching a collection of document fragments containing answer content of complete question information in a knowledge base; filtering out retrieval results from the collection of document fragments; inputting the complete question information and the retrieval results into an answer generation model, and outputting the answer information.
[0147] In the FAQ generation system, the implementation method of generating answer information for complete question information through retrieval-enhanced generation technology mainly utilizes the technology of combining document retrieval with generation model. This method can effectively provide accurate and relevant answers to complete questions raised by users, relying on document fragments in the knowledge base and combining with generation model to generate more accurate and fluent answers. The specific implementation process includes: retrieving document fragments related to complete question information in the knowledge base, screening out valuable related document fragments from these document fragments, then inputting the question and related document fragments into the answer generation model, and finally outputting appropriate answer information.
[0148] In actual application, firstly, a search is performed from a pre-built knowledge base based on the complete question information. The knowledge base usually contains a large number of documents, manuals, FAQ entries or other related content. This process is to find the most relevant document fragments by using retrieval techniques (such as keyword-based retrieval, semantic similarity calculation, etc.). The goal of the search is to find a collection of document fragments related to the complete question information, which should contain content directly related to the user's question. After the relevant document fragments are retrieved, they will be screened. The purpose of the screening process is to select the most relevant and accurate content from many possible document fragments. The screening may be based on multiple factors, including the relevance of the content, the accuracy of the information, and the completeness of the document. If the retrieved document fragments are too fragmented or not directly related to the question, they will be automatically removed. The screened relevant document fragments and the complete question information will be used as input together and passed into an answer generation model. The answer generation model is usually a deep learning model based on natural language processing. These answer generation models can generate fluent and accurate answers based on the context of the input complete question information and the relevant document fragments. The core task of the answer generation model is to combine the question background with the information in the retrieval results to provide an answer that meets the user's needs. After being processed by the answer generation model, the answer information will be output. At this point, the answer is not just a simple answer, but a complete answer that has been optimized through context understanding and document retrieval. The output answer should provide an accurate and useful explanation, operation guide or solution for the complete question information.
[0149] For example, suppose there is a smart speaker whose product documentation contains information on multiple modules. The question asked by the user is: "How to connect to Wi-Fi?" This question has generated the complete question information "How to connect to Wi-Fi for the smart speaker X100?" through the previous steps. Next, the answer is generated through the retrieval enhancement generation technology.
[0150] Complete question information: "How does the smart speaker X100 connect to Wi-Fi?" Knowledge base: contains multiple document fragments, such as: "Steps for the smart speaker X100 to connect to Wi-Fi", "How to configure Wi-Fi settings", etc. Retrieve relevant document fragments from the knowledge base based on the complete question information "How does the smart speaker X100 connect to Wi-Fi?" The retrieved fragments may include: "How does the smart speaker X100 set up Wi-Fi." "Wi-Fi connection steps: Configuration of the smart speaker X100." "What should I do if the Wi-Fi connection fails?" Filter out the most relevant content from the retrieved fragments. For example, select the two fragments "How does the smart speaker X100 set up Wi-Fi" and "Wi-Fi connection steps: Configuration of the smart speaker X100" because they directly involve detailed steps on how to connect to Wi-Fi. The complete question information "How does the smart speaker X100 connect to Wi-Fi?" and the filtered retrieval results (such as "Wi-Fi connection steps: Configuration of the smart speaker X100") are input into the answer generation model. The answer generation model combines the question and the document content to generate the following answer: "To connect the Smart Speaker X100 to Wi-Fi, please follow the steps below: First, press the Wi-Fi button on the top of the speaker to enter the Wi-Fi settings interface. Then, select 'Smart Speaker X100' in the Wi-Fi settings of your phone or tablet, enter the password, and complete the connection."
[0151] The embodiment of the present invention uses retrieval enhancement generation technology to effectively obtain the most relevant information from a large number of documents based on complete question information, and integrates this information through the answer generation model to generate accurate answer information. Not only does it improve the relevance of the answer, but it can also combine the context to ensure that users can get the most direct and clear answers. Through retrieval enhancement generation technology, when faced with different questions, relevant documents are automatically retrieved and answers are generated, greatly enhancing the intelligence and adaptability of the system. No matter how complex the problem is or how large the document is, the system can rely on the combination of retrieval and generation models to quickly find a solution.
[0152] In an exemplary embodiment of the present invention, an implementation method for filtering out retrieval results from a document fragment collection is: converting complete question information into a question vector; reading out the document vector of each document fragment in the document fragment collection from a knowledge base; calculating the similarity between the question vector and each document vector; arranging each document fragment in descending order according to the similarity, and extracting multiple document fragments with the highest ranking as retrieval results. This implementation method involves vectorizing the complete question information and document fragment information, and filtering out the most relevant document fragments by calculating the similarity, thereby generating an accurate answer. Specifically, first converting the complete question information into a question vector, then reading out the vector representation of all document fragments from the knowledge base, then calculating the similarity between the question vector and the document vector, and finally sorting the document fragments according to the similarity, and selecting multiple document fragments with the highest ranking as retrieval results.
[0153] In actual application, the complete question information is converted into a high-dimensional vector representation. This process is usually completed through a pre-trained natural language processing model. The purpose of vectorization is to convert text data into a numerical representation that can calculate similarity. In this way, the semantics and contextual information of the question are encoded into a vector of fixed dimension. Next, each document fragment in the document fragment collection is read from the knowledge base and a vector is generated for each document fragment. Similar to the question vector, the document fragment vector is also generated through a natural language processing model. Each document fragment represents a specific product information or solution, and the document vector also captures the semantic content of the document fragment. Calculate the similarity between the question vector and the document vector of each document fragment. Commonly used indicators for similarity calculation include cosine similarity and Euclidean distance. Cosine similarity measures the angle between two vectors in the vector space. The smaller the angle, the higher the similarity, indicating that the semantics of the two text contents are closer. In this way, the similarity between the question and the document fragment can be quantified. After calculating the similarity between the question vector and all document fragment vectors, all document fragments are sorted in descending order according to the similarity value. The top-ranked document fragments are the most relevant to the question information. The most relevant fragments are extracted from these top-ranked fragments as the final retrieval results. The fragments with the highest similarity are extracted from the ranked document fragment set. The specific number of fragments to be selected can be adjusted according to the parameters set by the system. Generally speaking, selecting the top few most relevant document fragments can greatly improve the accuracy of question answering.
[0154] For example, assume that the complete question information is: "How to set up the Wi-Fi connection of the smart speaker X100?" Convert the complete question information "How to set up the Wi-Fi connection of the smart speaker X100?" into a question vector. Then, read all document fragments related to Wi-Fi connection from the knowledge base and convert each document fragment into a document vector. For example, the document fragment may include:
[0155] Document snippet 1: "Steps to connect the Smart Speaker X100 to Wi-Fi". Document snippet 2: "How to configure the Wi-Fi settings of the smart speaker". Document snippet 3: "Wi-Fi connection troubleshooting".
[0156] Next, the similarity between the question vector and each document fragment vector is calculated, and the document fragments are sorted from high to low by similarity. Assume that the similarity between document fragments 1 and 2 is high, while the similarity between document fragment 3 is low. The most relevant information is extracted from the first two fragments to generate the answer information. For example, the answer that may be output is: "To connect the smart speaker X100 to Wi-Fi, please follow the steps below: 1. Turn on the device and enter the Wi-Fi settings; 2. Select 'X100' in the Wi-Fi list and enter the password."
[0157] The embodiment of the present invention can retrieve the document fragment most relevant to the question according to semantic matching by converting both the question and the document fragment into vectors and calculating the similarity between them. Compared with the traditional keyword-based retrieval method, this matching method based on vector space can better understand the semantics of the user's question, thereby improving the accuracy of the retrieval results. By calculating the similarity between the question vector and the document fragment vector, the document fragments that are most semantically relevant can be screened out. In this way, the answer obtained by the user will be based on the document fragment that is most likely to answer the question, avoiding the interference of irrelevant or repeated information fragments. By introducing the vectorized retrieval method, the intelligence of the system is enhanced, so that it can understand the deep meaning behind the question, not just the matching of keywords. This semantic-level matching can not only grasp the needs of users more accurately, but also better cope with the diversity and complexity of question expressions. Compared with the traditional full-text retrieval method, the vectorized retrieval method can find the most relevant document fragments in a more efficient time. Vector calculation (especially through efficient matrix operations and parallelization technology) is more efficient than keyword-based retrieval, which is particularly important for the rapid retrieval of large-scale knowledge bases.
[0158] Based on the above-mentioned relevant explanations on an embodiment of a method for generating a frequently asked question FAQ, a three-stage product document FAQ extraction method based on RAG is introduced below. In the three-stage product document FAQ extraction method based on RAG, the first stage extracts the query from the product document. The second stage uses a large language model to complete the product name for the query. The third stage uses RAG technology to generate an answer. The purpose of using a large language model to complete the product name for the query is to solve the problem of unclear query reference, and to play a role in reference resolution for the expression of the missing product name in the query. The purpose of using RAG technology to generate an answer is to increase the accuracy and completeness of the answer. First, the query is used to retrieve the answer document, and then the answer is generated, which is conducive to comprehensively and accurately locating the position of the answer in the document.
[0159] Reference Figure 2 , shows a step flow chart of a three-stage product document FAQ extraction method based on RAG in an embodiment of the present invention.
[0160] Step 1: Train a query extraction model F. The input of the training corpus is the product document, and the output is several queries proposed based on the document content.
[0161] Step 2: In the inference phase, query extraction model F is used to extract queries from product document d and q i It means that q i =F(d);
[0162] Step 3: Use the large language model LLM to give q i Complete the product name product_name i , enter the prompt words as follows:
[0163] prompt="'
[0164] I will give you a question and the corresponding product name. Your task is to determine whether the question contains the product name. If the question does not contain the product name, add the product name to the question.
[0165] "query":"{q i}",
[0166] "product_name":"{product_name i}"
[0167] You must return your output in the form of a dictionary with only the following keys:
[0168] - "is_complete": an integer, which is 1 if the question contains a product name, and 0 if the question does not contain a product name.
[0169] -"completed_query": a string that completes the question after the product name, or an empty string if the question contains a product name.
[0170] Your output must always be a dictionary, do not interpret yourself or output anything else.
[0171] ”'
[0172] Output:
[0173] res=LLM(q i ,prompt)
[0174] Use q to complete the query after the product name i 'express:
[0175]
[0176] Step 4: Generate q using RAG technology i 'Answer, use a i express;
[0177] Step 5: Output question-answer pairs (q i ′,a i ).
[0178] In step 4, the RAG technology implementation steps are as follows:
[0179] Step 4-1: Search the knowledge base for the words containing q i ′, take the top 5 product documents of the search results, and use d "#$%er ={d ( ,d 1 ,d 2 ,d + ,d ,}express;
[0180] Step 4-2: q i - and d "#$%er Input the answer generation model G and get q i 'Answer:
[0181] a i =G(q i -,d "#$%er )
[0182] Technical points of the embodiments of the present invention include but are not limited to:
[0183] The embodiment of the present invention proposes a three-stage product document FAQ extraction method, in which the query is extracted from the product document in the first stage, the product name is completed for the query in the second stage, and the answer is generated in the third stage.
[0184] The embodiment of the present invention alleviates the problem of unclear reference by completing the product name in the query.
[0185] The embodiment of the present invention utilizes RAG technology to generate answers to FAQs in product documents.
[0186] Compared with the prior art, the main advantages of the embodiments of the present invention are:
[0187] The product document FAQ extraction method proposed in the embodiment of the present invention utilizes RAG technology to generate answers and performs retrieval enhancement on the answer generation process. Compared with the method of directly generating answers, the embodiment of the present invention can make the answers generated by the model more accurate.
[0188] The embodiment of the present invention calls a large language model to complete the product name after extracting the query, which plays a role in reference resolution. Compared with the existing product document FAQ extraction method, the embodiment of the present invention can effectively alleviate the phenomenon of unclear reference in the query.
[0189] The product document FAQ extraction method proposed in the embodiment of the present invention can maintain the consistency of query and answer.
[0190] It should be noted that, for the sake of simplicity, the method embodiments are described as a series of action combinations, but those skilled in the art should be aware that the embodiments of the present invention are not limited by the order of the actions described, because according to the embodiments of the present invention, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions involved are not necessarily required by the embodiments of the present invention.
[0191] Reference Figure 3 , shows a structural block diagram of a FAQ generation system according to an embodiment of the present invention. The FAQ generation system may specifically include the following modules.
[0192] An initial question information extraction module 31 is used to extract initial question information from product documents using a question generation model;
[0193] A product name completion module 32, used to complete the product name corresponding to the product document for the initial question information based on a large language model to obtain complete question information;
[0194] An answer information generating module 33, used to generate answer information for the complete question information by using a search enhancement generation technique;
[0195] The FAQ generating module 34 is used to generate the FAQ of the product document according to the complete question information and the answer information.
[0196] In an exemplary embodiment of the present invention, the product name completion module 32 includes:
[0197] A product name determination module, used for determining whether the product name exists in the initial question information based on the large language model;
[0198] The complete question determination module is used to complete the product name to obtain the complete question information when the product name does not exist in the initial question information.
[0199] In an exemplary embodiment of the present invention, the product name completion module 32 is used to input the prompt word information including the initial question information and the product name into the large language model, and output the complete question information;
[0200] The prompt word information includes: input requirement information, output format information, and judgment rule information.
[0201] In an exemplary embodiment of the present invention, the product name completion module 32 is used to input the prompt word information including the initial question information and the product name into the large language model, and output the complete question information including the following key information:
[0202] The first key is an integer, used to indicate whether the initial question information contains the product name;
[0203] The second key is a string, which is used to represent the complete question information after completing the product name.
[0204] In an exemplary embodiment of the present invention: if the initial question information includes the product name, the second key is an empty string, and the complete question information is the initial question information.
[0205] In an exemplary embodiment of the present invention, the answer information generating module 33 includes:
[0206] A document fragment retrieval module is used to retrieve a document fragment set containing the answer content of the complete question information in the knowledge base;
[0207] A retrieval result screening module, used to screen out retrieval results from the document fragment collection;
[0208] The answer information output module is used to input the complete question information and the search results into the answer generation model and output the answer information.
[0209] In an exemplary embodiment of the present invention, the search result screening module includes:
[0210] A question vector conversion module, used to convert the complete question information into a question vector;
[0211] A document vector reading module, used for reading the document vector of each document fragment in the document fragment set from the knowledge base;
[0212] A similarity calculation module, used to calculate the similarity between the question vector and each of the document vectors;
[0213] The retrieval result determination module is used to arrange the document fragments in descending order according to the similarity, and extract a plurality of document fragments with the highest order as the retrieval results.
[0214] As for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0215] In an embodiment of the present invention, an electronic device is also provided. The electronic device may include one or more processors; and one or more computer-readable storage media having instructions stored thereon, and when executed by the one or more processors, the electronic device executes the method for generating FAQs as described above.
[0216] Reference Figure 4 , shows a structural block diagram of an electronic device according to an embodiment of the present invention. Figure 4 As shown, the electronic device 41 includes a processor 411 and a computer-readable storage medium 412 , on which a computer program 4121 is stored.
[0217] The processor 411 is used to execute the computer program 4121 stored on the computer-readable storage medium 412. When the processor 411 executes the computer program 4121, it implements the method for generating FAQs of any of the above-mentioned embodiments and can achieve the same technical effect. To avoid repetition, it will not be repeated here.
[0218] The processor 411 mentioned above may include but is not limited to: a central processing unit (CPU), a network processor (NP), a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.
[0219] The computer-readable storage medium 412 mentioned above may include but is not limited to: read-only memory (ROM), random access memory (RAM), compact disc read-only memory (CD-ROM), electronic erasable programmable read-only memory (EEPROM), hard disk, floppy disk, flash memory, etc.
[0220] In an embodiment of the present invention, a computer-readable storage medium is further provided, on which a computer program is stored. The computer program can be executed by a processor of an electronic device. When the computer program is executed by the processor, the processor executes the method for generating frequently asked questions FAQ as described in any of the above embodiments.
[0221] Reference Figure 5 , shows a block diagram of a computer-readable storage medium according to an embodiment of the present invention. Figure 5 As shown, a computer program 511 is stored on a computer-readable storage medium 51. When the computer program 511 is executed by a processor, the processor executes the method for generating FAQs as described in any of the above embodiments, and can achieve the same technical effect. To avoid repetition, it will not be repeated here.
[0222] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.
[0223] It will be appreciated by those skilled in the art that the embodiments of the present invention may be provided as methods, devices, or computer program products. Therefore, the embodiments of the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the embodiments of the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.
[0224] The embodiments of the present invention are described with reference to the flowcharts and / or block diagrams of the methods, terminal devices (systems), and computer program products according to the embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of the processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing terminal device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing terminal device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0225] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing terminal device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0226] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal device so that a series of operating steps are executed on the computer or other programmable terminal device to produce a computer-implemented process, thereby providing instructions for executing on the computer or other programmable terminal device to implement the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0227] Although the preferred embodiments of the present invention have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the embodiments of the present invention.
[0228] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or terminal device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or terminal device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or terminal device including the elements.
[0229] The above is a detailed introduction to a method for generating FAQ and a system for generating FAQ provided by the present invention. Specific examples are used in this article to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea. At the same time, for those skilled in the art, according to the idea of the present invention, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.
Claims
1. A method for generating FAQ, characterized in that: The method comprises: Use the question generation model to extract initial question information from product documents; Based on the large language model, the initial question information is supplemented with the product name corresponding to the product document to obtain complete question information; Generate answer information for the complete question information by using retrieval enhancement generation technology; Generate the FAQ of the product document according to the complete question information and the answer information.
2. The method according to claim 1, characterized in that The method of completing the product name corresponding to the product document for the initial question information based on the large language model to obtain complete question information includes: Determining whether the product name exists in the initial question information based on the large language model; In the case that the product name does not exist in the initial question information, the product name is completed to obtain the complete question information.
3. The method according to claim 1, characterized in that The method of completing the product name corresponding to the product document for the initial question information based on the large language model to obtain complete question information includes: Inputting the prompt word information including the initial question information and the product name into the large language model, and outputting the complete question information; The prompt word information includes: input requirement information, output format information, and judgment rule information.
4. The method according to claim 3, characterized in that: The step of inputting the prompt word information including the initial question information and the product name into the large language model and outputting the complete question information comprises: Input the prompt word information including the initial question information and the product name into the large language model, and output the complete question information including the following key information: The first key is an integer, used to indicate whether the initial question information contains the product name; The second key is a string, which is used to represent the complete question information after completing the product name.
5. The method according to claim 4, characterized in that: If the initial question information includes the product name, the second key is an empty string, and the complete question information is the initial question information.
6. The method according to claim 1, characterized in that The step of generating answer information for the complete question information by using the retrieval enhancement generation technology includes: Retrieving a collection of document fragments containing answer content of the complete question information in the knowledge base; Filtering search results from the document fragment collection; The complete question information and the retrieval results are input into an answer generation model, and the answer information is output.
7. The method according to claim 6, characterized in that The step of filtering out the search results from the document fragment set includes: Convert the complete question information into a question vector; Reading the document vector of each document fragment in the document fragment set from the knowledge base; Calculating the similarity between the question vector and each of the document vectors; The document fragments are arranged in descending order according to the similarities, and a plurality of the document fragments with the highest order are extracted as the search results.
8. A system for generating FAQs, characterized in that: The system comprises: An initial question information extraction module is used to extract initial question information from product documents using a question generation model; A product name completion module, used to complete the product name corresponding to the product document for the initial question information based on a large language model to obtain complete question information; An answer information generation module, used to generate answer information for the complete question information by using a search enhancement generation technology; The FAQ generation module is used to generate the FAQ of the product document according to the complete question information and the answer information.
9. An electronic device, characterized in that: include: one or more processors; and One or more computer-readable storage media having instructions stored thereon, when executed by the one or more processors, enable the electronic device to execute the method for generating FAQs as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: The computer program stored therein enables the processor to execute the method for generating FAQs as claimed in any one of claims 1 to 7.
Citation Information
Cited By
FAQ knowledge base closed-loop optimization method based on million-level user message data
CN122064792A