A knowledge question answering method, device, medium and equipment based on large language model

By expanding and deepening the initial problem many times and analyzing multiple large language model libraries, the problem of poor quality of user input problems is solved, and the answer accuracy and matching of the knowledge question and answer system are improved.

CN118690003BActive Publication Date: 2024-11-22HANGZHOU YSCREDIT CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411189024.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-08-28
Publication Date
2024-11-22
Estimated Expiration
2044-08-28

AI Technical Summary

Technical Problem

The existing knowledge question and answer system based on large language models is difficult to meet the user's question and answer needs when the quality of the user's input questions is poor, and the accuracy of the output answers is low.

Method used

By obtaining the initial question and expanding and deepening it multiple times, using multiple large language model libraries for analysis, generating more accurate answers, and improving the matching of questions and answers.

Benefits of technology

It improves the depth of the initial question and the richness of effective information, enhances the accuracy of the target knowledge answers, and meets the user's question-and-answer needs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118690003B_ABST
    Figure CN118690003B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of knowledge question answering technology, and in particular to a knowledge question answering method, device, medium and equipment based on a large language model, including: obtaining a first knowledge answer and a first knowledge field corresponding to an initial question based on a first large language model, obtaining N first expanded questions according to the initial question and the first knowledge answer, thereby improving the question depth and the richness of effective information of the initial question, obtaining a second knowledge answer and a second knowledge field corresponding to each first expanded question based on the first large language model, screening the first expanded questions, determining the screened first expanded questions as the initial questions, thereby expanding and deepening the initial questions multiple times until a target question is obtained, and performing an in-depth analysis of the target question based on a target large language model of a specified field on the basis of a comprehensive analysis of the first large language model, thereby improving the accuracy of the target knowledge answer corresponding to the initial question and improving the matching with the user's question and answer needs.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of knowledge question answering technology, and in particular to a knowledge question answering method, device, medium and equipment based on a large language model. Background Art

[0002] With the rapid development of Internet technology, a large amount of knowledge exists in the network in structured and unstructured forms. How to effectively obtain useful information from massive knowledge has become an important research direction in the field of artificial intelligence. Knowledge question answering based on large language models, as a technology that can understand natural language questions and retrieve answers from knowledge bases, provides a new way to acquire knowledge.

[0003] In the existing knowledge question-and-answer system based on the large language model, the large language model analyzes the questions input by the user and outputs the corresponding answers. However, in the actual use of the large language model, the quality of the questions input by the user varies. When the quality of the questions input by the user is high, the accuracy of the answers output by the large language model is high and can match the user's question-and-answer needs. When the questions input by the user are highly one-sided and of poor quality, the large language model does not fully understand the user's intentions, and the accuracy of the output answers is low, which makes it difficult to meet the user's question-and-answer needs.

[0004] Therefore, how to improve the accuracy of answers output by large language models to meet users' question-and-answer needs has become an urgent problem to be solved. Summary of the invention

[0005] In view of the above technical problems, the technical solution adopted by the present invention is a knowledge question answering method based on a large language model, and the knowledge question answering method comprises the following steps:

[0006] S1, obtain the initial question, the preset first language model and the preset second language model library.

[0007] S2: Input the initial question into the first language model to obtain the first knowledge answer and the first knowledge field corresponding to the initial question.

[0008] S3. Obtain N first expanded questions according to the initial question and the first knowledge answer, where N is an integer greater than 1.

[0009] S4, inputting the N first expanded questions into the first large language model respectively, and obtaining the second knowledge answer and the second knowledge field corresponding to each first expanded question.

[0010] S5. Obtain the answer priority corresponding to each second knowledge answer according to the initial question, the first knowledge domain, the first expanded question corresponding to each second knowledge answer, and the second knowledge domain corresponding to each first expanded question.

[0011] S6, taking the first expanded question corresponding to the largest answer priority as the initial question, updating the number of executions, and returning to execute step S2 until the largest answer priority or the number of executions meets the termination condition, and determining the first expanded question corresponding to the largest answer priority when the termination condition is met as the target question.

[0012] S7, in the preset second largest language model library, determine the second largest language model corresponding to the second knowledge field corresponding to the target question as the target large language model.

[0013] S8, input the target question into the target large language model to obtain the target knowledge answer corresponding to the initial question.

[0014] The present invention also provides a knowledge question answering device based on a large language model, the knowledge question answering device comprising:

[0015] The data acquisition module is used to obtain the initial question, the preset first language model and the preset second language model library.

[0016] The first model application module is used to input the initial question into the first large language model to obtain the first knowledge answer and the first knowledge field corresponding to the initial question.

[0017] The question expansion module is used to obtain N first expanded questions according to the initial question and the first knowledge answer, where N is an integer greater than 1.

[0018] The second model application module is used to input the N first expanded questions into the first large language model respectively, and obtain the second knowledge answer and the second knowledge field corresponding to each first expanded question.

[0019] The priority acquisition module is used to acquire the answer priority corresponding to each second knowledge answer based on the initial question, the first knowledge field, the first expanded question corresponding to each second knowledge answer, and the second knowledge field corresponding to each first expanded question.

[0020] The target question acquisition module is used to take the first expanded question corresponding to the maximum answer priority as the initial question, update the number of executions, and return to execute the first model application module until the maximum answer priority or the number of executions meets the termination condition, and determine the first expanded question corresponding to the maximum answer priority when the termination condition is met as the target question.

[0021] The model screening module is used to determine the second largest language model corresponding to the second knowledge field corresponding to the target question as the target large language model in the preset second largest language model library.

[0022] The answer acquisition module is used to input the target question into the target large language model and obtain the target knowledge answer corresponding to the initial question.

[0023] The present invention also provides a non-transitory computer-readable storage medium, which stores at least one instruction or at least one program, and the at least one instruction or at least one program is loaded and executed by a processor to implement the above-mentioned knowledge question and answer method based on a large language model.

[0024] The present invention also provides an electronic device, comprising a processor and the above-mentioned non-transitory computer-readable storage medium.

