Intelligent question answering method based on large language model, electronic equipment and storage medium

By obtaining the original questions and generating similar questions in the large language model question-and-answer system, matching the vector database to obtain relevant text, and generating the final answers in combination with the preliminary answers, the large language model's inaccurate answers when processing highly professional or private data is solved, and the answer accuracy in a specific field or private data environment is improved.

CN119807374APending Publication Date: 2025-04-11SHENZHEN GRANDSTREAM NETWORKS TECH
View PDF 0 Cites 3 Cited by

Patent Information

Application Number
CN202411928651.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-25
Publication Date
2025-04-11

AI Technical Summary

Technical Problem

When using large language models for question-and-answer questions, the generated answers may not be accurate enough when facing highly professional or private data, and the user's questions may be vague or ambiguity, which makes LLM unable to accurately understand the user's true intentions.

Method used

By obtaining the original problem and matching the vector database of the corresponding category, similar problems are generated, and similar problems are matched in the vector database of the corresponding category, several texts matching the similar problems are obtained. Enter similar questions and matching text into a large language model, generate initial answers to similar questions, and then enter the original questions and initial answers into a large language model, generating the final answer.

Benefits of technology

By automatically analyzing and reconstructing the user's original questions, a variety of possible query variants are generated, which prompts the large language model to generate richer answer options, avoiding incomplete answers or deviations from the true intention due to unclear user statements, and effectively improving the accuracy of answers.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119807374A_ABST
    Figure CN119807374A_ABST
Patent Text Reader

Abstract

The embodiment of the invention relates to the field of artificial intelligence, and discloses an intelligent question and answer method based on a large language model, electronic equipment and a storage medium. The intelligent question answering method comprises the steps of obtaining an original question and matching a corresponding category vector database; wherein the vector database comprises vector data stored by taking different item information as categories and corresponding original texts; inputting the user original question into a large language model to generate at least one similar question; matching the similar questions in the vector database of the corresponding category to obtain a plurality of texts matched with the similar questions; inputting the similar questions and the plurality of matched texts into the large language model to generate preliminary answers of the similar questions; and inputting the original question and the preliminary answer into the large language model to generate a final answer. According to the method disclosed by the invention, the understanding of questions can be enhanced, and the accuracy of answers can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] Embodiments of the present invention relate to the fields of artificial intelligence and natural language processing, and in particular to an intelligent question-answering method, electronic device, and storage medium based on a large language model. Background Art

[0002] With the rapid development of artificial intelligence and natural language processing technology, Large Language Model (LLM) has been widely used in intelligent question-answering systems. LLM has powerful language understanding and generation capabilities through pre-training on large-scale corpora, and can handle a variety of natural language tasks. This enables LLM-based intelligent question-answering systems to provide answers close to human level in open fields, providing users with a more convenient and efficient interactive experience.

[0003] However, when related technologies use large language models for question answering, they usually directly input user questions into the model to generate answers. This method has some problems when dealing with specific fields or private data. Since LLM mainly relies on public general corpora for training and lacks expertise in specific fields, when the existing LLM is directly used for highly professional or private data, the generated answers may not be accurate enough, and may even appear to be "hallucinations" that do not match the actual situation. In addition, the user's questions may contain vague or ambiguous expressions, which will cause LLM to be unable to accurately understand the user's true intentions and unable to generate accurate answers through a single response. Summary of the invention

[0004] The purpose of the embodiments of the present invention is to provide an intelligent question-answering method, electronic device and storage medium based on a large language model, so as to provide more accurate answers when the user's questions are ambiguous or ambiguous.

[0005] To solve the above technical problems, an embodiment of the present invention provides an intelligent question-answering method based on a large language model, comprising: obtaining an original question and matching it with a corresponding category vector database; wherein the vector database is vector data and corresponding original texts stored in categories of different project information; inputting the user's original question into the large language model to generate at least one similar question; matching the similar question in the corresponding category vector database to obtain several texts matching the similar question; inputting the similar question and the several matched texts into the large language model to generate a preliminary answer to the similar question; inputting the original question and the preliminary answer into the large language model to generate a final answer.

