Keyword-guided question-answering knowledge extraction method, device, equipment and medium

Through the keyword-guided Q&A knowledge extraction method, the use of keywords and triple maps for text generation is solved, and the problems of logical inconsistency and omissions in open knowledge extraction are highly logical, similar to human language, and reduced Invalid response.

CN114490984BActive Publication Date: 2025-01-03ONECONNECT TECH SERVICES CO LTD SHENZHEN
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210083587.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-01-21
Publication Date
2025-01-03
Estimated Expiration
2042-01-21

AI Technical Summary

Technical Problem

The existing knowledge extraction method based on trainable parameters has poor effect in open knowledge extraction, which is prone to problems such as inconsistency in front and back logic and omission of knowledge points.

Method used

Using a keyword-guided Q&A knowledge extraction method, by obtaining keywords in the target question statement, building a triple map and keyword vocabulary, using a knowledge extractor and a sorter to generate text to ensure the importance of knowledge points Sort and logical consistency.

Benefits of technology

It greatly reduces the logical inconsistency problem before and after the extraction of knowledge in open-problems, avoids the omission of knowledge points, and the generated text is highly logical, similar to human language, with good control, and reduces invalid responses.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114490984B_ABST
    Figure CN114490984B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of artificial intelligence technology, and provides a keyword-guided question-answering knowledge extraction method, device, equipment and medium. The method includes obtaining a target question sentence and extracting a number of first keywords therein, wherein the first keyword is a keyword that appears in a keyword vocabulary; obtaining a triple corresponding to each first keyword, and converting the triple corresponding to the first keyword into a plain text sentence as a potential knowledge point required by the target question sentence; sorting the importance of each potential knowledge point based on the existing text in the text generation area after the target question sentence to obtain the most important potential knowledge point; and generating text based on the most important potential knowledge point and the existing text in the text generation area. The knowledge points of the present application are obtained once in the knowledge extractor, and are selectively generated by relying on the sorter, so the problem of logical inconsistency before and after the open question knowledge extraction is greatly reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of artificial intelligence technology, and in particular to a keyword-guided question-answering knowledge extraction method, device, equipment and medium. Background Art

[0002] In the era of Internet information explosion, knowledge bases based on trainable parameters have become an effective means of knowledge storage. Compared with the knowledge injection method at the forefront of research, the current knowledge extraction method for trainable parameters is still very simple, generally using prompt structures to artificially construct auxiliary sentences to extract answers or simply using questions to generate answers.

[0003] These two methods have excellent extraction effects for simple entity query knowledge extraction, but the effect of extracting more complex open knowledge such as questions is very poor. The main problems are:

[0004] (1) Open-ended knowledge extraction usually requires a long text to answer questions, which is extremely dependent on the effectiveness of the generative model. If the text is too long, there will be logical inconsistencies in the knowledge extraction sentences. For example, the first sentence mentions insurance products, but the last sentence describes fund-type financial products.

[0005] (2) The problem of missing knowledge points in knowledge extraction. Knowledge extraction using natural language has no clear supervision signals, which may cause omissions of knowledge entities of some problems and over-describe a single knowledge body. Summary of the invention

[0006] In view of the above-mentioned shortcomings of the prior art, the purpose of the present invention is to provide a keyword-guided question-answering knowledge extraction method, device, equipment and medium to solve the problems existing in the prior art.

[0007] To achieve the above objectives and other related objectives, the present invention provides a keyword-guided question-answering knowledge extraction method, comprising:

[0008] Acquire a target question sentence and extract a plurality of first keywords from the target question sentence, wherein the first keywords are keywords that appear in a keyword vocabulary;

[0009] Acquire a triplet corresponding to each of the first keywords according to a triplet map, wherein the triplet map stores a correspondence between keywords and triples;

[0010] Converting the triples corresponding to the first keywords into plain text sentences as potential knowledge points required by the target question sentence;

[0011] sorting the importance of each of the potential knowledge points based on the existing text in the text generation area after the target question sentence to obtain the potential knowledge point with the highest importance;

[0012] Text generation is performed based on the potential knowledge point with the highest importance and the existing text in the text generation area.

[0013] In an optional embodiment of the present invention, the method for constructing the keyword vocabulary includes:

[0014] Collecting corpus text data in a target domain to form a corpus text set, wherein the corpus text data includes structured data and unstructured data;

[0015] Using a Chinese natural language processing tool to identify words of designated parts of speech in the corpus text data, the designated parts of speech including nouns and verbs;