[0025] The present invention has at least the following beneficial effects: inputting an initial question into the first large language model, obtaining a first knowledge answer and a first knowledge field corresponding to the initial question, obtaining N first expanded questions based on the initial question and the first knowledge answer, inputting the N first expanded questions into the first large language model respectively, obtaining a second knowledge answer and a second knowledge field corresponding to each first expanded question, obtaining an answer priority corresponding to each second knowledge answer based on the initial question, the first knowledge field, the first expanded question corresponding to each second knowledge answer, and the second knowledge field corresponding to each first expanded question, taking the first expanded question corresponding to the largest answer priority as the initial question, and updating the number of executions , and returns to execute step S2 until the maximum answer priority or the number of executions meets the termination condition, and the first expanded question corresponding to the maximum answer priority when the termination condition is met is determined as the target question. Compared with the initial question, the first expanded question integrates the effective information in the first knowledge answer, improves the problem depth and the richness of effective information of the initial question, and expands and deepens the initial question multiple times on the basis of the first large language model to comprehensively analyze the input question, and deeply analyzes the target question based on the target large language model of the specified field, and obtains the target knowledge answer corresponding to the initial question, thereby improving the accuracy of the target knowledge answer and the matching with the user's question and answer needs. BRIEF DESCRIPTION OF THE DRAWINGS

[0026] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0027] Figure 1 A flowchart of a knowledge question answering method based on a large language model provided in the first embodiment of the present invention;

[0028] Figure 2A flowchart of a data processing method for knowledge question answering provided in the second embodiment of the present invention;

[0029] Figure 3 A schematic diagram of the structure of a knowledge question-answering device based on a large language model provided in Embodiment 3 of the present invention. DETAILED DESCRIPTION

[0030] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.

[0031] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It is understood that, where appropriate, the above-mentioned terms used to distinguish similar objects can be interchanged so that the present invention can also implement other embodiments other than the above-mentioned illustrated embodiments or described embodiments. In addition, the terms "including" and "having" and any variations are intended to cover non-exclusive inclusions. For example, a process, method, system, product or server that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0032] Embodiment 1

[0033] This embodiment 1 provides a knowledge question answering method based on a large language model. The knowledge question answering method based on a large language model includes the following steps: Figure 1 As shown:

[0034] S1, obtain the initial question, the preset first language model and the preset second language model library.

[0035] Among them, large language models are usually natural language processing models with large-scale parameters and computing power. They can be trained with a large amount of data and parameters to generate human-like text or answer questions in natural language, and have wide applications in knowledge question and answering.

[0036] The initial question refers to the question input by the user. The preset first language model refers to a large language model without a specified field, which can be obtained based on relevant knowledge data and parameter training in multiple fields, and is used to comprehensively analyze the input question and output the corresponding knowledge answer. The preset second language model library includes several second language models, each of which corresponds to a specified knowledge field, and can be obtained based on relevant knowledge data and parameter training in the corresponding knowledge field, and is used to focus on analyzing the input question and output the knowledge answer in the corresponding knowledge field.

[0037] Among them, the specific knowledge areas can be set by the implementers according to actual conditions.

[0038] S2: Input the initial question into the first language model to obtain the first knowledge answer and the first knowledge field corresponding to the initial question.

[0039] Among them, the initial question is comprehensively analyzed based on the first language model, and the first knowledge answer corresponding to the initial question and the first knowledge field to which it belongs are obtained.

[0040] S3. Obtain N first expanded questions according to the initial question and the first knowledge answer, where N is an integer greater than 1.

[0041] Among them, when the questions input by users are relatively one-sided and of poor quality, the users provide less effective information to the large language model, and the answers output by the large language model are less accurate, making it difficult to meet the user's question-and-answer needs.

[0042] Therefore, in order to improve the information richness input into the large language model, this embodiment expands the initial question according to the initial question and the corresponding first knowledge answer, and obtains N first expanded questions, thereby increasing the effective amount of information input into the large language model, and further improving the accuracy of knowledge questions and answers.

[0043] In a specific implementation, S3 further includes the following steps:

[0044] S31, extracting several initial keywords in the initial question and several initial entity words in the first knowledge answer.

[0045] S32, based on all the initial keywords and all the initial entity words, N key entity words are screened out from all the initial entity words.

[0046] S33: For any key entity word, the initial question and the current key entity word are combined to obtain a first expanded question corresponding to the current key entity word.

[0047] S34, traverse N key entity words and obtain N first expansion questions.

[0048] Among them, the first knowledge answer contains non-entity words such as verbs, adjectives, adverbs, prepositions, conjunctions, auxiliary words, onomatopeia, and entity words that can reflect the core content and question and answer results. Therefore, when expanding the initial question based on the first knowledge answer, the initial entity words in the first knowledge answer are extracted as the basis for expanding the question.

[0049] Keywords can be used to locate the core content of the question and understand the user's question and answer intention. Therefore, this embodiment extracts several initial keywords in the initial question to filter the initial entity words in the first knowledge answer, and combines the initial question and the filtered key entity words to obtain the first expanded question.

[0050] Specifically, compared with the initial question, the first expanded question integrates the effective information in the first knowledge answer, improves the question depth and the richness of effective information of the initial question, so that when the target knowledge answer corresponding to the initial question is obtained based on the first expanded question, the accuracy of the target knowledge answer can be improved.

[0051] In a specific implementation, S32 further includes the following steps:

[0052] S321, obtaining the first position and the first occurrence number of each initial entity word in the first knowledge answer, and the second position and the second occurrence number of each initial keyword in the first knowledge answer.

[0053] S322, grouping all initial entity words and all initial keywords in the first knowledge answer according to the first position and the second position to obtain a plurality of phrases.

[0054] S323, for any initial entity word, obtain the word priority corresponding to the current initial entity word based on the first position of the current initial entity word, the second occurrence number of all initial keywords in the phrase corresponding to the current initial entity word, and the second position of the initial keywords in the phrase corresponding to the current initial entity word.

[0055] S324, determining the first N initial entity words with the highest word priority as key entity words.

[0056] Among them, according to the positional relationship between the initial entity words and the initial keywords in the first knowledge answer, all the initial entity words and all the initial keywords are grouped to obtain several phrases. Correspondingly, the positional correlation between the initial entity words and the initial keywords included in each phrase is relatively high, which serves as the data basis for filtering the initial entity words according to the initial keywords.

[0057] The initial keywords can be used to locate the core content of the initial question and understand the user's question and answer intention. The more times the initial keywords appear in a phrase, the more important the corresponding phrase is in locating the core content of the initial question and understanding the user's question and answer intention. Therefore, this embodiment characterizes the importance of the corresponding phrase by the sum of the second occurrence times of all the initial keywords in the phrase.

