A method and system for vertical domain intelligent question answering and suggestion
Patent Information
- Application Number
- CN202410484879.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-22
- Publication Date
- 2026-09-25
- Estimated Expiration
- 2044-04-22
AI Technical Summary
另外,传统的智能问答模型只能对用户的问题进行回答,无法满足人们对于个性化服务的需求
本发明提供的垂直领域智能问答和建议的方法通过两次检索增强生成技术,利用构建垂直领域知识库的方法,通过向量检索获取相关信息作为大模型输入的补充,即回答了用户的问题,也对用户下一步可能提出的问题进行了推测和回答,具有更高的准确性和时效性,也增加了反馈给用户的信息,具有更好的用户体验。同时,利用主动学习技术,通过构建用户问题和所选的偏好回答,构建数据集,对大模型进行微调,使得模型生成回答更符合用户偏好,能够满足用户个性化服务的需要。
Smart Images

Figure CN118520078B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of artificial intelligence technology, specifically relating to a method and system for intelligent question answering and suggestion in a vertical domain. Background Technology
[0002] Intelligent question answering is a task that utilizes artificial intelligence technology to enable computer systems to understand and answer natural language questions posed by users. This technology combines natural language processing and machine learning, analyzing the question context, extracting information, and using knowledge bases or pre-trained models to achieve efficient and accurate answer generation. Intelligent question answering is widely used in search engines, virtual assistants, and other fields, providing users with convenient information retrieval and problem-solving services.
[0003] Retrieval-enhanced generative techniques combine information retrieval with generative models, improving the text generation model's understanding of context to enhance the efficiency of retrieval systems. This technology can retrieve relevant information from large amounts of data and leverage generative models to produce more context-consistent and semantically rich results. In search engines and question-answering systems, retrieval-enhanced generative techniques provide more accurate and comprehensive answers, optimizing the user experience.
[0004] Active learning is a machine learning method that proactively selects the most informative samples for labeling to optimize model performance. Compared to traditional passive learning, active learning effectively reduces the number of labeled samples and lowers labeling costs by actively asking questions and selecting samples that are difficult to classify, while improving the model's accuracy on specific tasks. Active learning is widely used in situations where data is scarce or labeling costs are high, accelerating model iteration and training processes.
[0005] Traditional intelligent question answering methods suffer from limitations because the knowledge of the large model is fixed after pre-training, making them ineffective at answering timely questions. Retrieval-enhanced generation methods, however, utilize external knowledge bases to supplement the large model's input with timely information, allowing the model to generate answers with higher accuracy and timeliness. Furthermore, traditional intelligent question answering models can only answer user questions, failing to meet the demand for personalized services. Summary of the Invention
[0006] This invention addresses the problems of existing technologies by providing a method and system for intelligent question answering and suggestions in a vertical field. By continuously updating the external knowledge base, it improves the accuracy and timeliness of answers. Furthermore, through active learning, the system can gradually evolve to adapt to dynamic changes in user needs. Based on user questions and answers, the system infers the user's possible next questions and provides intelligent suggestions, thus offering users more information.
[0007] To achieve the above objectives, the technical solution adopted in this application is as follows: In a first aspect, the present invention provides a method for intelligent question answering and suggestion in a vertical domain, comprising: Build a local knowledge base; The system obtains the user's input question, searches the local knowledge base based on the user's input question, integrates the search results and the user's input question using prompting engineering, inputs them into a large model to obtain several answers, and the user selects one of the answers according to their preferences. After receiving the user's selected answer, the system uses prompting engineering to predict the user's next follow-up question. Then, it retrieves information related to the predicted question from the knowledge base, combines the search results with the predicted question, inputs them into the large model, and returns the final answer from the large model as an intelligent suggestion to the user. The active learning module constructs a dataset from user questions, user choices, and the final answers from the large model. The active learning module learns from the dataset and fine-tunes the large model periodically.
[0008] Furthermore, the step of building a local knowledge base includes: preprocessing knowledge from the vertical domain to build a local knowledge base.
[0009] Furthermore, the steps for retrieving user-input questions from the local knowledge base include: converting user questions into vectors using a vectorization model, and then retrieving them from the knowledge base using semantic matching.
[0010] Secondly, the present invention provides a system for intelligent question answering and suggestion in a vertical domain, comprising: The domain knowledge base construction module is configured to: build a local knowledge base using knowledge from the vertical domain and continuously update the domain knowledge; The retrieval module is configured to: use a vectorized model to transform queries into vector representations, and retrieve relevant information from the local knowledge base through vector retrieval; The intelligent question answering module is configured to: after the user enters a question, use the retrieval module to obtain relevant information, then integrate the user's question and relevant information through the prompting process, input the information into a large model to obtain several answers, and let the user choose the answer that best matches their preferences; The intelligent suggestion module is configured to: first, integrate the user's preferred answers and questions through prompting engineering, input them into the large model to obtain the inferred questions that the user may ask, then use the retrieval module to obtain relevant information based on the inferred questions, integrate the inferred questions and relevant information through prompting engineering, input them into the large model to obtain answers, and finally return the inferred questions and model answers to the user as the output of intelligent suggestions; The active learning module is configured to fine-tune the large question-answering model based on the dataset constructed from the model's answers to user questions and preferences, so that the answers output by the large model are more in line with user preferences.
[0011] Thirdly, the present invention provides a computer-readable storage medium comprising a stored program, wherein, when the program is running, the device on which the computer-readable storage medium resides executes the method for vertical domain intelligent question answering and suggestion as described in the first aspect.
[0012] Fourthly, the present invention provides an electronic device including a memory for storing computer program instructions and a processor for executing the program instructions, wherein when the computer program instructions are executed by the processor, the electronic device is triggered to execute the vertical domain intelligent question answering and suggestion method described in the first aspect.
[0013] Compared with the prior art, the advantages and positive effects of the present invention are as follows: The vertical domain intelligent question answering and suggestion method provided by this invention employs a two-stage retrieval enhancement generation technique. It utilizes a method of constructing a vertical domain knowledge base and obtains relevant information through vector retrieval as a supplement to the input of a large model. This not only answers the user's question but also predicts and answers the user's next possible questions, resulting in higher accuracy and timeliness, and increased information provided to the user, leading to a better user experience. Simultaneously, by utilizing active learning technology, a dataset is constructed based on user questions and selected preferred answers. This dataset is then fine-tuned to make the model's generated answers more aligned with user preferences, meeting the needs of personalized services. Attached Figure Description
[0014] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0015] Figure 1 This is a schematic diagram of the structure of the vertical domain intelligent question answering and suggestion system based on retrieval enhancement generation and active learning according to the present invention; Figure 2 This is a schematic diagram of the retrieval module of the present invention; Figure 3 This is a schematic diagram of the domain knowledge base construction module and the active learning module of the present invention. Detailed Implementation
[0016] To better understand the above-mentioned objectives, features, and advantages of the present invention, the present invention will be further described below in conjunction with the accompanying drawings and embodiments. It should be noted that, unless otherwise specified, the embodiments and features described in these embodiments can be combined with each other.
[0017] Numerous specific details are set forth in the following description in order to provide a full understanding of the invention. However, the invention may also be practiced in other ways than those described herein, and therefore the invention is not limited to the specific embodiments disclosed in the following specification.
[0018] Example 1, as Figures 1-3 As shown, this embodiment provides a method for intelligent question answering and suggestion in a vertical domain. The domain knowledge base construction module builds a local knowledge base using knowledge from the vertical domain and continuously updates the domain knowledge to ensure its timeliness. The retrieval module uses a vectorization model to transform queries into vector representations and retrieves relevant information from the local knowledge base through vector retrieval. After the user inputs a question, the intelligent question answering module uses the retrieval module to obtain relevant information, then integrates the user's question and related information through a prompting process, inputs it into a large model to obtain several answers, and allows the user to choose the answer that best matches their preferences. The intelligent suggestion module first integrates preferred answers and the user's question through a prompting process, inputs it into a large model to obtain inferred questions the user might ask, then uses the retrieval module to obtain relevant information based on the inferred questions, integrates the inferred questions and related information through a prompting process, inputs it into the large model to obtain answers, and finally returns the inferred questions and model answers to the user as intelligent suggestions. The active learning module fine-tunes the question answering model based on the dataset constructed from the user's questions and preferred model answers, making the answers output by the large model more consistent with the user's preferences.
[0019] The specific techniques involved in vectorization models, which transform queries into vector representations, typically involve using neural network models to convert text or other data inputs into dense vector representations. The Transformer is a widely used deep learning model that performs well in natural language processing tasks.
[0020] One of the core components of the Transformer model is the Transformer Encoder. When processing queries, the Transformer Encoder receives an input sequence and transforms it into a series of context-aware vector representations through a series of self-attention mechanisms and feedforward neural network layers. These vector representations are called "encoder hidden states," and they capture semantic information at each position in the input sequence.
[0021] Transformer: Transformer is the model structure for large models. Large models are obtained by pre-training and fine-tuning on high-quality data based on the Transformer model structure.
[0022] "Prompt Engineering" is a technical approach that aims to guide a model to generate the desired output by designing and optimizing prompt text.
[0023] Hint Engineering: The goal of hint engineering is to build more reasonable model inputs so that the output of large models better meets user needs. For example, if users have requirements on the number of characters or format of the model output, hint engineering is needed to build more stringent model inputs so that the output of large models meets user requirements.
[0024] Cue engineering involves selecting or designing appropriate cue text to ensure that the model understands and follows the user's intent when generating output. Cue text typically includes a problem description, example inputs and outputs, keywords, or templates to help the model understand the task requirements and context. Cue engineering controls the quality, style, and content of the generated results by adjusting the content and structure of the cue text, as well as the model's input settings.
[0025] Hint engineering is used to optimize the text of input and output for large models. For example, when a question is input, hint engineering pre-inputs the background of the question, and the large model outputs a targeted answer based on the background guidance. For example, when the input question is "What is 1+1?", the large model will answer "1+1 equals 2" without hint engineering. However, when hint engineering provides the background as a number that a primary school teacher needs to answer a question in the course of teaching, the large model will answer "2".
[0026] The input model is used to extract predicted user questions, which is also done using suggestion engineering. For example: A user asked: "What will the weather be like tomorrow?" The large model replied: 'Tomorrow's temperature will be 3-10 degrees Celsius.' The project integrates user questions and answers from the large model to create new prompts: Question: 'What will the weather be like tomorrow?' Answer: Tomorrow's temperature will be 3-10 degrees Celsius. Based on the questions and answers, what do you think the next question might be? The new prompt words are input into the large model to obtain the model's response, which is a prediction of the user's next question.
[0027] The active learning module is a technical component used to build datasets based on user questions and preferences, and to fine-tune large question-answering models using these datasets.
[0028] The active learning module collects dialogue data—combining user questions and model responses—from real-time or historical data through user interaction or supervised learning algorithms. This dialogue data may contain user questions, expected answers, feedback, etc. This data may then require manual annotation to ensure the quality and accuracy of the dataset.
[0029] Using the constructed dialogue dataset, the active learning module fine-tunes the large question-answering model. The goal of fine-tuning is to adjust the model parameters to better adapt to specific user questions and preferences, thereby improving the model's effectiveness and performance in real-world applications.
[0030] The specific steps are as follows: The domain knowledge base construction module uses knowledge from the vertical domain to build a local knowledge base and continuously updates the domain knowledge to ensure the timeliness of the knowledge.
[0031] The retrieval module uses a vectorized model to transform queries into vector representations and retrieves relevant information from the local knowledge base through vector retrieval.
[0032] After the user enters a question, the intelligent question-answering module uses the retrieval module to obtain relevant information, and then integrates the user's question and relevant information through the prompting process. After inputting into a large model, it obtains several answers, and the user selects the answer that best matches their preferences.
[0033] The intelligent suggestion module first integrates preferred answers and user questions through prompting engineering, inputs them into a large model to obtain inferred questions that the user might ask, then uses a retrieval module to obtain relevant information based on the inferred questions, integrates the inferred questions and relevant information through prompting engineering, inputs them into a large model to obtain answers, and finally returns the inferred questions and model answers to the user as the output of intelligent suggestions.
[0034] The active learning module fine-tunes the large question-answering model based on the dataset constructed from the model's answers to user questions and preferences, making the answers output by the large model more in line with user preferences.
[0035] This method is characterized by constructing a local knowledge base within a vertical domain and utilizing retrieval-enhanced generative techniques to acquire information relevant to user questions. A large model then answers user questions based on this supplementary information, resulting in higher accuracy and timeliness. Simultaneously, this method employs active learning techniques, allowing users to select their preferred model answers to construct a (question, answer) dataset and fine-tuning the large model to ensure its responses better align with user preferences. Furthermore, this method not only answers the user's original question but also predicts the user's next possible question and returns the system's answer, fully leveraging retrieval-enhanced generative techniques. For users, this intelligent question-answering and suggestion system provides richer information and a better user experience.
[0036] The vertical domain intelligent question answering and suggestion method provided in this embodiment fully utilizes retrieval-enhanced generation technology to obtain relevant information from a constructed vertical knowledge base based on user questions, supplementing the input of the large model and improving the timeliness and accuracy of the answers. Furthermore, it infers the user's next possible questions based on the model's answers and the user's questions, and returns corresponding answers using the retrieved relevant information and the large model. As a question answering system, this provides users with richer information and enhances the user experience. Simultaneously, through active learning technology, it fine-tunes the large model using a dataset constructed from user questions and selected preference answers, making the model-generated answers more aligned with user preferences and meeting personalized service needs.
[0037] Example 2 provides a vertical domain intelligent question answering and suggestion system, including a domain knowledge base construction module, a retrieval module, an intelligent question answering module, an intelligent suggestion module, and an active learning module. The domain knowledge base construction module builds a local knowledge base using knowledge from the vertical domain and continuously updates the domain knowledge to ensure its timeliness. The retrieval module uses a vectorization model to transform queries into vector representations and retrieves relevant information from the local knowledge base through vector retrieval. After the user inputs a question, the intelligent question answering module uses the retrieval module to obtain relevant information, then integrates the user's question and related information through a suggestion engineering process, inputs it into a large model to obtain several answers, and allows the user to choose the answer that best matches their preferences. The intelligent suggestion module first integrates preferred answers and the user's question through suggestion engineering, inputs it into a large model to obtain inferred questions the user might ask, then uses the retrieval module to obtain relevant information based on the inferred questions, integrates the inferred questions and related information through suggestion engineering, inputs it into the large model to obtain answers, and finally returns the inferred questions and model answers to the user as intelligent suggestions. The active learning module fine-tunes the large question-answering model based on the dataset constructed from the model's answers to user questions and preferences, making the answers output by the large model more in line with user preferences.
[0038] The method provided by this invention employs a two-stage retrieval enhancement generation technique. By utilizing a vertical domain knowledge base, it obtains relevant information through vector retrieval to supplement the input of a large model. This not only answers the user's question but also predicts and answers the user's next possible questions, resulting in higher accuracy and timeliness. It also increases the information provided to the user, leading to a better user experience. Simultaneously, by utilizing active learning technology, a dataset is constructed based on the user's question and selected preferred answers. This dataset is then fine-tuned to make the model's generated answers more aligned with user preferences, thus meeting the needs of personalized services.
[0039] To facilitate understanding of the present invention, an embodiment is given below, taking intelligent question-and-answer for patients with diseases in the medical field as an example: Domain knowledge base construction module: By combining traditional search engines with specific medical knowledge bases, it obtains more comprehensive and real-time medical knowledge fragments.
[0040] Retrieval module: It uses a vectorized model to transform queries into vector representations and retrieves relevant medical knowledge fragments from the knowledge base through vector retrieval.
[0041] Intelligent question answering module: After the patient inputs a question, the retrieval module retrieves relevant medical knowledge fragments, and then the prompting process integrates the question and relevant medical knowledge fragments. After inputting into a large model, several answers are obtained, and the patient selects the answer that best matches their preferences.
[0042] The intelligent suggestion module integrates preferred answers and patient questions through prompting engineering, inputs them into a large model to obtain inferred questions that the patient might ask, then uses a retrieval module to obtain relevant medical knowledge fragments based on the inferred questions, integrates the inferred questions and relevant medical knowledge fragments through prompting engineering, inputs them into the large model to obtain answers, and finally returns the inferred questions and model answers together to the patient as the output of intelligent suggestions.
[0043] Active learning module: Through real-time interaction with patients and the system, it collects user feedback, continuously optimizes model parameters and weights, and achieves active learning so that the model's output answers better match user preferences.
[0044] Example 3: This example provides a computer-readable storage medium including a stored program, wherein, when the program is running, it controls the device where the computer-readable storage medium is located to execute the vertical domain intelligent question answering and suggestion method described in Example 1.
[0045] Example 4: This example provides an electronic device, including a memory for storing computer program instructions and a processor for executing the program instructions, wherein when the computer program instructions are executed by the processor, the electronic device is triggered to execute the vertical domain intelligent question answering and suggestion method described in Example 1.
[0046] The above description is merely a preferred embodiment of the present invention and is not intended to limit the present invention in any other way. Any person skilled in the art may make changes or modifications to the above-disclosed technical content to create equivalent embodiments that can be applied to other fields. However, any simple modifications, equivalent changes, and modifications made to the above embodiments based on the technical essence of the present invention without departing from the scope of the present invention shall still fall within the protection scope of the present invention.
Claims
1. A method for intelligent question answering and suggestion in a vertical domain, characterized in that, include: Build a local knowledge base; The system obtains the user's input question, searches the local knowledge base based on the user's input question, integrates the search results and the user's input question using prompting engineering, inputs them into a large model to obtain several answers, and the user selects one of the answers according to their preferences. After receiving the user's selected answer, the system uses prompting engineering to predict the user's next follow-up question. Then, it retrieves information related to the predicted question from the knowledge base, combines the search results with the predicted question, inputs them into the large model, and returns the final answer from the large model as an intelligent suggestion to the user. The active learning module constructs a dataset from user questions, user choices, and the final answers from the large model. The active learning module learns from the dataset and fine-tunes the large model periodically. The steps for building a local knowledge base include: preprocessing knowledge from the vertical domain to build a local knowledge base; The steps for retrieving user-input questions from a local knowledge base include: converting user questions into vectors using a vectorization model, and then retrieving them from the knowledge base using semantic matching. By leveraging retrieval-enhanced generation techniques, relevant information is retrieved from a constructed vertical knowledge base based on user questions, supplementing the input of the large model and improving the timeliness and accuracy of responses. Furthermore, the system infers potential next questions from users based on model answers and user questions, and returns corresponding answers using retrieved information and the large model, providing users with richer information and enhancing the user experience. Simultaneously, through active learning techniques, the large model is fine-tuned using a dataset constructed from user questions and selected preference answers, making the model's generated answers more aligned with user preferences and meeting personalized service needs. The specific technical aspects of vectorization models, which transform queries into vector representations, involve using neural network models to convert text or other data inputs into dense vector representations. These neural network models employ the Transformer, and one of the core components of the Transformer model is the Transformer Encoder. When processing queries, the Transformer Encoder receives the input sequence and transforms it into a series of context-aware vector representations through a series of self-attention mechanisms and feedforward neural network layers. These vector representations are called "encoder hidden states," and they capture semantic information at each position in the input sequence. The Transformer is the model architecture for large-scale models, which are obtained through high-quality data pre-training and fine-tuning based on the Transformer model architecture. Cue engineering aims to guide models to generate desired outputs by designing and optimizing cue text. Its goal is to construct more reasonable model inputs so that the output of large models better meets user needs. When users have requirements regarding the word count or format of the model's output, cue engineering constructs the model input to ensure the large model's output meets user requirements. Cue engineering selects or designs appropriate cue texts to ensure the model understands and follows the user's intent when generating output. Cue texts typically include question descriptions, example inputs and outputs, keywords, or templates to help the model understand the task requirements and context. Cue engineering controls the quality, style, and content of the generated results by adjusting the content and structure of the cue text, as well as the model's input settings. Cue engineering is used for text optimization of the input and output of large models. When a question is input, cue engineering pre-inputs the background of the question, guiding the large model to output a targeted answer based on this background information.
2. A system for intelligent question answering and suggestion in a vertical domain, characterized in that, include: The domain knowledge base construction module is configured to: build a local knowledge base using knowledge from the vertical domain and continuously update the domain knowledge; The retrieval module is configured to: use a vectorized model to transform queries into vector representations, and retrieve relevant information from the local knowledge base through vector retrieval; The intelligent question answering module is configured to: after the user enters a question, use the retrieval module to obtain relevant information, then integrate the user's question and relevant information through the prompting process, input the information into a large model to obtain several answers, and let the user choose the answer that best matches their preferences; The intelligent suggestion module is configured to: first, integrate the user's preferred answers and questions through prompting engineering, input them into the large model to obtain the inferred questions that the user may ask, then use the retrieval module to obtain relevant information based on the inferred questions, integrate the inferred questions and relevant information through prompting engineering, input them into the large model to obtain answers, and finally return the inferred questions and model answers to the user as the output of intelligent suggestions; The active learning module is configured to fine-tune the large question-answering model based on the dataset constructed from the model's answers to user questions and preferences, so that the answers output by the large model are more in line with user preferences. The steps for building a local knowledge base include: preprocessing knowledge from the vertical domain to build a local knowledge base; The steps for retrieving user-input questions from a local knowledge base include: converting user questions into vectors using a vectorization model, and then retrieving them from the knowledge base using semantic matching. By leveraging retrieval-enhanced generation techniques, relevant information is retrieved from a constructed vertical knowledge base based on user questions, supplementing the input of the large model and improving the timeliness and accuracy of responses. Furthermore, the system infers potential next questions from users based on model answers and user questions, and returns corresponding answers using retrieved information and the large model, providing users with richer information and enhancing the user experience. Simultaneously, through active learning techniques, the large model is fine-tuned using a dataset constructed from user questions and selected preference answers, making the model's generated answers more aligned with user preferences and meeting personalized service needs. The specific technical aspects of vectorization models, which transform queries into vector representations, involve using neural network models to convert text or other data inputs into dense vector representations. These neural network models employ the Transformer, and one of the core components of the Transformer model is the Transformer Encoder. When processing queries, the Transformer Encoder receives the input sequence and transforms it into a series of context-aware vector representations through a series of self-attention mechanisms and feedforward neural network layers. These vector representations are called "encoder hidden states," and they capture semantic information at each position in the input sequence. The Transformer is the model architecture for large-scale models, which are obtained through high-quality data pre-training and fine-tuning based on the Transformer model architecture. Cue engineering aims to guide models to generate desired outputs by designing and optimizing cue text. Its goal is to construct more reasonable model inputs so that the output of large models better meets user needs. When users have requirements regarding the word count or format of the model's output, cue engineering constructs the model input to ensure the large model's output meets user requirements. Cue engineering selects or designs appropriate cue texts to ensure the model understands and follows the user's intent when generating output. Cue texts typically include question descriptions, example inputs and outputs, keywords, or templates to help the model understand the task requirements and context. Cue engineering controls the quality, style, and content of the generated results by adjusting the content and structure of the cue text, as well as the model's input settings. Cue engineering is used for text optimization of the input and output of large models. When a question is input, cue engineering pre-inputs the background of the question, guiding the large model to output a targeted answer based on this background information.
3. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes a stored program, wherein, when the program is executed, it controls the device on which the computer-readable storage medium resides to perform the method for vertical domain intelligent question answering and suggestion as described in claim 1.
4. An electronic device, characterized in that, It includes a memory for storing computer program instructions and a processor for executing the program instructions, wherein when the computer program instructions are executed by the processor, the electronic device is triggered to execute the vertical domain intelligent question answering and suggestion method of claim 1.
Citation Information
Patent Citations
Robot interaction method and system based on user feedback knowledge base
CN105938484A
Efficient network retrieval enhanced answering method and system oriented to human preferences
CN116501843A
Law and regulation question-answering system based on generative language model and construction method
CN117271716A