[0016] Use the TF-IDF algorithm to sort all the words with specified parts of speech that are identified;

[0017] A preset number of words ranked high are extracted as keyword words to construct a keyword vocabulary.

[0018] In an optional embodiment of the present invention, the method for constructing the triple map includes:

[0019] Collect corpus text data in the target domain;

[0020] According to a predefined relationship set, extracting the relationships in the relationship set using a relationship extraction algorithm in the corpus text;

[0021] The triple graph is constructed by using a sequence labeling method to obtain each extracted relationship connecting two entities in the corpus text data.

[0022] In an optional embodiment of the present invention, a plurality of the first keywords in the target question sentence are extracted by a trained knowledge extractor;

[0023] The training method of the knowledge extractor comprises:

[0024] Extracting the second keyword of each answer in the question-answering dataset of the target domain and marking them to form a first training set, wherein the second keyword is a keyword that appears in the keyword vocabulary;

[0025] The knowledge extractor is trained using the first training set.

[0026] In an optional embodiment of the present invention, based on the existing text in the text generation area after the target question sentence, the importance of each of the potential knowledge points is sorted by a trained knowledge sorter to obtain the potential knowledge point with the highest importance;

[0027] The training method of the knowledge sorter comprises:

[0028] Extracting the second keyword of each answer in the question-answering dataset of the target domain and marking them to form a first training set, wherein the second keyword is a keyword that appears in the keyword vocabulary;

[0029] Acquire a triple corresponding to the second keyword according to the triple graph, and convert the triple into a plain text sentence and add it to the question-answering dataset of the target domain to form a second training set;

[0030] The knowledge sorter is trained using the second training set.

[0031] In an optional embodiment of the present invention, the keyword-guided question-answer knowledge extraction method includes:

[0032] The triple corresponding to the first keyword is converted into a normal natural language sentence according to a predefined template as a plain text sentence of the triple corresponding to the first keyword.

[0033] In an optional embodiment of the present invention, the keyword-guided question-answer knowledge extraction method further includes:

[0034] Iterate the following steps until the answer to the target question is generated:

[0035] sorting the importance of each of the potential knowledge points based on the existing text in the text generation area after the target question sentence to obtain the potential knowledge point with the highest importance;

[0036] Text generation is performed based on the potential knowledge point with the highest importance and the existing text in the text generation area.

[0037] To achieve the above-mentioned purpose and other related purposes, the present invention also provides a keyword-guided question-answer knowledge extraction device, which comprises:

[0038] A knowledge extraction module, configured to obtain a target question sentence and extract a plurality of first keywords from the target question sentence, wherein the first keywords are keywords appearing in a keyword vocabulary;

[0039] A triple acquisition module, used for acquiring a triple corresponding to each of the first keywords according to a triple map, wherein the triple map stores a correspondence between keywords and triples;

[0040] A knowledge point acquisition module, used to convert the triples corresponding to the first keywords into plain text sentences as potential knowledge points required by the target question sentence;

[0041] A knowledge ranking module, used to rank the importance of each of the potential knowledge points based on the existing text in the text generation area after the target question sentence, so as to obtain the potential knowledge point with the highest importance;

[0042] The text generation module is used to generate text according to the potential knowledge point with the highest importance and the existing text in the text generation area.

[0043] To achieve the above-mentioned purpose and other related purposes, the present invention also provides an electronic device, comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that the processor implements the steps of the above-mentioned method when executing the computer program.

[0044] To achieve the above objectives and other related objectives, the present invention also provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the steps of the above method are implemented.

[0045] The keyword-guided question-and-answer knowledge extraction method, device, equipment and medium of the present invention greatly reduces the problem of logical inconsistency in open question knowledge extraction because knowledge points are obtained once in the knowledge extractor and selectively generated by a sorter.

[0046] The keyword-guided question-and-answer knowledge extraction method, device, equipment and medium of the present invention extract all knowledge points in a guided manner, avoiding the situation where incorrect context occurs due to interference from invalid information in the generated text, thereby missing more knowledge points.

[0047] The keyword-guided question-and-answer knowledge extraction method, device, equipment and medium of the present invention generate text that is more similar to the answer to the knowledge extraction rather than unguided chatting, thereby minimizing some invalid replies.

[0048] The keyword-guided question-and-answer knowledge extraction method, device, equipment and medium of the present invention generate answer texts that are more like human language, have their own logic, and are more controllable, and can make further control modifications for more in-depth tasks. BRIEF DESCRIPTION OF THE DRAWINGS