[0058] The closer the positions of the initial entity word and the initial keyword are, the higher the correlation between the initial entity word and the initial keyword. Therefore, this embodiment characterizes the degree of correlation between the initial entity word and the initial keyword through the first position of the initial entity word and the second position of the initial keyword.

[0059] Furthermore, the word priority corresponding to each initial entity word is obtained according to the importance of the corresponding phrase and the sum of the associations between the initial entity word and all initial keywords in the same phrase, which is used to expand the priority of the initial question.

[0060] In the above, all initial entity words and all initial keywords in the first knowledge answer are grouped based on the first position and the second position, and the word priority corresponding to the initial entity word is obtained according to the first position of the initial entity word, the second occurrence number of all initial keywords in the phrase corresponding to the initial entity word, and the second position of the initial keyword in the phrase corresponding to the initial entity word, to characterize the priority of the initial keyword for expanding the initial question, thereby improving the accuracy of the expanded question and more effectively improving the question depth and the richness of effective information of the initial question.

[0061] In a specific implementation, the first position includes a first sentence number, which refers to the number of the sentence corresponding to the corresponding initial entity word in the first knowledge answer, and the second position includes a second sentence number, which refers to the number of the sentence corresponding to the corresponding initial keyword in the first knowledge answer. S322 also includes the following steps:

[0062] S3221, assign an initial set to each first statement sequence number, where the initial set is an empty set.

[0063] S3222: For any initial entity word, assign the current initial entity word to the corresponding initial set according to the first sentence sequence number corresponding to the current initial entity word.

[0064] S3223: For any initial keyword, according to the second sentence sequence number corresponding to the current initial keyword and the first sentence sequence number corresponding to each initial set, the current initial keyword is allocated to the corresponding initial set.

[0065] S3224, traverse all initial entity words and all initial keywords, assign all initial entity words and all initial keywords to corresponding initial sets, and obtain an updated initial set;

[0066] S3225, determining each updated initial set as a corresponding phrase.

[0067] Among them, the first sentence sequence number refers to the sequence number of the sentence corresponding to the initial entity word in the first knowledge answer, which is used to represent the position information of the corresponding initial entity word in the first knowledge answer. The second sentence sequence number refers to the sequence number of the sentence corresponding to the initial keyword in the first knowledge answer, which is used to represent the position information of the corresponding initial keyword in the first knowledge answer. According to the first sentence sequence number and the second sentence sequence number, all initial entity words and all initial keywords can be assigned to the corresponding initial set to obtain a number of phrases.

[0068] In the above, based on the first sentence number representation, the position information of the initial entity word corresponding to the first knowledge answer is represented, and based on the second sentence number representation, the position information of the initial keyword corresponding to the first knowledge answer is represented, and then the initial entity word and the initial keyword are allocated according to the first sentence number and the second sentence number, so as to represent the correlation between the initial entity word and the initial keyword according to the phrase, thereby improving the measurement accuracy of the word priority corresponding to the initial entity word.

[0069] In a specific implementation, the first position further includes a first character serial number, the second position further includes a second character serial number, and S323 further includes the following steps:

[0070] S3231: For any initial entity word, the sum of the second occurrence times of all initial keywords in the phrase corresponding to the current initial entity word is determined as the importance corresponding to the phrase corresponding to the current initial entity word.

[0071] S3232, according to the first knowledge answer, obtain the total number of characters of the corresponding sentence of the phrase corresponding to the current initial entity word in the first knowledge answer.

[0072] S3233, for any initial keyword in the phrase corresponding to the current initial entity word, obtain the sequence number difference between the first character sequence number corresponding to the current initial entity word and the second character sequence number corresponding to the current initial keyword.

[0073] S3234, determining the ratio of the total number of characters to the sequence number difference as the degree of association between the current initial entity word and the current initial keyword.

[0074] S3235, obtaining the word priority corresponding to the current initial entity word according to the importance of the phrase corresponding to the current initial entity word and the association between each initial keyword in the phrase corresponding to the current initial entity word and the current initial entity word.

[0075] Among them, the sum of the degrees of association between all initial keywords in the phrase corresponding to the current initial entity word and the current initial entity word is determined as the first priority corresponding to the current entity word, and the product of the importance corresponding to the phrase corresponding to the current initial entity word and the first priority is determined as the word priority corresponding to the current initial entity word.

[0076] In the above, the importance of the corresponding phrase is characterized based on the sum of the second occurrence times of all the initial keywords in the phrase, and the correlation between the initial entity word and the initial keyword is characterized based on the proportion of the difference between the first character number of the initial entity word and the second character number of the initial keyword in the total number of characters of the corresponding sentence. Then, combined with the importance of the phrase corresponding to the current initial entity word and the correlation between each initial keyword in the phrase corresponding to the current initial entity word and the current initial entity word, the word priority corresponding to the current initial entity word is obtained, thereby improving the accuracy of the characterization of the word priority.

[0077] In the above, the initial question is expanded according to the first knowledge answer to obtain N first expanded questions. Compared with the initial question, the first expanded question integrates the effective information in the first knowledge answer, improves the question depth and the richness of effective information of the initial question, thereby improving the accuracy of the target knowledge answer when the target knowledge answer corresponding to the initial question is obtained based on the first expanded question.

[0078] S4, inputting the N first expanded questions into the first large language model respectively, and obtaining the second knowledge answer and the second knowledge field corresponding to each first expanded question.

[0079] Herein, each first expanded question is comprehensively analyzed based on the first language model, and the second knowledge answer and the second knowledge field corresponding to each first expanded question are obtained.

[0080] S5. Obtain the answer priority corresponding to each second knowledge answer according to the initial question, the first knowledge domain, the first expanded question corresponding to each second knowledge answer, and the second knowledge domain corresponding to each first expanded question.

[0081] In a specific implementation, S5 further includes the following steps:

[0082] S51, for any second knowledge answer, calculating a first similarity between the initial question and the first expanded question corresponding to the current second knowledge answer.

[0083] S52, obtaining a second similarity between the first knowledge field and the second knowledge field corresponding to the current second knowledge answer.

