Knowledge base management warehousing optimization method and device, equipment and medium
By calculating the semantic similarity between questions and answers in the knowledge base, forming similar question groups and obtaining user confirmation, the redundancy of redundant questions in the knowledge base is solved, and efficient data entry management and retrieval are achieved.
Patent Information
- Application Number
- CN202310838799.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-07-07
- Publication Date
- 2026-01-13
- Estimated Expiration
- 2043-07-07
AI Technical Summary
The existing knowledge base contains redundancy of similar or identical questions, which leads to a decrease in retrieval efficiency and accuracy, and the existing review mechanism cannot effectively solve this problem.
By acquiring the semantics of user-submitted questions and answers for database entry, calculating their similarity to known questions and answers in the target knowledge base, forming question groups and answer groups, comparing similar questions and providing feedback to the user, and determining the writing method after obtaining confirmation results, the matching detection of questions and answers for database entry is achieved.
It improved the standardization and efficiency of knowledge base management, reduced redundancy, and enhanced the accuracy and efficiency of retrieval.
Smart Images

Figure CN117033577B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application is suitable for the field of artificial intelligence, and in particular relates to a knowledge base management warehousing optimization method, device, equipment and medium. BACKGROUND
[0002] The knowledge base project is a project for managing knowledge content to support answering user questions through a question and answer robot in different application scenarios, that is, the supporting part of the question and answer robot, which is of great significance for the use of business systems such as customer management and intelligent interaction in some commercial or financial scenarios. Therefore, it is very important to build efficient and high-quality knowledge content. For example, some banks currently develop client business systems to facilitate customer remittance and the like, and there are question and answer robots in the client business systems for interacting with customers to solve customer problems.
[0003] At present, the source of providing professional and high-quality content for the knowledge base is generally artificial knowledge writing, which is then transmitted to the knowledge base for storage. Since the personnel who write knowledge are not the same, there may be the same writing content, which will cause redundancy of similar question and answer results in the knowledge base, thereby reducing the efficiency and accuracy of retrieval. The existing question and answer knowledge content is added and edited by the administrator of the knowledge base, and the auditors at the next node check the questions and answers professionally after editing. If it is passed, it will be included in the knowledge base, and if it is not passed, it will be rejected and the process will be ended. Although the quality can be controlled, the problem of question and answer redundancy still cannot be solved. Therefore, how to effectively manage the warehousing method of the knowledge base to reduce the existence of similar and identical questions and reduce the redundancy occupation of the knowledge base so as to improve the efficiency and accuracy of retrieval has become a problem to be solved. SUMMARY
[0004] Therefore, the embodiments of the present application provide a knowledge base management warehousing optimization method, device, equipment and medium to solve the problem of how to effectively manage the warehousing method of the knowledge base to reduce the existence of similar and identical questions and reduce the redundancy occupation of the knowledge base so as to improve the efficiency and accuracy of retrieval.
[0005] In a first aspect, the embodiments of the present application provide a knowledge base management warehousing optimization method, which comprises:
[0006] When a user initiates a warehousing operation, the warehousing question submitted by the user and the corresponding warehousing answer are obtained, and the warehousing question and the warehousing answer are respectively subjected to semantic extraction to obtain the question semantics corresponding to the warehousing question and the answer semantics corresponding to the warehousing answer;
[0007] perform similarity calculation on the semantics of the problem and the semantics of known problems stored in the target knowledge base to obtain a first similarity corresponding to the known problems, and filter target problems from all the known problems according to the first similarity to form a first problem group;
[0008] perform similarity calculation on the semantics of the stored answer and the semantics of known answers stored in the target knowledge base to obtain a second similarity corresponding to the known answers, and filter target answers from all the known answers according to the second similarity;
[0009] determine the problems corresponding to all the target answers to form a second problem group, compare the first problem group and the second problem group, determine the same problems as similar problems, and feed back the similar problems to the user;
[0010] obtain a confirmation result of the user on the similar problems, and write the stored problem and the stored answer into the target knowledge base according to a writing mode corresponding to the confirmation result.
[0011] In an embodiment, after obtaining the stored problem submitted by the user and the stored answer corresponding thereto, the method further includes:
[0012] perform retrieval on the target knowledge base based on the stored problem to obtain a retrieval result;
[0013] if the retrieval result is that no matching problem is retrieved, perform the steps of obtaining a confirmation result of the user on the similar problems and writing the stored problem and the stored answer into the target knowledge base according to a writing mode corresponding to the confirmation result.
[0014] In an embodiment, after performing retrieval on the target knowledge base based on the stored problem to obtain a retrieval result, the method further includes:
[0015] if the retrieval result is that a matching problem is retrieved, feed back a preset prompt to the user, and the preset prompt is used to prompt the user to prohibit writing the stored problem and the stored answer.
[0016] In an embodiment, the step of performing semantic extraction on the stored problem and the stored answer respectively to obtain problem semantics corresponding to the stored problem and answer semantics corresponding to the stored answer includes:
[0017] perform word segmentation on the stored problem and the stored answer respectively to obtain a first word segmentation result corresponding to the stored problem and a second word segmentation result corresponding to the stored answer;
[0018] perform word vector encoding on the first word segmentation result to obtain a first encoding result, and determine that the first encoding result is the problem semantics corresponding to the stored problem.
[0019] performing word vector coding on the second segmentation result to obtain a second coding result, and determining that the second coding result is an answer semantic of the warehousing answer corresponding to the warehousing question.
[0020] In an embodiment, the first question group is formed by screening target questions from all known questions according to the first similarity, which includes:
[0021] sorting all known questions according to a first similarity between semantics of all known questions and the question semantic to obtain a first sorting result, wherein the higher the first similarity is, the higher the corresponding known question is ranked in the first sorting result;
[0022] determining N known questions in front as target questions from the first sorting result, wherein the N target questions form the first question group, and N is an integer greater than zero;
[0023] The second answer group is formed by screening target answers from all known answers according to the second similarity, which includes:
[0024] sorting all known answers according to a second similarity between semantics of all known answers and the answer semantic to obtain a second sorting result, wherein the higher the second similarity is, the higher the corresponding known answer is ranked in the second sorting result;
[0025] determining N known answers in front as target answers from the second sorting result.
[0026] In an embodiment, after comparing the first question group and the second question group and determining that the same question is a similar question, the method further includes:
[0027] detecting whether the number of similar questions is zero;
[0028] if it is detected that the number of similar questions is zero, writing the warehousing question and the warehousing answer into the target knowledge base; or
[0029] if it is detected that the number of similar questions is not zero, executing the step of feeding back the similar question to the user.
[0030] In an embodiment, the warehousing question and the warehousing answer are written into the target knowledge base according to the writing mode corresponding to the confirmation result, which includes:
[0031] if the confirmation result is a confirmation submission, determining that the writing mode corresponding to the confirmation result is direct writing, and writing the warehousing question and the warehousing answer into the target knowledge base; or
[0032] If the confirmation result is a confirmation of similarity, it is determined that the writing mode corresponding to the confirmation result is associated writing, and the storage question and the storage answer are associated written into the target knowledge base with the similar question.
[0033] In a second aspect, the embodiments of the present application provide a storage optimization method for a knowledge base management, and the storage optimization device comprises:
[0034] A semantic extraction module is configured to, when a user initiates a storage operation, acquire a storage question submitted by the user and a corresponding storage answer, and perform semantic extraction on the storage question and the storage answer respectively to obtain a question semantic corresponding to the storage question and an answer semantic corresponding to the storage answer.
[0035] A first similarity calculation module is configured to calculate a first similarity corresponding to a known question stored in a target knowledge base by performing similarity calculation on the question semantic and the semantic of the known question, and select a target question from all known questions according to the first similarity to form a first question group.
[0036] A second similarity calculation module is configured to calculate a second similarity corresponding to a known answer stored in the target knowledge base by performing similarity calculation on the storage answer and the semantic of the known answer, and select a target answer from all known answers according to the second similarity.
[0037] A similar question feedback module is configured to determine questions corresponding to all target answers to form a second question group, compare the first question group and the second question group, determine a similar question as a question that is the same, and feed back the similar question to the user.
[0038] A target knowledge base writing module is configured to acquire a confirmation result of the similar question submitted by the user, and write the storage question and the storage answer into the target knowledge base according to a writing mode corresponding to the confirmation result.
[0039] In an embodiment, the storage optimization device further comprises:
[0040] A question retrieval module is configured to, after acquiring the storage question submitted by the user and the corresponding storage answer, perform retrieval on the target knowledge base based on the storage question to obtain a retrieval result.
[0041] A retrieval result analysis module is configured to, if the retrieval result is a question that is not retrieved, perform the steps of acquiring the confirmation result of the similar question submitted by the user and writing the storage question and the storage answer into the target knowledge base according to a writing mode corresponding to the confirmation result.
[0042] In an embodiment, the storage optimization device further comprises:
[0043] The prompt feedback module is configured to, after searching the target knowledge base based on the input question and obtaining a search result, if the search result is a matched question, feeding back a preset prompt to the user, the preset prompt being used to prompt the user to prohibit writing the input question and the input answer.
[0044] In an embodiment, the semantic extraction module comprises:
[0045] The word segmentation unit is configured to perform word segmentation on the input question and the input answer respectively to obtain a first word segmentation result corresponding to the input question and a second word segmentation result corresponding to the input answer.
[0046] The question semantic extraction unit is configured to perform word vector coding on the first word segmentation result to obtain a first coding result, and determine that the first coding result is a question semantic corresponding to the input question.
[0047] The answer semantic extraction unit is configured to perform word vector coding on the second word segmentation result to obtain a second coding result, and determine that the second coding result is an answer semantic corresponding to the input answer.
[0048] In an embodiment, the first similarity calculation module comprises:
[0049] The first sorting unit is configured to sort all known questions according to a first similarity between the semantic of all known questions and the question semantic to obtain a first sorting result, wherein the higher the first similarity is, the higher the corresponding known question is ranked in the first sorting result.
[0050] The first question group forming unit is configured to determine N known questions at the front in the first sorting result as target questions, and form a first question group with the N target questions, N being an integer greater than zero.
[0051] The second similarity calculation module comprises:
[0052] The second sorting unit is configured to sort all known answers according to a second similarity between the semantic of all known answers and the answer semantic to obtain a second sorting result, wherein the higher the second similarity is, the higher the corresponding known answer is ranked in the second sorting result.
[0053] The second sorting unit is configured to sort all known answers according to a second similarity between the semantic of all known answers and the answer semantic to obtain a second sorting result, wherein the higher the second similarity is, the higher the corresponding known answer is ranked in the second sorting result.
[0054] In an embodiment, the input optimization device further comprises:
[0055] The detection module is used to detect whether the number of similar questions is zero after comparing the first question group and the second question group and determining that the same questions are similar questions.
[0056] The first decision module is used to write the input question and the input answer into the target knowledge base if the number of similar questions detected is zero; or
[0057] The second decision module is used to detect if the number of similar questions is not zero, and then execute the step of feeding back the similar questions to the user.
[0058] In one embodiment, the target knowledge base writing module includes:
[0059] The direct write unit is used to determine that the write method corresponding to the confirmation result is direct write if the confirmation result is a confirmation submission, and to write the input question and the input answer into the target knowledge base; or
[0060] The associated writing unit is used to determine that the writing method corresponding to the confirmation result is associated writing if the confirmation result is confirmed as similar, and to associate the input question and the input answer with the similar question and write them into the target knowledge base.
[0061] Thirdly, embodiments of this application provide a computer device, the computer device including a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the data entry optimization method as described in the first aspect.
[0062] Fourthly, embodiments of this application provide a computer-readable storage medium storing a computer program that, when executed by a processor, implements the database optimization method as described in the first aspect.
[0063] The beneficial effects of this application embodiment compared with the prior art are as follows: When a user initiates a database entry operation, this application obtains the database entry question submitted by the user and its corresponding database entry answer. Semantic extraction is performed on the database entry question and the database entry answer respectively to obtain the question semantics of the corresponding database entry question and the answer semantics of the corresponding database entry answer. The question semantics are then compared with the semantics of known questions stored in the target knowledge base to obtain a first similarity score for the corresponding known question. Based on the first similarity score, a target question is selected from all known questions to form a first question group. Finally, the semantics of the database entry answer are compared with the semantics of known answers stored in the target knowledge base to obtain the first similarity score for the corresponding known question. Given the second similarity of the known answers, the target answer is selected from all known answers based on this second similarity. The questions corresponding to all target answers are determined, forming a second question group. The first and second question groups are compared, and identical questions are identified as similar questions. The similar questions are then fed back to the user, and the user's confirmation of the similar questions is obtained. Based on the writing method corresponding to the confirmation result, the questions and answers are written into the target knowledge base. This achieves matching and detection between the questions and answers and the existing content in the knowledge base, forming effective decision results for user use. Thus, the knowledge base is entered into the database according to user needs, improving the standardization and efficiency of knowledge base management. Attached Figure Description
[0064] To more clearly illustrate the technical solutions in the embodiments of this application, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0065] Figure 1 This is a schematic diagram of an application environment for an optimized knowledge base management method provided in Embodiment 1 of this application.
[0066] Figure 2 This is a flowchart illustrating an optimized knowledge base management method for data entry, as provided in Embodiment 2 of this application.
[0067] Figure 3 This is a flowchart illustrating an optimized knowledge base management method for data entry, as provided in Embodiment 3 of this application.
[0068] Figure 4 This is a schematic diagram of the structure of an optimized knowledge base management method provided in Embodiment 4 of this application;
[0069] Figure 5 This is a schematic diagram of the structure of a computer device provided in Embodiment 5 of this application. Detailed Implementation
[0070] In the following description, specific details such as particular system architectures and techniques are set forth for illustrative purposes and not for limitation, in order to provide a thorough understanding of the embodiments of this application. However, those skilled in the art will understand that this application may also be implemented in other embodiments without these specific details. In other instances, detailed descriptions of well-known systems, apparatuses, circuits, and methods have been omitted so as not to obscure the description of this application with unnecessary detail.
[0071] It should be understood that, when used in this application specification and the appended claims, the term "comprising" indicates the presence of the described features, integrals, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components and / or a collection thereof.
[0072] It should also be understood that the term “and / or” as used in this application specification and the appended claims means any combination of one or more of the associated listed items and all possible combinations, and includes such combinations.
[0073] As used in this application specification and the appended claims, the term "if" may be interpreted, depending on the context, as "when," "once," "in response to determination," or "in response to detection." Similarly, the phrases "if determined" or "if detected [the described condition or event]" may be interpreted, depending on the context, as meaning "once determined," "in response to determination," "once detected [the described condition or event]," or "in response to detection [the described condition or event]."
[0074] Furthermore, in the description of this application and the appended claims, the terms "first," "second," "third," etc., are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.
[0075] References to "one embodiment" or "some embodiments" as described in this specification mean that one or more embodiments of this application include a specific feature, structure, or characteristic described in connection with that embodiment. Therefore, the phrases "in one embodiment," "in some embodiments," "in other embodiments," "in still other embodiments," etc., appearing in different parts of this specification do not necessarily refer to the same embodiment, but rather mean "one or more, but not all, embodiments," unless otherwise specifically emphasized. The terms "comprising," "including," "having," and variations thereof mean "including but not limited to," unless otherwise specifically emphasized.
[0076] The embodiments of this application can acquire and process relevant data based on artificial intelligence technology. Artificial intelligence (AI) refers to the theories, methods, technologies, and application systems that use digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, perceive the environment, acquire knowledge, and use that knowledge to obtain optimal results.
[0077] Foundational technologies for artificial intelligence generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing, operating / interactive systems, and mechatronics. AI software technologies mainly encompass computer vision, robotics, biometrics, speech processing, natural language processing, and machine learning / deep learning.
[0078] It should be understood that the sequence number of each step in the following embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.
[0079] To illustrate the technical solution of this application, specific embodiments are described below.
[0080] The knowledge base management ingestion optimization method provided in Embodiment 1 of this application can be applied to, for example, Figure 1 In this application environment, the client communicates with the server. Clients include, but are not limited to, handheld computers, desktop computers, laptops, ultra-mobile personal computers (UMPCs), netbooks, cloud computing devices, and personal digital assistants (PDAs). The server can be implemented using a standalone server or a server cluster consisting of multiple servers.
[0081] See Figure 2 This is a flowchart illustrating a knowledge base management ingestion optimization method provided in Embodiment 2 of this application. The aforementioned knowledge base management ingestion optimization method is applied to... Figure 1 The server-side component connects to the corresponding knowledge base via computer devices to send relevant data. These computer devices can also connect to corresponding clients, which are operated by users. Users can submit questions and answers to be added to the knowledge base through the client.
[0082] In this application, the developer manages the knowledge base, that is, the operation object for entering the knowledge base is the developer, the aforementioned client is operated by the developer, and the knowledge base is connected to the corresponding business system in the business or financial scenario, so as to provide a matching answer based on the customer's question in the intelligent question answering process of the business system.
[0083] like Figure 2 As shown, the knowledge base management ingestion optimization method may include the following steps:
[0084] Step S201: When a user initiates an entry operation, obtain the entry question submitted by the user and its corresponding entry answer, and perform semantic extraction on the entry question and entry answer respectively to obtain the question semantics of the corresponding entry question and the answer semantics of the corresponding entry answer.
[0085] In this application, the user initiates a database entry operation through a client. This operation refers to storing the data to be submitted into the database. The client connects to the server, meaning the client sends a database entry command to the server, and the server executes the database entry optimization method described in this application to store the data in the database. The database targeted in this application is a knowledge base, which is essentially a database storing questions and answers. The use case of the knowledge base is to provide corresponding answers based on questions. Therefore, the user initiates the database entry operation to enrich the knowledge content in the knowledge base, that is, to add questions and answers to the knowledge base.
[0086] After receiving the user's submitted question and its corresponding answer, the server performs semantic extraction on the question and answer to obtain the corresponding question semantics and answer semantics for use in subsequent matching.
[0087] Optionally, semantic extraction is performed on the input question and the input answer separately to obtain the question semantics of the corresponding input question and the answer semantics of the corresponding input answer, including:
[0088] The input question and input answer are segmented into words respectively to obtain the first segmentation result of the input question and the second segmentation result of the input answer.
[0089] The first word segmentation result is encoded with word vectors to obtain the first encoding result, and the first encoding result is determined to be the semantics of the corresponding question to be entered into the database.
[0090] The second word segmentation result is encoded using word vectors to obtain the second encoding result, which is then used to determine the semantic meaning of the corresponding answer to be entered into the database.
[0091] In processing Chinese text, word segmentation is required to convert sentences into word representations. This segmentation can be done using rule-based segmentation or matching-based segmentation. The segmented results are then encoded using word vectors, a process that extracts semantic meaning. This encoding can be performed using a pre-trained word vector encoder.
[0092] The rule-based word segmentation described above is a mechanical word segmentation method. It mainly works by maintaining a dictionary and matching each string of the sentence with a word in the dictionary one by one when segmenting a sentence. If a word is found, it is segmented; otherwise, it is not segmented.
[0093] The methods for segmenting based on matching mentioned above mainly include the Maximum Match Method (MM), the Reserve Maximum Match Method (RMM), and the Bidirectional Maximum Match Method. Method (BMM method), where MM method assumes that the longest word in the word segmentation dictionary has i Chinese characters. Then, the first i characters in the current string of the document being processed are used as the matching field. The dictionary is searched. If such an i-character word exists in the dictionary, the match is successful and the matching field is segmented as a word. If such an i-character word is not found in the dictionary, the match fails. The last character in the matching field is removed, and the matching process is repeated for the remaining characters. This process is repeated until a match is successful, that is, until a word is segmented or the length of the remaining string is zero. This completes one round of matching. Then, the next i-character string is matched and processed until the document is completely scanned. The basic principle of RMM method is the same as that of MM method. The difference is that the direction of word segmentation is opposite to that of MM method. BMM method compares the word segmentation result obtained by MM method with the result obtained by reverse maximum matching method. Then, according to the maximum matching principle, the result with the fewest word segments is selected as the result.
[0094] Step S202: Calculate the similarity between the semantics of the question and the semantics of known questions stored in the target knowledge base to obtain the first similarity of the corresponding known questions. Based on the first similarity, select the target questions from all known questions to form the first question group.
[0095] In this application, the target knowledge base is the knowledge base that the user wants to include. The semantics of all the questions (i.e. known questions) that have been included in the target knowledge base can be either the semantics that have already been stored in the target knowledge base, or the semantics can be extracted by pulling all the known questions to the server.
[0096] For two semantic entities, their similarity can be calculated to represent the distance between them. Specifically, cosine similarity, Euclidean distance, etc., can be used for similarity calculation, and target questions can be selected based on the similarity. For example, a similarity threshold can be set, and known questions with similarity values greater than this threshold can be considered target questions, forming the first question group. Alternatively, a top value can be set, and known questions with similarity values within the top value can be identified as target questions, resulting in the first question group.
[0097] Step S203: Calculate the semantic similarity between the input answer and the known answers stored in the target knowledge base to obtain the second similarity of the corresponding known answers. Based on the second similarity, select the target answer from all known answers.
[0098] In this application, the semantics of all answers (i.e. known answers) already stored in the target knowledge base can be either the semantics already stored in the target knowledge base, or the semantics can be extracted by pulling all known answers to the server.
[0099] Similar to the approach used for inputting answers into the database, the semantic similarity between the input answer and the known answers is calculated, and the target answer is selected based on the similarity.
[0100] Optionally, based on the first similarity, target questions are selected from all known questions to form the first question group, which includes:
[0101] Based on the semantic similarity of all known questions to the first similarity of the question's semantics, all known questions are sorted to obtain the first sorting result. The higher the first similarity, the higher the corresponding known question is ranked in the first sorting result.
[0102] From the first sorting result, determine the top N known problems as target problems, and form the first problem group with N target problems, where N is an integer greater than zero;
[0103] Based on the second similarity score, the target answer is obtained by filtering from all known answers, including:
[0104] Based on the semantic similarity of all known answers to the second similarity of the answer, all known answers are sorted to obtain a second sorting result. The higher the second similarity, the higher the corresponding known answer is ranked in the second sorting result.
[0105] From the second sorting results, determine the top N known answers as the target answers.
[0106] The known answers and known questions are sorted according to their similarity. The greater the similarity, the higher the ranking. From this, the top N known questions and N known answers are determined.
[0107] Step S204: Determine the questions corresponding to all target answers to form a second question group. Compare the first question group and the second question group to identify identical questions as similar questions and provide feedback on similar questions to the user.
[0108] In this application, each target answer in the target knowledge base corresponds to a specific question. These questions form a second question group, which is then compared with the first question group to identify identical questions. These identical questions are those similar to both the input question and the input answer. These similar questions can then be fed back to the user, allowing for further action based on the user's selection.
[0109] Optionally, after comparing the first and second problem groups and determining that identical problems are similar, the process may also include:
[0110] Check if the number of similar questions is zero;
[0111] If the number of similar questions detected is zero, then the question and its answer will be written into the target knowledge base; or
[0112] If the number of similar issues detected is not zero, then proceed with the step of reporting the similar issues to the user.
[0113] If the number of similar questions is zero, it means that there are no questions in the target knowledge base similar to the user-provided question and answer. Therefore, the question and answer can be added to the target knowledge base. If similar questions exist, feedback needs to be provided to the user.
[0114] Step S205: Obtain the user's confirmation result for similar questions, and write the questions and answers into the target knowledge base according to the writing method corresponding to the confirmation result.
[0115] In this application, after sending similar questions to the user, the user can analyze the similar questions and their own input questions and answers to the database, and can provide different writing methods, including but not limited to direct writing and associated writing. Direct writing means that no other processing is required; the input question and answer are simply written into the target knowledge base, and then associated with the input question and answer in the target knowledge base. Associated writing can refer to associating the input question and answer with other questions in the target knowledge base, treating them as appendages to those other questions.
[0116] Optionally, depending on the writing method corresponding to the confirmation result, the input question and input answer are written to the target knowledge base, including:
[0117] If the confirmation result is "Confirm Submission," then the writing method corresponding to the confirmation result is determined to be "Direct Write," and the input question and input answer are written to the target knowledge base; or
[0118] If the confirmation result is "similar", then the writing method corresponding to the confirmation result is determined to be "associative writing", which associates the input question and the input answer with similar questions and writes them into the target knowledge base.
[0119] In this process, after receiving feedback on similar questions, if a user confirms that the similar question is not similar to the submitted question and answer for inclusion in the database, they can click the "Confirm Submission" button generated in the client. This will directly write the question and answer into the target knowledge base. Alternatively, if a user confirms that the similar question is similar to the submitted question and answer, they can click the "Confirm Similarity" button generated in the client. The server will then write the question and answer into the target knowledge base and associate it with the similar question. In this case, the written question and answer are only displayed when the similar question is retrieved.
[0120] In this embodiment, when a user initiates a knowledge base entry operation, the system obtains the user-submitted knowledge base entry question and its corresponding answer. Semantic extraction is performed on both the question and answer to obtain the question semantics and the answer semantics. The question semantics are then compared with the semantics of known questions stored in the target knowledge base to obtain a first similarity score. Based on this first similarity score, target questions are selected from all known questions to form a first question group. The semantics of the answer are then compared with the semantics of known answers stored in the target knowledge base to obtain a second similarity score. Based on this second similarity score, target answers are selected from all known answers to determine the questions corresponding to all target answers, forming a second question group. The first and second question groups are compared, and identical questions are identified as similar questions. These similar questions are then fed back to the user, and the user's confirmation of the similar questions is obtained. Based on the writing method corresponding to the confirmation result, the knowledge base entry question and answer are written into the target knowledge base. This achieves matching detection between the knowledge base entry question and answer and existing content in the knowledge base, forming effective decision results for user use. This allows for knowledge base entry based on user needs, improving the standardization and efficiency of knowledge base management.
[0121] See Figure 3 This is a flowchart illustrating an optimized knowledge base management method for data entry, as provided in Embodiment 3 of this application. Figure 3 As shown, the knowledge base management ingestion optimization method may include the following steps:
[0122] Step S301: When a user initiates an entry operation, obtain the entry question submitted by the user and its corresponding entry answer, and perform semantic extraction on the entry question and entry answer respectively to obtain the question semantics of the corresponding entry question and the answer semantics of the corresponding entry answer.
[0123] Step S302: Calculate the similarity between the semantics of the question and the semantics of known questions stored in the target knowledge base to obtain the first similarity of the corresponding known questions. Based on the first similarity, select the target questions from all known questions to form the first question group.
[0124] Step S303: Calculate the semantic similarity between the input answer and the known answers stored in the target knowledge base to obtain the second similarity of the corresponding known answers. Based on the second similarity, select the target answer from all known answers.
[0125] Step S304: Determine the questions corresponding to all target answers to form a second question group. Compare the first question group and the second question group to identify identical questions as similar questions and provide feedback on similar questions to the user.
[0126] The contents of steps S301 to S304 are partially the same as those of steps S201 to S204 above. Please refer to the description of steps S201 to S205 for details. They will not be repeated here.
[0127] Step S305: Based on the input question, search the target knowledge base to obtain the search results.
[0128] In this application, upon receiving an input question, a search of the target knowledge base can be triggered, that is, the input question is sent to the target knowledge base to match the corresponding search results. The search results can include successful matching and unsuccessful matching. Successful matching means that there is a matching question, and unsuccessful matching means that there is no matching question.
[0129] The above retrieval process is the process of the target knowledge base in normal use, that is, for the questions removed by the user, matching the corresponding questions and providing the corresponding answers.
[0130] Step S306: If the search result is that no matching question was found, obtain the user's confirmation result for similar questions, and write the questions and answers into the target knowledge base according to the writing method corresponding to the confirmation result.
[0131] In this application, if no matching question is found, it means that the same question as the entered question was not found in the target knowledge base by means of retrieval, and the case of the same question can be ruled out.
[0132] Step S307: If the search result is a matching question, a preset prompt is sent to the user. The preset prompt is used to remind the user to prohibit writing questions and answers into the database.
[0133] In this application, if a question is matched, it means that the same question as the one to be added to the target knowledge base was found in the target knowledge base through a search. This means that the question does not need to be added to the target knowledge base; the corresponding question and answer can still be found during normal use. Therefore, the question and answer to be added to the target knowledge base are redundant and should not be stored there. Additionally, a corresponding prompt is generated to remind users who wish to add the question and answer to the target knowledge base.
[0134] In this embodiment, when a user initiates a database entry operation, the system obtains the user-submitted entry question and its corresponding entry answer. Semantic extraction is performed on both the entry question and the entry answer to obtain the question semantics and the answer semantics. The question semantics are then compared with the semantics of known questions stored in the target knowledge base to obtain a first similarity score. Based on this first similarity score, target questions are selected from all known questions to form a first question group. The semantics of the entry answer are then compared with the semantics of known answers stored in the target knowledge base to obtain a second similarity score. Based on this second similarity score, target answers are selected from all known answers to determine the questions corresponding to all target answers, forming a second question group. The system compares the first and second question groups to identify identical questions as similar questions. These similar questions are then fed back to the user. Based on the questions to be added to the database, the target knowledge base is searched to obtain search results. If no matching questions are found, the user's confirmation of the similarity is obtained. According to the writing method corresponding to the confirmation result, the questions and answers are written to the target knowledge base. If a matching question is found, a preset prompt is sent to the user, indicating that writing questions and answers to the database is prohibited. This multi-faceted matching detection of questions and answers with existing content in the knowledge base generates effective decision results for user use, thus improving the standardization and efficiency of knowledge base management by allowing users to add information according to their needs.
[0135] Corresponding to the knowledge base management ingestion optimization method in the above embodiment, Figure 4 This paper shows a structural block diagram of the knowledge base management ingestion optimization method provided in Embodiment 4 of this application. The ingestion optimization device is applied to... Figure 1 The server-side component connects to a corresponding knowledge base via a computer device to send relevant data to the knowledge base. This computer device can also connect to a corresponding client, which is operated by the user. The user can submit questions and answers to be added to the knowledge base through the client. For ease of explanation, only the parts relevant to the embodiments of this application are shown.
[0136] See Figure 4 The warehousing optimization device includes:
[0137] The semantic extraction module 41 is used to obtain the user's submitted entry question and its corresponding entry answer when the user initiates the entry operation, and to perform semantic extraction on the entry question and entry answer respectively to obtain the question semantics of the corresponding entry question and the answer semantics of the corresponding entry answer.
[0138] The first similarity calculation module 42 is used to calculate the similarity between the semantics of the question and the semantics of the known questions stored in the target knowledge base, to obtain the first similarity of the corresponding known questions, and to select the target questions from all known questions based on the first similarity to form the first question group;
[0139] The second similarity calculation module 43 is used to calculate the semantic similarity between the input answer and the known answers stored in the target knowledge base, obtain the second similarity of the corresponding known answer, and filter the target answer from all known answers based on the second similarity.
[0140] The similar question feedback module 44 is used to identify the questions corresponding to all target answers, form a second question group, compare the first question group and the second question group, identify the same questions as similar questions, and provide similar questions to the user.
[0141] The target knowledge base writing module 45 is used to obtain the user's confirmation results for similar questions, and write the questions and answers to the target knowledge base according to the writing method corresponding to the confirmation results.
[0142] Optionally, the warehousing optimization device also includes:
[0143] The question retrieval module is used to retrieve the questions submitted by users and their corresponding answers, and then search the target knowledge base based on the questions to obtain the retrieval results.
[0144] The search result analysis module is used to perform the following steps if no matching question is found: obtain the user's confirmation result for similar questions, and write the questions and answers into the target knowledge base according to the writing method corresponding to the confirmation result.
[0145] Optionally, the warehousing optimization device also includes:
[0146] The prompt feedback module is used to search the target knowledge base based on the input question. After obtaining the search results, if the search results show a matching question, it will provide the user with a preset prompt. The preset prompt is used to remind the user not to write input questions and answers into the database.
[0147] Optionally, the semantic extraction module 41 includes:
[0148] The word segmentation unit is used to segment the input question and the input answer into the database, respectively, to obtain the first word segmentation result of the input question and the second word segmentation result of the input answer.
[0149] The question semantic extraction unit is used to encode the first word segmentation result into word vectors to obtain the first encoding result and determine the first encoding result as the question semantics of the corresponding question to be entered into the database.
[0150] The answer semantic extraction unit is used to encode the second word segmentation result into word vectors, obtain the second encoding result, and determine the answer semantics of the corresponding input answer.
[0151] Optionally, the first similarity calculation module 42 includes:
[0152] The first sorting unit is used to sort all known questions according to the semantics of all known questions and the first similarity between the semantics of all known questions and the semantics of the questions, and obtain the first sorting result. The higher the first similarity, the higher the corresponding known question is ranked in the first sorting result.
[0153] The first problem group forming unit is used to determine the top N known problems as target problems from the first sorting result. The N target problems form the first problem group, where N is an integer greater than zero.
[0154] The second similarity calculation module 43 includes:
[0155] The second sorting unit is used to sort all known answers according to the semantic similarity between all known answers and the second similarity between the semantics of all known answers and the answer's semantics, and obtain the second sorting result. The higher the second similarity, the higher the corresponding known answer is ranked in the second sorting result.
[0156] From the second sorting results, determine the top N known answers as the target answers.
[0157] Optionally, the warehousing optimization device also includes:
[0158] The detection module is used to check whether the number of similar questions is zero after comparing the first question group and the second question group and determining that the same questions are similar questions.
[0159] The first decision module is used to write the input question and its answer into the target knowledge base if the number of similar questions detected is zero; or
[0160] The second decision module is used to execute the step of feeding back similar problems to the user if the number of similar problems detected is not zero.
[0161] Optionally, the target knowledge base writing module 45 includes:
[0162] The direct write unit is used to determine the write method corresponding to the confirmation result as direct write if the confirmation result is "confirmed submission," and to write the input question and input answer into the target knowledge base; or
[0163] The associated writing unit is used to determine the writing method corresponding to the confirmation result as associated writing if the confirmation result is confirmed as similar, and to associate the input question and the input answer with similar questions and write them into the target knowledge base.
[0164] It should be noted that the information interaction and execution process between the above modules are based on the same concept as the method embodiments of this application. For details on their specific functions and technical effects, please refer to the method embodiments section, and they will not be repeated here.
[0165] Figure 5 This is a schematic diagram of the structure of a computer device provided in Embodiment 5 of this application. Figure 5 As shown, the computer device of this embodiment includes: at least one processor ( Figure 5 Only one is shown in the diagram), a memory, and a computer program stored in the memory and executable on at least one processor. When the processor executes the computer program, it implements the steps in the embodiments of the ingestion optimization method for any of the above-described knowledge base management methods.
[0166] This computer device may include, but is not limited to, a processor and memory. Those skilled in the art will understand that... Figure 5 The examples of computer devices are merely examples and do not constitute a limitation on computer devices. Computer devices may include more or fewer components than shown, or combinations of certain components, or different components, such as network interfaces, displays, and input devices.
[0167] The processor referred to can be a CPU, but it can also be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor can be a microprocessor or any conventional processor.
[0168] Memory includes readable storage media, internal memory, etc., wherein internal memory can be the RAM of a computer device, providing an environment for the operation of the operating system and computer-readable instructions stored in the readable storage media. The readable storage media can be the hard drive of a computer device, or in other embodiments, it can be an external storage device of the computer device, such as a plug-in hard drive, Smart Media Card (SMC), Secure Digital (SD) card, or Flash Card. Furthermore, memory can include both internal storage units and external storage devices of a computer device. Memory is used to store the operating system, applications, bootloader, data, and other programs, such as program code for computer programs. Memory can also be used to temporarily store data that has been output or will be output.
[0169] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is used as an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit. Furthermore, the specific names of the functional units and modules are only for easy differentiation and are not intended to limit the scope of protection of this application. The specific working process of the units and modules in the above device can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here. If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the methods of the above embodiments of this application can be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the above method embodiments. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. A computer-readable medium can include at least: any entity or device capable of carrying computer program code, a recording medium, a computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signals, telecommunication signals, and software distribution media. Examples include USB flash drives, portable hard drives, magnetic disks, or optical disks. In some jurisdictions, according to legislation and patent practice, computer-readable media cannot be electrical carrier signals or telecommunication signals.
[0170] The implementation of all or part of the processes in the methods of the above embodiments can also be accomplished by a computer program product. When the computer program product is run on a computer device, it enables the computer device to execute the steps in the above method embodiments.
[0171] In the above embodiments, the descriptions of each embodiment have different focuses. For parts that are not described in detail or recorded in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0172] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0173] In the embodiments provided in this application, it should be understood that the disclosed apparatus / computer devices and methods can be implemented in other ways. For example, the apparatus / computer device embodiments described above are merely illustrative. For instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.
[0174] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0175] The above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application, and should all be included within the protection scope of this application.
Claims
1. A method for in-place optimization of knowledge base management, characterized by, The warehouse optimization method comprises: When a user initiates a warehouse operation, the warehouse question submitted by the user and the corresponding warehouse answer are obtained, and semantic extraction is performed on the warehouse question and the warehouse answer respectively to obtain question semantics corresponding to the warehouse question and answer semantics corresponding to the warehouse answer; Similarity calculation is performed on the question semantics and the semantics of known questions stored in the target knowledge base to obtain a first similarity corresponding to the known questions, and target questions are selected from all known questions according to the first similarity to form a first question group; Similarity calculation is performed on the warehouse answer and the semantics of known answers stored in the target knowledge base to obtain a second similarity corresponding to the known answers, and target answers are selected from all known answers according to the second similarity; Questions corresponding to all target answers are determined to form a second question group, the first question group and the second question group are compared, the same questions are determined as similar questions, and the similar questions are fed back to the user; The confirmation result of the user on the similar questions is obtained, and the warehouse question and the warehouse answer are written into the target knowledge base according to the writing mode corresponding to the confirmation result.
2. The method of claim 1, wherein, After obtaining the warehouse question submitted by the user and the corresponding warehouse answer, the following steps are further included: Based on the warehouse question, the target knowledge base is searched to obtain a search result; If the search result is no matching question searched, the steps of obtaining the confirmation result of the user on the similar questions and writing the warehouse question and the warehouse answer into the target knowledge base according to the writing mode corresponding to the confirmation result are performed.
3. The method of claim 2, wherein, After searching the target knowledge base based on the warehouse question to obtain a search result, the following steps are further included: If the search result is a matching question searched, a preset prompt is fed back to the user, and the preset prompt is used to prompt the user to prohibit writing the warehouse question and the warehouse answer.
4. The put optimization method of claim 1, wherein, The semantic extraction on the warehouse question and the warehouse answer respectively to obtain question semantics corresponding to the warehouse question and answer semantics corresponding to the warehouse answer comprises: The warehouse question and the warehouse answer are respectively subjected to word segmentation to obtain a first word segmentation result corresponding to the warehouse question and a second word segmentation result corresponding to the warehouse answer; The first word segmentation result is subjected to word vector coding to obtain a first coding result, and the first coding result is determined as question semantics corresponding to the warehouse question; The second word segmentation result is subjected to word vector coding to obtain a second coding result, and the second coding result is determined as answer semantics corresponding to the warehouse answer.
5. The method of claim 1, wherein, According to the first similarity, target questions are selected from all known questions to form a first question group, which comprises: All known questions are sorted according to the first similarity of the semantics of all known questions and the question semantics to obtain a first sorting result, wherein the higher the first similarity is, the higher the corresponding known question is sorted in the first sorting result; determine top N known problems in the first ranking result as target problems, the N target problems form a first question group, and N is an integer greater than zero; the filtering of the target answer from all known answers according to the second similarity degree comprises: ranking all known answers according to a second similarity degree between semantics of all known answers and the answer semantics, to obtain a second ranking result, wherein the higher the second similarity degree is, the higher the corresponding known answer is ranked in the second ranking result; determine top N known answers in the second ranking result as target answers.
6. The method of claim any one of claims 1 to 5, wherein, after comparing the first question group and the second question group and determining the same question as a similar question, further comprising: detecting whether the number of similar questions is zero; if it is detected that the number of similar questions is zero, writing the storage question and the storage answer into the target knowledge base; or if it is detected that the number of similar questions is not zero, executing the step of feeding back the similar question to the user.
7. The method of claim 6, wherein, writing the storage question and the storage answer into the target knowledge base according to the corresponding writing mode of the confirmation result comprises: if the confirmation result is confirmation submission, determining that the corresponding writing mode of the confirmation result is direct writing, and writing the storage question and the storage answer into the target knowledge base; or if the confirmation result is confirmation similarity, determining that the corresponding writing mode of the confirmation result is associated writing, and writing the storage question and the storage answer into the target knowledge base in association with the similar question.
8. A knowledge base management in-place optimization apparatus, characterized by, The storage optimization device comprises: a semantic extraction module configured to, when a user initiates a storage operation, acquire a storage question submitted by the user and a corresponding storage answer, and perform semantic extraction on the storage question and the storage answer respectively, to obtain a question semantics corresponding to the storage question and an answer semantics corresponding to the storage answer; a first similarity degree calculation module configured to perform similarity degree calculation on the question semantics and semantics of known questions stored in a target knowledge base, to obtain a first similarity degree corresponding to the known questions, and filter target questions from all known questions according to the first similarity degree, to form a first question group; a second similarity degree calculation module configured to perform similarity degree calculation on the storage answer and semantics of known answers stored in the target knowledge base, to obtain a second similarity degree corresponding to the known answers, and filter target answers from all known answers according to the second similarity degree; a similar question feedback module configured to determine questions corresponding to all target answers, to form a second question group, compare the first question group and the second question group, determine the same question as a similar question, and feed back the similar question to the user; a target knowledge base writing module configured to acquire a confirmation result of the similar question submitted by the user, and write the storage question and the storage answer into the target knowledge base according to a corresponding writing mode of the confirmation result.
9. A computer device, comprising: The computer device comprises a processor, a memory, and a computer program stored in the memory and executable on the processor, and the processor implements the warehouse-in optimization method according to any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium storing a computer program, the computer program comprising instructions that, when executed by a computer, cause the computer to perform the method of any one of claims 1 to 9. The computer program is executable on the processor to implement the warehouse-in optimization method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Long text answer selection method based on transfer learning sentence vector
CN111259127A
Intelligent question-answering system construction method and question-answering processing method and device
CN114860913A