[0049] Figure 1A flowchart of a preferred embodiment of the keyword-guided question-answer knowledge extraction method of the present invention is shown.

[0050] Figure 2 The flowchart of constructing the keyword vocabulary in the keyword-guided question-answering knowledge extraction method of the present invention is shown.

[0051] Figure 3 A flowchart for constructing a triplet graph in the keyword-guided question-answering knowledge extraction method of the present invention is shown.

[0052] Figure 4 A functional module diagram of a preferred embodiment of the keyword-guided question-answer knowledge extraction device of the present invention is shown.

[0053] Figure 5 A schematic diagram of the structure of an electronic device of a preferred embodiment of the keyword-guided question-answer knowledge extraction method of the present invention is shown. DETAILED DESCRIPTION

[0054] The following describes the embodiments of the present invention through specific examples, and those skilled in the art can easily understand other advantages and effects of the present invention from the contents disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present invention.

[0055] See also Figure 1-5 It should be noted that the illustrations provided in this embodiment are only used to illustrate the basic concept of the present invention in a schematic manner, and the drawings only show components related to the present invention rather than being drawn according to the number, shape and size of components in actual implementation. In actual implementation, the type, quantity and proportion of each component may be changed arbitrarily, and the component layout may also be more complicated.

[0056] In order to solve the problems existing in the prior art, the present invention discloses a keyword-guided question-and-answer knowledge extraction method, which can be applied to question-and-answer knowledge extraction in a target field (such as the insurance field). The keyword-guided question-and-answer knowledge extraction method is applied to one or more electronic devices, which are devices that can automatically perform numerical calculations and / or information processing according to pre-set or stored instructions, and whose hardware includes but is not limited to microprocessors, application specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), digital signal processors (DSPs), embedded devices, etc.

[0057] The electronic device may be any electronic product that can perform human-computer interaction with a user, such as a personal computer, a tablet computer, a smart phone, a personal digital assistant (PDA), a game console, an interactive network television (IPTV), a smart wearable device, etc.

[0058] The electronic device may also include a network device and / or a user device, wherein the network device includes, but is not limited to, a single network server, a server group consisting of multiple network servers, or a cloud consisting of a large number of hosts or network servers based on cloud computing.

[0059] The network where the electronic device is located includes but is not limited to the Internet, a wide area network, a metropolitan area network, a local area network, a virtual private network (VPN), etc.

[0060] Figure 1 The flowchart of a preferred embodiment of the keyword-guided question-answer knowledge extraction method of the present invention is shown. The keyword-guided question-answer knowledge extraction method comprises the following steps:

[0061] Step S110, obtaining a target question sentence and extracting a plurality of first keywords in the target question sentence, wherein the first keywords are keywords appearing in a keyword vocabulary;

[0062] Step S120: acquiring a triple corresponding to each of the first keywords according to a triple map, wherein the triple map stores a correspondence between keywords and triples;

[0063] Step S130: converting the triples corresponding to the first keywords into plain text sentences as potential knowledge points required by the target question sentence;

[0064] Step S140, sorting the importance of each of the potential knowledge points based on the existing text in the text generation area after the target question sentence to obtain the potential knowledge point with the highest importance;

[0065] Step S150: generate text according to the potential knowledge point with the highest importance and the existing text in the text generation area.

[0066] The following will be combined Figure 1 To elaborate on the keyword-guided question-answering knowledge extraction method of the present invention.

[0067] First, step S110 is performed to obtain a target question sentence and extract a plurality of first keywords from the target question sentence, wherein the first keywords are keywords that appear in a keyword vocabulary. Specifically, the plurality of first keywords from the target question sentence are extracted by a trained knowledge extractor.

[0068] In order to achieve guided keyword extraction, it is necessary to establish a keyword vocabulary in advance, where: Figure 2 The flowchart of establishing the keyword vocabulary is shown in FIG. Figure 2 As shown, the steps for establishing the keyword vocabulary are as follows:

[0069] Step S210, collecting corpus text data of the target field to form a corpus text set;

[0070] Step S220, using a Chinese natural language processing tool to identify words of designated parts of speech in the corpus text data, wherein the designated parts of speech include nouns and verbs;

[0071] Step S230, using the TF-IDF algorithm to sort all the recognized words of the specified part of speech;

[0072] Step S240: extract a preset number of words that are ranked high as keyword words to construct a keyword vocabulary.

[0073] In this application, the corpus text data includes structured data and unstructured data. As an example, the structured data may come from Ping An's internal knowledge base, which is ready-made and extracted by others; and the unstructured data is daily insurance documents, and any plain text is unstructured data, such as any Ping An insurance description document.

