Knowledge question answering processing method, device, equipment and storage medium
By analyzing the data sources of statements in the FAQ Q&A system and matching the unified language model, the problem of inefficient answering questions in the FAQ system is solved, and full coverage of unconventional questions and answers is achieved, and the efficiency of knowledge Q&A processing is improved.
Patent Information
- Application Number
- CN202110565939.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-05-24
- Publication Date
- 2024-12-31
- Estimated Expiration
- 2041-05-24
AI Technical Summary
The accuracy of answers to extremely obvious questions in the existing FAQ Q&A system is low, which makes it difficult to cover all Q&A processing efficiency of knowledge Q&A.
By obtaining the pending statement information, analyzing its data sources, and matching the trained unified language model, the model is trained based on the statement information from different data sources and is used to generate question-and-answer information to achieve full coverage of unconventional question-and-answer questions and answers.
It greatly reduces the manpower and material resources for Q&A sentence recognition, improves the efficiency of knowledge Q&A processing, and achieves full coverage of Q&A questions and answers for unconventional sentences.
Smart Images

Figure CN113254612B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of language processing technology, and in particular to a knowledge question and answer processing method, device, equipment and storage medium. Background Art
[0002] With the rapid development of natural language technology, intelligent Frequently Asked Questions (FAQ) have gradually become intelligent, and more and more companies are using FAQ systems to solve various problems of online users unmanned. For the answers to common questions in FAQ systems, which are questions frequently asked by users, such questions have generally been fully and accurately answered through big data processing, machine learning and other methods. However, for uncommon questions in FAQ systems, the accuracy of answers is still relatively low.
[0003] At present, the existing recognition of such non-frequent question and answer sentences is generally done by collecting question and answer sentences and feeding them back to the system background for manual writing. However, due to the large number of such questions, a lot of human resources are consumed, and manual writing is difficult to cover all questions and answers, which affects the efficiency of processing knowledge questions and answers. Summary of the invention
[0004] In view of this, the present invention provides a knowledge question and answer processing method, device, equipment and storage medium, the main purpose of which is to solve the problem of low efficiency in the existing processing of unconventional knowledge questions and answers.
[0005] According to one aspect of the present invention, a knowledge question answering processing method is provided, comprising:
[0006] Acquire first category sentence information to be processed for knowledge question answering, and analyze the data source of the first category sentence information;
[0007] A unified language model trained according to the parsed data source matching, wherein the unified language model is trained according to second category sentence information in different data sources, and the second category sentence information has a replacement relationship with the first category sentence information;
[0008] Question and answer processing is performed on the first category sentence information according to the matched unified language model to generate question and answer information of the first category sentence information.
[0009] According to another aspect of the present invention, a knowledge question and answer processing device is provided, comprising:
[0010] An acquisition module, used to acquire first category sentence information to be processed for knowledge question answering, and analyze the data source of the first category sentence information;
[0011] A matching module, used for matching a trained unified language model according to the parsed data source, wherein the unified language model is trained according to the second category sentence information in different data sources, and the second category sentence information has a replacement relationship with the first category sentence information;
[0012] A processing module is used to perform question-answering processing on the first category sentence information according to the matched unified language model to generate question-answering information of the first category sentence information.
[0013] According to another aspect of the present invention, a storage medium is provided, wherein at least one executable instruction is stored in the storage medium, and the executable instruction enables a processor to perform operations corresponding to the above-mentioned knowledge question and answer processing method.
[0014] According to another aspect of the present invention, there is provided a computer device, comprising: a processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface communicate with each other via the communication bus;
[0015] The memory is used to store at least one executable instruction, and the executable instruction enables the processor to execute operations corresponding to the above-mentioned knowledge question and answer processing method.
[0016] By means of the above technical solution, the technical solution provided by the embodiment of the present invention has at least the following advantages:
[0017] The present invention provides a method, device, equipment and storage medium for processing knowledge questions and answers. Compared with the prior art, the embodiments of the present invention obtain first-category sentence information to be processed for knowledge questions and answers, and parse the data source of the first-category sentence information; match a trained unified language model according to the parsed data source, wherein the unified language model is trained according to second-category sentence information in different data sources, and the second-category sentence information has a replacement relationship with the first-category sentence information; perform question-and-answer processing on the first-category sentence information according to the matched unified language model, generate question-and-answer information of the first-category sentence information, achieve full coverage of question-and-answer for unconventional sentence information, greatly reduce the manpower and material resources for question-and-answer sentence recognition, and thus improve the processing efficiency of knowledge questions and answers.
[0018] The above description is only an overview of the technical solution of the present invention. In order to more clearly understand the technical means of the present invention, it can be implemented according to the contents of the specification. In order to make the above and other purposes, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are listed below. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] Various other advantages and benefits will become apparent to those of ordinary skill in the art by reading the detailed description of the preferred embodiments below. The accompanying drawings are only for the purpose of illustrating the preferred embodiments and are not to be considered as limiting the present invention. Moreover, the same reference symbols are used throughout the accompanying drawings to represent the same components. In the accompanying drawings:
[0020] Figure 1 A flow chart of a knowledge question answering processing method provided by an embodiment of the present invention is shown;
[0021] Figure 2 A schematic diagram of a UNILM model network construction provided by an embodiment of the present invention is shown;
[0022] Figure 3 A block diagram showing the composition of a knowledge question and answer processing device provided by an embodiment of the present invention is shown;
[0023] Figure 4 A schematic structural diagram of a computer device provided by an embodiment of the present invention is shown. DETAILED DESCRIPTION
[0024] The exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided to enable a more thorough understanding of the present disclosure and to fully convey the scope of the present disclosure to those skilled in the art.
[0025] The embodiment of the present invention provides a knowledge question answering method, such as Figure 1 As shown, the method includes:
[0026] 101. Obtain first category sentence information to be processed for knowledge question answering, and analyze the data source of the first category sentence information.
[0027] In the embodiment of the present invention, the first category of sentence information to be subjected to knowledge question and answer is a sentence that has been subjected to a conventional question and answer recognition, that is, the first category of sentence information is a sentence information for which question and answer information has not been found in the preset question and answer library, and the second category of sentence information is a sentence information for which question and answer information has been found in the preset question and answer library. The preset question and answer library stores a large amount of question and answer information corresponding to different sentence information obtained by calculation based on the unified language model that has been trained. Specifically, the first category of sentence information is a question and answer sentence that is not recognized relative to the conventional question and answer sentence that can recognize (question, answer) pairs. As an unconventional question and answer sentence, the question and answer information can be directly recognized based on the established knowledge question and answer library. Therefore, the unconventional question and answer sentence is the first category of sentence information, and the conventional question and answer sentence is the second category of sentence information. Among them, the data source is used to characterize the data storage source of the first category of sentence information to be identified, including but not limited to the question and answer knowledge base, the knowledge graph library, the product list database, and the product terms database. The specific parsing method can be judged based on the storage path of the first category of sentence information, etc., and the embodiment of the present invention does not make specific limitations.
[0028] It should be noted that the knowledge question and answer in the embodiment of the present invention can be applied to product trading applications, and can also be applied to application scenarios with different needs such as web page question and answer. As long as the sentences cannot be recognized based on common sense knowledge question and answer, the knowledge question and answer processing in the embodiment of the present invention can be performed. Among them, conventional question and answer sentences are a large number of question and answer sentences that have obtained corresponding (question, answer) pairs based on big data analysis, and unconventional question and answer sentences are a large number of question and answer sentences that have not been accurately processed. Generally, conventional question and answer sentences and unconventional question and answer sentences are consulting questions generated by users' habitual questions about different businesses and products, and the embodiment of the present invention does not make specific limitations.
[0029] 102. Complete the training of a unified language model based on matching of the parsed data sources.
[0030] In view of the fact that different data sources correspond to different data storage structures, in an embodiment of the present invention, a corresponding unified language model is trained according to a training sample set in different data sources, wherein the unified language model is obtained by training according to the second category sentence information in different data sources, indicating that different data sources correspond to different unified language models. Therefore, according to the specific data source analyzed, the corresponding unified language model can be directly matched. In addition, the second category sentence information is a conventional question and answer sentence, so as to realize a replacement model for question and answer recognition of unconventional question and answer sentences based on a unified language model that has been trained based on conventional question and answer sentences. Specifically, the second category sentence information has a replacement relationship with the first category sentence information, and the replacement relationship is used to characterize the relationship between the first category sentence information as an input parameter of the unified language model and the second sentence information, that is, the first category sentence information is processed as an input parameter of the unified language model corresponding to the second category sentence information to obtain the question and answer information of the first category sentence information.
[0031] It should be noted that since the first category of sentence information to be processed for knowledge question and answering may have been stored in different data source databases, or may be expected to be stored in corresponding different data source databases, when parsing the data source, it can be identified based on the already stored path or the expected stored path, and the embodiment of the present invention does not make specific limitations.
[0032] 103. Perform question-answering processing on the first category sentence information according to the matched unified language model to generate question-answering information of the first category sentence information.
[0033] In an embodiment of the present invention, when a data source based on first-category sentence information is matched to a unified language model, model processing is performed based on the first-category sentences as input parameters of the unified language model, thereby obtaining question and answer information corresponding to the first-category sentence information, and by using the trained unified language model corresponding to the second-category sentence information as a processing and recognition model for the first-category sentence information, the knowledge question and answer database is expanded, which greatly improves the coverage of answers to unconventional questions and answers and saves a lot of manpower and material resources.
[0034] It should be noted that the question and answer sentences in the embodiments of the present invention are sentence information containing questions and answers that need to be identified. Therefore, based on the unified language model, the question and answer information that can be obtained includes the (question, answer) pairs corresponding to the sentence information.
[0035] In one embodiment of the present invention, in order to achieve the coverage of answers to unconventional questions and answers based on a conventional question and answer library, the data sources include a question and answer knowledge base, a knowledge graph library, a product list database, and a product terms database. Before the unified language model that has been trained is matched according to the parsed data sources, the method also includes: respectively obtaining a second category sentence information training sample set from the question and answer knowledge base, the knowledge graph library, the product list database, and the product terms database; using the second category sentence information training sample set to train the unified language model that has completed the language network construction, and obtain a unified language model that is respectively applicable to the question and answer knowledge base, the knowledge graph library, the product list database, and the product terms database and has completed the training; and establishing a replacement link between the input parameters of the unified language model and the first category sentence information.
[0036] Specifically, in combination with the embodiments of the present invention, the data sources include at least a question-and-answer knowledge base, a knowledge graph database, a product list database, and a product terms database. In order to allow the first category sentence information to be directly replaced with the input parameters of the unified language model that has been trained corresponding to the second category sentence information, it is necessary to pre-train the unified language model. Among them, the question-and-answer knowledge base, the knowledge graph database, the product list database, and the product terms database respectively store training sample sets that match the second category sentence information, that is, the second category sentence information training sample sets. When performing model training, corresponding training samples are obtained for different data sources. Then, the unified language model (UNI□ed pre-trained Language Model, UNILM) is trained using the second category sentence information training sample sets from different data sources. First, a language network is constructed, such as Figure 2 As shown, the training sample set is then used for model training. After the training is completed, in order to facilitate the replacement of the first category sentence information as an input parameter, a replacement link between the input parameter of the unified language model and the first category sentence information is established, so that when the first category sentence information is recognized, the model trained in different data sources is directly used for processing.
[0037] It should be noted that the training process of the UNILM model includes: 1. Define the model function loss function, such as cross entropy; 2. Update the model parameters by gradient descent on the loss function; 3. When the loss function is less than the threshold, the model training is completed. Among them, the structure of the model function includes: from bottom to top through the embedding layer -> transmission layer -> output layer, the final model output is obtained. All inputs are in the form of text sentences. The text is segmented and converted into temporary identification tokens of word vectors (each token corresponds to a word or punctuation mark). Then, the embedding layer maps the token to a vector, which is calculated through the transmission layer. Finally, the output layer calculates the output text (question, answer) pair (each token of the output text answer pair is the token with the largest probability value). In addition, the model input parameter X is a string of text sequences, which can be a text fragment or a pair of text fragments. During the training process, the main network structure consists of 24 layers of Transformers. The input vector {xi} is converted into H0 = [x1,...,x|x|] and transmitted to this 24-layer Transformer network for model training.
[0038] In addition, for the embodiment of the present invention, since the output question and answer information is in the form of (question, answer) pairs, when training the UNILM model, the output format is pre-set to be in the form of (question, answer) pairs, so that no matter whether the input parameter is a single word, a single sentence or a text paragraph, the obtained question and answer information is in the form of (question, answer) pairs, so as to improve the recognition coverage of the question and answer information.
[0039] In one embodiment of the present invention, in order to further limit and illustrate, so as to realize that the first category sentence information from different data sources can be applicable to the corresponding unified language model that has been trained, thereby achieving a wide coverage effect of unconventional knowledge question and answer recognition, the question and answer processing of the first category sentence information according to the matched unified language model includes: if the data source is a question and answer knowledge base, then according to the replacement link, the first category sentence information is used as an input parameter of the unified language model for model operation processing; if the data source is a knowledge graph library, the first category sentence information is split according to the triple form of the knowledge graph, and according to the replacement link, the first category sentence information is split according to the triple form of the knowledge graph, and The link uses the split sentence subject and sentence predicate as input parameters of the unified language model for model operation processing; if the data source is a product list database, the list structured data of the first category of sentences is extracted from the product list database, and the extracted list structured data is used as the input parameter of the unified language model for model operation processing according to the replacement link; if the data source is a product term database, the clause structured data of the first category of sentences is extracted from the product term database, and the extracted clause structured data is used as the input parameter of the unified language model for model operation processing according to the replacement link.
[0040] In an embodiment of the present invention, for a specific question-and-answer knowledge base, such as an FAQ question-and-answer knowledge base, if the data source is the question-and-answer knowledge base, the first category of sentence information is used as an input parameter of the unified language model for question-and-answer processing according to the replacement link. Specifically, since the FAQ question-and-answer knowledge base is a database obtained by developers who have completed the knowledge question-and-answer recognition processing of conventional question-and-answer statements, and stores a large number of entity names, questions, and corresponding output (question, answer) pairs as input question-and-answer knowledge bases, therefore, when performing recognition processing, the first category of sentence information is used as an input parameter of the unified language model trained with the training sample set of the second category of sentence information according to the replacement link, and transport processing is performed to obtain question-and-answer information. For example, the UNILM model is trained using the sentence content such as "Xinsheng's insurance features" in the training sample set of the second category of sentence information. After the data source of the first category of sentence information is determined to be the FAQ question-and-answer knowledge base, the first category of sentence information is replaced with "What is the selling point of Jinrui Life" as the input parameter of the UNILM model for operation processing to obtain question-and-answer information. It should be noted that most of the sentence information stored in the FAQ knowledge base is applicable to common problems in application scenarios such as insurance products and the selection of insurance products, for example, how to settle claims for **products? What are the characteristics of **products?, etc., so that after replacing the relevant inputs, (question, answer) pairs that meet the requirements of claims settlement, characteristics, etc. are obtained, which improves the coverage efficiency of question and answer.
[0041] In an embodiment of the present invention, if the data source is a knowledge graph library, that is, for a specific knowledge graph library, since in the knowledge graph library, the data is stored in the format of (S, P, O) triples, where S represents the subject, P represents the predicate, and O represents the object, for example: "The waiting period for Ping An Fu is 90 days" is stored in the format of (Ping An Fu, waiting period, 90 days) in the knowledge graph library. Therefore, when training the UNILM model, the training is completed in the form of triples as input samples. Correspondingly, the first category of sentence information is split according to the triple form of the knowledge graph, and the split sentence subject and sentence predicate are used as input parameters of the unified language model for question and answer processing according to the replacement link. Specifically, the first category sentence information is split in the triple form storage structure of the knowledge graph, the split subject is the entity, the predicate is the attribute, and then the split entity and attribute are used as input parameters of the UNILM model for operation, thereby completing the question and answer recognition of the first category sentence information. It should be noted that most of the sentence information stored in the knowledge graph library is suitable for questions and answers about existing products and recognition of existing triple question and answer, including but not limited to product information and insurance questions, for example, the recognition of (question, answer) pairs such as the grace period of Ping An Fu.
[0042] In an embodiment of the present invention, if the data source is a product list database, that is, for a specific product list database, since the data stored in the product list database is a list in PDF format and the stored statements are all structured, the list structured data of the first category of statements is extracted from the product list database, and the extracted list structured data is used as the input parameter of the unified language model for question and answer processing according to the replacement link. Specifically, the structured data in the PDF list is extracted based on the pipeline technology, that is, the table content is converted into structured sentence content. After the data is structured, the obtained list structured data is used as the input parameter of the UNILM model for operation, thereby completing the question and answer recognition of the first category of sentence information. Among them, since the trained UNILM model is trained after the structured data is extracted based on the second category of sentence information, the purpose of replacing the first category of sentence information can be achieved. When replacing, it is necessary to traverse the first column of the list of structured data, that is, the header, as an input parameter, and the table content is the output obtained by the pre-model under the corresponding conditions.
[0043] It should be noted that, since the table content and header in the list structured data may be one sentence or multiple sentences (text paragraphs), in order to extract the entities and intentions as model input parameters, the first category of sentence information is processed based on the semantic dependency analyzer. For example, as the first category of user question and answer sentence information is "How much does it cost for a 16-year-old boy to buy a safe life", "safe life" is extracted as an entity based on the entity extraction module in the semantic dependency analyzer, and the intention of "premium consultation" is obtained. The semantic dependency analyzer can further parse out the two constraints of "16 years old" and "boys". Therefore, the entity and intention are used as model input parameters, and the output parameters are determined in combination with the two constraints, namely "144 yuan for insurance until 80 years old, 160 yuan for insurance until 100 years old".
[0044] In an embodiment of the present invention, if the data source is a product terms database, that is, for a specific product terms database, since the data stored in the product terms database is in PDF format and the stored statements are all structured, the clause structured data of the first category of statements are extracted from the product terms database, and the extracted clause structured data is used as the input parameter of the unified language model for question and answer processing according to the replacement link. Specifically, the structured data in the product terms data PDF file is extracted based on the pipeline technology, that is, the clause content is converted into structured sentence content. After the data is structured, the obtained clause structured data is used as the input parameter of the UNILM model for operation, thereby completing the question and answer recognition of the first category of sentence information. Among them, since the trained UNILM model is trained after the structured data is extracted based on the second category of sentence information, the purpose of replacing the first category of sentence information can be achieved. When replacing based on the replacement link, it is necessary to traverse the text of each paragraph of the structured data, and combine the recognized intention as the input parameter of the model training for model operation, thereby completing the question and answer recognition of the first category of sentence information. In addition, the first category of sentence information is product terms data, and combined with the characteristics of the data content in the product terms data being large paragraph text content, after completing the structural processing of the product terms data, the content achieved based on the model operation is to extract and generate answers from the paragraph text according to the recognized intention. For example, the large paragraph text content in the product terms is "After we receive the above-mentioned relevant certification materials in the insurance payment application...,...refers to the value of the insurance policy...From the day after you sign this main insurance contract, there is a 20-day cooling-off period...", after structural processing, the formatted text content such as "the loan amount shall not exceed...", "the maximum loan term for each loan shall not exceed 6 months", "the cooling-off period is 20 days" is obtained, and then used as the model input for model operation to obtain question and answer information.
[0045] In one embodiment of the present invention, for further limitation and explanation, the data source of parsing the first category statement information includes: obtaining the storage path of the first category statement information, and parsing the storage location in the storage path; matching a database corresponding to at least one data source based on the storage location to determine the data source of the first category.
[0046] In the embodiment of the present invention, since different data sources are data sources stored in different data forms, when parsing the data source, the storage path of the first category statement information is obtained, and the storage path represents the system path corresponding to the database where the data of the first category statement information can be stored, or the database to be stored. Specifically, the storage location of the storage path is parsed, that is, the character string, code identifier, etc. belonging to the storage location in the storage path is filtered, so as to determine the data source according to the storage location.
[0047] In addition, since different data sources include at least one of the question and answer knowledge base, knowledge graph library, product list database, and product terms database, one data can be stored in both the question and answer knowledge base and the knowledge graph library, that is, there can be multiple storage paths. Therefore, in the process of parsing the data source, if multiple data sources are parsed based on the storage path, such as the question and answer knowledge base, knowledge graph library, product list database, and product terms database all store this statement information, the data source is determined according to the pre-set priority of question and answer knowledge base > knowledge graph library > product list database > product terms database.
[0048] In one embodiment of the present invention, in order to effectively cover all question and answer statements and improve the efficiency of answering knowledge questions and answers, before obtaining the first category of sentence information to be processed for knowledge questions and answers, the method also includes: collecting at least one sentence information requesting a knowledge question and answer; searching from the question and answer library corresponding to the second category of sentence information whether there is question and answer information for the sentence information; if not, determining that the sentence information is the first category sentence information and performing knowledge question and answer processing; if so, determining that the found question and answer information is the question and answer information of the sentence.
[0049] In the embodiment of the present invention, a conventional question and answer sentence is a (question, answer) pair that has obtained a standard answer after a large amount of data processing and sentence recognition. Therefore, when a user requests a knowledge question and answer, first determine whether it is a conventional question and answer sentence, that is, collect at least one sentence information of the requested knowledge question and answer, and this sentence information represents the template question and answer sentence entered or selected by the user. Then, find out whether there is question and answer information with matching sentence information from the question and answer library established by the second category sentence information. If so, it means that this sentence information is a conventional question and answer sentence. If not, it means that this sentence is an unconventional question and answer sentence, and then determine this sentence information as the first category sentence information to perform the recognition method in steps 101 to 103.
[0050] In one embodiment of the present invention, for further limitation and explanation, the step of searching the question and answer library corresponding to the second category statement information for question and answer information of the first category statement information includes: extracting semantic words from the first category statement and the second category statement respectively, and calculating the similarity between the semantic words; and judging whether the question and answer information of the second category statement information is applicable to the knowledge question and answer of the first category statement information according to the similarity.
[0051] Since the second category of sentence information is a regular question-and-answer sentence, the corresponding question-and-answer database stores (question, answer) pairs that match the regular question-and-answer sentence. Therefore, the specific method for searching the (question, answer) pairs corresponding to the first category of sentence information in the question-and-answer database can be based on similarity. Specifically, the semantic words corresponding to the first category of sentence information and the second category of sentence information can be parsed based on natural language processing technology, including subject words, predicate words, object words, etc., and then the similarity between the semantic words is calculated, that is, the similarity between the subject words in the first category of sentence information and the subject words in the second category of sentence information, the similarity between the predicate words in the first category of sentence information and the object words in the second category of sentence information, and the similarity between the object words in the first category of sentence information and the object words in the second category of sentence information. Based on the three calculated similarities, it is determined whether the question and answer information of the second category sentence information is applicable to the knowledge question and answer of the first category sentence information, that is, a similarity threshold is preset according to the similarity of the meanings of the words. If any two of the three similarities exceed this similarity threshold, it is determined that the question and answer information of the second category sentence information is applicable to the knowledge question and answer of the first category sentence information. The question and answer information corresponding to the second category sentence information determined by the similarity matching in the question and answer library can be used as the question and answer information of the first category sentence information to complete the identification.
[0052] In one embodiment of the present invention, in order to optimize the unified language model to improve the recognition accuracy of knowledge question and answer sentences, the method also includes: receiving a question and answer feedback result obtained based on outputting the question and answer information, the question and answer feedback result is used to characterize the satisfaction level of the answer to the question and answer information; determining to convert the first category sentence information into the second category sentence information based on the question and answer feedback result, and determining to update the question and answer information to the second category sentence information training sample set to perform model updating.
[0053] Specifically, after the recognition of the first category of sentence information is completed based on the unified language model, the obtained question and answer information is fed back to the user. The user determines whether it is the answer he wants based on the question and answer information. If it is the answer obtained by the user, the question and answer feedback result fed back by the user is information indicating the degree of satisfaction, such as satisfaction, dissatisfaction, acceptable, unacceptable, etc., that is, the question and answer feedback result is used to characterize the satisfaction degree of the answer to the question and answer information. After the current execution end receives the question and answer feedback result, it determines whether to convert the first category of sentence information into the second category of sentence information according to the question and answer feedback result. For example, when the question and answer feedback result is satisfied, it means that the question and answer information identified by the first category of sentence information is correct, and the first category of sentence information of unconventional questions and answers can be converted into the second category of sentence information of conventional questions and answers. In addition, in order to improve the training efficiency of the model, since the question and answer information is the corresponding answer of the first category of sentence information, the question and answer information is updated to the second category of sentence information training sample set at the same time of conversion, so that when the model is trained again, it is based on the updated training set, thereby improving the model training efficiency.
[0054] An embodiment of the present invention provides a method for processing knowledge questions and answers. Compared with the prior art, the embodiment of the present invention obtains first-category sentence information to be processed for knowledge questions and answers, and parses the data source of the first-category sentence information; matches a trained unified language model according to the parsed data source, wherein the unified language model is trained according to second-category sentence information in different data sources, and the second-category sentence information has a replacement relationship with the first-category sentence information; performs question-and-answer processing on the first-category sentence information according to the matched unified language model, and generates question-and-answer information of the first-category sentence information, thereby achieving the purpose of full coverage of question-and-answer for unconventional sentence information, greatly reducing the manpower and material resources for question-and-answer sentence recognition, and thus improving the processing efficiency of knowledge questions and answers.
[0055] Furthermore, as a response to the above Figure 1 The implementation of the method shown in the figure, the embodiment of the present invention provides a knowledge question answering processing device, such as Figure 3 As shown, the device comprises:
[0056] An acquisition module 21 is used to acquire the first category of sentence information to be processed for knowledge question answering, and analyze the data source of the first category of sentence information;
[0057] A matching module 22, configured to match a trained unified language model according to the parsed data source, wherein the unified language model is trained according to the second category sentence information in different data sources, and the second category sentence information has a replacement relationship with the first category sentence information;
[0058] The processing module 23 is used to perform question-answering processing on the first category sentence information according to the matched unified language model to generate question-answering information of the first category sentence information.
[0059] Furthermore, the first category of sentence information is sentence information for which question and answer information has not been found in the preset question and answer library, and the second category of sentence information is sentence information for which question and answer information has been found in the preset question and answer library. The data source includes a question and answer knowledge base, a knowledge graph library, a product list database, and a product terms database. The device also includes: a training module, an establishment module,
[0060] The acquisition module is further used to respectively acquire a training sample set of second category sentence information from the question-answer knowledge base, the knowledge graph database, the product list database, and the product terms database;
[0061] The training module is used to train the unified language model that has completed the language network construction using the second category sentence information training sample set, to obtain a unified language model that is respectively applicable to the question-answer knowledge base, the knowledge graph database, the product list database, and the product terms database and has completed the training;
[0062] The establishment module is used to establish a replacement link between the input parameters of the unified language model and the first category sentence information to determine the replacement relationship between the first category sentence information and the second category sentence information, and the replacement relationship is used to characterize the relationship between the first category sentence information as the input parameter of the unified language model and the second sentence information.
[0063] Further,
[0064] The processing module is specifically configured to, if the data source is a question-answer knowledge base, use the first category sentence information as an input parameter of the unified language model to perform model operation processing according to the replacement link;
[0065] The processing module is specifically used to split the first category sentence information according to the triple form of the knowledge graph if the data source is a knowledge graph library, and use the split sentence subject and sentence predicate as input parameters of the unified language model for model operation processing according to the replacement link;
[0066] The processing module is specifically configured to extract the list structured data of the first category sentence from the product list database if the data source is a product list database, and use the extracted list structured data as an input parameter of the unified language model for model operation processing according to the replacement link;
[0067] The processing module is specifically used to extract the clause structured data of the first category statement from the product clause database if the data source is the product clause database, and use the extracted clause structured data as input parameters of the unified language model for model operation processing according to the replacement link.
[0068] Furthermore, the acquisition module includes:
[0069] an acquiring unit, configured to acquire a storage path of the first category statement information and parse a storage location in the storage path;
[0070] A determination unit is used to determine the data source of the first category by matching the storage location with a database corresponding to at least one data source.
[0071] Furthermore, the device also includes:
[0072] A collection module, used for collecting at least one sentence information of a knowledge question and answer request;
[0073] A search module, used to search the question and answer database corresponding to the second category of sentence information to see whether there is question and answer information of the sentence information;
[0074] A first determination module, for determining that the sentence information is first category sentence information if it does not exist, and performing knowledge question and answer processing;
[0075] The second determination module is used to determine that the found question and answer information is the question and answer information of the sentence if it exists.
[0076] Furthermore, the search module includes:
[0077] An extraction unit, used to extract semantic words from the first category sentences and the second category sentences respectively, and calculate the similarity between the semantic words;
[0078] A judging unit is used to judge whether the question and answer information of the second category sentence information is applicable to the knowledge question and answer of the first category sentence information according to the similarity.
[0079] Furthermore, the device also includes:
[0080] A receiving module, used to receive a question-answering feedback result obtained by outputting the question-answering information, wherein the question-answering feedback result is used to indicate a satisfaction degree of an answer to the question-answering information;
[0081] A judgment module is used to determine whether to convert the first category sentence information into the second category sentence information according to the question and answer feedback result, and to determine whether to update the question and answer information to the second category sentence information training sample set to perform model updating.
[0082] An embodiment of the present invention provides a knowledge question and answer processing device. Compared with the prior art, the embodiment of the present invention obtains first-category sentence information to be processed for knowledge question and answer, and parses the data source of the first-category sentence information; matches a trained unified language model according to the parsed data source, wherein the unified language model is trained according to second-category sentence information in different data sources, and the second-category sentence information has a replacement relationship with the first-category sentence information; performs question and answer processing on the first-category sentence information according to the matched unified language model, and generates question and answer information of the first-category sentence information, thereby achieving the purpose of full coverage of question and answer for unconventional sentence information, greatly reducing the manpower and material resources for question and answer sentence recognition, and thus improving the processing efficiency of knowledge question and answer.
[0083] According to one embodiment of the present invention, a storage medium is provided, wherein the storage medium stores at least one executable instruction, and the computer executable instruction can execute the knowledge question and answer processing method in any of the above method embodiments.
[0084] Figure 4 A schematic diagram of the structure of a computer device provided according to an embodiment of the present invention is shown. The specific embodiment of the present invention does not limit the specific implementation of the computer device.
[0085] like Figure 4 As shown, the computer device may include: a processor (processor) 302 , a communication interface (Communications Interface) 304 , a memory (memory) 306 , and a communication bus 308 .
[0086] The processor 302 , the communication interface 304 , and the memory 306 communicate with each other via the communication bus 308 .
[0087] The communication interface 304 is used to communicate with other devices such as clients or other servers.
[0088] The processor 302 is used to execute the program 310, and specifically can execute the relevant steps in the above-mentioned knowledge question and answer processing method embodiment.
[0089] Specifically, the program 310 may include program codes, which include computer operation instructions.
[0090] The processor 302 may be a central processing unit (CPU), or an application-specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present invention. The one or more processors included in the computer device may be processors of the same type, such as one or more CPUs; or processors of different types, such as one or more CPUs and one or more ASICs.
[0091] The memory 306 is used to store the program 310. The memory 306 may include a high-speed RAM memory, and may also include a non-volatile memory (non-volatile memory), such as at least one disk memory.
[0092] The program 310 may be specifically configured to enable the processor 302 to perform the following operations:
[0093] Acquire first category sentence information to be processed for knowledge question answering, and analyze the data source of the first category sentence information;
[0094] A unified language model trained according to the parsed data source matching, wherein the unified language model is trained according to second category sentence information in different data sources, and the second category sentence information has a replacement relationship with the first category sentence information;
[0095] Question and answer processing is performed on the first category sentence information according to the matched unified language model to generate question and answer information of the first category sentence information.
[0096] Obviously, those skilled in the art should understand that the above modules or steps of the present invention can be implemented by a general computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, and optionally, they can be implemented by a program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, and in some cases, the steps shown or described can be executed in a different order than here, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. Thus, the present invention is not limited to any specific combination of hardware and software.
[0097] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A knowledge question answering method, characterized in that: include: Acquire first category sentence information to be processed for knowledge question answering, and analyze the data source of the first category sentence information; A unified language model trained according to the parsed data source matching, wherein the unified language model is trained according to second category sentence information in different data sources, and the second category sentence information has a replacement relationship with the first category sentence information; Performing question-answering processing on the first category sentence information according to the matched unified language model to generate question-answering information of the first category sentence information; Wherein, the first category of sentence information is sentence information for which question and answer information has not been found in the preset question and answer library, and the second category of sentence information is sentence information for which question and answer information has been found in the preset question and answer library, and the data sources include a question and answer knowledge base, a knowledge graph library, a product list database, and a product terms database. Before the training unified language model is completed according to the parsed data source matching, the method further includes: Respectively obtain a second category sentence information training sample set from the question-answer knowledge base, the knowledge graph database, the product list database, and the product terms database; The unified language model that has completed the language network construction is trained using the second category sentence information training sample set to obtain a unified language model that is respectively applicable to the question-answer knowledge base, the knowledge graph database, the product list database, and the product terms database and has completed the training; Establishing a replacement link between the input parameter of the unified language model and the first category sentence information to determine a replacement relationship between the first category sentence information and the second category sentence information, wherein the replacement relationship is used to characterize a relationship in which the first category sentence information, as an input parameter of the unified language model, replaces the second sentence information; The performing question-answering processing on the first category sentence information according to the matched unified language model includes: If the data source is a question-answer knowledge base, the first category sentence information is used as an input parameter of the unified language model to perform model operation processing according to the replacement link; If the data source is a knowledge graph library, the first category of sentence information is split according to the triple form of the knowledge graph, and the split sentence subject and sentence predicate are used as input parameters of the unified language model for model operation processing according to the replacement link; If the data source is a product list database, extracting list structured data of the first category sentence from the product list database, and using the extracted list structured data as input parameters of the unified language model for model operation processing according to the replacement link; If the data source is a product terms database, the terms structured data of the first category of sentences are extracted from the product terms database, and the extracted terms structured data are used as input parameters of the unified language model for model calculation according to the replacement link.
2. The method according to claim 1, characterized in that The data sources for parsing the first category of sentence information include: Obtaining a storage path for the first category statement information, and resolving a storage location in the storage path; The data source of the first category is determined based on the storage location matching the database corresponding to at least one data source.
3. The method according to claim 1, characterized in that Before obtaining the first category of sentence information to be processed for knowledge question answering, the method further includes: Collect at least one sentence information of requesting knowledge question and answer; Searching from the question-and-answer database corresponding to the second category of sentence information whether there is question-and-answer information for the sentence information; If not, determining that the sentence information is the first category of sentence information, and performing knowledge question and answer processing; If so, it is determined that the found question and answer information is the question and answer information of the sentence.
4. The method according to claim 3, characterized in that The step of searching the question-and-answer database corresponding to the second category sentence information for question-and-answer information of the first category sentence information includes: extracting semantic words from the first category sentences and the second category sentences respectively, and calculating the similarity between the semantic words; It is determined whether the question and answer information of the second category sentence information is applicable to the knowledge question and answer of the first category sentence information according to the similarity.
5. The method according to any one of claims 1 to 4, characterized in that: The method further comprises: receiving a question-and-answer feedback result obtained according to outputting the question-and-answer information, wherein the question-and-answer feedback result is used to indicate a satisfaction degree of an answer to the question-and-answer information; According to the question and answer feedback result, determine to convert the first category sentence information into the second category sentence information, and determine to update the question and answer information to the second category sentence information training sample set to perform model updating.
6. A knowledge question answering processing device, characterized in that: include: An acquisition module, used to acquire first category sentence information to be processed for knowledge question answering, and analyze the data source of the first category sentence information; A matching module, used for matching a trained unified language model according to the parsed data source, wherein the unified language model is trained according to the second category sentence information in different data sources, and the second category sentence information has a replacement relationship with the first category sentence information; a processing module, configured to perform question-answering processing on the first category of sentence information according to the matched unified language model, and generate question-answering information of the first category of sentence information; The first category of sentence information is sentence information for which question and answer information has not been found in the preset question and answer library, and the second category of sentence information is sentence information for which question and answer information has been found in the preset question and answer library. The data sources include a question and answer knowledge base, a knowledge graph library, a product list database, and a product terms database. The device also includes: a training module, an establishment module, The acquisition module is further used to respectively acquire a training sample set of second category sentence information from the question-answer knowledge base, the knowledge graph database, the product list database, and the product terms database; The training module is used to train the unified language model that has completed the language network construction using the second category sentence information training sample set, to obtain a unified language model that is respectively applicable to the question-answer knowledge base, the knowledge graph database, the product list database, and the product terms database and has completed the training; The establishing module is used to establish a replacement link between the input parameter of the unified language model and the first category sentence information to determine the replacement relationship between the first category sentence information and the second category sentence information, wherein the replacement relationship is used to characterize the relationship between the first category sentence information as the input parameter of the unified language model and the second sentence information for replacement; The processing module is specifically configured to, if the data source is a question-answer knowledge base, use the first category sentence information as an input parameter of the unified language model to perform model operation processing according to the replacement link; The processing module is specifically used to split the first category sentence information according to the triple form of the knowledge graph if the data source is a knowledge graph library, and use the split sentence subject and sentence predicate as input parameters of the unified language model for model operation processing according to the replacement link; The processing module is specifically configured to extract the list structured data of the first category sentence from the product list database if the data source is a product list database, and use the extracted list structured data as an input parameter of the unified language model for model operation processing according to the replacement link; The processing module is specifically used to extract the clause structured data of the first category statement from the product clause database if the data source is the product clause database, and use the extracted clause structured data as input parameters of the unified language model for model operation processing according to the replacement link.
7. A storage medium storing at least one executable instruction, wherein the executable instruction enables a processor to execute an operation corresponding to the knowledge question and answer processing method as described in any one of claims 1-5.
8. A computer device comprising: A processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface communicate with each other via the communication bus; The memory is used to store at least one executable instruction, and the executable instruction enables the processor to perform operations corresponding to the knowledge question and answer processing method as described in any one of claims 1-5.