[0006] An embodiment of the present invention also provides an electronic device, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the intelligent question-answering method based on a large language model as described above.

[0007] An embodiment of the present invention further provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the intelligent question-answering method based on a large language model as described above.

[0008] In an embodiment of the present invention, an intelligent question-answering method based on a large language model is provided. The electronic device first obtains the original data and matches the vector database of the corresponding category to ensure that the subsequent processing is based on data in the relevant field. Before answering the user's question, the system generates at least one similar question based on the user's question, first generates answers to similar questions as preliminary answers, and then combines the user's question and the preliminary answer to generate the final answer. Through this mechanism, the electronic device can automatically analyze and reconstruct the user's original question, generate a variety of possible query variants, and prompt the large language model to generate richer answer options, avoiding the situation where the answer is incomplete or deviates from the true intention due to unclear user expression, and solves the problem of unclear understanding of vague or ambiguous user questions, and effectively improves the accuracy of answers in specific fields or private data environments.

[0009] In addition, similar questions are matched in the corresponding category vector database to obtain several texts matching the similar questions, including: matching the similar questions in the corresponding category vector database to obtain multiple candidate texts with the highest relevance to the similar questions; based on the similarity between the keyword groups in the similar questions and the multiple candidate texts, the multiple candidate texts are reordered and screened to obtain the several texts. After similar questions are matched in the vector database of the corresponding category and multiple candidate texts are obtained, the electronic device reorders and screens these multiple candidate texts based on the keyword groups. This process optimizes the multiple candidate text results of the initial match by removing redundancy and improving accuracy, and realizes similarity sorting and redundancy elimination from different angles. This ensures that the final matched text has a higher correlation with similar questions, thereby improving the accuracy and relevance of the subsequent generation of preliminary answers.

[0010] In addition, similar questions and several matching texts are input into the large language model to generate preliminary answers to similar questions, including: taking the several texts as known information, inputting the known information and the similar questions into the large language model, so that the large language model can generate preliminary answers to the similar questions based on the understanding of the known information; the original question and the preliminary answer are input into the large language model to generate the final answer, including: taking the preliminary answer as known information, inputting the known information and the original question into the large language model, so that the large language model can generate the final answer based on the understanding of the known information. When similar questions and several matching texts are input into the large language model together to generate preliminary answers, the several matching texts are used as known information. When the original question and the preliminary answer are input into the large language model together to generate the final answer, the preliminary answer is used as known information, and the large language model answers the original question based on the understanding of the preliminary answer. In this way, the scope of the answer can be limited to the known information that has been queried, thereby improving the accuracy of the answer. BRIEF DESCRIPTION OF THE DRAWINGS

[0011] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0012] Figure 1 It is a flow chart of an intelligent question-answering method based on a large language model provided in an embodiment of the present application;

[0013] Figure 2 is a schematic diagram of an intelligent question-answering method based on a large language model provided in an embodiment of the present application;

[0014] Figure 3 It is a flowchart of another intelligent question-answering method based on a large language model provided in an example of this application;

[0015] Figure 4 It is a structural schematic diagram of an electronic device provided in the example of this application. DETAILED DESCRIPTION

[0016] When related technologies use large language models for question-answering, they usually directly input users' questions into the model to generate answers. As a result, when the existing LLM is used directly for highly professional or private data, the generated answers may not be accurate enough, and may even produce "hallucinations" that do not match the actual situation. In addition, users' questions may contain vague or ambiguous expressions, which will cause the LLM to be unable to accurately understand the user's true intentions and unable to generate accurate answers through a single answer. Therefore, there is an urgent need for an intelligent question-answering method that can understand user questions and give accurate answers.

[0017] To make the purpose, technical scheme and advantages of the embodiments of the present invention clearer, the embodiments of the present invention will be described in detail below in conjunction with the accompanying drawings. However, it will be appreciated by those skilled in the art that in the embodiments of the present invention, many technical details are proposed in order to enable the reader to better understand the present application. However, even without these technical details and various changes and modifications based on the following embodiments, the technical scheme claimed in the present application can be implemented. The division of the following embodiments is for the convenience of description, and should not constitute any limitation on the specific implementation of the present invention. The various embodiments can be combined and referenced with each other without contradiction.