[0074] Taking the construction of a keyword vocabulary in the insurance field as an example, first, it is necessary to collect and obtain corpus text in the insurance field. The corpus text can be, for example, all insurance-related documents of Ping An; then, after obtaining the target text, the Chinese natural language processing tool LTP can be used to identify all nouns and verbs in the corpus text; then, the TF-IDF algorithm is used to sort all the recognized words (including verbs and nouns); finally, the top 5000 (configurable) nouns and verbs are extracted as keywords to construct the keyword vocabulary.

[0075] LTP is a complete Chinese language processing system. LTP has developed an XML-based representation of language processing results, and on this basis provides a complete set of bottom-up, rich and efficient Chinese language processing modules (including 6 core Chinese processing technologies such as lexical, syntactic, and semantic), as well as an application program interface based on a dynamic link library (DLL), visualization tools, and can be used in the form of a network service (Web Service).

[0076] TF-IDF (Term Frequency–Inverse Document Frequency) is a commonly used weighting technique for information retrieval and data mining. TF stands for term frequency and IDF stands for inverse document frequency. TF-IDF is a statistical method used to evaluate the importance of a word to a document set or one of the documents in a corpus. The importance of a word increases in direct proportion to the number of times it appears in a document, but decreases in inverse proportion to the frequency of its appearance in the corpus.

[0077] In order to obtain potential knowledge points later, it is necessary to pre-build a triple map of the target domain, where: Figure 3 The construction flow chart of the triplet graph is shown in FIG. Figure 3 As shown, the steps of constructing the triplet graph include:

[0078] Step S310: Collect corpus text data of the target field to form a corpus text set;

[0079] Step S320: extracting relations in the relation set from the corpus text data in the corpus text set based on a relation extraction algorithm according to a predefined relation set;

[0080] Step S330: Based on the sequence labeling method, each extracted relationship is obtained in the corpus text data to connect two entities to construct the triple graph.

[0081] It should be noted that the corpus text set used in the process of constructing the triple spectrum and the corpus text set used in the process of constructing the keyword vocabulary are the same corpus text set.

[0082] A person skilled in the art may define the relationship set according to the actual field and actual content involved in the question and answer, and the relationship in the relationship set may be an entity relationship or an attribute relationship. In the insurance field, an attribute relationship may refer to an attribute relationship such as an annual interest rate, an annual yield rate, and a current annual interest rate.

[0083] As an example, the BERT model can be used as a tool for relationship extraction. Taking the construction of the triple (Century Financial Management, Current Annual Interest Rate, 7%) as an example, suppose an insurance document contains the sentence "Century Financial Management's current annual interest rate is 7%." Our BERT model will first recognize the word "current annual interest rate", and then based on this attribute relationship, input it into the BERT model, and use the method of sequence labeling (classifying each word) to find the two entities "Century Financial Management" and "7%" corresponding to this attribute relationship "current annual interest rate", and then form a triple.

[0084] In the present application, the first keyword in the target question sentence is extracted by a knowledge extractor. Before extracting the first keyword, the knowledge extractor needs to be trained. During training, it is necessary to first construct a first training set based on the question and answer data set of the target field, and then train the knowledge extractor based on the first training set.

[0085] Specifically, the training process of the knowledge extractor is as follows:

[0086] Extracting the second keyword of each answer in the question-answering dataset of the target domain and marking them to form a first training set, wherein the second keyword is a keyword that appears in the keyword vocabulary;

[0087] The knowledge extractor is trained using the first training set: questions in the question-answering dataset of the target field are input, and the target given is the second keyword in the answer corresponding to the extracted question, so as to complete this prediction step in a generative manner.

[0088] Taking the insurance field as the target field (of course it can also be other fields) as an example, when training the knowledge extractor, the input is a question from the insurance field question and answer dataset, and the target given is the keyword (second keyword) in the corresponding answer that has been extracted in advance. This prediction step is completed in a generative manner, so that in the inference stage, the knowledge extractor can extract enough keywords based on the given question.

[0089] Next, step S120 is executed to obtain the triplet corresponding to the first keyword according to the triplet graph, wherein the triplet graph stores the correspondence between the keywords and the triples.

[0090] Specifically, since there is a correspondence between keywords and triples in the triple graph, the triple corresponding to the keyword can be found in the pre-constructed triple knowledge graph through the extracted first keyword. When the extracted first keyword has no corresponding triple in the pre-constructed triple knowledge graph, the first keyword can be discarded.