[0084] S53: Obtain the answer priority corresponding to the current second knowledge answer according to the first similarity and the second similarity.

[0085] Among them, the higher the first similarity between the initial question and the first expanded question, and the higher the second similarity between the first knowledge field corresponding to the initial question and the second knowledge field corresponding to the current second knowledge answer, the less the first expanded question deviates from the core content and question-answering intention of the initial question while improving the question depth and richness of effective information of the initial question, and the higher the reliability of the second knowledge answer corresponding to the first expanded question as the target knowledge answer to the initial question.

[0086] Therefore, this embodiment obtains the answer priority corresponding to each second knowledge answer based on the first similarity and the second similarity, which is used to characterize the priority of using the second knowledge answer as the target knowledge answer of the initial question, thereby improving the accuracy of the answer priority.

[0087] In a specific implementation, S52 further includes the following steps:

[0088] S521, obtaining a preset similarity question and answer template.

[0089] S522, fill the first knowledge field and the second knowledge field corresponding to the current second knowledge answer into the similarity question and answer template to obtain a similarity question.

[0090] S523, inputting the similarity question into the first large language model, and obtaining a second similarity between the first knowledge field and the second knowledge field corresponding to the current second knowledge answer.

[0091] The specific similarity question-answering template can be set by the implementer according to the actual situation. For example, the similarity question-answering template can be set as "How high is the similarity between A and B as two fields?", with a representing the first knowledge field and b representing the second knowledge field, then a can be filled in the A position and b can be filled in the B position, and the corresponding similarity question is "How high is the similarity between the first knowledge field a and the second knowledge field b as two fields?". The similarity question is input into the first large language model, and the first large language model is used to perform semantic analysis on the relevant knowledge in the first knowledge field and the second knowledge field, so as to obtain the second similarity between the first knowledge field and the second knowledge field corresponding to the current second knowledge answer.

[0092] In the above, semantic analysis is performed on relevant knowledge in the first knowledge field and the second knowledge field based on the first language model to obtain the second similarity between the first knowledge field and the second knowledge field, thereby improving the accuracy of the second similarity.

[0093] In a specific implementation, S53 further includes the following steps:

[0094] S531: Obtain a first preset weight corresponding to the first similarity and a second preset weight corresponding to the second similarity.

[0095] S532: Determine the sum of the product of the first similarity and the first preset weight and the product of the second similarity and the second preset weight as the answer priority corresponding to the current second knowledge answer.

[0096] The specific values ​​of the first preset weight and the second preset weight can be set by the implementer according to actual conditions.

[0097] In the above, the answer priority of the second knowledge answer as the target knowledge answer to the initial question is measured based on the similarity between the initial question and the first expanded question, and the similarity between the first knowledge field and the second knowledge field, thereby improving the answer priority and the accuracy of the target knowledge answer.

[0098] S6, taking the first expanded question corresponding to the largest answer priority as the initial question, updating the number of executions, and returning to execute step S2 until the largest answer priority or the number of executions meets the termination condition, and determining the first expanded question corresponding to the largest answer priority when the termination condition is met as the target question.

[0099] Among them, the first expanded question corresponding to the largest answer priority is taken as the initial question, the execution times are updated, and the execution step S2 is returned to expand the first expanded question until the largest answer priority or the execution times meet the termination condition, completing multiple expansions of the initial question and multiple improvements to the problem depth and the richness of effective information of the initial question, thereby effectively improving the depth of the target problem and the richness of effective information.

[0100] In a specific implementation, S6 includes the following steps:

[0101] S61, taking the first expanded question corresponding to the largest answer priority as the initial question, adding one to the number of executions, and obtaining an updated number of executions.

[0102] S62, return to step S2 to obtain the updated maximum answer priority.

[0103] S63, if the updated maximum answer priority is greater than the preset first priority threshold, or the updated execution times are equal to the preset execution times, it is determined that the maximum answer priority or the execution times meet the termination condition.

[0104] S64, determining the first expanded question corresponding to the maximum answer priority when the termination condition is satisfied as the target question.

[0105] Among them, before executing step S2 for the first time, the execution times can be initialized to 0, and the execution times can be updated by adding one to the execution times. Then, when the updated maximum answer priority is greater than the preset first priority threshold, or the updated execution times are equal to the preset execution times, it is determined that the maximum answer priority or the execution times meet the termination condition, and the target question is obtained.

[0106] The specific values ​​of the preset first priority threshold and the preset execution times may be set by the implementer according to actual conditions.

[0107] As described above, the initial question is expanded and deepened multiple times, thereby improving the depth of the initial question and the richness of effective information multiple times, effectively improving the depth of the target question and the richness of effective information, thereby improving the accuracy of the target knowledge answer when the target knowledge answer corresponding to the initial question is obtained based on the target question.

[0108] S7, in the preset second largest language model library, determine the second largest language model corresponding to the second knowledge field corresponding to the target question as the target large language model.

[0109] S8, input the target question into the target large language model to obtain the target knowledge answer corresponding to the initial question.

[0110] Among them, based on the comprehensive analysis of the input question by the first large language model, the initial question is expanded and deepened multiple times to obtain the target question, so that the target question has higher question depth and richness of effective information than the initial question. Furthermore, this embodiment performs a deep analysis of the target question based on the target large language model of the specified field, obtains the target knowledge answer corresponding to the initial question, improves the accuracy of the target knowledge answer, meets the user's question and answer needs, and improves the matching with the user's question and answer needs.

[0111] In the above, the initial question is input into the first large language model, the first knowledge answer and the first knowledge field corresponding to the initial question are obtained, and according to the initial question and the first knowledge answer, N first expanded questions are obtained, and the N first expanded questions are respectively input into the first large language model to obtain the second knowledge answer and the second knowledge field corresponding to each first expanded question, and according to the initial question, the first knowledge field, the first expanded question corresponding to each second knowledge answer and the second knowledge field corresponding to each first expanded question, the answer priority corresponding to each second knowledge answer is obtained, and the first expanded question corresponding to the largest answer priority is used as the initial question, the execution count is updated, and the execution count is returned. Perform step S2 until the maximum answer priority or the number of executions meets the termination condition, and determine the first expanded question corresponding to the maximum answer priority when the termination condition is met as the target question. Compared with the initial question, the first expanded question integrates the effective information in the first knowledge answer, and improves the question depth and the richness of effective information of the initial question. On the basis of the comprehensive analysis of the input question by the first large language model, the initial question is expanded and deepened for many times, and the target question is deeply analyzed based on the target large language model of the specified field to obtain the target knowledge answer corresponding to the initial question, thereby improving the accuracy of the target knowledge answer and the matching with the user's question and answer needs.