[0018] An embodiment of the present invention relates to an intelligent question-answering method based on a large language model, which can be applied to electronic devices. The method includes: obtaining an original question and matching a corresponding category vector database; wherein the vector database is vector data and corresponding original texts stored in categories of different project information; inputting the original question of the user into the large language model to generate at least one similar question; matching the similar question in the corresponding category vector database to obtain several texts matching the similar question; inputting the similar question and the several matched texts into the large language model to generate a preliminary answer to the similar question; inputting the original question and the preliminary answer into the large language model to generate a final answer. By reconstructing the original question of the user, a variety of possible query variants are generated, which prompts the large language model to generate richer answer options, avoids the situation where the answer is incomplete or deviates from the true intention due to unclear expression of the user, and effectively improves the accuracy of the answer. The following is a specific description of the implementation details of an intelligent question-answering method based on a large language model in an embodiment of the present invention. The following content is only the implementation details provided for the convenience of understanding, and is not necessary for the implementation of this solution.

[0019] like Figure 1 As shown, an intelligent question answering method based on a large language model provided in an embodiment of the present application may include the following steps:

[0020] In step 101, the original question is obtained and matched with a corresponding category vector database, wherein the vector database is vector data stored in categories of different project information and the corresponding original text.

[0021] In a possible implementation manner, the item information category in the above steps may be a specific switch signal.

[0022] In a possible implementation manner, before obtaining the original question and matching the corresponding category vector database, the following may also be included:

[0023] Acquire a private document, and preprocess data of the private document;

[0024] Vectorizing the preprocessed data;

[0025] Taking the project information of the private document as a category, the vectorized data is stored in a vector database of a corresponding category to obtain private vector databases D1, D2 to Dn, where n is the number of project information categories.

[0026] For example, Figure 2 Before the electronic device provides the question-and-answer function, a vector database based on private document data can be pre-built to handle questions related to this data. The specific steps are as follows: First, the electronic device collects private document data in a specific field, such as user manuals and technical introduction documents of company products. Then, the collected data is pre-processed, including extracting text information from PDF and Word files, and reorganizing the table content in the data into text descriptions. Next, the electronic device performs cleaning operations on the pre-processed data to ensure the quality and consistency of the data. These operations include removing invalid words, dividing into blocks and sentences, and deleting stop words. After the cleaning is completed, the electronic device uses a vector model (such as the paraphrase-multilingual-MiniLM-L12-v2 vector model) to vectorize the data to obtain vectorized private document data. Finally, the electronic device stores the vectorized data in the vector database of the corresponding category according to the project information category in the private document data, forming vector databases D1, D2 to Dn, where n is the number of project information categories.

[0027] For example, private documents can come from the company's product manuals and product technical introduction documents.

[0028] In a possible implementation, this step includes:

[0029] Get the original question;

[0030] Inputting the original question into the large language model, and extracting item information words of the original question;

[0031] Based on the item information words of the original question, the vector database of the corresponding category is matched to obtain the matched vector database Dm.

[0032] For example, after receiving the original question input by the user, the electronic device first converts the original question into a prompt word for extracting project information data through a prompt word template, and inputs the prompt word into the large language model. Subsequently, the electronic device extracts the project information data from the original question using the large language model. Based on the extracted project information data, the electronic device matches the vector data database Dm with the same project information category as the original question in the constructed vector database.

[0033] In step 102, the original question of the user is input into a large language model to generate at least one similar question.

[0034] Example, combined Figure 1 and Figure 2 The electronic device first converts the user's original question into a prompt word for generating similar questions through a prompt word template, and then inputs the prompt word into a large language model to generate at least one similar question Q1, Q2 to Qn.

[0035] By inputting the user's original question into the large language model to generate multiple similar questions, possible query variants can be generated from multiple angles, prompting the large language model to generate richer answer options, avoiding incomplete answers or deviations from the true intention due to unclear user expressions, and effectively improving the accuracy of the answers.