[0091] Next, step S130 is executed to convert the triples corresponding to the first keyword into plain text sentences as potential knowledge points required by the target question sentence. Specifically, the triples corresponding to the first keyword can be converted into normal natural language sentences according to a predefined template as plain text sentences of the triples.

[0092] In this embodiment, a fixed sentence template may be pre-set for each relationship in the relationship set to perform text conversion. For example, for an attribute relationship, a sentence template such as (attribute B) of (entity A) is (entity C) may be defined.

[0093] Next, step S140 is executed to sort the importance of the potential knowledge points required by the target question sentence based on the existing text in the text generation area after the target question sentence to obtain the potential knowledge points with the highest importance. Specifically, based on the existing text in the text generation area after the target question sentence, the potential knowledge points are sorted by importance using a trained knowledge sorter to obtain the potential knowledge points with the highest importance.

[0094] The knowledge sorter is an LSTM model. In each iteration, the LSTM model will be called N times (N is the number of potential knowledge points). The input each time is a three-tuple plain text sentence plus the text generated in the text generation area, for example (Century Financial's current annual interest rate is 7% + I want to buy Century Financial Insurance, can you introduce it? + Century Financial's current) The three parts separated by the plus sign are potential knowledge points, input questions and text currently generated in the text generation area. The output of the knowledge sorter is the importance score. The potential knowledge point with the highest importance score among N times wins and enters the text generation area.

[0095] Before using the trained knowledge sorter to sort the importance of each potential knowledge point to obtain the potential knowledge point with the highest importance, the knowledge sorter needs to be trained. During the training, it is necessary to first construct a second training set based on the question and answer data set of the target field, and then train the knowledge extractor based on the second training set.

[0096] Specifically, the training process of the knowledge sorter is as follows:

[0097] Extracting a second keyword of each answer in the question-answering dataset of the target domain and marking it, wherein the second keyword is a keyword that appears in the keyword vocabulary;

[0098] Acquire a triple corresponding to the second keyword according to the triple graph, and convert the triple into a plain text sentence and add it to the question-answering dataset of the target domain to form a second training set;

[0099] Train the knowledge sorter using the second training set.

[0100] Taking the insurance field as an example of the target field, when training the knowledge sorter, the input is the questions, answers, and the plain text statements of the triples corresponding to the second keywords in the answers in the Q&A dataset of the insurance field. The given target is the score of the plain text statements of the triples corresponding to the second keywords in the answers. This prediction is completed by simple regression numerical prediction. Thus, in the inference stage, the knowledge sorter can generate the scores of each potential knowledge point required by the target question statement based on the target question statement and the generated text in the text generation area after the target question statement, and then rank the importance of each potential knowledge point required by the target question statement according to the scores to obtain the potential knowledge point with the highest importance.

[0101] It should be noted that in practical applications, the second training set can be directly used as the first training set to train the above-mentioned knowledge extractor, that is, the first training set and the second training set can use the same training set.

[0102] Next, execute step S150, and perform text generation based on the potential knowledge point with the highest importance and the existing text in the text generation area. Specifically, the text generator performs the next text generation based on the potential knowledge point with the highest importance and the existing text in the text generation area. Among them, the text generator is a language model constructed by a Transformer, and the next text is generated by inputting the above text into the text generator.

[0103] As an example, input "I want to buy Century Financial Management Insurance. Please introduce it? + The current situation of Century Financial Management" into the text generator. This is the text that has been generated in the text generation area. Then, the result generated according to the potential knowledge point with the highest importance "The current interest rate of Century Financial Management is 7%" is the character "行" (xing). Then, return to step S30 to enter the next round of iteration. The input for the next iteration is (I want to buy Century Financial Management Insurance. Please introduce it? + The current situation of Century Financial Management), and the character "利" (li) will be generated according to the potential knowledge point with the highest importance "The current interest rate of Century Financial Management is 7%". This iteration will continue until "I want to buy Century Financial Management Insurance. Please introduce it? + The current interest rate of Century Financial Management is 7%" is completely generated.

[0104] The keyword-guided question-and-answer knowledge extraction method of the present application greatly reduces the problem of logical inconsistency in the extraction of open-ended questions because the knowledge points are obtained in the knowledge extractor at one time and are selectively generated by the sorter. In the keyword-guided question-and-answer knowledge extraction method of the present application, all knowledge points are extracted with guidance, avoiding the situation where the incorrect context is caused by the interference of invalid information in the generated text, thereby missing more knowledge points. The keyword-guided question-and-answer knowledge extraction method of the present application generates a text that is more similar to the answer to the knowledge extraction rather than an unguided chat, which reduces some invalid replies to a minimum. The keyword-guided question-and-answer knowledge extraction method of the present application generates an answer text that is more like human language, has its own logic, and is more controllable, and can make further control modifications for more in-depth tasks.

