Knowledge base updating method and device and storage medium
By obtaining user input content and context information, identifying and optimizing dialogue content, the problem that the knowledge base cannot be dynamically updated in the existing technology is solved, and efficient knowledge base operations are achieved.
Patent Information
- Application Number
- CN202510483000.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-17
- Publication Date
- 2025-08-08
AI Technical Summary
In the prior art, users need to manually upload knowledge content before talking to large language models, and the personal knowledge base cannot dynamically maintain intelligently based on the dialogue context, resulting in low efficiency in the knowledge base operation.
By obtaining user input and context information, identify key information in conversation content, conduct intent analysis, optimize and update the knowledge base, including storing new content or correcting existing content.
It realizes dynamic update of the knowledge base during the conversation between users and large language models, and improves the operation efficiency and intelligent maintenance capabilities of the knowledge base.
Smart Images

Figure CN120448486A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of artificial intelligence technology, and in particular to a knowledge base updating method, device, and storage medium. Background Art
[0002] Currently, users must manually upload knowledge content to their personal knowledge base before engaging with a large language model. The large language model then answers questions based on this personal knowledge base. During this conversation, the personal knowledge base cannot be dynamically and intelligently maintained based on the semantics of the conversation context, resulting in inefficient knowledge base operation. Summary of the Invention
[0003] The purpose of this application is to provide a knowledge base updating method, device and storage medium, aiming to solve the problem of how to efficiently operate the knowledge base.
[0004] To achieve the above objectives, this application adopts the following technical solutions:
[0005] In a first aspect, the present application provides a knowledge base updating method, which includes: obtaining the user's input content and context information of the input content; determining the answer content corresponding to the input content based on the input content and the context information of the input content; performing intent recognition on the input content and the answer content to determine whether the conversation content includes content that needs to be stored in the user's corresponding knowledge base or content that needs to be corrected for existing content in the knowledge base; the conversation content includes input content and answer content; when it is determined that the conversation content includes content that needs to be stored in the knowledge base or content that needs to be corrected for existing knowledge in the knowledge base, optimizing the conversation content to obtain optimized conversation content; and updating the knowledge base based on the optimized conversation content.
[0006] The knowledge base updating method provided in the embodiment of the present application can update the knowledge base during the process of the user's dialogue with the large language model, thereby being able to efficiently operate the knowledge base.
[0007] In one possible implementation, answer content corresponding to the input content is determined based on the input content and contextual information of the input content, including: acquiring target knowledge related to the input content from a knowledge base based on the input content and contextual information of the input content; and determining answer content corresponding to the input content based on a large language model and target knowledge.
[0008] In one possible implementation, the input content and the answer content are subjected to intent recognition to determine whether the conversation content includes content that needs to be stored in the knowledge base or content that needs to be corrected for content already in the knowledge base, including: identifying key information in the conversation content; comparing the key information with content already in the knowledge base; if the key information does not exist in the knowledge base, determining that the conversation content includes content that needs to be stored in the knowledge base; if there is a difference between the key information and content already in the knowledge base, determining that the conversation content includes content that needs to be corrected for content already in the knowledge base.
[0009] In one possible implementation, identifying key information in a conversation includes: dividing the conversation into multiple phrases based on a preset division method; calculating the aggregation degree of each phrase; the aggregation degree is used to reflect the importance of the phrase in the conversation content; and determining phrases with an aggregation degree greater than a preset threshold as key information in the conversation content.
[0010] In a possible implementation, the aggregation degree of the phrase satisfies a preset formula, which is:
[0011]
[0012] Among them, P w represents the degree of aggregation of phrase w, N represents the total number of phrases, m represents the number of words that make up phrase w, and F i Indicates that the word w is included i F represents the number of phrases including phrase w.
[0013] In one possible implementation, the knowledge base is updated based on the optimized conversation content, including: when it is determined that the conversation content includes content that needs to be stored in the knowledge base, storing the optimized conversation content in the knowledge base; when it is determined that the conversation content includes content that requires correction of existing content in the knowledge base, replacing the existing content in the knowledge base with the optimized content.
[0014] In one possible implementation, when it is determined that the conversation content includes content that needs to be stored in the knowledge base, the optimized conversation content is stored in the knowledge base, including: when it is determined that the conversation content includes content that needs to be stored in the knowledge base, determining the knowledge category to which the conversation content belongs, and storing the optimized conversation content in a storage location corresponding to the knowledge category.
[0015] In a second aspect, the present application provides a knowledge base updating device, which includes: a communication unit and a processing unit; the communication unit is used to obtain the user's input content and the context information of the input content; the processing unit is used to determine the answer content corresponding to the input content based on the input content and the context information of the input content; the processing unit is also used to identify the intention of the input content and the answer content, and determine whether the conversation content includes content that needs to be stored in the knowledge base corresponding to the user or content that requires correction of existing content in the knowledge base; the conversation content includes input content and answer content; the processing unit is also used to optimize the conversation content to obtain optimized conversation content when it is determined that the conversation content includes content that needs to be stored in the knowledge base or content that requires correction of existing knowledge in the knowledge base; the processing unit is also used to update the knowledge base based on the optimized conversation content.
[0016] In one possible implementation, the communication unit is further used to obtain target knowledge related to the input content from the knowledge base based on the input content and context information of the input content; the processing unit is further used to determine the answer content corresponding to the input content based on the large language model and the target knowledge.
[0017] In one possible implementation, the processing unit is further used to identify key information in the conversation content; the processing unit is further used to compare the key information with existing content in the knowledge base; if the key information does not exist in the knowledge base, the processing unit determines that the conversation content includes content that needs to be stored in the knowledge base; if there is a difference between the key information and the existing content in the knowledge base, the processing unit determines that the conversation content includes content that needs to be corrected with respect to the existing content in the knowledge base.
[0018] In one possible implementation, the processing unit is further used to divide the conversation content into multiple phrases based on a preset division method; the processing unit is further used to calculate the aggregation degree of each phrase; the aggregation degree is used to reflect the importance of the phrase in the conversation content; the processing unit is further used to use phrases with an aggregation degree greater than a preset threshold as key information in the conversation content.
[0019] In a possible implementation, the aggregation degree of the phrase satisfies a preset formula, which is:
[0020]
[0021] Among them, P w represents the degree of aggregation of phrase w, N represents the total number of phrases, m represents the number of words that make up phrase w, and F i Indicates that the word w is included i F represents the number of phrases including phrase w.
[0022] In one possible implementation, the processing unit is further used to store the optimized conversation content in the knowledge base when it is determined that the conversation content includes content that needs to be stored in the knowledge base; the processing unit is further used to replace the existing content in the knowledge base with the optimized content when it is determined that the conversation content includes content that needs to be corrected.
[0023] In one possible implementation, when it is determined that the conversation content includes content that needs to be stored in the knowledge base, the processing unit is further used to determine the knowledge category to which the conversation content belongs, and store the optimized conversation content in a storage location corresponding to the knowledge category.
[0024] In a third aspect, the present application provides a knowledge base updating device, which includes: a processor and a communication interface; the communication interface and the processor are coupled, and the processor is used to run a computer program or instructions to implement the knowledge base updating method described in the first aspect and any possible implementation method of the first aspect.
[0025] In a fourth aspect, the present application provides a computer-readable storage medium, which stores instructions. When the instructions are executed on a terminal, the terminal executes the knowledge base updating method described in the first aspect and any possible implementation of the first aspect.
[0026] In a fifth aspect, the present application provides a computer program product comprising instructions, which, when the computer program product is run on a knowledge base updating device, enables the knowledge base updating device to perform the knowledge base updating method as described in the first aspect and any possible implementation of the first aspect.
[0027] In a sixth aspect, the present application provides a chip, which includes a processor and a communication interface, the communication interface and the processor are coupled, and the processor is used to run a computer program or instructions to implement the knowledge base update method described in the first aspect and any possible implementation method of the first aspect.
[0028] Specifically, the chip provided in this application also includes a memory for storing computer programs or instructions. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0030] Figure 1 A schematic diagram of the composition of a knowledge base updating device provided in an embodiment of the present application;
[0031] Figure 2 A schematic diagram of a module of a knowledge base updating device provided in an embodiment of the present application;
[0032] Figure 3 A flowchart of a knowledge base updating method provided in an embodiment of the present application;
[0033] Figure 4 A flowchart of another knowledge base updating method provided in an embodiment of the present application;
[0034] Figure 5 A flowchart of another knowledge base updating method provided in an embodiment of the present application;
[0035] Figure 6 A flowchart of another knowledge base updating method provided in an embodiment of the present application;
[0036] Figure 7 A flowchart of another knowledge base updating method provided in an embodiment of the present application;
[0037] Figure 8 A schematic diagram of the structure of a knowledge base updating device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0038] The following will be combined with the drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.
[0039] In the description of this application, it should be understood that the terms "upper," "lower," "left," "right," "front," "back," "inner," "outer," and the like, indicating directions or positional relationships, are based on the directions or relative positional relationships shown in the accompanying drawings and are intended solely to facilitate the description of this application and simplify the description. They do not indicate or imply that the devices or components referred to must have a specific direction, be constructed, or operate in a specific direction. Therefore, they should not be construed as limitations on this application. Unless otherwise specified, the above-mentioned directionality descriptions may be flexibly set in actual application, provided that the relative positional relationships shown in the accompanying drawings are met.
[0040] The terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of the technical features being referred to. Thus, a feature specified as "first" or "second" may explicitly or implicitly include one or more of the features. Throughout this application, unless otherwise specified, "plurality" means two or more.
[0041] In the embodiments of the present application, the terms "comprises," "comprising," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, article, or device comprising a series of elements includes not only those elements but also other elements not explicitly listed, or elements inherent to such process, article, or device. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not preclude the presence of other identical elements in the process, article, or device comprising the element.
[0042] In the embodiments of this application, words such as "exemplary" or "for example" are used to indicate examples, illustrations, or descriptions. Any embodiment or design described as "exemplary" or "for example" in the embodiments of this application should not be interpreted as being preferred or advantageous over other embodiments or designs. Rather, the use of words such as "exemplary" or "for example" is intended to present the relevant concepts in a concrete manner.
[0043] In the description of this specification, specific features, structures, materials or characteristics may be combined in an appropriate manner in any one or more embodiments or examples.
[0044] Currently, users must manually upload knowledge content to their personal knowledge base before engaging with a large language model. The large language model then answers questions based on this personal knowledge base. During this conversation, the personal knowledge base cannot be dynamically and intelligently maintained based on the semantics of the conversation context, resulting in inefficient knowledge base operation.
[0045] In view of this, an embodiment of the present application provides a knowledge base updating method, which includes: obtaining the user's input content and the context information of the input content. Based on the input content and the context information of the input content, determining the answer content corresponding to the input content. Performing intention recognition on the input content and the answer content, and optimizing the conversation content to obtain optimized conversation content when it is determined that the conversation content includes content that needs to be stored in the knowledge base or content that needs to correct existing knowledge in the knowledge base. Based on the optimized conversation content, updating the knowledge base. That is, the knowledge base updating method provided in the embodiment of the present application can update the knowledge base during the process of the user's conversation with the large language model, and thus can efficiently operate the knowledge base.
[0046] For example, Figure 1 Schematic diagram of the composition of a knowledge base updating device 10 provided in an embodiment of the present application. Figure 1 As shown, the knowledge base updating device 10 may include a processor 101 and a bus 102 .
[0047] Furthermore, the knowledge base updating device 10 may further include a communication interface 103 and a memory 104 , wherein the processor 101 , the memory 104 and the communication interface 103 may be connected via a bus 102 .
[0048] The processor 101 is a central processing unit (CPU), a general-purpose processor, a network processor (NP), a digital signal processor (DSP), a microprocessor, a microcontroller, a programmable logic device (PLD), or any combination thereof. The processor 101 may also be other devices with processing functions, such as circuits, devices, or software modules, without limitation.
[0049] The bus 102 is used to transmit information between the components included in the knowledge base updating device 10 .
[0050] Communication interface 103 is used to communicate with other devices or other communication networks. Such other communication networks may be Ethernet, radio access networks (RAN), wireless local area networks (WLAN), etc. Communication interface 103 may be a module, circuit, communication interface, or any other device capable of implementing communication.
[0051] The memory 104 is used to store instructions, where the instructions may be computer programs.
[0052] The memory 104 may be a read-only memory (ROM) or other type of static storage device that can store static information and / or instructions, or a random access memory (RAM) or other type of dynamic storage device that can store information and / or instructions, or an electrically erasable programmable read-only memory (EEPROM), a compact disc read-only memory (CD-ROM) or other optical disc storage, optical disc storage (including compact disc, laser disc, optical disc, digital versatile disc, Blu-ray disc, etc.), magnetic disk storage media or other magnetic storage devices, etc., without limitation.
[0053] It should be noted that the memory 104 can exist independently of the processor 101 or can be integrated with the processor 101. The memory 104 can be used to store instructions, program code, or some data. The memory 104 can be located within the knowledge base updating device 10 or outside the knowledge base updating device 10, without limitation. The processor 101 is configured to execute the instructions stored in the memory 104 to implement the knowledge base updating method provided in the following embodiments of this application.
[0054] It should be noted that the knowledge base updating device 10 can be a desktop computer, a portable computer, a network server, a mobile phone, a tablet computer, a wireless terminal, an embedded device, a chip system or a computer with a Figure 1 In addition, Figure 1 The composition shown in the Figure 1 The limitations of each device in Figure 1 In addition to the parts shown, Figure 1 The various devices in the figures may include more or fewer components than shown, or combine certain components, or arrange the components differently.
[0055] In the embodiment of the present application, the chip system can be composed of chips, or can include chips and other discrete devices.
[0056] In addition, the actions, terms, etc. involved in the various embodiments of this application can refer to each other without limitation. The message names or parameter names in the messages exchanged between the various devices in the embodiments of this application are only examples, and other names can also be used in specific implementations without limitation.
[0057] For example, Figure 2 This is a module diagram of a knowledge base updating device provided in an embodiment of the present application. Figure 2 As shown, the knowledge base updating device includes: a user interface (UI) module, an intelligent processing module, a large model module and a knowledge base (KB) module.
[0058] The user interface module is used to receive user input, send a storage confirmation instruction to the user, and send answer content corresponding to the input content.
[0059] Optionally, the user interface module can be configured with a multimodal input channel that can accept text or voice input. The user interface module can have a built-in visual confirmation panel for displaying the optimized conversation content to the user and displaying confirm save and cancel save buttons.
[0060] The intelligent processing module includes an intent recognition module, a knowledge optimization module, and a knowledge base update module. The intent recognition module identifies the intent of the input and response content, determining whether the conversation contains content that needs to be stored in the knowledge base or requires revision of existing content in the knowledge base. The knowledge optimization module optimizes the conversation content to produce optimized conversation content. The knowledge base update module updates the knowledge base based on the optimized conversation content.
[0061] The large model module is used to determine the answer content corresponding to the input content based on the input content and the context information of the input content.
[0062] The knowledge base module is used to store various types of knowledge data, including structured data and text data.
[0063] Optionally, the knowledge base module can be a repository for retrieval-augmented generation (RAG) vectors.
[0064] The following describes the knowledge base updating method provided by the embodiment of the present application in conjunction with the accompanying drawings. Among them, the actions, terms, etc. involved in the various embodiments of the present application can refer to each other without limitation. The message name or parameter name in the message exchanged between the various devices in the embodiment of the present application is only an example, and other names can also be used in the specific implementation without limitation. The actions involved in the various embodiments of the present application are only an example, and other names can also be used in the specific implementation, such as: "included in" in the embodiment of the present application can also be replaced by "carried on" or "carried in", etc.
[0065] like Figure 3 As shown, the embodiment of the present application proposes a knowledge base updating method, which includes:
[0066] S301: Obtain user input content and context information of the input content.
[0067] In a possible implementation, input content from a user is received through a user interface, and context information related to the input content is collected.
[0068] Optionally, the user interface can employ a variety of interaction methods, such as text input, voice input, or gesture recognition. Furthermore, after obtaining the user input, the input can be pre-processed, for example, by removing noise, identifying special symbols, or performing part-of-speech tagging. This can improve the accuracy and efficiency of subsequent processing.
[0069] For example, the above input content can be "how to effectively improve the performance of large language models in small sample learning scenarios" or "what are the effective performance improvement methods for large language models in small sample learning scenarios."
[0070] For example, the context information of the input content may be context information of conversations such as the content of related materials that have been consulted, similar issues that have been discussed, etc.
[0071] S302: Determine answer content corresponding to the input content based on the input content and context information of the input content.
[0072] In one possible implementation, natural language processing technology is used to deeply analyze the input content and its context. Retrieval and reasoning are then performed based on the parsed results to filter out target knowledge related to the input content. After obtaining the target knowledge, it is filtered, integrated, and reorganized to generate a response corresponding to the input content.
[0073] For example, taking the input content in the aforementioned S301 "What are the effective performance improvement methods for large language models in small sample learning scenarios?" as an example, the answer content corresponding to this input content can be "Currently in small sample learning scenarios, we can use a small number of samples to quickly adapt to new tasks through fine-tuning methods based on meta-learning. We can also use data enhancement technology to expand small sample data sets and improve the model's generalization ability."
[0074] S303: Perform intent recognition on the input content and the answer content to determine whether the conversation content includes content that needs to be stored in the user's corresponding knowledge base or content that requires modification of existing content in the knowledge base.
[0075] The conversation content includes input content and answer content.
[0076] In one possible implementation, the input content and the answer content are analyzed to identify key information, and the key information is compared with the existing content in the user's corresponding knowledge base to determine whether the conversation content includes content that needs to be stored in the user's corresponding knowledge base or content that needs to be modified in the knowledge base. Figure 5 The embodiments described are not described in detail here.
[0077] Another possible implementation involves using a transformer-based bidirectional encoder representation model (BERT) to identify the intent of both the input and the response. The BERT model, with its self-attention mechanism at its core and pre-trained on large amounts of unlabeled text, is capable of accurately analyzing conversation content.
[0078] S304: When it is determined that the conversation content includes content that needs to be stored in the knowledge base or content that requires correction of existing knowledge in the knowledge base, the conversation content is optimized to obtain optimized conversation content.
[0079] In one possible implementation, if the conversation content is determined to include content that needs to be stored in the knowledge base or content that requires revision of existing knowledge in the knowledge base, the conversation content is formatted and standardized. For example, different forms of words with the same meaning are converted to a unified standard vocabulary, and the units and formats of the data are standardized. In addition, long and complex sentences are simplified and reorganized to make the expression clearer and more accurate.
[0080] S305: Update the knowledge base based on the optimized conversation content.
[0081] In one possible implementation, if it is determined that the conversation content includes content that needs to be stored in the knowledge base, the optimized conversation content is stored in the knowledge base. If it is determined that the conversation content includes content that requires revision of existing content in the knowledge base, the existing content in the knowledge base is replaced with the optimized content.
[0082] Optionally, when it is determined that the conversation content includes content that needs to be stored in the knowledge base, the knowledge category to which the conversation content belongs may be determined. Based on the knowledge category, the optimized conversation content is stored in a storage location corresponding to the knowledge category.
[0083] Optionally, when replacing existing content in the knowledge base with optimized content, the reason for the correction, the basis, and the specific content before and after the correction can also be recorded for subsequent auditing and tracing.
[0084] Furthermore, the optimized conversation content can be displayed in the form of suggestions on the user interface, prompting the user whether to store the optimized conversation content in the knowledge base. For example, the user interface displays "New large language model small sample learning knowledge is detected, whether to store the following content: The meta-learning fine-tuning method is to learn multiple related tasks, extract the commonalities and general patterns between tasks, so that the model can quickly adapt to new small sample tasks. The application of data enhancement technology in small sample learning is to use various transformation operations on the original small sample data, such as rotation, flipping, cropping, adding noise, etc., to expand the scale and diversity of the data set." If in response to the user's confirmation operation, the knowledge base is updated based on the optimized conversation content. If in response to the user's cancellation operation, no update operation is performed on the knowledge base.
[0085] In the knowledge base updating method provided by the present application, the user's input content and the context information of the input content are obtained. Based on the input content and the context information of the input content, the answer content corresponding to the input content is determined. The input content and the answer content are intentionally identified, and when it is determined that the conversation content includes content that needs to be stored in the knowledge base or content that requires correction of existing knowledge in the knowledge base, the conversation content is optimized to obtain the optimized conversation content. Based on the optimized conversation content, the knowledge base is updated. In other words, the knowledge base updating method provided in the embodiment of the present application can update the knowledge base during the process of the user's conversation with the large language model, and thus can efficiently operate the knowledge base.
[0086] In one embodiment, Figure 4 As shown, the above S302 can be specifically determined through the following S401 to S402.
[0087] S401 : Based on input content and context information of the input content, obtain target knowledge related to the input content from a knowledge base.
[0088] In one possible implementation, the input content is preprocessed and broken down into semantically meaningful vocabulary and phrase units. A query statement is constructed based on the preprocessed input content and its contextual information. A search is performed in the knowledge base based on the query statement, and the retrieved knowledge is ranked. The top Q pieces of knowledge are used as target knowledge.
[0089] It should be noted that the above Q is a positive integer and Q can be set according to needs.
[0090] S402: Determine the answer content corresponding to the input content based on the large language model and target knowledge.
[0091] In one possible implementation, a large language model is used to analyze, integrate, and reason with the target knowledge to obtain enhanced target knowledge. The input content and the enhanced target knowledge are fed into the large language model to obtain the corresponding answer content.
[0092] Optionally, constraints can be set to ensure the quality of the answers. For example, you can limit the length of the answers and require them to include the core points of the target knowledge. This can avoid generating overly lengthy answers and ensure the accuracy and completeness of the answers.
[0093] In one embodiment, Figure 5 As shown, the above S303 can be specifically determined through the following S501 to S504.
[0094] S501: Identify key information in the conversation content.
[0095] In one possible implementation, the conversation content is divided into multiple phrases based on a preset division method, and the aggregation degree of each phrase is calculated. Phrases with an aggregation degree greater than a preset threshold are regarded as key information in the conversation content. Figure 6 The embodiments described are not described in detail here.
[0096] S502: Compare the key information with the existing content in the knowledge base.
[0097] In a possible implementation, for each key information, a query is performed in the index of the knowledge base to obtain knowledge content related to each key information, and the knowledge content is compared with the key information to obtain a comparison result.
[0098] S503: If the key information does not exist in the knowledge base, determine that the conversation content includes content that needs to be stored in the knowledge base.
[0099] In a possible implementation, the comparison result obtained in S502 is checked. If no matching knowledge content exists in the knowledge base for all key information, it is determined that the conversation content includes content that needs to be stored in the knowledge base.
[0100] S504: If the key information differs from the existing content in the knowledge base, determine that the conversation content includes content that requires correction to the existing content in the knowledge base.
[0101] Among them, the difference between key information and existing content in the knowledge base refers to the situation where the key information is inconsistent with the content stored in the knowledge base in terms of factual data, descriptions, opinions, evaluations, logical reasoning, etc.
[0102] In one possible implementation, the comparison result obtained in S502 is checked. If there is a difference between the key information and the knowledge content in the knowledge base, it is determined that the conversation content includes content that requires correction to the existing content in the knowledge base.
[0103] In one embodiment, Figure 6 As shown, the above S501 can be specifically determined through the following S601 to S603.
[0104] S601: Divide the conversation content into multiple phrases based on a preset division method.
[0105] In one possible implementation, a word segmentation tool is used to segment the conversation content to obtain multiple words. Multiple phrases are traversed from the multiple words according to a preset length k, where k is a positive integer.
[0106] For example, if the result of word segmentation of the conversation content is "A, B, C, D, E, F, G, H, I", and k = 5, then the traversed phrases are "A, AB, ABC, ABCD, ABCDE, B, BC, BCD, BCDE, BCDEF, C, CD, CDE, CDEF, CDEFG, D, DE, DEF, ... ".
[0107] S602: Calculate the aggregation degree of each phrase.
[0108] Among them, the aggregation degree is used to reflect the importance of a phrase in the conversation content.
[0109] Alternatively, assume a phrase w consists of {w1,w2,…,w m}, the polymerization degree of the phrase can be calculated according to the following formula.
[0110]
[0111] Among them, P w represents the degree of aggregation of phrase w. N represents the total number of phrases. m represents the number of words that make up phrase w. i Indicates that the word w is included i F represents the number of phrases that include phrase w.
[0112] S603: taking phrases with an aggregation degree greater than a preset threshold as key information in the conversation content.
[0113] In one possible implementation, a preset threshold is set, all phrases are traversed, and it is determined whether their aggregation degree is greater than the preset threshold, and phrases with an aggregation degree greater than the preset threshold are used as key information in the conversation content.
[0114] Figure 7This is a flow chart of a knowledge base updating method provided in an embodiment of the present application. Figure 7 As shown, the knowledge base updating method provided in the embodiment of the present application may include the following steps.
[0115] S701: The user interface obtains user input content.
[0116] S702: The user interface sends input content and context information of the input content to the large model. Correspondingly, the large model receives the input content and context information of the input content from the user interface.
[0117] S703: The large model sends a query request to the knowledge base. Correspondingly, the knowledge base receives the query request from the large model.
[0118] The query request is used to instruct the acquisition of target knowledge related to the input content.
[0119] S704: The knowledge base sends the target knowledge to the large model. Correspondingly, the large model receives the target knowledge from the knowledge base.
[0120] S705. The large model performs knowledge enhancement on the target knowledge.
[0121] S706. The large model generates answer content based on the enhanced target knowledge.
[0122] S707: The large model sends input content and answer content to the intelligent processing. Correspondingly, the intelligent processing receives input content and answer content from the large model.
[0123] S708: Intelligent processing to identify the intent of the conversation content.
[0124] The conversation content includes input content and answer content.
[0125] S709 , when the intelligent processing determines that the conversation content includes content that needs to be stored in the knowledge base or content that requires correction of existing knowledge in the knowledge base, the conversation content is optimized to obtain optimized conversation content.
[0126] S710: The intelligent processing sends an update request to the user interface. Correspondingly, the user interface receives the update request from the intelligent processing.
[0127] The update request is used to request updating of the knowledge base according to the optimized content.
[0128] S711: The user interface sends confirmation information to the intelligent processing. Correspondingly, the intelligent processing receives the confirmation information from the user interface.
[0129] The confirmation information is used to instruct the knowledge base to be updated.
[0130] S712: The intelligent processing sends an update instruction to the knowledge base. Correspondingly, the knowledge base receives the update instruction from the intelligent processing.
[0131] The update instruction is used to instruct to update the knowledge base according to the optimized content.
[0132] S713: The knowledge base performs an update operation.
[0133] S714: The knowledge base sends a response message to the intelligent processing. Correspondingly, the intelligent processing receives the response message from the knowledge base.
[0134] The response information is used to respond to the completion of the update operation.
[0135] Optionally, the above response information may also include an identifier (ID) of this update operation.
[0136] S715: The intelligent processing sends the answer content to the user interface. Correspondingly, the user interface receives the answer content from the intelligent processing.
[0137] To sum up, the knowledge base update method provided in the embodiment of the present application can be deeply integrated with the large language model, and the knowledge retrieval or storage function can be triggered during the conversation between the user and the large language model. The knowledge base can be dynamically and intelligently maintained based on the large model, and thus the knowledge base can be operated efficiently.
[0138] The knowledge base update method provided in the embodiments of this application can be applied to fields related to knowledge base retrieval. For example, knowledge accumulation in intelligent customer service systems, learning assistants in education, intelligent management of corporate meeting minutes, and personal digital memory enhancement systems. Furthermore, the knowledge base update method provided in the embodiments of this application can also be integrated into existing large language models, improving the convenience of knowledge base use and reducing knowledge base management costs.
[0139] It is understandable that the above-mentioned knowledge base updating method can be implemented by a knowledge base updating device. In order to realize the above-mentioned functions, the knowledge base updating device includes hardware structures and / or software modules corresponding to the execution of each function. Those skilled in the art should easily realize that, in combination with the modules and algorithm steps of each example described in the embodiments disclosed herein, the embodiments disclosed in this application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the embodiments disclosed in this application.
[0140] The embodiments disclosed in this application can divide the functional modules of the knowledge base updating device generated by the above method example. For example, each functional module can be divided according to each function, or two or more functions can be integrated into one processing module. The above integrated modules can be implemented in the form of hardware or in the form of software functional modules. It should be noted that the division of modules in the embodiments disclosed in this application is schematic and is only a logical functional division. In actual implementation, there may be other division methods.
[0141] Figure 8 This is a schematic diagram of the structure of a knowledge base updating device provided in an embodiment of the present application. Figure 8 As shown, the knowledge base updating device 80 can be used to perform Figure 3-Figure 7 The knowledge base updating method shown in FIG. 8 shows a knowledge base updating device 80 including a communication unit 801 and a processing unit 802 .
[0142] Communication unit 801 is used to obtain the user's input content and context information of the input content; processing unit 802 is used to determine the answer content corresponding to the input content based on the input content and the context information of the input content; processing unit 802 is also used to identify the intention of the input content and the answer content, and determine whether the conversation content includes content that needs to be stored in the knowledge base corresponding to the user or content that requires correction of existing content in the knowledge base; the conversation content includes input content and answer content; processing unit 802 is also used to optimize the conversation content to obtain optimized conversation content when it is determined that the conversation content includes content that needs to be stored in the knowledge base or content that requires correction of existing knowledge in the knowledge base; processing unit 802 is also used to update the knowledge base based on the optimized conversation content.
[0143] In one possible implementation, the communication unit 801 is further used to obtain target knowledge related to the input content from the knowledge base based on the input content and context information of the input content; the processing unit 802 is further used to determine the answer content corresponding to the input content based on the large language model and the target knowledge.
[0144] In one possible implementation, the processing unit 802 is further used to identify key information in the conversation content; the processing unit 802 is further used to compare the key information with existing content in the knowledge base; if the key information does not exist in the knowledge base, the processing unit 802 determines that the conversation content includes content that needs to be stored in the knowledge base; if there is a difference between the key information and the existing content in the knowledge base, the processing unit 802 determines that the conversation content includes content that requires correction of the existing content in the knowledge base.
[0145] In one possible implementation, the processing unit 802 is further used to divide the conversation content into multiple phrases based on a preset division method; the processing unit 802 is further used to calculate the aggregation degree of each phrase; the aggregation degree is used to reflect the importance of the phrase in the conversation content; the processing unit 802 is further used to use phrases with an aggregation degree greater than a preset threshold as key information in the conversation content.
[0146] In a possible implementation, the aggregation degree of the phrase satisfies a preset formula, which is:
[0147]
[0148] Among them, P w represents the degree of aggregation of phrase w, N represents the total number of phrases, m represents the number of words that make up phrase w, and F i Indicates that the word w is included i F represents the number of phrases including phrase w.
[0149] In one possible implementation, the processing unit 802 is further used to store the optimized conversation content in the knowledge base when it is determined that the conversation content includes content that needs to be stored in the knowledge base; the processing unit 802 is further used to replace the existing content in the knowledge base with the optimized content when it is determined that the conversation content includes content that needs to be corrected.
[0150] In one possible implementation, when it is determined that the conversation content includes content that needs to be stored in the knowledge base, the processing unit 802 is further used to determine the knowledge category to which the conversation content belongs, and store the optimized conversation content in a storage location corresponding to the knowledge category.
[0151] Through the description of the above embodiments, those skilled in the art will clearly understand that for the sake of convenience and brevity, only the division of the above functional modules is used as an example. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. The specific working processes of the above-described systems, devices, and units can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0152] The present disclosure also provides a computer-readable storage medium having instructions stored thereon. When the instructions in the storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute the knowledge base updating method provided in the above-mentioned embodiment of the present disclosure.
[0153] The embodiments of the present disclosure also provide a computer program product containing instructions, which, when executed on an electronic device, enables the electronic device to execute the knowledge base updating method provided by the embodiments of the present disclosure.
[0154] Among them, the computer-readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination thereof. More specific examples of computer-readable storage media (a non-exhaustive list) include: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a register, a hard disk, an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above, or any other form of computer-readable storage medium known in the art. An exemplary storage medium is coupled to a processor so that the processor can read information from the storage medium and write information to the storage medium. Of course, the storage medium can also be an integral part of the processor. The processor and the storage medium can be located in an application-specific integrated circuit (ASIC). In the embodiments of the present application, a computer-readable storage medium may be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.
[0155] The above are only specific embodiments of the present application, but the scope of protection of this application is not limited thereto. Any changes or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in this application should be included in the scope of protection of this application. Therefore, the scope of protection of this application should be based on the scope of protection of the claims.
Claims
1. A knowledge base updating method, characterized in that: The method comprises: Obtaining user input content and context information of the input content; Determining answer content corresponding to the input content based on the input content and context information of the input content; performing intent recognition on the input content and the answer content to determine whether the conversation content includes content that needs to be stored in the knowledge base corresponding to the user or content that requires revision of existing content in the knowledge base; the conversation content includes the input content and the answer content; When it is determined that the conversation content includes content that needs to be stored in the knowledge base or content that requires correction of existing knowledge in the knowledge base, optimizing the conversation content to obtain optimized conversation content; The knowledge base is updated based on the optimized conversation content.
2. The method according to claim 1, characterized in that The determining, based on the input content and context information of the input content, answer content corresponding to the input content includes: Based on the input content and context information of the input content, acquiring target knowledge related to the input content from the knowledge base; Based on the large language model and the target knowledge, answer content corresponding to the input content is determined.
3. The method according to claim 1, characterized in that The performing of intention recognition on the input content and the answer content to determine whether the conversation content includes content that needs to be stored in the knowledge base or content that needs to be modified for existing content in the knowledge base includes: Identifying key information in the conversation content; Comparing the key information with existing content in the knowledge base; If the key information does not exist in the knowledge base, determining that the conversation content includes content that needs to be stored in the knowledge base; If the key information is different from the existing content in the knowledge base, it is determined that the conversation content includes content that requires correction of the existing content in the knowledge base.
4. The method according to claim 3, characterized in that The identifying key information in the conversation content includes: Dividing the conversation content into a plurality of phrases based on a preset division method; Calculating the aggregation degree of each phrase; the aggregation degree is used to reflect the importance of the phrase in the conversation content; Phrases with a degree of aggregation greater than a preset threshold are used as key information in the conversation content.
5. The method according to claim 4, characterized in that The degree of aggregation of the phrase satisfies a preset formula, which is: Among them, P w represents the degree of aggregation of phrase w, N represents the total number of phrases, m represents the number of words that make up phrase w, and F i Indicates that the word w is included i F represents the number of phrases including phrase w.
6. The method according to any one of claims 1 to 5, characterized in that The updating of the knowledge base based on the optimized conversation content includes: If it is determined that the conversation content includes content that needs to be stored in the knowledge base, storing the optimized conversation content in the knowledge base; In the case where it is determined that the conversation content includes content that requires modification of existing content in the knowledge base, the existing content in the knowledge base is replaced with the optimized content.
7. The method according to claim 6, characterized in that When determining that the conversation content includes content that needs to be stored in the knowledge base, storing the optimized conversation content in the knowledge base includes: When it is determined that the conversation content includes content that needs to be stored in the knowledge base, the knowledge category to which the conversation content belongs is determined, and the optimized conversation content is stored in a storage location corresponding to the knowledge category.
8. A knowledge base updating device, characterized in that: The device includes: a communication unit and a processing unit; The communication unit is configured to obtain user input content and context information of the input content; The processing unit is configured to determine answer content corresponding to the input content based on the input content and context information of the input content; The processing unit is further configured to perform intent recognition on the input content and the answer content, and determine whether the conversation content includes content that needs to be stored in the knowledge base corresponding to the user or content that requires revision of existing content in the knowledge base; the conversation content includes the input content and the answer content; The processing unit is further configured to, upon determining that the conversation content includes content that needs to be stored in the knowledge base or content that requires revision of existing knowledge in the knowledge base, optimize the conversation content to obtain optimized conversation content; The processing unit is further configured to update the knowledge base based on the optimized conversation content.
9. A knowledge base updating device, characterized in that: include: A processor and a communication interface; the communication interface is coupled to the processor, and the processor is used to run a computer program or instruction to implement the knowledge base updating method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that The computer-readable storage medium stores computer instructions, and when the computer instructions are executed on a computer, the computer is caused to execute the knowledge base updating method according to any one of claims 1 to 7.
Citation Information
Cited By
Knowledge base correction method, electronic equipment and computer readable storage medium
CN121614062A