[0112] Embodiment 2

[0113] This embodiment 2 provides a data processing method for knowledge question answering. The data processing method for knowledge question answering includes: Figure 2 As shown:

[0114] S100, obtaining a number of initial keywords corresponding to the initial question, a first knowledge answer and a first knowledge field corresponding to the initial question, a number of initial entity words corresponding to the first knowledge answer, a first position and a first occurrence number of each initial entity word in the first knowledge answer, and a second position and a second occurrence number of each initial keyword in the first knowledge answer.

[0115] In a specific implementation, S100 further includes the following steps:

[0116] S110, obtaining the initial question and the preset first language model.

[0117] S120, inputting the initial question into the first large language model, and obtaining a first knowledge answer and a first knowledge field corresponding to the initial question.

[0118] S130, extracting a number of initial keywords in the initial question and a number of initial entity words in the first knowledge answer.

[0119] S200, grouping all initial entity words and all initial keywords in the first knowledge answer according to the first position and the second position to obtain a plurality of phrases.

[0120] In a specific implementation, the first position includes a first sentence number, which refers to the number of the sentence corresponding to the corresponding initial entity word in the first knowledge answer, and the second position includes a second sentence number, which refers to the number of the sentence corresponding to the corresponding initial keyword in the first knowledge answer. S200 also includes the following steps:

[0121] S210, allocating an initial set to each first statement sequence number, wherein the initial set is an empty set.

[0122] S220: For any initial entity word, according to the first sentence sequence number corresponding to the current initial entity word, assign the current initial entity word to the corresponding initial set.

[0123] S230: For any initial keyword, according to the second sentence sequence number corresponding to the current initial keyword and the first sentence sequence number corresponding to each initial set, the current initial keyword is allocated to the corresponding initial set.

[0124] S240, traversing all initial entity words and all initial keywords, assigning all initial entity words and all initial keywords to corresponding initial sets, and obtaining an updated initial set;

[0125] S250, determining each updated initial set as a corresponding phrase.

[0126] S300, for any initial entity word, obtain the word priority corresponding to the current initial entity word based on the first position of the current initial entity word, the second occurrence number of all initial keywords in the phrase corresponding to the current initial entity word, and the second position of the initial keywords in the phrase corresponding to the current initial entity word.

[0127] In a specific implementation, the first position further includes a first character serial number, the second position further includes a second character serial number, and S300 further includes the following steps:

[0128] S310: For any initial entity word, the sum of the second occurrence times of all initial keywords in the phrase corresponding to the current initial entity word is determined as the importance corresponding to the phrase corresponding to the current initial entity word.

[0129] S320, according to the first knowledge answer, obtain the total number of characters of the corresponding sentence of the phrase corresponding to the current initial entity word in the first knowledge answer.

[0130] S330, for any initial keyword in the phrase corresponding to the current initial entity word, obtain the sequence number difference between the first character sequence number corresponding to the current initial entity word and the second character sequence number corresponding to the current initial keyword.

[0131] S340: Determine the ratio of the total number of characters to the sequence number difference as the degree of association between the current initial entity word and the current initial keyword.

[0132] S350, obtaining the word priority corresponding to the current initial entity word according to the importance of the phrase corresponding to the current initial entity word and the association between each initial keyword in the phrase corresponding to the current initial entity word and the current initial entity word.

[0133] S400, traverse all initial entity words, and determine the initial entity word corresponding to the largest word priority as the target keyword.

[0134] S500, obtaining a target expanded question based on the initial question and the target keywords.

[0135] Among them, the target keywords are combined with the initial question to obtain the target expanded question. Compared with the initial question, the target expanded question corresponds to a higher level of question depth and richer effective information, and the target expanded question has a higher accuracy in identifying the user's question and answer intention.

[0136] In a specific implementation, S500 further includes the following steps:

[0137] S510: Obtain a preset question expansion template.

[0138] S520, filling the initial question and the target keywords into the question expansion template to obtain the target expanded question.

[0139] The preset question expansion template can be set by the implementer according to the actual situation. For example, the preset question expansion template can be "Based on X, what does Y specifically include?", where the initial question is recorded as w and the target keyword is recorded as g, then w can be filled in the position corresponding to X and g can be filled in the position corresponding to Y, and the corresponding target expansion question is "Based on w, what does g specifically include?".

[0140] As described above, the target keywords are combined with the initial question to obtain the target expanded question, so as to enhance the depth of the question and the richness of effective information, thereby improving the accuracy of identifying the user's question and answer intention.

[0141] S600: Input the target expansion question into the target large language model corresponding to the first knowledge domain, and obtain the target knowledge answer corresponding to the target expansion question.

[0142] In a specific implementation, S600 further includes the following steps:

[0143] S610: Obtain a preset second largest language model library, wherein the second largest language model library includes a plurality of second largest language models, and each second largest language model corresponds to a preset knowledge domain.

[0144] S620, matching the first knowledge domain corresponding to the initial question with the preset knowledge domain corresponding to each second large language model, and acquiring a target large language model corresponding to the target expanded question.

[0145] S630, input the target expansion question into the target large language model to obtain the target knowledge answer corresponding to the target expansion question.

[0146] As described above, the target expansion question is input into the target large language model corresponding to the first knowledge domain, so as to focus on analyzing the target expansion question within the corresponding preset knowledge domain, obtain the target knowledge answer corresponding to the target expansion question, and improve the accuracy of the target knowledge answer.

[0147] S700, takes the target knowledge answer as the first answer, updates the number of returns, and returns to execute step S100 until the maximum word priority or the number of returns meets the stopping condition, and determines the target knowledge answer corresponding to the maximum word priority when the stopping condition is met as the target knowledge query result corresponding to the initial question.

[0148] Among them, the target knowledge answer is taken as the first answer, the return number is updated, and the execution returns to step S100, and the target expansion question is expanded and deepened until the maximum word priority or the return number meets the stopping condition, completing multiple expansions and deepenings of the initial question, thereby completing multiple improvements in the question depth and the richness of effective information of the initial question, effectively improving the question depth and the richness of effective information of the target expansion question.