[0105] It should be noted that the step division of the above methods is only for clear description. When implemented, they can be combined into one step or some steps can be split and decomposed into multiple steps. As long as they contain the same logical relationship, they are all within the scope of protection of this patent; adding insignificant modifications to the algorithm or process or introducing insignificant designs without changing the core design of the algorithm and process are all within the scope of protection of this patent.

[0106] Figure 4 The functional module diagram of the keyword-guided question-answering knowledge extraction device of the present invention is shown. The keyword-guided question-answering knowledge extraction device comprises: a knowledge extraction module 111, a triple acquisition module 112, a knowledge point acquisition module 113, a knowledge sorting module 114, and a text generation module 115. The module referred to in the present invention refers to a series of computer program segments that can be executed by the processor 13 and can complete fixed functions, which are stored in the memory 12.

[0107] The knowledge extraction module 111 serves as a knowledge extractor, and is used to obtain a target question sentence and extract a number of first keywords from the target question sentence, where the first keywords are keywords that appear in a keyword vocabulary.

[0108] In order to achieve guided keyword extraction, it is necessary to construct a keyword vocabulary in advance based on the corpus text data of the target field. The steps for constructing the key keyword vocabulary are detailed in S210-S240 above and will not be repeated here.

[0109] In the present application, the first keyword in the target question sentence is extracted by a knowledge extractor. Before extracting the first keyword, the knowledge extractor needs to be trained. During the training, a first training set needs to be constructed based on the question-answering data set of the target field, and then the knowledge extractor is trained based on the first training set. Please refer to the description of the relevant part above for the training of the knowledge extractor, which will not be repeated here.

[0110] The triple acquisition module 112 is used to acquire the triple corresponding to each of the first keywords according to the triple map, and the triple map stores the correspondence between keywords and triples. The triple map is constructed by the corpus text data of the target field. The specific construction steps are detailed in S310-S330 above, and will not be repeated here.

[0111] The knowledge point acquisition module 113 is used to convert the triples corresponding to the first keyword into plain text sentences as potential knowledge points required by the target question sentence. Specifically, the knowledge point acquisition module 113 can convert the triples corresponding to the first keyword into normal natural language sentences according to a predefined template as plain text sentences of the triples.

[0112] In this embodiment, a fixed sentence template may be pre-set for each relationship in the relationship set to perform text conversion. For example, for an attribute relationship, a sentence template such as (attribute B) of (entity A) is (entity C) may be defined.

[0113] The knowledge sorting module 114 is used as a knowledge sorter to sort the importance of each of the potential knowledge points based on the existing text in the text generation area after the target question sentence, so as to obtain the potential knowledge point with the highest importance. Specifically, based on the existing text in the text generation area after the target question sentence, the importance of each of the potential knowledge points is sorted by a trained knowledge sorter to obtain the potential knowledge point with the highest importance. The training of the knowledge sorter can be found in the description of the relevant part above, which will not be repeated here.

[0114] The text generation module 115 is used as a text generator to generate text according to the potential knowledge point with the highest importance and the existing text in the text generation area. Specifically, the text generator generates the next text according to the potential knowledge point with the highest importance and the existing text in the text generation area, wherein the text generator is a language model constructed by a Transformer, and the following text is generated by inputting the previous text into the text generator.

[0115] It should be noted that the keyword-guided question-and-answer knowledge extraction device of the present application is a device corresponding to the keyword-guided question-and-answer knowledge extraction method mentioned above, and the functional modules in the keyword-guided question-and-answer knowledge extraction device respectively correspond to the corresponding steps in the keyword-guided question-and-answer knowledge extraction method. The keyword-guided question-and-answer knowledge extraction device of the present application can be implemented in conjunction with the keyword-guided question-and-answer knowledge extraction method. The relevant technical details mentioned in the keyword-guided question-and-answer knowledge extraction method of the present application are still valid in the keyword-guided question-and-answer knowledge extraction device, and will not be repeated here to reduce repetition.