[0036] In a possible implementation, this step may include: converting the input text into prompt words through a prompt word template; inputting the prompt words into the large language model to generate similar questions.

[0037] For example, a prompt word template for generating similar questions may include two parts: task description and question and answer examples:

[0038] (1) Task description: This part provides detailed instruction information to the large language model and is used to set the model's processing method.

[0039] One implementation may be as shown in the following table (see the task description section of Table 1), including task instructions and task output constraints. Task instructions are used to define the roles and responsibilities of the model, and task output constraints are used to limit the processing method and output structure of the model.

[0040] (2) Question-answering examples: This section provides examples of analogy learning for large language models (see the example section in Table 1).

[0041] Table 1

[0042]

[0043]

[0044] In step 103, the similar questions are matched in the corresponding category vector database to obtain a number of texts matching the similar questions.

[0045] In a possible implementation, this step may include:

[0046] Matching the similar questions in the vector database of the corresponding category to obtain a plurality of candidate texts with the highest relevance to the similar questions;

[0047] Among them, each similar question Qi corresponds to a set of multiple candidate texts Pi, so there are P1, P2 to Pn;

[0048] Based on the similarity between the keyword groups in the similar questions and the multiple candidate texts, the multiple candidate texts are reordered and screened to obtain the multiple texts;

[0049] Among them, for n groups of multiple candidate texts, n groups of reordered texts R1, R2 to Rn are obtained.

[0050] For example, Figure 3 A specific implementation method including the above steps is shown, wherein steps 301, 302, 305 and 306 are Figure 1 101, 102, 104 and 105 correspond to each other. Figure 1 , this embodiment refines step 103 into steps 304 and 305. Specifically, when obtaining a number of texts matching similar questions, firstly, the similar questions are matched in the vector database of the corresponding category to obtain a plurality of candidate texts P1, P2 to Pn with the highest relevance to the similar questions (such as step 304). Next, based on the similarity between the keyword groups in the similar questions and these multiple candidate texts, they are reordered and screened, and finally a number of processed texts R1, R2 to Rn are obtained (such as step 305).

[0051] In a possible implementation, the step of matching the similar questions in the vector database of the corresponding category to obtain a plurality of candidate texts with the highest relevance to the similar questions may further include:

[0052] Performing vectorization processing on the similar problems to obtain vector data of the similar problems;

[0053] Among them, n similar problems are vectorized to obtain n vector data E1, E2 to En;

[0054] Calculate the similarity between the vector data of the similar problem and the vectors in the vector database of the corresponding category;

[0055] Obtain multiple similarity vectors with the highest similarity;

[0056] Obtaining multiple candidate texts corresponding to the multiple similarity vectors;

[0057] Among them, for n groups of similar questions, n groups of multiple candidate texts P1, P2 to Pn are obtained by matching.

[0058] In a possible implementation, the above-mentioned reordering and screening the multiple candidate texts based on the similarity between the keyword group in the similar question and the multiple candidate texts to obtain the multiple texts may also include:

[0059] Inputting the similar questions into the large language model to extract keyword groups;

[0060] Among them, n similar questions are extracted to obtain n groups of key words K1, K2 to Kn;

[0061] Calculating the similarity between the keyword group and the plurality of candidate texts;

[0062] Re-arrange the plurality of candidate texts from high to low according to the similarity;

[0063] The plurality of texts are obtained by removing texts that do not contain any keyword in the keyword group from the plurality of candidate texts.

[0064] Among them, n similar questions are reordered and screened to obtain n groups of texts R1, R2 to Rn.

[0065] For example, the electronic device first vectorizes similar questions Q1, Q2 to Qn to obtain corresponding vector representations E1, E2 to En. Then, the similarity between each similar question vector Ei and all vectors in the vector database of the corresponding project information category is calculated, and multiple candidate texts corresponding to several vectors with the highest similarity are selected as matching results. For n similar questions, this step will obtain n groups of multiple candidate text groups P1, P2 to Pn; next, the keyword group of each similar question is extracted using a large language model to obtain n groups of keyword groups K1, K2 to Kn. For each similar question, the similarity between its keyword group and the corresponding multiple candidate texts is calculated, and multiple candidate texts are rearranged from high to low according to the similarity, and candidate texts that do not contain any keyword are removed, and finally several texts after reordering and screening are obtained. This process enables each similar question to obtain n groups of texts R1, R2 to Rn after matching.