[0149] In a specific implementation, S700 further includes the following steps:

[0150] S710, taking the target knowledge answer as the first answer and increasing the number of returns by one.

[0151] S720, returning to step S100 to obtain the updated maximum word priority.

[0152] S730: If the updated maximum word priority is greater than the preset second priority threshold, or the updated return times are equal to the preset return times, it is determined that the maximum word priority or the return times meets the stop condition.

[0153] S740, determining the target knowledge answer corresponding to the maximum word priority when the stop condition is met as the target knowledge query result corresponding to the initial question.

[0154] Among them, before executing step S100 for the first time, the return number can be initialized to 0, and the return number can be updated by adding one to the return number. Then, when the updated maximum word priority is greater than the preset second priority threshold, or the updated return number is equal to the preset return number, it is determined that the maximum word priority or the return number meets the termination condition, and the target knowledge query result is obtained.

[0155] The specific values ​​of the preset second priority threshold and the preset number of returns can be set by the implementer according to actual conditions.

[0156] As described above, the initial question is expanded and deepened multiple times, thereby improving the question depth and the richness of effective information of the initial question multiple times, effectively improving the question depth and the richness of effective information of the target expanded question, thereby improving the accuracy of the corresponding target knowledge query results.

[0157] In the above, according to the first position and the second position, all the initial entity words and all the initial keywords in the first knowledge answer are grouped to obtain a number of phrases. For any initial entity word, according to the first position of the current initial entity word, the second occurrence number of all the initial keywords in the phrase corresponding to the current initial entity word, and the second position of the initial keyword in the phrase corresponding to the current initial entity word, the word priority corresponding to the current initial entity word is obtained, all the initial entity words are traversed, and the initial entity word corresponding to the largest word priority is determined as the target keyword. According to the initial question and the target keyword, the target expanded question is obtained, and the target expanded question is input into the target large language model corresponding to the first knowledge field, and the target knowledge answer corresponding to the target expanded question is obtained. The target knowledge answer is used as the first answer, the return number is updated, and the execution of step S100 is returned until the largest word is reached. When the word priority or the number of returns meets the stopping condition, the target knowledge answer corresponding to the largest word priority when the stopping condition is met is determined as the target knowledge query result corresponding to the initial question. It can be seen that the target keywords are screened through the degree of association between the initial entity words and the initial keywords and the corresponding importance of the phrases, and then the initial question and the target keywords are integrated to obtain the target expanded question, which improves the depth of the question and the richness of effective information. On the basis of the comprehensive analysis of the initial question by the first large language model, the target question is deeply analyzed based on the target large language model of the corresponding knowledge field to obtain the target knowledge answer, and the target knowledge answer is continuously updated by expanding and deepening the initial question multiple times to obtain a more accurate target knowledge answer as the target knowledge query result, thereby improving the accuracy of the target knowledge query result and thus improving the matching with the user's question and answer needs.

[0158] Embodiment 3

[0159] This embodiment 3 provides a knowledge question answering device based on a large language model. The knowledge question answering device based on a large language model includes: Figure 3 As shown:

[0160] The data acquisition module 31 is used to acquire the initial question, the preset first language model and the preset second language model library.

[0161] The first model application module 32 is used to input the initial question into the first large language model to obtain the first knowledge answer and the first knowledge field corresponding to the initial question.

[0162] The question expansion module 33 is used to obtain N first expanded questions according to the initial question and the first knowledge answer, where N is an integer greater than 1.

[0163] The second model application module 34 is used to input the N first expanded questions into the first large language model respectively, and obtain the second knowledge answer and the second knowledge field corresponding to each first expanded question.

[0164] The priority acquisition module 35 is used to acquire the answer priority corresponding to each second knowledge answer according to the initial question, the first knowledge field, the first expanded question corresponding to each second knowledge answer and the second knowledge field corresponding to each first expanded question.

[0165] The target question acquisition module 36 is used to take the first expanded question corresponding to the maximum answer priority as the initial question, update the number of executions, and return to execute the first model application module until the maximum answer priority or the number of executions meets the termination condition, and determine the first expanded question corresponding to the maximum answer priority when the termination condition is met as the target question.

[0166] The model screening module 37 is used to determine the second largest language model corresponding to the second knowledge field corresponding to the target question as the target large language model in the preset second largest language model library.

[0167] The answer acquisition module 38 is used to input the target question into the target large language model to obtain the target knowledge answer corresponding to the initial question.

[0168] In a specific implementation, the question expansion module 33 further includes:

[0169] The keyword extraction submodule is used to extract several initial keywords in the initial question and several initial entity words in the first knowledge answer.

[0170] The entity word screening submodule is used to screen out N key entity words from all the initial entity words according to all the initial keywords and all the initial entity words.

[0171] The first question expansion submodule is used to combine the initial question and the current key entity word for any key entity word to obtain the first expanded question corresponding to the current key entity word.

[0172] The second question expansion submodule is used to traverse N key entity words and obtain N first expanded questions.

[0173] In a specific implementation, the entity word screening submodule further includes:

[0174] The data acquisition unit is used to acquire the first position and the first occurrence number of each initial entity word in the first knowledge answer, and the second position and the second occurrence number of each initial keyword in the first knowledge answer.

[0175] The phrase grouping unit is used to group all initial entity words and all initial keywords in the first knowledge answer according to the first position and the second position to obtain a plurality of phrases.

[0176] A word priority acquisition unit is used to acquire the word priority corresponding to any initial entity word based on the first position of the current initial entity word, the second occurrence number of all initial keywords in the phrase corresponding to the current initial entity word, and the second position of the initial keywords in the phrase corresponding to the current initial entity word.

[0177] The entity word screening unit is used to determine the first N initial entity words with the highest word priority as key entity words.

[0178] In a specific implementation, the first position includes a first sentence number, which refers to the number of the sentence corresponding to the corresponding initial entity word in the first knowledge answer, the second position includes a second sentence number, which refers to the number of the sentence corresponding to the corresponding initial keyword in the first knowledge answer, and the phrase grouping unit also includes:

[0179] The initial set allocation subunit is used to allocate an initial set to each first statement sequence number, wherein the initial set is an empty set.