[0116] It should be noted that the above-mentioned functional modules can be fully or partially integrated into one physical entity during actual implementation, or they can be physically separated. And these modules can all be implemented in the form of software called by processing elements; they can also be all implemented in the form of hardware; some modules can also be implemented in the form of software called by processing elements, and some modules can be implemented in the form of hardware. In addition, these modules can be fully or partially integrated together, or they can be implemented independently. The processing element described here can be an integrated circuit with signal processing capabilities. In the implementation process, some or all of the steps of the above method, or the above functional modules can be completed by hardware integrated logic circuits in the processor element or instructions in software form.

[0117] like Figure 5 , which is a schematic diagram of the structure of an electronic device of a preferred embodiment of the present invention for implementing the keyword-guided question-and-answer knowledge extraction method.

[0118] The electronic device 1 may include a memory 12, a processor 13 and a bus, and may also include a computer program stored in the memory 12 and executable on the processor 13, such as a keyword-guided question-answering knowledge extraction program.

[0119] Among them, the memory 12 includes at least one type of readable storage medium, and the readable storage medium includes flash memory, mobile hard disk, multimedia card, card-type memory (for example: SD or DX memory, etc.), magnetic memory, disk, optical disk, etc. In some embodiments, the memory 12 can be an internal storage unit of the electronic device 1, such as a mobile hard disk of the electronic device 1. In other embodiments, the memory 12 can also be an external storage device of the electronic device 1, such as a plug-in mobile hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. equipped on the electronic device 1. Further, the memory 12 can also include both an internal storage unit of the electronic device 1 and an external storage device. The memory 12 can not only be used to store application software installed in the electronic device 1 and various types of data, such as codes based on keyword-guided question-answering knowledge extraction, but also can be used to temporarily store data that has been output or is to be output.

[0120] In some embodiments, the processor 13 may be composed of an integrated circuit, for example, a single packaged integrated circuit, or a plurality of packaged integrated circuits with the same or different functions, including one or more central processing units (CPUs), microprocessors, digital processing chips, graphics processors, and a combination of various control chips. The processor 13 is the control core (Control Unit) of the electronic device 1, and uses various interfaces and lines to connect the various components of the entire electronic device 1, and executes or executes the programs or modules stored in the memory 12 (for example, executing a question-and-answer knowledge extraction program based on keyword guidance, etc.), and calls the data stored in the memory 12 to execute various functions of the electronic device 1 and process data.

[0121] The processor 13 executes the operating system of the electronic device 1 and various installed applications. The processor 13 executes the applications to implement the steps in the above-mentioned keyword-guided question-answer knowledge extraction method, for example Figure 1 Steps shown.

[0122] Exemplarily, the computer program may be divided into one or more modules, which are stored in the memory 12 and executed by the processor 13 to complete the present invention. The one or more modules may be a series of computer program instruction segments capable of completing specific functions, which are used to describe the execution process of the computer program in the electronic device 1. For example, the computer program may be divided into a knowledge extraction module 111, a triple acquisition module 112, a knowledge point acquisition module 113, a knowledge sorting module 114, and a text generation module 115.

[0123] The above-mentioned integrated unit implemented in the form of a software function module can be stored in a computer-readable storage medium. The above-mentioned software function module is stored in a storage medium, and includes a number of instructions for enabling a computer device (which can be a personal computer, a computer device, or a network device, etc.) or a processor to perform part of the functions of the keyword-guided question-answering knowledge extraction method described in each embodiment of the present invention.

[0124] The bus can be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 4 Only one arrow is used in the figure, but it does not mean that there is only one bus or one type of bus. The bus is configured to realize the connection and communication between the memory 12 and at least one processor 13, etc.

[0125] The keyword-guided question-and-answer knowledge extraction method, device, equipment and medium of the present application greatly reduces the problem of logical inconsistency before and after the open question knowledge extraction because the knowledge points are obtained in the knowledge extractor at one time and selectively generated by the sorter. The keyword-guided question-and-answer knowledge extraction method, device, equipment and medium of the present application, all knowledge points are extracted with guidance, avoiding the situation where the incorrect context is caused by the interference of invalid information in the generated text, thereby missing more knowledge points. The keyword-guided question-and-answer knowledge extraction method, device, equipment and medium of the present application, the generated text is more similar to the answer to the knowledge extraction, rather than the unguided chat, which reduces some invalid replies to a minimum. The keyword-guided question-and-answer knowledge extraction method, device, equipment and medium of the present application, the generated answer text is more like human language, has its logic, and is more controllable, and can make further control transformations for more in-depth tasks.

[0126] It is obvious to those skilled in the art that the present invention is not limited to the details of the above exemplary embodiments, and that the present invention can be implemented in other specific forms without departing from the spirit or essential characteristics of the present invention.

