A large model knowledge base construction method and device, medium and equipment
By dividing and parsing the knowledge base, identifying knowledge points, and constructing a question-answer pair retrieval knowledge base, the problem of large language models generating incorrect answers in low-relevance knowledge bases is solved, thus improving retrieval accuracy and output accuracy.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- ZHEJIANG ANT SECRET TECH CO LTD
- Filing Date
- 2026-05-08
- Publication Date
- 2026-06-05
AI Technical Summary
Large Language Models (LLMs) may suffer from knowledge gaps, errors, or outdated knowledge due to limitations in training data, leading to illusions when performing tasks. Furthermore, Retrieval Augmentation (RAG) techniques are prone to generating incorrect answers when retrieving from low-relevance knowledge bases.
The target knowledge base for retrieval enhancement is divided into data segments, and knowledge points are identified through a pre-trained parsing big model to generate question-answer pairs, thereby constructing a retrieval knowledge base to support the reasoning of the business big model.
It improves the matching accuracy between search results and user queries, reduces the probability of model illusion, and enhances the accuracy and reliability of output results.
Smart Images

Figure CN122153014A_ABST
Abstract
Description
Technical Field
[0001] This specification relates to the field of computer technology, and in particular to a method, apparatus, storage medium and device for constructing a large model knowledge base. Background Technology
[0002] With the development of artificial intelligence (AI) technology, large language models (LLM) have been widely applied in various fields.
[0003] However, LLM may suffer from problems such as lack of knowledge, knowledge errors, or outdated knowledge due to limitations in training data. These problems may cause LLM to experience "illusions" when performing tasks, thereby reducing the accuracy and reliability of LLM in performing tasks.
[0004] While existing technologies can mitigate these issues through Retrieval-augmented Generation (RAG), LLM (Local Level Management) is prone to inferring incorrect answers based on irrelevant information when the knowledge base content has low relevance to the problem being solved. For example, based on multiple low-relevance search results, it may infer an answer that seems logically reasonable but is actually not factual.
[0005] Therefore, how to avoid incorrect LLM outputs due to the introduction of RAG has become an urgent problem to be solved. Thus, this specification provides a method for constructing a large model knowledge base. Summary of the Invention
[0006] This specification provides a method, apparatus, storage medium, and electronic device for constructing a large model knowledge base, in order to partially solve the problems existing in the prior art.
[0007] The embodiments in this specification adopt the following technical solutions: This specification provides a method for constructing a large model knowledge base, the method comprising: Obtain the target knowledge base for enhanced retrieval, and divide the target knowledge base to obtain several data fragments; For each data segment, the data segment is input into a pre-trained analytical large model to obtain the knowledge points contained in the data segment. The knowledge points are composed of the input question generated by the analytical large model and the output content contained in the sub-data. According to the data format of the target knowledge base, the knowledge points are used as database content to construct a retrieval knowledge base; the retrieval knowledge base is used to support the business model in performing business operations, obtaining knowledge points through retrieval enhancement, performing reasoning, and outputting results.
[0008] This specification provides a large model knowledge base construction device, the device comprising: The acquisition module is used to acquire the target knowledge base for retrieval enhancement, and to divide the target knowledge base into several data fragments; The knowledge point identification module is used to input each data segment into a pre-trained parsing large model to obtain the knowledge points contained in the data segment. The knowledge points are composed of the input question generated by the parsing large model and the output content contained in the sub-data. The knowledge base construction module is used to construct a retrieval knowledge base by using the knowledge points as database content according to the data format of the target knowledge base. The retrieval knowledge base is used to support the business model in performing business operations by obtaining knowledge points through retrieval enhancement, conducting reasoning, and outputting results.
[0009] This specification provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the above-described method for constructing a large model knowledge base.
[0010] This specification provides an electronic device including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, it implements the above-described method for constructing a large model knowledge base.
[0011] The above-described at least one technical solution adopted in the embodiments of this specification can achieve the following beneficial effects: This specification discloses a method for constructing a large-scale model knowledge base. The method divides the target knowledge base for retrieval enhancement into several data segments. Each data segment is parsed to determine its knowledge points, i.e., question-answer pairs. Finally, the obtained knowledge points are formatted according to the original target knowledge base format to support retrieval enhancement during large-scale business model reasoning. By parsing the knowledge base into knowledge points, the retrieval unit is refined from traditional text fragments or directory indexes to semantically complete question-answer pairs. The retrieval granularity is reduced from paragraphs to question-answer pairs, significantly improving the matching accuracy between the retrieved content and the user's question, reducing the probability of forced interpretation due to irrelevant paragraphs, thereby reducing model illusion. Attached Figure Description
[0012] The accompanying drawings, which are included to provide a further understanding of this specification and form part of this specification, illustrate exemplary embodiments and are used to explain this specification, but do not constitute an undue limitation thereof. In the drawings: Figure 1 A flowchart illustrating the construction of a large model knowledge base is provided for an embodiment of this specification. Figure 2This is a schematic diagram of the analytical large model training provided in the embodiments of this specification; Figure 3 A schematic diagram of a large model knowledge base construction device provided in the embodiments of this specification; Figure 4 This is a schematic diagram of the structure of the electronic device provided in the embodiments of this specification. Detailed Implementation
[0013] 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 and corresponding drawings. Obviously, the described embodiments are only a part of the embodiments of this specification, and not all of them. Based on the embodiments in this specification, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this specification.
[0014] Large Language Model (LLM), also known simply as a large model, is a model that performs logical reasoning on input natural language text and outputs a natural language description that users can understand. Although LLM can generate fluent and logically sound content, its output is not always based on facts, which is known as model "hallucination".
[0015] Retrieval-Augmented Generation (RAG) is a common technique for addressing the knowledge illusion problem in large models. Its basic idea is to segment an external knowledge base, construct a set of searchable text fragments, and retrieve relevant fragments during model inference as contextual input to assist the model in generating answers. However, in practical applications, when the retrieved knowledge base content has low relevance to the user's question, large models often force answers based on instruction following.
[0016] The shortcomings of RAG include its inflexible document segmentation method, which may result in complete knowledge points being split into multiple fragments, making individual search units incomplete and unable to support accurate answers. User input consists of complete semantic content, while RAG's search units are physical text fragments, which may contain redundant information, with only a limited proportion of content usable for answering questions. While searches may find fragments with similar themes, excessive noise makes it difficult to accurately extract answers from them.
[0017] Furthermore, there are discrepancies between the retrieval and LLM generation processes. Retrieval is based on semantic similarity, searching for text similar to the question, while the generation task requires generating content containing the answer. This results in retrieval results that, while relevant, may not be usable for generating output.
[0018] It is evident that RAG still has limitations in addressing model illusion, which stems from its inherent design. This specification provides a novel knowledge base construction method to resolve some of the problems inherent in RAG.
[0019] The technical solutions provided in the various embodiments of this specification are described in detail below with reference to the accompanying drawings.
[0020] Figure 1 A flowchart for constructing a large model knowledge base, provided for embodiments of this specification, specifically includes the following steps: S100: Obtain the target knowledge base for enhanced retrieval, divide the target knowledge base, and obtain several data fragments.
[0021] In the embodiments described in this specification, the following are employed: Figure 1 The device used to construct the large model knowledge base using the method shown can be any electronic device, such as a computer, server, or server cluster consisting of multiple servers. For ease of description, the following explanation uses a server as an example.
[0022] To address the issue of knowledge base existence in RAG technology, the server can first retrieve the target knowledge base originally used for RAG support and then repartition it so that subsequent steps can construct a non-physically partitioned knowledge base.
[0023] Since part of the problems with RAG stem from the construction of the knowledge base, which typically involves directly physically splitting the original documents and using fragmented data segments as retrieval units, it is necessary to rationally divide the target knowledge base.
[0024] Specifically, the server first retrieves the target knowledge base for retrieval enhancement to be processed. This target knowledge base can be a collection of various documents pre-stored in a database, such as product manuals, technical specifications, or business guidelines.
[0025] Subsequently, the server determines the length of the basic unit for segmentation based on the size of the context fragments supported by the business big model. The size of this context fragment refers to the text length that the business big model can effectively utilize when processing retrieval enhancements; this parameter is typically determined by the token constraints of the business big model. Based on the determined basic unit length, the server performs a sliding window segmentation of the target knowledge base, resulting in several data fragments.
[0026] In one or more embodiments of this specification, the server can be configured to have overlapping regions between adjacent data segments during the segmentation process. The proportion of this overlapping region to the length of the basic unit can be from 10% to 50%, and the specific value can be set as needed. By setting the overlap ratio, the probability of the same knowledge point being segmented into two data segments decreases, while the probability of the knowledge point appearing completely in two or more adjacent data segments increases. Although this may increase data duplication, deduplication is simpler and more efficient than splitting the knowledge point into two data segments.
[0027] For example, in a product manual's description of installation height, suppose this description happens to be at the end of the first segment and the beginning of the second segment. Without overlapping segmentation, the first segment only contains the first half of the installation height description, and the second segment only contains the second half of the parameters; neither is complete. However, by setting an overlap area of 10% to 50% in this step, the end of the first segment is more likely to contain the beginning of the second segment, ensuring that the complete description of the installation height is preserved in at least one segment. This allows the subsequent analysis of the larger model to extract knowledge points based on the complete context.
[0028] Additionally, it's important to note that when determining the slice size based on the context window of the large business model, the server doesn't directly adopt the large model's specifications. Instead, it considers the depth of effective token utilization by the large business model. This is because large models can become lost in the middle when processing long contexts—that is, their attention and utilization of information located in the middle of long texts decreases significantly. Therefore, there may be a difference between the theoretical maximum window and the actual effective utilization length. When determining the slice size, the server can place knowledge fragments in the foreground or background areas where the model performs better.
[0029] Furthermore, the context window of the large model input also needs to include fixed instructions to guide model behavior, possible dialogue history, and the space required to generate answers. Therefore, the actual available length allocated to the retrieved knowledge fragment needs to take into account these other parts. In other words, the server can determine the space required for other parts based on the content of classic inputs in the business application scenario of the large business model. Then, based on the theoretical maximum context window, this required space is subtracted to determine the size of the retrieved data fragment.
[0030] S102: For each data segment, input the data segment into a pre-trained analytical large model to obtain the knowledge points contained in the data segment. The knowledge points are composed of the input question generated by the analytical large model and the output content contained in the sub-data.
[0031] Since general models struggle to identify which content in a knowledge base constitutes a knowledge point, and cannot naturally organize knowledge points into question-answer pairs, it is necessary to pre-train a large parsing model to learn how to identify knowledge points from data fragments and how to generate corresponding input questions in order to learn the ability to identify knowledge points from data fragments.
[0032] Specifically, when training a large parsing model, the server can first obtain the business knowledge base used for training and the historical business data supported by that knowledge base. The business knowledge base can be a collection of various documents from the business scenario, such as product manuals, technical manuals, or FAQ libraries. Historical business data consists of user interaction records accumulated during the actual operation of the business system, including user-input questions and the output provided by the large business model or human customer service for those questions.
[0033] Next, the server locates data content related to the output result from the business knowledge base based on user input in historical business data. For example, in a customer service Q&A scenario, suppose the historical business data records a user inputting "How to reset the device password," and the corresponding output result is "Please press and hold the reset button on the back of the device for five seconds." The server can then use this output result to search for document paragraphs in the business knowledge base containing key information such as "reset button" and "press and hold for five seconds," and identify these paragraphs as data content related to the output result.
[0034] Then, the server can construct the knowledge points corresponding to the business knowledge base based on the user's input and the determined data content. Each constructed knowledge point consists of a question portion (user input) and an answer portion (text from the data content corresponding to the output result). Continuing with the previous example, the user input "How to reset the device password" is the question for the knowledge point, and the description in the data content about "pressing and holding the reset button for five seconds" is the answer.
[0035] The server can perform the above operations on each record in the historical business data to generate a set of knowledge points consisting of a large number of question-answer pairs.
[0036] Finally, the server uses this business knowledge base as training samples and the generated set of knowledge points as labeled data to perform supervised fine-tuning on the large parsing model. The goal of supervised fine-tuning is to enable the large parsing model to learn how to identify which text fragments might constitute the data needed for the output based on the input database content, and how to generate corresponding input questions based on the identified content.
[0037] During training, the server inputs document fragments from the business knowledge base into the parsing model to be trained, and compares the prediction results output by the parsing model to be trained with the labeled knowledge points, continuously optimizing the model parameters through the backpropagation algorithm.
[0038] Therefore, in step S102, the server can input each data segment into the parsing model to obtain the knowledge points contained in the data segment output by the parsing model.
[0039] Furthermore, in the embodiments of this specification, since there may be overlap between data segments in step S101, and adjacent data segments may share 10% to 50% common content, the parsing large model may identify the same knowledge points in different segments, resulting in knowledge point redundancy. If redundant knowledge points are not processed, the subsequently constructed retrieval knowledge base will contain duplicate content, which not only occupies storage resources but also causes the business large model to recall multiple identical answers during retrieval, resulting in information redundancy and decreased reasoning efficiency. Therefore, after obtaining the knowledge points of each data segment, the server can also perform consistency checks and deduplication on the knowledge points.
[0040] Specifically, the server can first extract the output content of each knowledge point as a comparison benchmark, because the output content is usually a factual description and has high stability. Using a text similarity algorithm, the output content of any two knowledge points is calculated. When the similarity exceeds a preset fourth threshold, these two knowledge points are identified as duplicate knowledge points. Of course, since duplicate knowledge points generally only exist between adjacent segments, the server can also perform deduplication on the knowledge points identified between any two pairs of adjacent segments during deduplication, improving processing efficiency.
[0041] For duplicate knowledge points, the server can retain one and delete the rest. Furthermore, the server can retain knowledge points that are more complete in the input question, more relevant to the business scenario, or the first knowledge point identified. This manual does not restrict the specific strategy used; it can be configured as needed.
[0042] S104: According to the data format of the target knowledge base, the knowledge points are used as database content to construct a retrieval knowledge base; the retrieval knowledge base is used to support the business model to obtain knowledge points through retrieval enhancement for reasoning when performing business, and output the results.
[0043] After obtaining the set of knowledge points consisting of input questions and output content, these knowledge points remain scattered and have not yet formed a structured data source for retrieval by the large business model. If these fragmented knowledge points are directly used for retrieval enhancement, the server must traverse all knowledge points for matching when receiving user queries, resulting in low retrieval efficiency and failing to leverage the original data organization advantages of the target knowledge base. Therefore, the server can also repackage the knowledge points according to the original data format of the target knowledge base and construct a unified retrieval knowledge base, enabling the large business model to perform retrieval enhancement based on this knowledge base during reasoning.
[0044] Specifically, the server retrieves all the knowledge points generated in step S102 and simultaneously calls up the original data format definition of the target knowledge base. The data format definition describes how the content in the target knowledge base is organized. For example, for a product knowledge base stored in JSON format, each record contains a question field, an answer field, a product model field, and an update date field. For an FAQ knowledge base stored in tabular form, each row corresponds to a question-answer pair, containing a question column and an answer column.
[0045] The server can map each knowledge point to the corresponding field or column based on this data format.
[0046] For example, taking an after-sales knowledge base in JSON format as an example, the original data format of this knowledge base specifies that each record contains four fields: question, answer, product_model, and last_updated. The server creates a new JSON record for each knowledge point, filling the question field with the input question generated by parsing the large model, and filling the answer field with the corresponding output content of the knowledge point.
[0047] For the `product_model` and `last_updated` fields, the server retrieves the relevant information from the metadata accompanying the data fragment from which the knowledge point originates and populates it accordingly. For example, if a knowledge point originates from the repair manual of a certain printer model, the server fills the model identifier into the `product_model` field and the current system timestamp into the `last_updated` field.
[0048] Finally, the server aggregates all the transformed records to construct a complete retrieval knowledge base. This retrieval knowledge base maintains the same data structure as the target knowledge base, but its content has been upgraded from raw document fragments to semantically complete knowledge point units. The retrieval knowledge base is stored in a server-accessible database system or vector database, and indexes are created for the input question fields of the knowledge points to support fast retrieval based on semantic vectors.
[0049] When the business model is performing business reasoning, the server can receive the query statement input by the user and perform retrieval enhancement in the retrieval knowledge base based on the query statement.
[0050] Specifically, the server converts the query statement into a semantic vector, searches the knowledge base for knowledge points that are semantically similar to the input question field according to their similarity, and retrieves one or more knowledge points.
[0051] Then, the server uses the retrieved knowledge points as context, along with the user's query, and inputs them into the business big model. The business big model then generates the final answer based on the output content of the knowledge points. Because each knowledge point in the retrieved knowledge base has a clear question-answer boundary, and the input question fields are more closely matched to the user's questioning habits, the retrieval accuracy is improved. The business big model no longer needs to forcibly interpret irrelevant and redundant information, thus effectively reducing the risk of illusion and improving the accuracy and reliability of the output results. based on Figure 1 The method for constructing a large-scale model knowledge base, as shown, divides the target knowledge base for retrieval enhancement into several data segments. Each data segment is parsed to identify its knowledge points, i.e., question-answer pairs. Finally, the obtained knowledge points are formatted according to the original target knowledge base format to support retrieval enhancement during large-scale business model reasoning. By parsing the knowledge base into knowledge points, the retrieval unit is refined from traditional text fragments or directory indexes to semantically complete question-answer pairs. The retrieval granularity is reduced from paragraphs to question-answer pairs, significantly improving the matching accuracy between search content and user questions, reducing the probability of forced interpretation due to irrelevant paragraphs, and thus reducing model illusion.
[0052] Furthermore, in the embodiments of this specification, when determining the overlap ratio of the segmented data fragments in step S100, using a fixed single ratio often fails to adapt to diverse business scenarios and knowledge base characteristics. If the overlap ratio is set too low, in scenarios with complex logic and high requirements for semantic coherence, key knowledge points may be fragmented by the segmentation boundaries, resulting in incomplete retrieval information. If the overlap ratio is set too high, in scenarios with simple structure and low information redundancy, a large number of duplicate fragments will be generated, increasing retrieval noise and reducing system efficiency. Therefore, the server needs to dynamically adjust the overlap ratio according to the complexity of the actual business scenario and the data type of the knowledge base.
[0053] Specifically, when determining the overlap ratio between adjacent data segments, the server can determine the ratio based on the application business scenario served by the large business model and the data type of the target knowledge base. The complexity of the business scenario is positively correlated with the overlap ratio; that is, the higher the complexity, the greater the overlap ratio. The overlap ratio for unstructured data types is higher than that for structured data types to address the stronger semantic coherence requirements in unstructured text.
[0054] The server can calculate the overlap ratio in several specific ways. For example, it can determine the complexity of a business scenario by analyzing user queries. The server obtains the user's query input and parses it to obtain the query length and the number of query intents. The query length can be measured in characters or tokens, while the number of query intents reflects the number of different requests or topics involved in the user's question. The server compares the query length with a first preset threshold and the number of query intents with a second preset threshold. When both the query length and the number of query intents exceed these thresholds, it is identified as a high-complexity query, and a first ratio is determined, for example, 30% to 50%. If neither exceeds these thresholds, it is identified as a low-complexity query, and a second ratio is determined, for example, 10% to 20%.
[0055] In the embodiments of this specification, the server can also calculate the overlap ratio based on the structure of the knowledge base document to be processed. For example, the server obtains the document corresponding to the target knowledge base and determines the average paragraph length and keyword density of the document. The average paragraph length can be obtained by counting the number of characters or lexical units in each paragraph of the document and calculating the average value, while the keyword density reflects the frequency of occurrence of core terms in the document.
[0056] The server then calculates the step size of the sliding window based on the average paragraph length and keyword density, and determines the overlap rate of adjacent text segments. The longer the average paragraph length, the smaller the overlap rate, because long paragraphs already contain rich context and do not require excessive overlap to maintain coherence. Conversely, the higher the keyword density, the larger the overlap rate, because high-density keyword regions often contain key knowledge points, requiring greater overlap to ensure the integrity of information across segments.
[0057] In the embodiments of this specification, the server can also calculate the complexity score of the business scenario through preset rules. For example, the server obtains the text length L, the number of entities E, and the number of logical relationship levels R of the business data, and substitutes these parameters into the preset formula C = a × L + b × E + c × R, where a, b, and c are preset weight coefficients. The text length L can be determined based on the total number of characters or total number of tokens in the business data, the number of entities E reflects the number of key objects or concepts involved in the data, and the number of logical relationship levels R reflects the nesting depth of causal, conditional, and other relationships within the data. The server compares the calculated complexity score C with a third preset threshold. When the complexity score is greater than the third preset threshold, the overlap rate of adjacent text segments is set to a first proportion, for example, 30% to 50%; when the complexity score is not greater than the third preset threshold, the overlap rate is set to a second proportion, for example, 10% to 20%.
[0058] In one or more embodiments of this specification, in addition to deduplicating the knowledge points in step S102, the server may further perform consistency verification and supplementary optimization on the knowledge points.
[0059] In terms of consistency verification, the server can check the semantic matching degree between the output content and the input question in each knowledge point. For the input question generated by the parsing large model and the corresponding output content, the server uses a lightweight semantic model to calculate the relevance score between the two. When the score is lower than the preset fifth threshold, it indicates that the knowledge point may have a generation error, and the server can mark the knowledge point as needing manual review or directly remove it.
[0060] In terms of supplementary optimization, the server can add contextual metadata to knowledge points. For example, the data fragment identifier from which the knowledge point originates, the name of the document to which it belongs, and the path of the chapter it belongs to. This metadata can serve as a source tracing basis during subsequent large-scale business model reasoning. When the model generates an answer based on a certain knowledge point, it can simultaneously output the source information of the knowledge point, enhancing the interpretability and credibility of the answer.
[0061] Furthermore, in the examples presented in this manual, user input from historical business data is a crucial source for constructing knowledge points when training large parsing models. However, in real-world business scenarios, users often ask the same question in multiple different ways, such as "How to reset my password?", "What should I do if I forget my password?", and "Steps to reset my password," all of which point to the same answer.
[0062] Therefore, if only one user input from the original record is used as the question portion of the knowledge point, the subsequent retrieval of the knowledge base will struggle to cover diverse user queries, leading to matching failures. Thus, the server can perform data augmentation on the original user input, generating multiple semantically consistent input questions to broaden the knowledge point entry points and improve the hit rate during the retrieval phase.
[0063] Specifically, when determining the knowledge points of the business knowledge base based on user input and data content, the server can first perform data augmentation operations on the acquired user input. The goal of data augmentation is to generate as many diverse synonymous question statements as possible while maintaining the core semantics. The server can employ various augmentation strategies, which can be configured as needed; this specification does not impose any restrictions.
[0064] In one or more examples in this specification, data augmentation may include lexical-level substitution. The server can use a thesaurus or word vector model to replace keywords in the user input with their synonyms, generating new questions. For example, if a user inputs "how to reset password," the server might replace "reset" with synonyms such as "modify" or "retrieve," generating synonymous questions like "how to change password" and "how to retrieve password." This method is low-cost but prone to semantic shifts due to polysemous word substitution. For instance, replacing "reset" with "reset" maintains semantic consistency, while replacing it with "reinstall" might deviate from the original meaning. Therefore, a semantic detection process can be added at the end to determine whether semantic consistency is maintained by performing semantic similarity detection on the original user input and the replaced user data.
[0065] For data augmentation methods involving sentence structure perturbations, the server can adjust word order or insert / delete redundant components while maintaining the core of the sentence, generating synonymous questions with different structures. For example, when a user inputs "What should I do if I forget my password?", the server can adjust it to "What should I do if I forget my password?" or change the declarative sentence to the interrogative sentence "What should I do if I forget my password?". Of course, sentence structure perturbations must be limited to a local window to prevent semantic reversal caused by significant word order adjustments. The size of this local window can be set as needed, for example, based on the average text length, language characteristics, and business risks. Business risk is negatively correlated with the local window size. Using grammatical units such as noun phrases and verb phrases as window boundaries ensures that perturbations do not cross core semantic units; the local window size is positively correlated with the number of phrases it contains. The window is dynamically determined based on the shortest path length between words in the syntactic dependency tree; the local window size is positively correlated with the allowed dependency path length—the longer the path, the farther the adjustable word distances.
[0066] Furthermore, for data augmentation methods involving cross-sentence combinations, the server can concatenate multiple short sentences on the same topic into a coherent long sentence, or conversely, split a long sentence into several short sentences to increase sample diversity.
[0067] For generative model enhancement, the server can employ back-translation technology, translating user input into an intermediate language and then back into the source language, utilizing the differences in expression during the translation process to generate synonymous questions. Taking Chinese user input as an example, the server first translates it into English, then translates the English back into Chinese, resulting in different expressions such as "How to reset password".
[0068] In addition, the server can also directly utilize the large language model, using prompt words to request the model to generate several questions that have the same meaning as the original input but express different ideas.
[0069] In the examples of this specification, for noise injection, the server can simulate spelling mistakes or format chaos that may occur in real scenarios, impose slight perturbations on the user input, so as to enhance the robustness of the model to imperfect inputs. For example, miswrite "置" as "制" in "如何重置密码" to generate "如何重制密码", or insert extra spaces, punctuation, etc. The input problems generated by such enhancements can be used to train the model to handle scenarios where there is noise in the user input.
[0070] Finally, after the server completes data enhancement, it obtains several input problems that are semantically consistent with the original user input. Based on the original data content, it combines with each enhanced generated input problem respectively to construct multiple knowledge points. Each knowledge point consists of an input problem as the question part and the text corresponding to the output result in the data content as the answer part. Through the above processing, the originally single user input is expanded into knowledge points corresponding to multiple synonymous questions, enriching the entry coverage of the retrieval knowledge base.
[0071] When the subsequent business large model conducts retrieval, no matter how the user formulates the question, it can recall the corresponding answer content by matching the enhanced question fields, thereby improving the recall rate and accuracy of the retrieval enhancement.
[0072] Figure 2 For the schematic diagram of parsing large model training provided by this specification embodiment, obtain the business knowledge base for training, determine the data content related to the output result from the business knowledge base according to the user input in the historical business data, construct and improve knowledge points through data enhancement, use the business knowledge base as the training sample, and use the determined knowledge points as annotations to fine-tune the parsing large model.
[0073] In one or more embodiments of this specification, in step S102, the server inputs each data segment into the parsing large model, and the parsing large model performs extraction and generation of knowledge points.
[0074] However, not all text contents in the data segment are suitable as the output part of the knowledge point. For example, content such as background introduction, transitional statements, or repeated descriptions, although they are in the segment, if directly used as the answer, it will lead to redundant knowledge points or low information value.
[0075] Therefore, the parsing large model first identifies the data content that can truly support the inference of the business large model from the data segment, and then generates corresponding input questions based on this content, so as to ensure that each knowledge point is composed of high-quality "question and answer pairs", improving the accuracy and usability of subsequent retrieval.
[0076] Specifically, the server sequentially inputs the data fragments obtained in step S101 into the pre-trained parsing big data model. The parsing big data model first performs semantic understanding and content filtering on the input data fragments, identifying the data content that can be used to support the business big data model in executing business operations. This data content is usually a factual description within the fragment that has independent semantics and can completely answer a certain type of question, such as operation steps, fault handling methods, parameter definitions, or rule descriptions.
[0077] For example, consider a data segment from a device maintenance manual. This segment contains the statement, "When the device indicator light flashes red, it means the battery power is too low. Please charge it promptly. If the device still cannot be turned on after charging, please contact after-sales support." Assume the large-scale parsing model identifies "When the device indicator light flashes red, it means the battery power is too low. Please charge it promptly" as a complete fault handling instruction, and also identifies "If the device still cannot be turned on after charging, please contact after-sales support" as another handling guideline. Both are marked as data content usable for business support.
[0078] After the large model completes data content recognition, it further generates corresponding input questions based on at least a portion of the recognized data content. The process of generating questions is not a mechanical pairing of every piece of recognized data content, but rather selective processing based on business needs and semantic integrity.
[0079] Continuing with the previous example, for the first data item, the large model generates the input questions "What causes the device indicator light to flash red?" and "How to handle the device indicator light flashing red?". For the second data item, the large model generates the input question "What to do if the device still cannot be turned on after charging?".
[0080] In addition, large-scale analysis models may generate multiple input questions with different expressions for the same data content to cover users' diverse questioning habits. However, if a piece of identified data content is too detailed or highly overlaps with other content, the model may choose not to generate questions for it to avoid excessive redundancy of knowledge points.
[0081] Finally, the large model outputs knowledge points composed of data content and input questions. Each knowledge point consists of two parts: one part is the data content identified by the model, which serves as the answer part of the knowledge point; the other part is at least one input question generated by the model based on that data content, which serves as the question part of the knowledge point.
[0082] Continuing with the previous example, the knowledge points output by the large model include "What is the reason for the device indicator light to flash red?" and "When the device indicator light flashes red, it means that the battery power is too low and you should charge it in time", as well as "What should I do if the device still cannot be turned on after charging?" and "If it still cannot be turned on after charging, please contact after-sales support".
[0083] It is evident that when generating questions, the large parsing model does not match all identified content one by one, but can selectively generate questions for some of the content. This ensures coverage of knowledge points while avoiding redundant generation, thereby improving parsing efficiency and the quality of knowledge points.
[0084] The above is a method for constructing a large model knowledge base provided by the embodiments of this specification. Based on the same idea, this specification also provides corresponding devices, storage media and electronic devices.
[0085] Figure 3 This is a schematic diagram of a large model knowledge base construction device provided in an embodiment of this specification. The device includes: The acquisition module 201 is used to acquire the target knowledge base for enhanced retrieval, and to divide the target knowledge base to obtain several data fragments. The knowledge point identification module 202 is used to input the data segment into a pre-trained parsing large model for each data segment to obtain the knowledge points contained in the data segment. The knowledge points are composed of the input question generated by the parsing large model and the output content contained in the sub-data. The knowledge base construction module 203 is used to construct a retrieval knowledge base by using the knowledge points as database content according to the data format of the target knowledge base; the retrieval knowledge base is used to support the business model to obtain knowledge points through retrieval enhancement for reasoning and output results when performing business.
[0086] Optionally, the knowledge point recognition module 202 is used to determine the context window of the business big model; and to divide the target knowledge base according to the size of the context window to obtain several data segments.
[0087] Optionally, the knowledge point recognition module 202 is used to determine the overlap ratio of the segmented data segments; divide the target knowledge base according to the overlap ratio and the size of the context window to obtain each data segment; wherein, the common part contained in adjacent data segments and the size of the data segments satisfy the overlap ratio.
[0088] Optionally, the knowledge point recognition module 202 is used to determine the overlap ratio of the segmented data fragments based on at least one of the application business scenario of the business big model and the data type of the target knowledge base; wherein, the complexity of the business scenario is positively correlated with the overlap ratio, and the overlap ratio of unstructured data types is higher than that of structured data types.
[0089] Optionally, the device further includes: a training module 204; The training module 204 is used to acquire a business knowledge base for training, as well as historical business data supported by the business knowledge base; determine data content related to the output result from the business knowledge base based on user input in the historical business data; determine knowledge points of the business knowledge base based on the user input and the data content; use the business knowledge base as training samples and the determined knowledge points as annotations to fine-tune the parsing model, so that the parsing model learns to identify data constituting the output content based on the input database content, and generates corresponding input questions based on the identified data content.
[0090] Optionally, the knowledge base construction module 203 is used to perform data augmentation on the user input to obtain several semantically consistent input questions; based on the data content, it constructs knowledge points of the business knowledge base with each input question.
[0091] Optionally, the knowledge point recognition module 202 is used to input the data fragment into a pre-trained parsing big model to obtain the data content in the data fragment that the parsing big model recognizes for supporting the execution of business by the business big model; and to generate an input question corresponding to the identified at least part of the data content through the parsing big model; and to obtain the knowledge point output by the parsing big model, which consists of the data content and the input question.
[0092] This specification also provides a computer-readable storage medium storing a computer program that, when executed by a processor, can be used to perform the large model knowledge base construction method provided above.
[0093] based on Figure 1 The method for constructing a large model knowledge base shown in this specification also provides the following embodiments: Figure 4 The diagram shows the structure of the electronic device. Figure 4 At the hardware level, the electronic device includes a processor, internal bus, network interface, memory, and non-volatile storage, and may also include other hardware required for business operations. The processor reads the corresponding computer program from the non-volatile storage into memory and then runs it to implement the aforementioned method for constructing a large model knowledge base.
[0094] The above description is merely an embodiment of this specification and is not intended to limit this specification. Various modifications and variations can be made to this specification by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this specification should be included within the scope of the claims of this specification.
Claims
1. A method for constructing a large model knowledge base, the method comprising: Obtain the target knowledge base for enhanced retrieval, and divide the target knowledge base to obtain several data fragments; For each data segment, the data segment is input into a pre-trained analytical large model to obtain the knowledge points contained in the data segment. The knowledge points are composed of the input question generated by the analytical large model and the output content contained in the sub-data. According to the data format of the target knowledge base, the knowledge points are used as database content to construct a retrieval knowledge base; the retrieval knowledge base is used to support the business model in performing business operations, obtaining knowledge points through retrieval enhancement, performing reasoning, and outputting results.
2. The method as described in claim 1, wherein the target knowledge base is divided to obtain several data segments, specifically including: Determine the context window of the business model; Based on the size of the context window, the target knowledge base is divided into several data segments.
3. The method as described in claim 2, wherein the target knowledge base is divided into several data segments according to the size of the context window, specifically including: Determine the overlap ratio of the segmented data; The target knowledge base is divided into data segments according to the overlap ratio and the size of the context window; wherein the common part contained in adjacent data segments and the size of the data segments satisfy the overlap ratio.
4. The method as described in claim 3, wherein determining the overlap ratio of the segmented data fragments specifically includes: Based on at least one of the application business scenarios of the business model and the data types of the target knowledge base, determine the overlap ratio of the segmented data fragments; The complexity of the business scenario is positively correlated with the overlap ratio, and the overlap ratio of unstructured data types is higher than that of structured data types.
5. The method of claim 1, wherein the analytical large model is trained using the following method: Obtain the business knowledge base used for training, as well as the historical business data supported by the business knowledge base; Based on user input in the historical business data, determine the data content related to the output result from the business knowledge base; Based on the user input and the data content, the knowledge points of the business knowledge base are determined; Using the business knowledge base as training samples and the identified knowledge points as annotations, the parsing model is fine-tuned so that it learns to identify data that constitutes the output content based on the input database content, and to generate corresponding input questions based on the identified data content.
6. The method as described in claim 5, wherein determining the knowledge points of the business knowledge base based on the user input and the data content specifically includes: Data augmentation is performed on the user input to obtain several semantically consistent input questions; Based on the data content, knowledge points of the business knowledge base are constructed for each input question.
7. The method as described in claim 1, wherein the data fragment is input into a pre-trained analytical large model to obtain the knowledge points contained in the data fragment, specifically including: The data fragment is input into a pre-trained analytical large model to obtain the data content in the data fragment that the analytical large model identifies as being used to support the execution of business by the business large model. And based on at least a portion of the identified data content, the large parsing model is used to generate the input question corresponding to the identified portion of the data content; The knowledge points output by the analytical model are composed of data content and input questions.
8. A large model knowledge base construction apparatus, the apparatus comprising: The acquisition module is used to acquire the target knowledge base for retrieval enhancement, and to divide the target knowledge base into several data fragments; The knowledge point identification module is used to input each data segment into a pre-trained parsing large model to obtain the knowledge points contained in the data segment. The knowledge points are composed of the input question generated by the parsing large model and the output content contained in the sub-data. The knowledge base construction module is used to construct a retrieval knowledge base by using the knowledge points as database content according to the data format of the target knowledge base; the retrieval knowledge base is used to support the business model to obtain knowledge points through retrieval enhancement for reasoning and output results when executing business.
9. A computer-readable storage medium storing a computer program that, when executed by a processor, implements the method described in any one of claims 1-7.
10. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor, when executing the program, implements the method described in any one of claims 1-7.