[0066] Through the above examples, when similar questions are matched in the vector database of the corresponding category and multiple candidate texts are obtained, the electronic device reorders and screens these multiple candidate texts based on the keyword group. This process optimizes the multiple candidate text results of the initial match by removing redundancy and improving accuracy, and realizes similarity sorting and redundancy elimination from different angles. This ensures that the final matched text has a higher relevance to similar questions, thereby improving the accuracy and relevance of the subsequent generation of preliminary answers.

[0067] In a possible implementation manner, after matching each similar question in the vector database of the corresponding category, the number of multiple candidate texts with the highest relevance to the similar question may be ten.

[0068] In a possible implementation manner, in the specific implementation method of matching the similar questions in the vector database of the corresponding category, the similarity calculation method may adopt the Euclidean distance, cosine similarity and Jaccard similarity method.

[0069] For example, the prompt word template for extracting keyword groups may include two parts: task description and question and answer examples, as shown in Table 2 for details.

[0070] Table 2

[0071]

[0072] In step 104, the similar questions and the matching texts are input into the large language model to generate preliminary answers to the similar questions.

[0073] In a possible implementation, the specific steps may include:

[0074] Taking the plurality of texts as known information, inputting the known information and the similar questions into the large language model, so that the large language model generates preliminary answers to the similar questions based on its understanding of the known information;

[0075] Among them, n similar questions eventually generate n preliminary answers A1, A2 to An.

[0076] Example, combined Figure 2, the electronic device first generates a preliminary answer for each similar question and its matching texts through a large language model, preparing for the subsequent production of the final answer. The specific steps are as follows: First, for each similar question, the matching texts are used as known information, and the similar questions and known information are constructed into prompt words through a prompt word template. Then the constructed prompt words are input into the large language model, so that it can answer the corresponding questions according to the known information and generate preliminary answers. In this way, n similar questions can generate preliminary answers A1, A2 to An.

[0077] In the above implementation, similar questions and their matching texts are input into the large language model, and the texts are used as known information. The large language model answers similar questions based on its understanding of known information, thereby limiting the scope of answers to the known information that has been queried, thereby improving the accuracy of the answers.

[0078] For example, a prompt word template for answering questions based on known information may include two parts: task description and question and answer example:

[0079] (1) Task description: This part provides detailed instruction information for the large language model, which is used to set the model's processing method.

[0080] One implementation method may be as shown in the following table (see the task description section of Table 3).

[0081] (2) Question and answer examples: This section provides examples for analogy learning of the large language model (see the example section in Table 3). The input content includes two parts: known information and questions. The large language model answers the input questions based on its understanding of the input known information. As shown in Question 1 and Output 1 in Table 3, when the known information learned by the large language model is related to the question, the large language model will answer the user's question based on the known information. However, as shown in Question 2 and Output 2 in Table 3, when the content of the user's question is irrelevant to the known information learned by the large language model, the large language model cannot answer the question and will give a preset prompt word.

[0082] Table 3

[0083]

[0084]

[0085]

[0086] In step 105, the original question and the preliminary answer are input into the large language model to generate a final answer.

[0087] In a possible implementation, the specific steps may include:

[0088] The preliminary answers A1, A2 and An are used as known information, and the known information and the original question are input into the large language model, so that the large language model generates the final answer based on its understanding of the known information.

[0089] Example, combined Figure 2 The electronic device first takes the original question input by the user as the question, takes the preliminary answers A1, A2 and An obtained in step 104 as known information, and constructs prompt words through the prompt word template. Then, the constructed prompt words are input into the large language model, so that it answers the corresponding question according to the known information and generates the final answer.

[0090] For example, a prompt word template for answering questions based on known information may include two parts: task description and question and answer example:

[0091] (1) Task description: This part provides detailed instruction information to the large language model, which is used to set the processing method of the model. One implementation method can be shown in the following table (see Table 4 Task description part).

[0092] (2) Question-answering examples: This section provides examples of analogy learning for large language models (see the example section in Table 4).

[0093] The input content includes two parts: known information and questions. The large language model answers the input questions based on its understanding of the input known information.

[0094] In a possible implementation, the electronic device may set the number of similar questions to two, and in the specific implementation steps, Figure 1 In comparison, the electronic device generates two similar questions in step 102. First, the original question is obtained and matched with the corresponding category vector database. Then, the user's original question is input into the large language model to generate two similar questions. Next, the similar questions are matched in the corresponding category vector database to obtain several texts matching the similar questions. Next, the similar questions and the matched texts are input into the large language model to generate preliminary answers to the similar questions. Finally, the original question and the preliminary answer are input into the large language model to generate the final answer.

[0095] In the above embodiment, when the number of similar questions is 2, the algorithm efficiency and accuracy of the electronic device generating similar questions achieve the best balance. The accuracy of question answering and the time consumption of the algorithm under different numbers of similar questions are shown in Table 4 below:

[0096] Table 4

[0097] n value Subjective evaluation of question-answering accuracy Algorithm time (S) 1 1 10.15S 2 2 11.51S 3 2 32.73S 5 2 38.51S 10 2 59.53S

[0098] Among them, the subjective evaluation of question and answer accuracy is scored based on the following rules: when the answer content is completely irrelevant to the user's question, the score is 0; when the answer content is related to the user's question, but some of the content is not known information, the score is 1; when the answer content is related to the user's question and the answer content is known information, the score is 2.

[0099] In an embodiment of the present invention, the problem of unclear understanding of ambiguous or ambiguous user questions is solved, and the accuracy of answers in specific fields or private data environments is effectively improved. Specifically, the system first extracts project information words from the original question and matches the vector database of the corresponding category to ensure that subsequent processing is based on data in related fields. Before answering the user's question, the system generates at least one similar question based on the user's question, first generates answers to similar questions as preliminary answers, and then combines the user's question and the preliminary answer to generate the final answer. Through this mechanism, the system can automatically analyze and reconstruct the user's original question, generate a variety of possible query variants, and prompt the large language model to generate richer answer options, avoiding situations where the answer is incomplete or deviates from the true intention due to unclear user expression, and effectively improves the accuracy of the answer.

[0100] The steps of the above method are divided only for the purpose of clear description. When implemented, they can be combined into one step or some steps can be split and decomposed into multiple steps. As long as they include the same logical relationship, they are all within the scope of protection of this patent; adding insignificant modifications to the algorithm or process or introducing insignificant designs without changing the core design of the algorithm and process are all within the scope of protection of this patent.

[0101] In addition, the examples mentioned in the above embodiments can be freely combined, and any combination can be understood as an embodiment. The "embodiment" or "example" appearing in various positions in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It can be understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.

[0102] Another embodiment of the present invention relates to an electronic device, such as Figure 4 As shown, it includes at least one processor 401; and a memory 402 that is communicatively connected to the at least one processor; wherein the memory stores instructions that can be executed by at least one processor, and the instructions are executed by at least one processor so that the at least one processor can execute an intelligent question-answering method based on a large language model as described above.

[0103] Among them, the memory and the processor are connected in a bus manner, and the bus may include any number of interconnected buses and bridges, and the bus connects various circuits of one or more processors and memories together. The bus can also connect various other circuits such as peripherals, voltage regulators, and power management circuits, which are well known in the art and are therefore not further described herein. The bus interface provides an interface between the bus and the transceiver. The transceiver can be one element or multiple elements, such as multiple receivers and transmitters, providing a unit for communicating with various other devices on a transmission medium. The data processed by the processor is transmitted on a wireless medium via an antenna, and further, the antenna also receives data and transmits the data to the processor.

[0104] The processor is responsible for managing the bus and general processing, and can also provide various functions, including timing, peripheral interfaces, voltage regulation, power management, and other control functions. Memory can be used to store data used by the processor when performing operations.