[0180] The entity word allocation subunit is used to allocate the current initial entity word to the corresponding initial set according to the first sentence sequence number corresponding to the current initial entity word and the first sentence sequence number corresponding to each initial set for any initial entity word.

[0181] The keyword allocation subunit is used to allocate all initial entity words and all initial keywords to the corresponding initial set for any initial keyword, and obtain the updated initial set;

[0182] The phrase acquisition subunit is used to determine each updated initial set as a corresponding phrase.

[0183] The phrase acquisition subunit is used to traverse all initial entity words and all initial keywords, and determine each grouped initial set as a corresponding phrase.

[0184] In a specific implementation, the priority acquisition module 35 further includes:

[0185] The first similarity acquisition submodule is used to calculate, for any second knowledge answer, a first similarity between the initial question and the first expanded question corresponding to the current second knowledge answer.

[0186] The second similarity acquisition submodule is used to acquire the second similarity between the first knowledge field and the second knowledge field corresponding to the current second knowledge answer.

[0187] The priority acquisition submodule is used to acquire the answer priority corresponding to the current second knowledge answer according to the first similarity and the second similarity.

[0188] In a specific implementation, the second similarity acquisition submodule further includes:

[0189] The template acquisition unit is used to acquire a preset similarity question and answer template.

[0190] The similarity question acquisition unit is used to fill the first knowledge field and the second knowledge field corresponding to the current second knowledge answer into the similarity question and answer template to acquire the similarity question.

[0191] The second similarity acquisition unit is used to input the similarity question into the first large language model to acquire the second similarity between the first knowledge field and the second knowledge field corresponding to the current second knowledge answer.

[0192] In a specific implementation, the target question acquisition module 36 further includes:

[0193] The execution count updating submodule is used to take the first expanded question corresponding to the largest answer priority as the initial question, increase the execution count by one, and obtain the updated execution count.

[0194] The return execution submodule is used to return to execute the first model application module 32 to obtain the updated maximum answer priority.

[0195] Return the termination submodule, which is used to determine whether the maximum answer priority or the number of executions meets the termination condition if the updated maximum answer priority is greater than the preset first priority threshold, or the updated number of executions is equal to the preset number of executions.

[0196] The target question determination submodule is used to determine the first expanded question corresponding to the maximum answer priority when the termination condition is met as the target question.

[0197] It should be noted that the information interaction, execution process and other contents between the above modules are based on the same concept as the embodiment of the method of the present invention. Their specific functions and technical effects can be found in the method embodiment part and will not be repeated here.

[0198] Embodiment 4

[0199] Embodiment 4 of the present invention provides a non-transitory computer-readable storage medium, wherein at least one instruction or at least one program is stored in the non-transitory computer-readable storage medium, and the at least one instruction or at least one program is loaded and executed by a processor to implement the steps:

[0200] S1, obtain the initial question, the preset first language model and the preset second language model library.

[0201] S2: Input the initial question into the first language model to obtain the first knowledge answer and the first knowledge field corresponding to the initial question.

[0202] S3. Obtain N first expanded questions according to the initial question and the first knowledge answer, where N is an integer greater than 1.

[0203] S4, inputting the N first expanded questions into the first large language model respectively, and obtaining the second knowledge answer and the second knowledge field corresponding to each first expanded question.

[0204] S5. Obtain the answer priority corresponding to each second knowledge answer according to the initial question, the first knowledge domain, the first expanded question corresponding to each second knowledge answer, and the second knowledge domain corresponding to each first expanded question.

[0205] S6, taking the first expanded question corresponding to the largest answer priority as the initial question, updating the number of executions, and returning to execute step S2 until the largest answer priority or the number of executions meets the termination condition, and determining the first expanded question corresponding to the largest answer priority when the termination condition is met as the target question.

[0206] S7, in the preset second largest language model library, determine the second largest language model corresponding to the second knowledge field corresponding to the target question as the target large language model.

[0207] S8, input the target question into the target large language model to obtain the target knowledge answer corresponding to the initial question.

[0208] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include non-volatile and volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM, electrically programmable ROM, electrically erasable programmable ROM or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM, dynamic RAM, synchronous DRAM, double data rate SDRAM, enhanced SDRAM, synchronization link (Synchronization Link) DRAM, memory bus (Rambus) direct RAM, direct memory bus dynamic RAM, and memory bus dynamic RAM.

[0209] Those skilled in the art can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above.

[0210] Embodiment 5

[0211] A fifth embodiment of the present invention provides an electronic device, which includes a processor and the non-transitory computer-readable storage medium in the fourth embodiment of the present invention.

[0212] The above are only preferred embodiments of the present invention, and are not intended to limit the present invention in any form. Although the present invention has been disclosed as a preferred embodiment as above, it is not intended to limit the present invention. Any technician familiar with the profession can make some changes or modifications to equivalent embodiments of equivalent changes using the technical contents disclosed above without departing from the scope of the technical solution of the present invention. 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 content of the technical solution of the present invention are still within the scope of the technical solution of the present invention.

Claims

1. A knowledge question answering method based on a large language model, characterized in that: The knowledge question answering method comprises the following steps: S1, obtain the initial question, the preset first language model and the preset second language model library; S2, inputting the initial question into the first large language model to obtain a first knowledge answer and a first knowledge field corresponding to the initial question; S3, obtaining N first expanded questions according to the initial question and the first knowledge answer, where N is an integer greater than 1, and S3 further includes the following steps: S31, extracting a number of initial keywords in the initial question and a number of initial entity words in the first knowledge answer; S32, based on all the initial keywords and all the initial entity words, N key entity words are screened out from all the initial entity words, wherein S32 also includes the following steps: S321, obtaining the first position and the first occurrence number of each initial entity word in the first knowledge answer, and the second position and the second occurrence number of each initial keyword in the first knowledge answer; S322, grouping all initial entity words and all initial keywords in the first knowledge answer according to the first position and the second position to obtain a plurality of phrases; S323, for any initial entity word, according to the first position of the current initial entity word, the second occurrence number of all initial keywords in the phrase corresponding to the current initial entity word, and the second position of the initial keyword in the phrase corresponding to the current initial entity word, obtain the word priority corresponding to the current initial entity word; S324, determining the first N initial entity words with the highest word priority as key entity words; S33, for any key entity word, combining the initial question and the current key entity word to obtain a first expanded question corresponding to the current key entity word; S34, traverse N key entity words to obtain N first expansion questions; S4, inputting N first expanded questions into the first large language model respectively, and obtaining a second knowledge answer and a second knowledge field corresponding to each first expanded question; S5, obtaining an answer priority corresponding to each second knowledge answer according to the initial question, the first knowledge domain, the first expanded question corresponding to each second knowledge answer, and the second knowledge domain corresponding to each first expanded question; S6, taking the first expanded question corresponding to the largest answer priority as the initial question, updating the number of executions, and returning to step S2 until the largest answer priority or the number of executions meets the termination condition, and determining the first expanded question corresponding to the largest answer priority when the termination condition is met as the target question; S7, in the preset second largest language model library, determining the second largest language model corresponding to the second knowledge field corresponding to the target question as the target large language model; S8, input the target question into the target large language model to obtain the target knowledge answer corresponding to the initial question.

