A Question Answering Method, Device, Storage Medium and Electronic Device Based on a Large Model
By dividing and predicting the domain knowledge base and determining the index information, the problem of inaccurate answers to the big model in a specific domain is solved, and more accurate answer output is achieved.
Patent Information
- Application Number
- CN202510333579.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-19
- Publication Date
- 2025-07-29
- Estimated Expiration
- 2045-03-19
AI Technical Summary
When dealing with professional Q&A with specific domain knowledge, the big model lacks understanding of knowledge in that specific domain, resulting in inaccurate answers.
By dividing the domain knowledge base, identifying each text block, and predicting the prediction problem of each text block, determining the index information based on the text block and the prediction problem, matching the user's questions to obtain relevant text blocks, and entering the big model to answer.
It improves the accuracy of the big model's Q&A in specific fields, enhances the relevance of relevant information by integrating multiple types of index information, and provides more accurate answers.
Smart Images

Figure CN119848222B_ABST
Abstract
Description
Technical Field
[0001] This specification relates to the field of computer technology, and particularly to a question-answering method, device, storage medium, and electronic device based on a large model. Background Art
[0002] Large models have powerful natural language processing and text generation capabilities. Since the training materials of large models cannot cover professional knowledge in various fields, when large models handle professional questions and answers in specific fields, they may give inaccurate answers due to the lack of understanding of the specific field knowledge.
[0003] To solve the above problems, a method of enhanced retrieval has been proposed currently. According to the question raised by the user, relevant content of the question is retrieved from an external knowledge base containing specific field knowledge, and the large model gives an answer to the question in combination with the retrieved relevant content.
[0004] However, in the existing enhanced retrieval methods, only the similarity between the question raised by the user and each text block contained in the external knowledge base is used to retrieve in the external knowledge base to determine relevant information. The retrieval method in the prior art is single, resulting in inaccurate relevant information obtained. The relevant content retrieved by the prior art provides limited specific field knowledge for the large model, resulting in low accuracy of the answers given by the large model.
[0005] Therefore, this specification provides a question-answering method based on a large model. Summary of the Invention
[0006] This specification provides a question-answering method, device, storage medium, and electronic device based on a large model to at least partially solve the above problems existing in the prior art.
[0007] This specification adopts the following technical solutions:
[0008] This specification provides a question-answering method based on a large model, including:
[0009] Determine a domain knowledge base, divide each document contained in the domain knowledge base, and determine each text block according to the division result;
[0010] For each text block, predict the question that the text block is asked, as the predicted question corresponding to the text block;
[0011] Determine the index information of each text block according to each text block and the predicted question corresponding to each text block;
[0012] When receiving the target question proposed by the user, match the target question with the index information to obtain text blocks related to the target question as relevant information; input the target question and the relevant information into the large model to obtain the target answer given by the large model.
[0013] Optionally, matching the target question with the index information to obtain text blocks related to the target question as relevant information specifically includes:
[0014] Determine the text blocks matching the target question according to the similarity between the target question and each text block; determine the prediction questions matching the target question according to the similarity between the target question and the prediction questions corresponding to each text block as relevant questions;
[0015] Take the text blocks matching the target question and the text blocks corresponding to the relevant questions as each relevant text block;
[0016] Determine relevant information according to each relevant text block.
[0017] Optionally, determining relevant information according to each relevant text block specifically includes:
[0018] Deduplicate each relevant text block to obtain the deduplicated relevant text blocks;
[0019] Respectively determine the correlation scores between each deduplicated relevant text block and the target question;
[0020] According to each correlation score, determine a specified number of relevant text blocks among the deduplicated relevant text blocks as relevant information.
[0021] Optionally, the text block includes a sub - text block and a parent text block;
[0022] Dividing each document included in the domain knowledge base and determining each text block according to the division result specifically includes:
[0023] Divide each document included in the domain knowledge base to obtain each parent text block;
[0024] For each parent text block, divide the parent text block to obtain each sub - text block included in the parent text block.
[0025] Optionally, matching the target question with the index information to obtain text blocks related to the target question as relevant information specifically includes:
[0026] Determine the sub - text blocks that match the target problem according to the similarity between the target problem and each sub - text block; determine the prediction problems that match the target problem according to the similarity between the target problem and the prediction problems corresponding to each sub - text block, and use them as relevant problems;
[0027] Use the sub - text blocks that match the target problem and the sub - text blocks corresponding to the relevant problems as each relevant text block;
[0028] Determine relevant information according to each relevant text block.
[0029] Optionally, determine the index information of each text block according to each text block and the prediction problems corresponding to each text block, specifically including:
[0030] For each parent text block, extract the summary of the parent text block to determine the summary text of the parent text block;
[0031] Use the sub - text blocks, the prediction problems corresponding to the sub - text blocks, and the summary texts of the parent text blocks as the index information of each text block.
[0032] Optionally, match the target problem with the index information to obtain the text blocks related to the target problem as relevant information, specifically including:
[0033] Determine the sub - text blocks that match the target problem according to the similarity between the target problem and each sub - text block; determine the prediction problems that match the target problem according to the similarity between the target problem and the prediction problems corresponding to each sub - text block, and use them as relevant problems; determine the summary text that matches the target problem according to the similarity between the target problem and the summary texts of the parent text blocks, and use it as the relevant summary;
[0034] Use the sub - text blocks that match the target problem, the sub - text blocks corresponding to the relevant problems, and the sub - text blocks included in the parent text blocks corresponding to the relevant summary as each relevant text block;
[0035] Determine relevant information according to each relevant text block.
[0036] Optionally, determine relevant information according to each relevant text block, specifically including:
[0037] Determine relevant information according to the parent text blocks corresponding to each relevant text block.
[0038] Optionally, match the target problem with the index information to obtain the text blocks related to the target problem as relevant information, specifically including:
[0039] Obtain the user's historical conversations;
[0040] Input the historical conversations and the target question into a large model, identify the elliptical descriptions in the target question, and supplement the target question according to the identified elliptical descriptions to obtain a first canonical question;
[0041] Identify the professional terms included in the first canonical question according to a preset glossary;
[0042] When it is determined that the professional terms included in the first canonical question are non-standard expressions, replace the non-standard expressions with the standard expressions in the glossary to obtain a second canonical question;
[0043] Match the second canonical question with the index information, and determine the text blocks related to the target question according to the matching result as relevant information.
[0044] Optionally, before matching the target question with the index information to obtain the text blocks related to the target question as relevant information, the method further includes:
[0045] Determine that the target question is of a specified type;
[0046] If the target question is not of the specified type, determine the keyword tag corresponding to the target question among the preset keyword tags, and determine the text blocks related to the target question among the respective text blocks according to the keyword tag corresponding to the target question as relevant information.
[0047] Optionally, matching the target question with the index information to obtain the text blocks related to the target question as relevant information specifically includes:
[0048] Split the target question to obtain each sub-question of the target question;
[0049] For each sub-question, match the sub-question with the index information to obtain the text blocks related to the sub-question as the relevant information of the sub-question.
[0050] Optionally, inputting the target question and the relevant information into a large model to obtain the target answer given by the large model specifically includes:
[0051] For each sub-question, input the sub-question and the relevant information of the sub-question into the large model to obtain the sub-answer of the sub-question given by the large model;
[0052] Integrate the sub-answers of each sub-question to obtain the target answer.
[0053] This specification provides a question-answering device based on a large model, and the device includes:
[0054] A partitioning module that determines a domain knowledge base, partitions each document included in the domain knowledge base, and determines each text block according to the partitioning result;
[0055] A predicted question determination module that, for each text block, predicts the question that the text block will be asked as the predicted question corresponding to the text block;
[0056] An index information determination module that determines the index information of each text block according to each text block and the predicted question corresponding to each text block;
[0057] An answering module that, when receiving a target question raised by a user, matches the target question with the index information to obtain a text block related to the target question as relevant information, and inputs the target question and the relevant information into the large model to obtain the target answer given by the large model.
[0058] This specification provides a computer-readable storage medium storing a computer program, and when the computer program is executed by a processor, the above-mentioned question-answering method based on a large model is implemented.
[0059] This specification provides an electronic device including a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the program, the above-mentioned question-answering method based on a large model is implemented.
[0060] At least one of the above technical solutions adopted in this specification can achieve the following beneficial effects:
[0061] In the question-answering method based on a large model provided in this specification, a domain knowledge base is determined, each document included in the domain knowledge base is partitioned, and each text block is determined according to the partitioning result. For each text block, the question that the text block will be asked is predicted as the predicted question corresponding to the text block, and the index information of each text block is determined according to each text block and the predicted question corresponding to each text block. When receiving a target question raised by a user, the target question is matched with the index information to obtain a text block related to the target question as relevant information, and the target question and the relevant information are input into the large model to obtain the target answer given by the large model.
[0062] Since the index information in this method is determined according to the predicted questions corresponding to each text block and each text block, that is, the index information includes multiple types, the relevant information in this method is determined by comprehensively considering the similarity between the target question and multiple types of index information, and has a stronger correlation with the target question. Therefore, the relevant information obtained in this method can provide domain knowledge with a stronger correlation with the target question for the large model, guiding the large model to output a more accurate target answer. BRIEF DESCRIPTION OF THE DRAWINGS
[0063] The drawings described herein are used to provide a further understanding of this specification, form a part of this specification, and the schematic embodiments and descriptions thereof are used to explain this specification and do not constitute an improper limitation to this specification. In the drawings:
[0064] Figure 1 is a schematic flowchart of a question-answering method based on a large model in this specification;
[0065] Figure 2 is a schematic diagram of the composition of a type of index information provided in an embodiment of this specification;
[0066] Figure 3 is a schematic diagram of the execution of a question-answering process provided in an embodiment of this specification;
[0067] Figure 4 is a schematic flowchart of a method for determining text blocks provided in an embodiment of this specification;
[0068] Figure 5 is a schematic diagram of the composition of a type of index information provided in an embodiment of this specification;
[0069] Figure 6 is a schematic flowchart of a method for determining index information provided in an embodiment of this specification;
[0070] Figure 7 corresponds to the one provided in an embodiment of this specification Figure 6 schematic diagram of the composition of index information;
[0071] Figure 8 is a schematic diagram of the execution of a question-answering process provided in an embodiment of this specification;
[0072] Figure 9 is a schematic diagram of the execution of a question-answering process provided in an embodiment of this specification;
[0073] Figure 10 is a schematic diagram of the execution of a question-answering process provided in an embodiment of this specification;
[0074] Fig.11 is a schematic diagram of the execution of a question-answering process provided in an embodiment of this specification;
[0075] Figure 12 Schematic diagram of a question-answering device based on a large model in this specification;
[0076] Fig.13 Corresponding to what is provided in this specification Figure 1 Schematic diagram of an electronic device Specific implementation manners
[0077] To make the objectives, technical solutions, and advantages of this specification clearer, the technical solutions of this specification will be clearly and completely described below in conjunction with specific embodiments of this specification and the corresponding drawings. Obviously, the described embodiments are only a part of the embodiments of this specification, rather than all the embodiments. Based on the embodiments in this specification, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the scope of protection of this application.
[0078] The following will, in conjunction with the drawings, detail the technical solutions provided by each embodiment of this specification.
[0079] Figure 1 Schematic flowchart of a question-answering method based on a large model in this specification, specifically including the following steps:
[0080] S100: Determine a domain knowledge base, divide each document included in the domain knowledge base, and determine each text block according to the division result.
[0081] In this specification, the device for performing question-answering based on a large model can be a server or an electronic device such as a desktop computer or a laptop computer. For the sake of convenience of description, the following will only use the server as the execution subject to illustrate the question-answering method based on a large model provided by this specification.
[0082] The domain knowledge base in this specification corresponds to a specific question domain of the question-answering method in this specification and is a database containing the domain knowledge of the specific question domain. This specification does not limit the specific content of the domain knowledge base. For example, if the question domain is related to the financial risk assessment of a certain workgroup, the domain knowledge base is the financial risk assessment materials of the workgroup, which may include assessment criteria, assessment suggestions, assessment conclusions of the assessed members, etc. If the question domain is related to network security, the domain knowledge base may include network security time cases, vulnerability management specifications, compliance standards, etc. of a certain department.
[0083] In the implementation of enhanced retrieval, it is necessary to match relevant information in the domain knowledge base through the target question proposed by the user. Usually, for more accurate matching, the content in the domain knowledge base is first divided to obtain multiple text fragments as sub-text blocks.
[0084] This specification does not limit the specific method of content division. Any text segmentation method can be used. For example, rule-based segmentation can set segmentation rules according to chapters, paragraphs, etc., and semantic-based segmentation can use machine learning to learn contextual semantics and then perform segmentation based on semantics.
[0085] After content division, the obtained text blocks can be used to match user questions to determine the text blocks with higher similarity to user questions, and guide the large model to reason about specific domain problems.
[0086] S102: For each text block, predict the question asked about the text block as the predicted question corresponding to the text block.
[0087] In this method, in order to obtain more types of content that match the target question and make the matching range more diversified, the server predicts the question asked about each text block as the predicted question corresponding to the text block.
[0088] Specifically, in one embodiment, the server may input the text block into the large model, causing the large model to parse the content of the text block and ask questions related to the content of the text block to obtain prediction questions for the text block. In this embodiment, the server may limit the number of prediction questions output by the large model, so that the large model outputs a preset number of prediction questions. Alternatively, the server may not limit the number of prediction questions output by the large model, allowing the large model to flexibly determine the number of prediction questions to output based on the content of the sub-text block.
[0089] In another embodiment, the predicted questions may also be obtained by asking questions manually, and the server may obtain, for each sub-text block, the manually annotated predicted questions for the sub-text block.
[0090] A predicted question for a text block is a question that is predicted to be asked about that text block. The answer to the predicted question can be determined based on at least a portion of the content in the text block. This specification does not limit the number of predicted questions for a sub-text block; it can be one or more.
[0091] Taking the financial risk assessment data of a certain working group as an example, if a text block is: Compliance assessment focuses on the compliance of member countries with 40 standards, and is divided into four levels according to the compliance status: "Compliance" (C, full compliance), "Generally compliant" (LC, with a few defects, most of which can be fully compliant), "Partial compliance" (PC, with serious defects, most of which are not complied with) and "Non-compliance" (NC, due to defects in national structure, laws or mechanisms, all or part of the requirements are not applicable).
[0092] Then the prediction questions for this sub - text may include: "What does the compliance assessment mainly focus on?", "How many levels is the compliance assessment divided into?", "What does C represent?", "What does LC represent?", "What does PC represent?", "What does NC represent?", etc.
[0093] The prediction questions for each sub - text will be used to match with the target question input by the user. Based on the matched prediction questions, more accurate text blocks related to the target question can be determined to obtain more accurate relevant information.
[0094] Because there are differences in the grammatical structures between interrogative sentences and descriptive sentences, and the target question input by the user is usually an interrogative sentence. Matching the target question directly with the text blocks may not obtain accurate matching results, resulting in inaccurate determination of relevant information.
[0095] In this specification, questions that each text block may be asked are predicted in advance. Then, during the matching process, prediction questions that are extremely similar or even exactly the same as the expression of the target question may be matched. Furthermore, the server can accurately locate the user's intention based on the text blocks corresponding to the prediction questions, determine more accurate relevant information, and finally obtain a more accurate answer based on the relevant information during the large - model inference.
[0096] S104: Determine the index information of each text block according to each text block and the prediction questions corresponding to each text block.
[0097] Figure 2 This is a schematic diagram of the composition of index information provided in the embodiments of this specification. In Figure 2 the corresponding embodiments, the index information contains two types of content, namely the prediction questions corresponding to each text block and each text block itself.
[0098] The index information in this specification is the content that needs to be matched with the user's question. Compared with the conventional index information that only contains one type of content, which is the text block itself, the composition of the index information in this specification is more abundant.
[0099] The text block itself is used to perform semantic similarity matching of question answers for the target question, so sub - text blocks with words that are the same or have similar meanings to the target question may be retrieved. The prediction questions corresponding to the sub - text blocks are used to perform consistency of question expression and semantic similarity matching for the target question, so prediction questions that are exactly the same as the target question in terms of expression and semantics may be determined. Through this embodiment, the server can perform hybrid retrieval on the user's question in the index information of multiple types of content to determine more accurate relevant information.
[0100] S106: When receiving the target question raised by the user, match the target question with the index information to obtain a text block related to the target question as relevant information; input the target question and the relevant information into the large model to obtain the target answer given by the large model.
[0101] After the above index information is determined, the server can store the index information. When receiving the target question raised by the user, the server matches the target question with the index information to obtain a text block related to the target question as relevant information.
[0102] In one or more embodiments of this specification, the server simultaneously matches the target question with various types of content included in the index information to determine relevant information.
[0103] Specifically, the server takes each sub - text block included in the index information and the predicted question corresponding to each sub - text block as each candidate content. Then, according to the similarity between the target question and each candidate content, a specified number of candidate contents are determined from each candidate content as relevant contents.
[0104] When the relevant content determined by the server is a text block, this text block is used as relevant information. When the relevant content determined by the server is a predicted question, the text block corresponding to this predicted question is used as relevant information.
[0105] Therefore, in this specification, by comprehensively determining the text block related to the target question through various types of index information to obtain relevant information, more accurate retrieval can be performed in the domain knowledge base.
[0106] The server inputs the retrieved relevant information and the target question into the large model together, enabling the large model to reason about the target question based on the relevant information to obtain an accurate target answer.
[0107] In the question - answering method based on the large model provided in this specification, a domain knowledge base is determined, each document included in the domain knowledge base is divided, and each text block is determined according to the division result. For each text block, the question that the text block is likely to be asked is predicted as the predicted question corresponding to this text block, and the index information of each text block is determined according to each text block and the predicted question corresponding to each text block. When receiving the target question raised by the user, the target question is matched with the index information to obtain a text block related to the target question as relevant information, and the target question and the relevant information are input into the large model to obtain the target answer given by the large model.
[0108] Because the index information in this method is determined based on the prediction question and each text block, meaning that the index information includes multiple types, the relevant information in this method is determined by combining the similarities between the target question and various types of index information, resulting in a stronger correlation with the target question. Therefore, the relevant information obtained in this method can provide the large model with domain knowledge that is more relevant to the target question, guiding the large model to output a more accurate target answer.
[0109] In the above step S106, the server may further match the target question with various types of content included in the index information to determine relevant information.
[0110] First, the server determines the text blocks that match the target question based on the similarity between the target question and each text block. Based on the similarity between the target question and the predicted questions corresponding to each text block, the server determines the predicted questions that match the target question as related questions.
[0111] Specifically, the server may vectorize each text block and the prediction problem corresponding to each text block through a text embedding model to determine a first feature vector of each text block and a second feature vector of the prediction problem of each text block.
[0112] After receiving the user's target question, the server vectorizes the target question using the aforementioned text embedding model and determines the target feature vector for the target question. Then, based on the similarity between the target question and each first feature vector, the server identifies a first specified number of text blocks corresponding to the first feature vectors from the text blocks corresponding to each first feature vector as matching text blocks for the target question. Based on the similarity between the target question and each second feature vector, the server identifies a second specified number of predicted questions corresponding to the second feature vectors from the predicted questions corresponding to each second feature vector as related questions.
[0113] Then, the server may use the text block matching the target question and the text blocks corresponding to the related questions as the related text blocks.
[0114] Specifically, the server uses the text block that matches the target question as the first text block, and the text block corresponding to the relevant question as the second text block, and uses the first text block and the second text block as the relevant text blocks.
[0115] Finally, the server determines the relevant information based on the relevant text blocks.
[0116] Because the first text block is at least one text block related to the target question selected from the various text blocks contained in the domain knowledge base, that is, the first text block is the original content in the domain knowledge base, and the related question is further predicted based on the content of the sub-text, which is not the original content in the domain knowledge base. When reasoning with the large model, it is necessary to rely on the original content in the domain knowledge base to provide a reasoning basis for the large model. If it is not the original content, it may provide inaccurate information to the large model, resulting in inaccurate reasoning results. Therefore, in this embodiment, after the server determines the predicted question related to the target question, it needs to use the text block corresponding to the predicted question as the second text block, that is, as part of the relevant information.
[0117] Figure 3 This is a schematic diagram of a question-answering process provided in an embodiment of this specification. Figure 3 As shown, the server matches the target question with each text block and the prediction question corresponding to each text block, determines the first text block and the second text block, and determines the relevant information of the input large model based on the first text block and the second text block.
[0118] The relevant information determined in this embodiment includes both a first text block determined based on the text block and a second text block determined based on the prediction question corresponding to the text block. The relevant information is determined by combining the first text block and the second text block. The determined relevant information has a high similarity with the target question in terms of the semantics of the content itself and the semantics of the prediction question, and can provide a more accurate reasoning basis for the large model.
[0119] The server may determine the relevant information based on the relevant text blocks in a variety of ways.
[0120] In one embodiment, the server may treat all relevant text blocks as relevant information.
[0121] However, because the text block itself and the predicted question of the text block are semantically similar, the first text block obtained by matching the target question with each text block and the second text block obtained by matching the target question with the predicted question corresponding to each text block may contain the same text block.
[0122] Therefore, to reduce information redundancy, in one embodiment, the server can deduplicate the related text blocks consisting of the first text block and the second text block, and use the deduplicated related text blocks as related information. Inputting the related information in this embodiment into the large model reduces the redundancy contained in the related information, thereby improving the inference speed of the large model while maintaining inference accuracy.
[0123] In one embodiment, because the number of determined first text blocks and the number of second text blocks may be large, the number of related text blocks is also large, the amount of relevant information input into the large model is large, and the large model is slow in determining the target answer based on the relevant information.
[0124] Therefore, in order to further improve the reasoning speed of large models, the server can sort each relevant text block according to the correlation between each relevant text block and the target question, and further screen each relevant text block based on the sorting results to determine some relevant text blocks as relevant information.
[0125] Specifically, the server determines a relevance score between each relevant text block and the target question. This specification does not limit the method for determining the relevance score.
[0126] The server can determine the relevance score using any existing relevance evaluation algorithm, such as the term frequency–inverse document frequency (TF-IDF) algorithm or the Best Matching 25 (BM25) algorithm. Machine learning can also be used to determine the relevance score, using a neural network model to extract features from each text block and the target question. Based on the extracted features, the neural network model outputs a relevance score for each text block and the target question. Alternatively, the relevance score can be determined using a large model. Specifically, the server inputs each text block, the target question, and a prompt word into the large model. The prompt word explicitly instructs the large model to evaluate the relevance of each text block to the target question and output a corresponding relevance score for each text block.
[0127] After determining the relevance score corresponding to each text block, the server sorts the text blocks according to the relevance score of each text block, and determines a specified number of related text blocks in descending order of relevance scores as related information.
[0128] In another embodiment, in order to obtain relevant information without duplication and with a smaller data volume, the above-mentioned embodiment of determining relevant information by removing duplication and the embodiment of determining relevant information by screening can be used in a superimposed manner.
[0129] Specifically, the server removes duplicates from each relevant text block to obtain deduplicated relevant text blocks. Then, the server determines a relevance score between each deduplicated relevant text block and the target question. Based on the relevance scores, the server determines a specified number of relevant text blocks from each deduplicated relevant text block as relevant information.
[0130] In one or more embodiments of this specification, the server may also adopt a multi-level division method to determine each text block, and the text blocks in this specification include sub-text blocks and parent text blocks.
[0131] Then, in the above step S100, the server may determine each text block according to Figure 4 the steps shown. Figure 4 It is a schematic flowchart of a method for determining text blocks provided in an embodiment of this specification. As Figure 4 shown, this method specifically includes the following steps:
[0132] S200: Divide each document included in the domain knowledge base to obtain each parent text block.
[0133] S202: For each parent text block, divide the parent text block to obtain each sub-text block included in the parent text block.
[0134] In step S100, if the domain knowledge base is divided into each text block through one division, and there is no overlap between the divided text blocks, then each text block included in the finally determined relevant information is independent of each other and does not include context information. This results in limited domain knowledge provided to the large model, which is not conducive to the large model for reasoning.
[0135] In this embodiment, a two-level division method is adopted to determine the parent text block and the sub-text block. Since the sub-text block is divided within the parent text block, the parent text block is composed of multiple sub-text blocks, and the parent text block provides context information for the sub-text blocks it contains. When determining the relevant information according to the text blocks in this embodiment, relevant information including context can be determined, providing richer domain knowledge for the large model.
[0136] Based on the above Figure 4 shown embodiment, in the above step S106, the server may also determine the relevant information according to the following method.
[0137] First, the server determines the sub-text block that matches the target problem according to the similarity between the target problem and each sub-text block. According to the similarity between the target problem and the predicted problems corresponding to each sub-text block, the predicted problem that matches the target problem is determined as the relevant problem.
[0138] Then, the server may use the sub-text block that matches the target problem and the sub-text blocks corresponding to the relevant problems as each relevant text block.
[0139] Specifically, the server uses the sub-text block that matches the target problem as the first text block, and the sub-text blocks corresponding to the relevant problems as the second text block. And the first text block and the second text block are used as each relevant text block.
[0140] Finally, the server determines relevant information based on each relevant text block.
[0141] Figure 5 This is a schematic diagram of the composition of an index information provided in an embodiment of this specification. In Figure 5 the corresponding embodiment, the index information includes two types of content, namely the predicted questions corresponding to each sub-text block and each sub-text block itself.
[0142] In this embodiment, the specific steps of matching the target question with each sub-text block, the specific steps of matching the target question with the predicted questions corresponding to each sub-text block, and the specific steps of determining relevant information based on relevant text blocks are similar to the specific steps of matching the target question with each text block, the specific steps of matching the target question with the predicted questions corresponding to each text block, and the specific steps of determining relevant information based on relevant text blocks involved in the embodiment related to step S106 above. For details, reference can be made to the description of the corresponding content above.
[0143] Since the sub-text block is a more fine-grained division result of the domain knowledge base and usually can contain more specific semantics, the relevant information determined based on the sub-text block is a more fine-grained matching result of the semantics of the target question, with a higher semantic similarity to the target question. Therefore, when the large model is reasoning, more accurate target answers can be obtained based on the relevant information in this embodiment.
[0144] Based on the above Figure 4 shown embodiment, in the above step S104, in order to perform more accurate retrieval, the server can also determine another type of index information through the parent text block to enrich the types of index information.
[0145] In one embodiment, the server can use each parent text block as another type of index information, together with each sub-text block and the predicted questions corresponding to each sub-text block, as a mixed form of index information for matching with the target question.
[0146] However, considering that the content of the parent text block is usually long and the sub-text blocks included in one parent text block may have different semantic themes, directly using the parent text block for matching with the target question may make it difficult to locate the semantic theme expressed by the target question, resulting in inaccurate matching.
[0147] Therefore, in another embodiment, the server can determine the index information according to the Figure 6 shown steps. Figure 6 This is a schematic flowchart of a method for determining index information provided in an embodiment of this specification. As Figure 6 shown, the method specifically includes the following steps:
[0148] S300: For each parent text block, extract a summary of the parent text block to determine a summary text of the parent text block.
[0149] S302: Using each sub-text block, the prediction question corresponding to each sub-text block, and the summary text of each parent text block as index information of each text block.
[0150] Figure 7 A method corresponding to Figure 6 The index information composition diagram is as follows: Figure 7 As shown, the index information consists of each child text block, the predicted question of each child text block, and the summary text of each parent text block.
[0151] The summary text is a description of the main content of the parent text block. The summary text is shorter and more concise. Using the summary text as index information can not only improve the matching speed, but also achieve more accurate semantic matching with the target question.
[0152] Based on the above Figure 6 In the illustrated embodiment, when the index information consists of each sub-text block, the predicted question of each sub-text block, and the summary text of each parent text block, in the above step S106, the server may also determine the relevant information according to the following method.
[0153] First, the server determines the subtext blocks that match the target question based on the similarity between the target question and each subtext block. Based on the similarity between the target question and the predicted questions corresponding to each subtext block, the server determines the predicted questions that match the target question as related questions. Based on the similarity between the target question and the summary text of each parent text block, the server determines the summary text that matches the target question as related summaries.
[0154] In this step, the specific method for determining the sub-text block that matches the target question, and the specific method for determining the related questions are similar to the specific steps of determining the text block that matches the target question and the related questions based on the text block obtained by one division in the embodiment related to the above step S106. For details, please refer to the description of the corresponding content above.
[0155] When determining relevant summaries, the server pre-vectorizes the summary text of each parent text block using the aforementioned text embedding model to obtain a third feature vector for each summary text. After receiving the user's target question, the server vectorizes the target question using the same text embedding model to determine a target feature vector for the target question. Based on the similarity between the target feature vector and each third feature vector, the server identifies a third specified number of summary texts from the summary texts corresponding to each third feature vector as relevant summaries.
[0156] Then, the server uses the sub-text block matching the target question, the sub-text block corresponding to the relevant question, and each sub-text block contained in the parent text block corresponding to the relevant summary as each relevant text block.
[0157] Specifically, the server uses the sub-text block that matches the target question as the first text block. It uses the sub-text block corresponding to the relevant question as the second text block. It uses each sub-text block contained in the parent text block corresponding to the relevant summary as the third text block. The first, second, and third text blocks are used as relevant text blocks. The server then determines relevant information based on each relevant text block.
[0158] Because the summary text is not the original content in the domain knowledge base, the server needs to determine the original content of the relevant summary based on the relevant summary, that is, to use the child text blocks contained in the parent text block corresponding to the relevant summary as the third text block to ensure that the large model can determine accurate domain information based on the third text block.
[0159] Because the first and second text blocks are both divided into sub-text blocks, the sub-text blocks within the parent text block, rather than the parent text block itself, are considered the third text block. This is to align the division levels of the third text block with those of the first and second text blocks. If the division levels are inconsistent, the text blocks included in the relevant information input to the large model will vary in length, hindering accurate reasoning for the large model.
[0160] Figure 8 This is a schematic diagram of a question-answering process provided in an embodiment of this specification. Figure 8 As shown, the server matches the target question with each text block, the predicted question corresponding to each text block, and the summary text of each parent text block, and obtains the first text block, the second text block, and the third text block that match the target question, and determines the relevant information of the input large model based on the first text block, the second text block, and the third text block.
[0161] Based on the above Figure 5 or Figure 7 In a corresponding embodiment, that is, when the index information consists of each sub-text block and the prediction question corresponding to each sub-text block, or the index information consists of each sub-text block, the prediction question corresponding to each sub-text block and the summary text of each parent text block, in the above-mentioned step S106, the server can also determine the relevant information according to the following method.
[0162] The server can determine the relevant text blocks in the manner described in any of the above embodiments. In the above embodiments, the relevant text blocks are divided into sub-text blocks. The relevant information is determined based on the parent text block corresponding to each relevant text block.
[0163] Sub-text blocks are shorter and contain more specific semantic information, enabling more accurate identification of user intent when matching target questions. However, due to limited length and a lack of context, when sub-text blocks are provided as relevant information to the larger model, the larger model may be unable to fully understand the semantics of the sub-text blocks, resulting in inaccurate reasoning. A parent text block, however, consists of multiple sub-text blocks, providing contextual information for each of them.
[0164] Therefore, the method of this embodiment matches the target problem at the level of the sub-text block and determines the relevant information of the input large model at the level of the parent text block, combining the advantages of the accurate positioning of the sub-text block in the matching process and the contextual information contained in the parent text block.
[0165] In the above step S106, because the target question input by the user may not be standardized enough, the server may first normalize the target question to determine a more accurate user intention and provide a more accurate answer to the target question.
[0166] First, the server obtains the user's historical conversations.
[0167] Specifically, the server may obtain all historical conversations contained in the user's historical question and answer records, or a specified number of historical conversations in the historical question and answer records, as needed.
[0168] Alternatively, in some real-time scenarios, a user may initiate conversations in different conversation groups, and the content of each conversation group is independent of each other. The server may then obtain all of the user's historical conversations in the current conversation group, or a specified number of historical conversations in the current conversation group.
[0169] Secondly, the server inputs the historical conversation and target question into the big model, identifies the omitted descriptions in the target question, and supplements the target question based on the identified omitted descriptions to obtain the first standard question.
[0170] Due to language habits, users often omit information in continuous conversations and do not repeat content already mentioned in previous conversations. In this case, the target question entered by the user may be incomplete. If the original target question entered by the user is fed into the large model, the large model will not be able to accurately identify the user's intent and will not be able to provide an accurate answer.
[0171] For example, in a certain conversation scenario, the target question entered by the user in the previous conversation of the current conversation was "How about the CDD in Country A" (here, CDD is an abbreviation for Customer Due Diligence, and the full Chinese name is Customer Due Diligence. The target question entered by the user does not include the full English or Chinese name of CDD), and the target question entered in the current conversation is "What about Region B".
[0172] Then, the server can determine that the target question in the current conversation is an elliptical description based on the target question in the previous conversation, supplement the current target question as "How about the CDD in Region B", and use "How about the CDD in Region B" as the first standardized question.
[0173] Again, the server identifies the professional terms included in the first standardized question according to the preset glossary, and determines whether the professional terms included in the first standardized question are non-standard expressions. If so, replace the non-standard expression with the standardized expression in the glossary to obtain the second standardized question. If not, use the first standardized question as the second standardized question.
[0174] The non-standard expressions here can be colloquial expressions, contain typos, use English abbreviations, etc. In the glossary, various professional terms included in the professional field of the Q&A scenario are stored, as well as the corresponding relationships between the standardized expressions of each professional term and various possible non-standard expressions.
[0175] For example, if using an English abbreviation is a non-standard expression, when the first standardized question is "How about the CDD in Region B", the server can identify that "CDD" in the first standardized expression is a non-standard expression according to the glossary, and determine that the standardized expression corresponding to "CDD" in the glossary is "Customer Due Diligence", so the second standardized expression is determined as "How about the Customer Due Diligence in Region B".
[0176] Then, the server matches the second standardized question with the index information determined in step S104 to obtain the text block related to the target question as the relevant information. The specific method for determining the relevant information here can refer to the description of the corresponding content in the above step S106.
[0177] In this embodiment, there are two types of standardization operations, namely supplementing elliptical descriptions to determine the first standardized question, and determining the second standardized question through replacing professional terms. In this embodiment, the above two standardization operations are described by taking the example of first supplementing elliptical descriptions and then replacing professional terms.
[0178] In another embodiment, the two normalization operations can be performed simultaneously. That is, the server supplements the target question with an abbreviated description based on the historical conversations while identifying non-standard descriptions of professional terms contained in the target question.
[0179] It should be noted that this embodiment is a scenario in which two normalization operations are used in combination. In fact, the two normalization operations can also be used separately.
[0180] If the normalization operation of supplementing omitted descriptions is used alone, the server will directly match relevant information based on the first canonical question after determining it, and use the first canonical question as the input for the large model. If the normalization operation of replacing professional terms is used alone, without supplementing omitted descriptions, the server will directly replace the non-standard description in the target question to obtain the second canonical question, match relevant information based on the second canonical question, and use the second canonical question as the input for the large model.
[0181] In one or more embodiments of the present specification, the server may perform integrity verification on the target question to ensure that the target question can fully answer the user's intention before further processing.
[0182] In a scenario, the content contained in the domain knowledge base is described according to different content categories, and the descriptions under each content category are similar. The content category is the narrative theme of the domain knowledge base, and the domain knowledge base expands the narrative according to each content category.
[0183] For example, let's consider a domain knowledge base representing a work group's financial risk assessment data. This domain knowledge base contains assessment reports for each assessed member, and the content and structure of the reports from different assessors are similar. For example, the assessment report for assessor 1 includes the results of the professional supervision assessment, the results of the preventive measures assessment, and corrective action recommendations. The assessment report for assessor 2 also includes the results of the professional supervision assessment, the results of the preventive measures assessment, and corrective action recommendations. In this example, the assessor represents the content category.
[0184] In this case, if the target question is "What are the evaluation results of professional supervision?", because the target question does not clearly define the content dimension, that is, it does not contain any information about the evaluators. Even if the target question is input into the big model, the big model cannot determine the true user intent and does not know which evaluator's evaluation results the user wants to know about professional supervision, so the big model cannot provide an accurate answer.
[0185] In order to prevent the large model from being unable to perform accurate inference due to incomplete semantics of the target question, in the above step S106, the server performs semantic analysis on the target question to determine whether the target question corresponds to any content category.
[0186] If yes, the target question is matched with the index information to determine the relevant information of the target question. The specific method of determining the relevant information can refer to the description of the specific steps of determining the relevant information in step S106 above.
[0187] If not, the user is prompted to re-enter the target question to end the reasoning process of the target question in advance and save computing resources.
[0188] Furthermore, in addition to identifying the target question's content category, the server can also perform sentence structure analysis on the target question to determine its completeness. If the target question's sentence structure is incomplete, it typically cannot convey the full semantics and cannot express the user's true intent.
[0189] For example, the target question "Financial security in Region B" lacks an object, making it unclear what the user is asking about. Even if this target question is fed into the large model, it's difficult to get an accurate answer. Therefore, when an incomplete sentence structure is detected, the user is prompted to re-enter the target question.
[0190] The above-mentioned content category identification and structural integrity identification can be performed either one or both depending on the actual situation. When performed together, the order of the two identification methods is not restricted and can be performed simultaneously or sequentially.
[0191] In the above Figure 1 In the illustrated embodiment, when determining relevant information, the target question is matched with the index information of each text block in terms of vector similarity to determine the relevant information.
[0192] In practice, the server can also use a tag matching method to match the target question with each text block. In this embodiment, before step S106, the server needs to determine the tag of each text block in the domain knowledge base. This specification does not limit the method for determining tags, and manual annotation, keyword extraction, or any other existing tag determination method can be used.
[0193] Then, in step S106, after receiving the target question, the label of the target question is determined, and then the server filters the text blocks in the domain knowledge base according to the label of the target question, and determines the text blocks with labels consistent with the target question as relevant information.
[0194] Considering that label matching is a simple string matching, not a semantic matching, and its accuracy is lower than that of vector similarity matching, this manual Figure 1 However, precisely because label matching is string matching, compared to vector similarity matching, the calculation process is simpler, the matching process consumes less computing resources, and the matching speed is higher.
[0195] For target questions that can be answered clearly in the domain knowledge base, the relevant information retrieved for such questions is highly correlated with the keywords contained in the target question, and the relevant information retrieved in the domain knowledge base is relatively fixed. In this case, label matching can be used to quickly locate the relevant information.
[0196] For target questions that cannot be answered clearly in the domain knowledge base, a large model is required to infer the answers based on the relevant information retrieved from the domain knowledge base. The relevant information retrieved for such questions has a strong correlation with the semantics of the target question itself, and vector similarity matching can be used to achieve a more accurate semantic match.
[0197] Therefore, in one or more embodiments of this specification, the server may combine the advantages of both retrieval methods. In step S106, before matching the target question with the index information, the server first determines whether the target question is of a specified type. A specified type indicates a target question type for which vector similarity matching can be used to determine relevant information. A non-specified type indicates a target question type for which label matching can be used to determine relevant information.
[0198] This specification does not limit the specific classification method of the designated type, which can be set according to needs. For example, types such as query questions and closed questions can be used as designated types. The designated type can also be flexibly determined based on the specific content of the documents contained in the domain knowledge base.
[0199] When the server determines that the target question is of the specified type, according to any embodiment corresponding to step S106 above, vector similarity matching is performed between the target question and the index information of each text block to determine relevant information.
[0200] When the server determines that the target question is not of the specified type, it performs label matching on the target question and each text block in the domain knowledge base, and determines the text block related to the target question as the relevant information.
[0201] Specifically, the server determines the keyword tag corresponding to the target question from among the preset keyword tags, and determines, according to the keyword tag corresponding to the target question, the text block related to the target question from among the text blocks as the relevant information.
[0202] Figure 9This is a schematic diagram of a question-answering process provided in an embodiment of this specification. Figure 9 As shown in , when the target question is not of the specified type, the label matching method is used to determine the relevant information. When the target question is of the specified type, the vector similarity matching method is used to determine the relevant information. Figure 9 The dotted box lists a specific method of vector similarity matching, and the content in the dotted box can be replaced by any vector similarity matching method in the embodiment corresponding to S106.
[0203] The server matches the target question with each text block and the prediction question corresponding to each text block, determines the first text block and the second text block, and determines the relevant information of the input large model based on the first text block and the second text block.
[0204] In one embodiment, when each document contained in the domain knowledge base contains clear summary text about specific content, when a user asks a summary question about the specific content, the server can directly query the summary text of the specific question in each text block as relevant information.
[0205] For example, when the domain knowledge base is the financial risk assessment data of a certain working group, the domain knowledge base contains the working group's assessment report for each assessment member. The assessment report includes both the assessment conclusions for each assessment project and a summary description of the assessment situation based on the assessment conclusions of each assessment project.
[0206] The text blocks corresponding to the assessment conclusions of individual assessment items and the summary description of the assessment situation can be annotated with the content tag of the summary text. When a user asks about the assessment conclusions of a particular assessment item or the overall assessment status of a particular assessment member, the tags can be directly matched among the text blocks contained in the domain knowledge base to determine the summary text the user needs.
[0207] In the scenario of this embodiment, before step S106, the server may assign content tags to each text block contained in the domain knowledge base. These content tags may include summary content and non-summary content. Furthermore, each text block may be assigned a keyword tag. These keyword tags are keywords contained in the text block and may indicate the specific description of the text block. Content tags and keyword tags may be obtained through manual annotation or extracted using a large model based on the semantics of the text block.
[0208] For example, in a text block 1, it contains the evaluation results of professional supervision, the evaluation results of preventive measure supervision, and rectification suggestions. Then the keyword tags of this text block can be "the first evaluation result of professional supervision", "the second evaluation result of professional supervision", "first-level suggestion", "second-level suggestion", etc. In another text block, it contains the evaluation results of professional supervision, the evaluation results of preventive measure supervision, and rectification suggestions. Then the keyword tags of this text block can be "the first evaluation result of preventive measure supervision", "the second evaluation result of preventive measure supervision", "first-level suggestion", "second-level suggestion", etc.
[0209] Based on the application scenario of this embodiment, the server can flexibly determine the specified type according to the specific content of the documents included in the domain knowledge base, and use the target question with the content label of summary content as the specified type.
[0210] Before the server matches the target question with the index information in step S106, according to the semantics of the target question, it determines the content label corresponding to the target question. And it judges whether this content label is summary content.
[0211] If so, it determines that this target question is the specified type, then determines that this target question is not the specified type, and uses the vector similarity matching method. According to any one of the embodiments related to the above step S106, it matches the target question with the index information to determine the relevant information.
[0212] If not, it uses the label matching method to determine the relevant information.
[0213] Specifically, the server determines the keyword tag corresponding to the target question according to the semantics of the target question. And it matches the keyword tag corresponding to the target question with the keyword tags of each text block to determine the text block with the keyword tag consistent with the target question as the relevant information.
[0214] Further, in another embodiment, in order to perform more accurate matching on the summary questions according to the labels, the summary content can be further divided into full-text summary content and single-item summary content. That is, the content label consists of full-text summary content, single-item summary content, and non-summary content.
[0215] The summary degree of the sub-text blocks of the full-text summary type is higher, usually being the summary of a relatively long piece of content. The summary degree of the sub-text of the single-item summary type is lower, usually being the summary of a relatively short piece of content.
[0216] For example, if a certain content in the domain knowledge base is the evaluation result of professional supervision, then at this content level, it may contain the evaluation results of professional supervision of multiple evaluation members. In the evaluation result of professional supervision of one evaluation member, it contains the evaluation results of this evaluation member in multiple evaluation items.
[0217] According to the above example, when the domain knowledge base is the financial risk assessment data of a certain workgroup, the domain knowledge base contains the assessment reports of the workgroup for each assessment member. In the assessment reports, there are both assessment conclusions for each assessment item and summary descriptions of the assessment situation obtained based on the assessment conclusions of each assessment item.
[0218] Then, for the text block corresponding to the assessment conclusion of a single assessment item, it can be marked as single-item summary content. For the text block corresponding to the summary description of the assessment situation, it can be marked as full-text summary content.
[0219] When the content label of the target question is full-text summary content, among the sub-text blocks with the content label of full-text summary type, determine the relevant information of the target question according to the sub-text block that is the same as the keyword label of the target question.
[0220] When the content label of the target question is single-item summary content, among the sub-text blocks with the content label of single-item summary type, determine the relevant information of the target question according to the sub-text that is the same as the keyword label of the target question.
[0221] In one or more embodiments of this specification, the target question input by the user may be relatively long, or the logical reasoning process of the target question may be relatively complex. If the target question is directly matched with the index information, it may be impossible to locate the key information in the target question, and the accuracy of the obtained relevant information is not high. Then, when the relevant information is input into the large model later, it is also impossible to provide accurate domain knowledge for the large model, resulting in the large model being unable to output accurate answers.
[0222] Therefore, in the above step S106, after the server obtains the target question, it can split the target question to obtain each sub-question included in the target question. Then, for each sub-question, match the sub-question with the index information to obtain the text block related to the sub-question as the relevant information of the sub-question.
[0223] This specification does not limit the splitting method of the target question. It can be split according to punctuation marks or by the large model.
[0224] Compared with the target question, the understanding and reasoning process of the sub-question is relatively simple, which helps the large model extract the key information of the sub-question for targeted answering.
[0225] For a comparative target question, the server needs to first identify the comparison objects in the target question and split the target question into sub-questions for the comparison objects.
[0226] For example, in a scenario, the target question is "In the evaluation results of professional supervision, which country, Country A or Country C, performs better?" Then this target question can be split into two sub-questions: sub-question 1: "The evaluation results of professional supervision in Country A" and sub-question 2: "The evaluation results of professional supervision in Country C".
[0227] For complex long questions, the server can split the target question into multiple simple questions.
[0228] Another example, in a scenario, the target question is "What types of non-profit organizations are there in Country D? What activities do these non-profit organizations mainly carry out? What is the main source of funds? Do they receive funds from other countries or regions?" Then this target question can be split into four sub-questions: sub-question 1: "What types of non-profit organizations are there in Country D", sub-question 2: "What activities do these non-profit organizations in Country D mainly carry out?", sub-question 3: "What is the main source of funds for these non-profit organizations in Country D?", and sub-question 4: "Do these non-profit organizations in Country D receive funds from other countries or regions?"
[0229] Sub-questions are used to match the target information. By splitting the target question into sub-questions, in subsequent steps, the sub-questions can be input into the large model for reasoning, which can simplify the reasoning process of the large model and obtain a more accurate target answer.
[0230] Based on the above embodiments, when splitting the target question into multiple sub-questions, in step S106 above, the server can input each sub-question and its relevant information into the large model for each sub-question, and obtain the sub-answer for that sub-question output by the large model.
[0231] Then, the server integrates the sub-answers of each sub-question to obtain the target answer. This integration operation can be sentence splicing, that is, splicing the sub-answers of each sub-question into the target answer.
[0232] Alternatively, this integration operation can also be semantic fusion, that is, the sub-answers of each sub-question can be input into the large model again, and the large model performs semantic fusion on each sub-answer and outputs the target answer. Compared with the above sentence splicing operation in this embodiment, the sentences in the obtained target answer are more naturally connected and the target answer has better coherence.
[0233] Figure 10 This is a schematic diagram of the execution process of a question-and-answer process provided in the embodiments of this specification. Figure 10 The content in the dashed box shows a way to determine relevant information, and the content in this dashed box can be replaced by any of the ways to determine relevant information in the corresponding embodiments of step S106 above.
[0234] Such as Figure 10As shown in the figure, the target question is split into three sub-questions, and for each sub-question, the relevant information of the sub-question is determined. Then, the sub-question and its relevant information are input into the large model to obtain the sub-answer of the sub-question. Finally, the sub-answers are integrated to obtain the target answer.
[0235] In one or more embodiments of the present specification, in combination with the above-mentioned multiple embodiments, the execution process of a question-answering method can be as Fig.11 shown Fig.11 This is a schematic diagram of the execution process of a question-answering process provided in the embodiments of the present specification.
[0236] As Fig.11 shown, when the target question from the user is received in step S106, the target question is first normalized and integrity-verified. After the integrity verification, the normalized and semantically complete target question is split to obtain three sub-questions.
[0237] Secondly, for each sub-question, the server executes the relevant information determination steps shown in the dashed box to respectively determine the relevant information of each sub-question. In Fig.11 the relevant information determination steps shown in the dashed box, the server first determines whether the target question is of a specified type.
[0238] If so, then in the way of vector similarity matching, the sub-question is respectively matched with three types of index information, namely each sub-text block, the predicted questions of each sub-text block, and the summary text of each parent text block, to determine the first text block, the second text block, and the third text block as the relevant text blocks. Among them, the division level of the relevant text blocks is the sub-text block. The server can use the relevant text blocks as the relevant information, or use the parent text blocks of the relevant text blocks as the relevant information.
[0239] If not, then by means of label matching, the sub-text block with the same label as the sub-question is determined, and the determined sub-text block, or the parent text block of the determined sub-text block, is used as the relevant information.
[0240] Then, the server inputs the sub-question and its relevant information into the large model to obtain the sub-answer of the sub-question. Finally, the sub-answers of each sub-question are integrated to obtain the target answer of the target question.
[0241] The above is the question-answering method based on the large model provided in the present specification. Based on the same idea, the present specification also provides a corresponding question-answering device based on the large model, as Figure 12 shown.
[0242] Figure 12 This is a schematic diagram of a question-answering device based on the large model provided in the present specification, specifically including:
[0243] A division module 400 is used to determine a domain knowledge base, divide each document contained in the domain knowledge base, and determine each text block based on the division result;
[0244] A predicted question determination module 402 is configured to predict, for each text block, a question to be asked about the text block as the predicted question corresponding to the text block;
[0245] An index information determination module 404 is configured to determine index information of each text block based on each text block and the prediction question corresponding to each text block;
[0246] The answer module 406 is used to match the target question with the index information when receiving the target question raised by the user, and obtain a text block related to the target question as relevant information; input the target question and the relevant information into the big model to obtain the target answer given by the big model.
[0247] Optionally, the answer module 406 is specifically used to determine the text block that matches the target question based on the similarity between the target question and the text blocks; determine the predicted question that matches the target question as the related question based on the similarity between the target question and the predicted questions corresponding to the text blocks, and use the text block that matches the target question and the text block corresponding to the related question as related text blocks, and determine relevant information based on the related text blocks.
[0248] Optionally, the answer module 406 is specifically used to deduplicate the relevant text blocks to obtain the deduplicated relevant text blocks, determine the correlation scores between the deduplicated relevant text blocks and the target question respectively, and determine a specified number of relevant text blocks in the deduplicated relevant text blocks as relevant information based on the correlation scores.
[0249] Optionally, the text block includes child text blocks and parent text blocks, and the division module 400 is specifically used to divide the documents contained in the domain knowledge base to obtain parent text blocks, and for each parent text block, divide the parent text block to obtain child text blocks contained in the parent text block.
[0250] Optionally, the answer module 406 is specifically used to determine the sub-text block that matches the target question based on the similarity between the target question and the sub-text blocks; determine the predicted question that matches the target question based on the similarity between the target question and the predicted questions corresponding to the sub-text blocks, as the related questions, and use the sub-text block that matches the target question and the sub-text block corresponding to the related question as each related text block, and determine relevant information based on the each related text block.
[0251] Optionally, the index information determination module 404 is specifically used to extract a summary of each parent text block, determine the summary text of the parent text block, and use the child text blocks, the prediction questions corresponding to the child text blocks, and the summary text of the parent text blocks as the index information of the text blocks.
[0252] Optionally, the answer module 406 is specifically used to determine the sub-text block that matches the target question based on the similarity between the target question and the sub-text blocks; determine the predicted question that matches the target question as a related question based on the similarity between the target question and the predicted questions corresponding to the sub-text blocks; determine the summary text that matches the target question as a related summary based on the similarity between the target question and the summary text of the parent text blocks, and use the sub-text block matching the target question, the sub-text block corresponding to the related question, and the sub-text blocks contained in the parent text block corresponding to the related summary as related text blocks, and determine relevant information based on the related text blocks.
[0253] Optionally, the answer module 406 is specifically configured to determine relevant information according to the parent text block corresponding to each relevant text block.
[0254] Optionally, the answer module 406 is specifically used to obtain the user's historical conversations, input the historical conversations and the target question into a large model, identify the omitted descriptions in the target question, and supplement the target question based on the identified omitted descriptions to obtain a first standard question, identify the professional terms contained in the first standard question according to a preset glossary, and when it is determined that the professional terms contained in the first standard question are non-standard expressions, replace the non-standard expressions with standard expressions in the glossary to obtain a second standard question, match the second standard question with the index information, and determine the text block related to the target question as relevant information based on the matching results.
[0255] Optionally, the answer module 406 is specifically used to determine whether the target question is of a specified type. If the target question is not of the specified type, the keyword tag corresponding to the target question is determined among the preset keyword tags. Based on the keyword tag corresponding to the target question, the text block related to the target question is determined among the text blocks as relevant information.
[0256] Optionally, the answer module 406 is specifically used to split the target problem to obtain sub-problems of the target problem, and for each sub-problem, match the sub-problem with the index information to obtain a text block related to the sub-problem as relevant information of the sub-problem.
[0257] Optionally, the answer module 406 is specifically used to input the sub-problem and related information of each sub-problem into the big model, obtain the sub-answer of the sub-problem given by the big model, and integrate the sub-answers of each sub-problem to obtain the target answer.
[0258] This specification also provides a computer-readable storage medium, which stores a computer program that can be used to execute the above Figure 1 The provided question answering method based on large models.
[0259] This manual also provides Fig.13 The schematic structure diagram of the electronic device shown in FIG. Fig.13 As mentioned above, at the hardware level, the electronic device includes a processor, an internal bus, a network interface, a memory and a non-volatile memory, and may also include other hardware required for the business. The processor reads the corresponding computer program from the non-volatile memory into the memory and then runs it to achieve the above Figure 1 The aforementioned large model-based question-answering method. Of course, in addition to software implementation, this specification does not exclude other implementation methods, such as logic devices or a combination of software and hardware, etc., that is, the execution subject of the following processing flow is not limited to each logic unit, but can also be hardware or logic devices.
[0260] An improvement to a technology can be clearly distinguished as either a hardware improvement (e.g., improvement to circuit structures such as diodes, transistors, switches, etc.) or a software improvement (improvement to method flows). However, with the development of technology, many improvements to method flows today can be regarded as direct improvements to hardware circuit structures. Almost all designers obtain the corresponding hardware circuit structure by programming the improved method flow into the hardware circuit. Therefore, it cannot be said that an improvement to a method flow cannot be implemented with a hardware entity module. For example, a programmable logic device (PLD) (such as a field programmable gate array (FPGA)) is such an integrated circuit whose logic function is determined by a user's programming of the device. Designers can program by themselves to "integrate" a digital system onto a single PLD, without having to ask a chip manufacturer to design and fabricate a dedicated integrated circuit chip. Moreover, nowadays, instead of manually fabricating integrated circuit chips, this programming is mostly implemented using "logic compiler" software, which is similar to the software compiler used in program development and writing. The original code before compilation also has to be written in a specific programming language, which is called a hardware description language (HDL), and there is not only one type of HDL, but many types, such as ABEL (Advanced Boolean Expression Language), AHDL (Altera Hardware Description Language), Confluence, CUPL (Cornell University Programming Language), HDCal, JHDL (Java Hardware Description Language), Lava, Lola, MyHDL, PALASM, RHDL (Ruby Hardware Description Language), etc. The most commonly used ones currently are VHDL (Very-High-Speed Integrated Circuit Hardware Description Language) and Verilog. Those skilled in the art should also be aware that by simply performing a little logical programming on the method flow using the above-mentioned several hardware description languages and programming it into an integrated circuit, it is easy to obtain the hardware circuit that implements the logical method flow.
[0261] The controller can be implemented in any suitable manner. For example, the controller can take the form of a microprocessor or processor and a computer-readable medium storing computer-readable program code (e.g., software or firmware) executable by the (micro)processor, logic gates, switches, an application-specific integrated circuit (ASIC), a programmable logic controller, and an embedded microcontroller. Examples of controllers include, but are not limited to, the following microcontrollers: ARC 625D, Atmel AT91SAM, Microchip PIC18F26K20, and Silicone Labs C8051F320. The memory controller can also be implemented as part of the memory control logic. Those skilled in the art will also appreciate that, in addition to implementing the controller purely in computer-readable program code, the controller can also be implemented in the form of logic gates, switches, an application-specific integrated circuit, a programmable logic controller, an embedded microcontroller, etc. by logically programming the method steps. Therefore, such a controller can be considered a hardware component, and the means for implementing the various functions included therein can also be considered as structures within the hardware component. Alternatively, the means for implementing the various functions can be considered both a software module implementing the method and a structure within the hardware component.
[0262] The systems, devices, modules, or units described in the above embodiments may be implemented by computer chips or entities, or by products having certain functions. A typical implementation device is a computer. Specifically, the computer may be, for example, a personal computer, a laptop computer, a cellular phone, a camera phone, a smartphone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
[0263] For the convenience of description, the above devices are described as being divided into various units according to their functions. Of course, when implementing this specification, the functions of each unit can be implemented in the same or multiple software and / or hardware.
[0264] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware. Furthermore, the present application may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0265] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 a process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0266] These computer program instructions may also be stored in a computer readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 a process or multiple processes and / or boxes Figure 1 The function specified in one or more boxes.
[0267] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing the instructions executed on the computer or other programmable device for implementing the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0268] In a typical configuration, a computing device includes one or more processors (CPUs), input / output interfaces, network interfaces, and memory.
[0269] Memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. Memory is an example of a computer-readable medium.
[0270] Computer-readable media includes permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. The information can be computer-readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer-readable media does not include transitory computer-readable media (transitory media), such as modulated data signals and carrier waves.
[0271] It should also be noted that the terms "comprises," "includes," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, commodity, or apparatus that includes a series of elements includes not only those elements but also other elements not explicitly listed, or includes elements inherent to such process, method, commodity, or apparatus. In the absence of further limitations, an element defined by the phrase "comprises a ..." does not exclude the presence of other identical elements in the process, method, commodity, or apparatus that includes the element.
[0272] Those skilled in the art will appreciate that the embodiments of this specification may be provided as methods, systems, or computer program products. Therefore, this specification may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware. Furthermore, this specification may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0273] This specification may be described in the general context of computer-executable instructions, such as program modules, executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, and the like that perform specific tasks or implement specific abstract data types. This specification may also be practiced in distributed computing environments where tasks are performed by remote processing devices connected through a communications network. In a distributed computing environment, program modules may be located in both local and remote computer storage media, including storage devices.
[0274] The various embodiments in this specification are described in a progressive manner. For the same or similar parts among the various embodiments, reference can be made to each other, and the key points of each embodiment are the differences from other embodiments. In particular, for the system embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and for the relevant parts, reference can be made to the partial description of the method embodiments.
[0275] The above is only the embodiments of this specification and is not intended to limit this specification. For those skilled in the art, various modifications and changes can be made to this specification. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of this specification shall be included within the scope of the claims of this application.
Claims
1. A question-answering method based on a large model, characterized in that including: Determine a domain knowledge base, divide each document contained in the domain knowledge base, and determine each text block according to the division result; The text block includes a sub-text block and a parent text block; the parent text block is divided into multiple sub-text blocks; For each text block, predict the question that the text block will be asked as the predicted question corresponding to the text block; According to each text block and the predicted question corresponding to each text block, determine the index information of each text block; the index information includes each sub-text block, the predicted question corresponding to each sub-text block, and the summary text of each parent text block; When receiving the target question proposed by the user, match the target question with the index information to obtain the text block related to the target question as the relevant information; Input the target question and the relevant information into a large model to obtain the target answer given by the large model; Among them, the text blocks related to the target question include: the sub-text blocks matching the target question, the sub-text blocks corresponding to the predicted questions matching the target question, and each sub-text block included in the parent text block corresponding to the summary text matching the target question.
2. The method according to claim 1, wherein Matching the target question with the index information to obtain the text block related to the target question as the relevant information specifically includes: Determine the text block that matches the target question according to the similarity between the target question and each text block; determine the predicted question that matches the target question according to the similarity between the target question and the predicted questions corresponding to each text block as the relevant question; Use the text block that matches the target question and the text block corresponding to the relevant question as each relevant text block; Determine the relevant information according to each relevant text block.
3. The method according to claim 2, wherein Determining the relevant information according to each relevant text block specifically includes: Deduplicate each relevant text block to obtain each deduplicated relevant text block; Determine the correlation score between each deduplicated relevant text block and the target question respectively; According to each correlation score, determine a specified number of relevant text blocks among each deduplicated relevant text block as the relevant information.
4. The method according to claim 1, wherein Dividing each document contained in the domain knowledge base and determining each text block according to the division result specifically includes: Divide each document contained in the domain knowledge base to obtain each parent text block; For each parent text block, divide the parent text block to obtain each sub-text block included in the parent text block.
5. The method according to claim 4, wherein Matching the target question with the index information to obtain the text block related to the target question as the relevant information specifically includes: Determine the sub-text block that matches the target question according to the similarity between the target question and each sub-text block; determine the predicted question that matches the target question according to the similarity between the target question and the predicted questions corresponding to each sub-text block as the relevant question; Use the sub-text block that matches the target question and the sub-text block corresponding to the relevant question as each relevant text block; Determine the relevant information according to each relevant text block.
6. The method according to claim 4, wherein Determine the index information of each text block according to each text block and the predicted question corresponding to each text block, specifically including: For each parent text block, extract the summary of the parent text block to determine the summary text of the parent text block; Use the sub-text blocks, the predicted questions corresponding to the sub-text blocks, and the summary texts of the parent text blocks as the index information of the text blocks.
7. The method according to claim 6, wherein Match the target question with the index information to obtain the text blocks related to the target question as relevant information, specifically including: Determine the sub-text blocks that match the target question according to the similarity between the target question and the sub-text blocks; determine the predicted questions that match the target question according to the similarity between the target question and the predicted questions corresponding to the sub-text blocks as relevant questions; determine the summary text that matches the target question according to the similarity between the target question and the summary texts of the parent text blocks as relevant summaries; Use the sub-text blocks that match the target question, the sub-text blocks corresponding to the relevant questions, and the sub-text blocks included in the parent text blocks corresponding to the relevant summaries as the relevant text blocks; Determine relevant information according to the relevant text blocks.
8. The method according to claim 5 or 7, characterized in that Determine relevant information according to the relevant text blocks, specifically including: Determine relevant information according to the parent text blocks corresponding to the relevant text blocks.
9. The method according to claim 1, where matching the target question with the index information to obtain the text blocks related to the target question as relevant information specifically includes: Obtain the user's historical conversation; Input the historical conversation and the target question into a large model to identify the ellipsis description in the target question, and supplement the target question according to the identified ellipsis description to obtain a first canonical question; Identify the professional terms included in the first canonical question according to a preset glossary; When it is determined that the professional terms included in the first canonical question are non-standard expressions, replace the non-standard expressions with the standard expressions in the glossary to obtain a second canonical question; Match the second canonical question with the index information, and determine the text blocks related to the target question as relevant information according to the matching result.
10. The method according to claim 1, wherein Before matching the target question with the index information to obtain the text blocks related to the target question as relevant information, the method further includes: Determine that the target question is of a specified type; If the target question is not of the specified type, determine the keyword label corresponding to the target question among the preset keyword labels, and determine the text blocks related to the target question in the text blocks as relevant information according to the keyword label corresponding to the target question.
11. The method according to claim 1, wherein Match the target question with the index information to obtain the text blocks related to the target question as relevant information, specifically including: Split the target question to obtain the sub-questions of the target question; For each sub-question, match the sub-question with the index information to obtain a text block related to the sub-question as the relevant information for the sub-question.
12. The method according to claim 11, wherein Input the target question and the relevant information into the large model to obtain the target answer given by the large model, specifically including: For each sub-question, input the sub-question and its relevant information into the large model to obtain the sub-answer of the sub-question given by the large model; Integrate the sub-answers of each sub-question to obtain the target answer.
13. A question-answering device based on a large model, characterized in that, Including: A division module determines the domain knowledge base, divides each document included in the domain knowledge base, and determines each text block according to the division result; The text block includes a sub-text block and a parent text block; the parent text block is divided into multiple sub-text blocks; A predicted question determination module predicts the question that each text block will be asked as the predicted question corresponding to the text block; An index information determination module determines the index information of each text block according to each text block and the predicted question corresponding to each text block; the index information includes each sub-text block, the predicted question corresponding to each sub-text block, and the summary text of each parent text block; An answering module, when receiving the target question proposed by the user, matches the target question with the index information to obtain a text block related to the target question as the relevant information; Input the target question and the relevant information into the large model to obtain the target answer given by the large model; Among them, the text blocks related to the target question include: the sub-text block matching the target question, the sub-text block corresponding to the predicted question matching the target question, and each sub-text block included in the parent text block corresponding to the summary text matching the target question.
14. A computer-readable storage medium, characterized in that, The storage medium stores a computer program, and when the computer program is executed by a processor, the method described in any one of the above claims 1 to 12 is implemented.
15. An electronic device, characterized in that, Including a memory, a processor, and a computer program stored on the memory and executable on the processor, and when the processor executes the program, the method described in any one of the above claims 1 to 12 is implemented.
Citation Information
Patent Citations
Insurance knowledge question-answer pair acquisition method and device, equipment and storage medium
CN117709359A
Question and answer method and device based on large model
CN118885579A
Question answering method and device and computer readable storage medium
CN119166792A