[0105] Another embodiment of the present invention relates to a computer-readable storage medium storing a computer program, which implements the above method embodiment when executed by a processor.

[0106] That is, those skilled in the art can understand that all or part of the steps in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a program, and the program is stored in a storage medium, including several instructions to enable a device (which can be a single-chip microcomputer, chip, etc.) or a processor to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.

[0107] Those skilled in the art will appreciate that the above embodiments are specific embodiments for implementing the present invention, and that in actual applications, various changes may be made in form and detail without departing from the spirit and scope of the present invention.

Claims

1. An intelligent question answering method based on a large language model, characterized in that: include: Obtain the original question and match it with the corresponding category vector database; wherein the vector database is vector data stored in categories of different project information and the corresponding original text; Inputting the original question of the user into the large language model to generate at least one similar question; Matching the similar questions in the corresponding category vector database to obtain a number of texts matching the similar questions; Inputting the similar questions and the matching multiple texts into the large language model to generate preliminary answers to the similar questions; The original question and the preliminary answer are input into the large language model to generate a final answer.

2. The intelligent question answering method based on a large language model according to claim 1, characterized in that: The similar questions are matched in the corresponding category vector database to obtain a plurality of texts matching the similar questions, including: Matching the similar questions in the corresponding category vector database to obtain a plurality of candidate texts with the highest relevance to the similar questions; Based on the similarity between the keyword groups in the similar questions and the multiple candidate texts, the multiple candidate texts are reordered and screened to obtain the multiple texts.

3. The intelligent question answering method based on a large language model according to claim 2, characterized in that: The matching of the similar questions in the vector database of the corresponding category to obtain a plurality of candidate texts with the highest relevance to the similar questions includes: Performing vectorization processing on the similar problems to obtain vector data of the similar problems; Calculate the similarity between the vector data of the similar question and the vectors in the corresponding category vector database; Obtain multiple similar vectors with the highest similarity in the vector database; A plurality of candidate texts corresponding to the plurality of similarity vectors are obtained.

4. The intelligent question answering method based on a large language model according to claim 2, characterized in that: The method of reordering and screening the multiple candidate texts based on the similarity between the keyword group in the similar question and the multiple candidate texts to obtain the multiple texts includes: Inputting the similar questions into the large language model to extract keyword groups; Calculating the similarity between the keyword group and the plurality of candidate texts; Re-arrange the plurality of candidate texts from high to low according to the similarity; The plurality of texts are obtained by removing texts that do not contain any keyword in the keyword group from the plurality of candidate texts.

5. The intelligent question answering method based on a large language model according to claim 1, characterized in that: The step of inputting the similar questions and the matching multiple texts into the large language model to generate preliminary answers to the similar questions includes: Taking the plurality of texts as known information, inputting the known information and the similar questions into the large language model, so that the large language model generates preliminary answers to the similar questions based on its understanding of the known information; The step of inputting the original question and the preliminary answer into the large language model to generate a final answer includes: The preliminary answer is used as known information, and the known information and the original question are input into the large language model, so that the large language model generates the final answer based on its understanding of the known information.

6. The intelligent question answering method based on a large language model according to claim 1, characterized in that: Before obtaining the original question and matching the corresponding category vector database, the method further includes: Acquire a private document, and preprocess data of the private document; Vectorizing the preprocessed data; The project information of the private document is used as a category, and the vectorized data is stored in a vector database of the corresponding category.

7. The intelligent question answering method based on a large language model according to claim 1, characterized in that: The obtaining of the original question and matching the corresponding category vector database includes: Get the original question; Inputting the original question into the large language model, and extracting item information words of the original question; The item information words based on the original question are matched to a vector database of corresponding categories.

8. The intelligent question answering method based on a large language model according to claims 1 to 7, characterized in that: The item information is the switch model.

9. An electronic device, characterized in that: include: at least one processor; as well as, a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 8.

10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 8 is implemented.

Citation Information

Cited By

  • Automatic question answering system and method based on large language model

    CN120541183A

  • An automatic question answering system and method based on a large language model

    CN120541183B

  • Data classification method and device based on large model

    CN120632109A