[0127] The above embodiments are only used to illustrate the technical solution of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solution of the present invention may be modified or replaced by equivalents without departing from the spirit and scope of the technical solution of the present invention.

Claims

1. A keyword-guided question-answering knowledge extraction method, characterized in that: include: Acquire a target question sentence and extract a plurality of first keywords from the target question sentence, wherein the first keywords are keywords that appear in a keyword vocabulary; Acquire a triplet corresponding to each of the first keywords according to a triplet map, wherein the triplet map stores a correspondence between keywords and triples; Converting the triples corresponding to the first keywords into plain text sentences as potential knowledge points required by the target question sentence; sorting the importance of each of the potential knowledge points based on the existing text in the text generation area after the target question sentence to obtain the potential knowledge point with the highest importance; Text generation is performed based on the potential knowledge point with the highest importance and the existing text in the text generation area.

2. The keyword-guided question-answer knowledge extraction method according to claim 1, characterized in that: The method for constructing the keyword vocabulary includes: Collect corpus text data in the target field to form a corpus text set; Using a Chinese natural language processing tool to identify words of designated parts of speech in the corpus text data, the designated parts of speech including nouns and verbs; Use the TF-IDF algorithm to sort all the words with specified parts of speech that are identified; A preset number of words ranked high are extracted as keyword words to construct a keyword vocabulary.

3. The keyword-guided question-answer knowledge extraction method according to claim 1, characterized in that: The method for constructing the triplet map includes: Collect corpus text data in the target field to form a corpus text set; According to a predefined relationship set, extracting the relationships in the relationship set from the corpus text data in the corpus text set based on a relationship extraction algorithm; Based on the sequence labeling method, each extracted relationship is obtained in the corpus text data to connect two entities to construct the triple graph.

4. The keyword-guided question-answer knowledge extraction method according to claim 1, characterized in that: Extracting a plurality of the first keywords in the target question sentence by using a trained knowledge extractor; The training method of the knowledge extractor comprises: Extracting the second keyword of each answer in the question-answering dataset of the target domain and marking them to form a first training set, wherein the second keyword is a keyword that appears in the keyword vocabulary; The knowledge extractor is trained using the first training set.

5. The keyword-guided question-answer knowledge extraction method according to claim 1, characterized in that: Based on the existing text in the text generation area after the target question sentence, the importance of each of the potential knowledge points is sorted by a trained knowledge sorter to obtain the most important potential knowledge point; The training method of the knowledge sorter comprises: Extracting the second keyword of each answer in the question-answering dataset of the target domain and marking it, wherein the second keyword is a keyword that appears in the keyword vocabulary; Acquire a triple corresponding to the second keyword according to the triple graph, and convert the triple into a plain text sentence and add it to the question-answering dataset of the target domain to form a second training set; The knowledge sorter is trained using the second training set.

6. The keyword-guided question-answer knowledge extraction method according to claim 1, characterized in that: The keyword-guided question-answering knowledge extraction method includes: The triple corresponding to the first keyword is converted into a normal natural language sentence according to a predefined template as a plain text sentence of the triple corresponding to the first keyword.

7. The keyword-guided question-answer knowledge extraction method according to claim 1, characterized in that: The keyword-guided question-answering knowledge extraction method further includes: Iterate the following steps until the answer to the target question is generated: sorting the importance of each of the potential knowledge points based on the existing text in the text generation area after the target question sentence to obtain the potential knowledge point with the highest importance; Text generation is performed based on the potential knowledge point with the highest importance and the existing text in the text generation area.

8. A keyword-guided question-answer knowledge extraction device, characterized in that: The keyword-guided question-answering knowledge extraction device comprises: A knowledge extraction module, configured to obtain a target question sentence and extract a plurality of first keywords from the target question sentence, wherein the first keywords are keywords appearing in a keyword vocabulary; A triple acquisition module, used for acquiring a triple corresponding to each of the first keywords according to a triple map, wherein the triple map stores a correspondence between keywords and triples; A knowledge point acquisition module, used to convert the triples corresponding to the first keywords into plain text sentences as potential knowledge points required by the target question sentence; A knowledge ranking module, used to rank the importance of each of the potential knowledge points based on the existing text in the text generation area after the target question sentence, so as to obtain the potential knowledge point with the highest importance; The text generation module is used to generate text according to the potential knowledge point with the highest importance and the existing text in the text generation area.

9. An electronic device, characterized in that: The method comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the method according to any one of claims 1 to 7 when executing the computer program.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.