2. The knowledge question answering method based on a large language model according to claim 1, characterized in that: The first position includes a first sentence sequence number, which refers to the sequence number of the sentence corresponding to the corresponding initial entity word in the first knowledge answer, and the second position includes a second sentence sequence number, which refers to the sequence number of the sentence corresponding to the corresponding initial keyword in the first knowledge answer. S322 also includes the following steps: S3221, allocating an initial set to each first statement sequence number, wherein the initial set is an empty set; S3222, for any initial entity word, assign the current initial entity word to the corresponding initial set according to the first sentence sequence number corresponding to the current initial entity word; S3223, for any initial keyword, according to the second sentence sequence number corresponding to the current initial keyword and the first sentence sequence number corresponding to each initial set, assign the current initial keyword to the corresponding initial set; S3224, traverse all initial entity words and all initial keywords, assign all initial entity words and all initial keywords to corresponding initial sets, and obtain an updated initial set; S3225, determining each updated initial set as a corresponding phrase.

3. The knowledge question answering method based on a large language model according to claim 1, characterized in that: S5 also includes the following steps: S51, for any second knowledge answer, calculating a first similarity between the initial question and a first expanded question corresponding to the current second knowledge answer; S52, obtaining a second similarity between the first knowledge field and the second knowledge field corresponding to the current second knowledge answer; S53: Obtain the answer priority corresponding to the current second knowledge answer according to the first similarity and the second similarity.

4. The knowledge question answering method based on a large language model according to claim 3, characterized in that: S52 also includes the following steps: S521, obtaining a preset similarity question and answer template; S522, filling the first knowledge field and the second knowledge field corresponding to the current second knowledge answer into the similarity question and answer template to obtain a similarity question; S523: Input the similarity question into the first large language model to obtain a second similarity between the first knowledge field and the second knowledge field corresponding to the current second knowledge answer.

5. The knowledge question answering method based on a large language model according to claim 1, characterized in that: S6 includes the following steps: S61, taking the first expanded question corresponding to the largest answer priority as the initial question, increasing the execution count by one, and obtaining an updated execution count; S62, returning to step S2 to obtain the updated maximum answer priority; S63, if the updated maximum answer priority is greater than the preset first priority threshold, or the updated execution count is equal to the preset execution count, then determining that the maximum answer priority or execution count meets the termination condition; S64, determining the first expanded question corresponding to the maximum answer priority when the termination condition is satisfied as the target question.

6. A knowledge question-answering device based on a large language model, characterized in that: The knowledge question answering device comprises: A data acquisition module, used to obtain an initial question, a preset first language model and a preset second language model library; A first model application module, used for inputting the initial question into the first large language model to obtain a first knowledge answer and a first knowledge field corresponding to the initial question; A question expansion module, used to obtain N first expanded questions according to the initial question and the first knowledge answer, wherein N is an integer greater than 1, and the question expansion module further includes: A keyword extraction submodule, used to extract a number of initial keywords in the initial question and a number of initial entity words in the first knowledge answer; The entity word screening submodule is used to screen out N key entity words from all the initial entity words according to all the initial keywords and all the initial entity words, wherein the entity word screening submodule also includes: A data acquisition unit, used to acquire a first position and a first occurrence number of each initial entity word in the first knowledge answer, and a second position and a second occurrence number of each initial keyword in the first knowledge answer; A phrase grouping unit, used to group all initial entity words and all initial keywords in the first knowledge answer according to the first position and the second position, to obtain a plurality of phrases; A word priority acquisition unit is used to acquire, for any initial entity word, the word priority corresponding to the current initial entity word according to the first position of the current initial entity word, the second occurrence number of all initial keywords in the phrase corresponding to the current initial entity word, and the second position of the initial keyword in the phrase corresponding to the current initial entity word; An entity word screening unit, used to determine the first N initial entity words with the highest word priority as key entity words; A first question expansion submodule is used to combine the initial question with the current key entity word for any key entity word, and obtain a first expanded question corresponding to the current key entity word; The second question expansion submodule is used to traverse N key entity words and obtain N first expansion questions; A second model application module is used to input the N first expanded questions into the first large language model respectively, and obtain a second knowledge answer and a second knowledge field corresponding to each first expanded question; A priority acquisition module, configured to acquire the answer priority corresponding to each second knowledge answer according to the initial question, the first knowledge domain, the first expanded question corresponding to each second knowledge answer, and the second knowledge domain corresponding to each first expanded question; a target question acquisition module, configured to use the first expanded question corresponding to the maximum answer priority as the initial question, update the number of executions, and return to execute the first model application module until the maximum answer priority or the number of executions meets a termination condition, and determine the first expanded question corresponding to the maximum answer priority when the termination condition is met as the target question; A model screening module, used to determine, in the preset second largest language model library, the second largest language model corresponding to the second knowledge field corresponding to the target question as the target large language model; The answer acquisition module is used to input the target question into the target large language model to obtain the target knowledge answer corresponding to the initial question.

7. A non-transitory computer-readable storage medium, wherein at least one instruction or at least one program is stored in the non-transitory computer-readable storage medium, characterized in that: The at least one instruction or the at least one program is loaded and executed by the processor to implement the knowledge question answering method based on a large language model as described in any one of claims 1-5.

8. An electronic device, characterized in that: The invention comprises a processor and the non-transitory computer-readable storage medium as claimed in claim 7.