An intelligent question-and-answer generation method, device, electronic device, and storage medium
By syntactic analysis and keyword extraction of questions in the intelligent Q&A knowledge base, a question-and-answer correspondence between questions and answers is constructed, and the problem of time-consuming search of the intelligent Q&A knowledge base and inaccurate answer positioning is solved, and a fast and accurate question-and-answer pairing is achieved.
Patent Information
- Application Number
- CN202211729442.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-30
- Publication Date
- 2025-06-27
- Estimated Expiration
- 2042-12-30
AI Technical Summary
In the prior art, the search for intelligent Q&A knowledge base takes time and the answer positioning is not accurate enough, resulting in the phenomenon of answering the question that is not asked.
By obtaining the questions and corresponding answers in the file, the preset Chinese natural language processing method is used for syntactic analysis, keywords, constraints and question types are extracted, the question-and-answer correspondence between the questions and answers is constructed based on the CVT composite node, a knowledge graph is generated, and the corresponding answers are obtained through the analysis of the questions to be found.
It realizes fast and accurate question-and-answer pairing, reduces search time, improves the accuracy of answer positioning, and avoids answering non-questions.
Smart Images

Figure CN116204618B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of intelligent question answering, and particularly to an intelligent question answering generation method, device, electronic device and storage medium. Background Art
[0002] A knowledge graph, known as knowledge domain visualization or knowledge domain mapping map in the library and information science field, is a series of various different graphs showing the development process and structural relationships of knowledge. It uses visualization technology to describe knowledge resources and their carriers, mine, analyze, construct, draw and display knowledge and the interconnections between them. The knowledge graph combines the theories and methods of disciplines such as applied mathematics, graphics, information visualization technology, and information science with methods such as bibliometric citation analysis and co-occurrence analysis, and uses a visualized graph to vividly display the core structure, development history, frontier fields and overall knowledge architecture of a discipline to achieve the purpose of multi-disciplinary integration. It can provide practical and valuable references for disciplinary research. Specifically, the knowledge graph combines the theories and methods of disciplines such as applied mathematics, graphics, information visualization technology, and information science with methods such as bibliometric citation analysis and co-occurrence analysis, and uses a visualized graph to vividly display the core structure, development history, frontier fields and overall knowledge architecture of a discipline to achieve the purpose of multi-disciplinary integration. It displays complex knowledge fields through data mining, information processing, knowledge metrology and graph drawing, reveals the dynamic development laws of knowledge fields, and provides practical and valuable references for disciplinary research. So far, its practical applications have been gradually expanded and achieved good results in developed countries, but it is still in the initial stage of research in our country.
[0003] In practical applications, the problems and answers corresponding to the knowledge graph between the file content and the query personnel involve very complex content. When the knowledge graph runs in the background, it takes a long time and the answer positioning for questions is not accurate enough, resulting in the phenomenon of answering irrelevant questions. Based on this, it is necessary to establish an intelligent question answering system for the knowledge base to solve the above problems. Summary of the Invention
[0004] The purpose of the present invention is to overcome the above technical deficiencies, and provide an intelligent question answering generation method, device, electronic device and storage medium to solve the technical problems of time-consuming search in the intelligent question answering knowledge base and inaccurate answer positioning in the prior art.
[0005] To achieve the above technical purpose, the present invention adopts the following technical solutions:
[0006] In the first aspect, the present invention provides an intelligent question answering generation method, including:
[0007] Obtain the questions and corresponding answers in the file;
[0008] Perform syntactic analysis on the question using a preset Chinese natural language processing method to obtain the keywords, constraints, and question type in the question;
[0009] Based on the keywords, constraints, and question type, use a preset CVT composite node to construct the Q&A correspondence between the question and the answer corresponding to the question, and generate the knowledge graph of the Q&A correspondence;
[0010] Obtain the question to be queried, perform syntactic analysis on the question to be queried, determine the keywords to be queried and the question type to be queried, and obtain the answer corresponding to the question to be queried through the keywords to be queried and the question type to be queried according to the Q&A correspondence in the knowledge graph.
[0011] In some embodiments, the performing syntactic analysis on the question using a preset Chinese natural language processing method to obtain the keywords and constraints in the question includes:
[0012] Construct a custom word dictionary according to the inherent phrase collocations involved in the document;
[0013] Perform word segmentation, part-of-speech tagging, and syntactic analysis on the question using a preset Chinese natural language processing method to obtain the keywords and constraints of the question;
[0014] Determine whether the keyword matches the phrases in the custom word dictionary;
[0015] If it matches, determine the keyword as the target keyword of the question;
[0016] If it does not match, find similar words through the first similarity calculation and determine the similar words as the target keyword of the question.
[0017] In some embodiments, the performing word segmentation, part-of-speech tagging, and syntactic analysis on the question using a preset Chinese natural language processing method to obtain the keywords and constraints of the question includes:
[0018] Perform word segmentation, part-of-speech tagging, and syntactic analysis on the question using a preset Chinese natural language processing method to obtain the keywords of the question, the part-of-speech of the keywords, the association relationship between the keywords, and the
[0019] syntactic structure;
[0020] Extract keywords from the questions with different syntactic structures according to the association relationship between the keywords to obtain the keywords and constraints of the questions.
[0021] In some embodiments, the constructing the Q&A correspondence between the question and the answer corresponding to the question based on the keywords, constraints, and question type using a preset CVT composite node includes:
[0022] Based on a preset resource description framework, express the question sentence in the form of a combination of triples, and store the keywords, constraints, and answers of the question sentence in separate nodes;
[0023] Construct a connection expression of the question sentence between the nodes corresponding to the keywords and constraints and a preset CVT composite node;
[0024] Using the question sentence type as the response relationship, construct a connection between the connection expression of the question sentence and the node corresponding to the answer to form a question-answer correspondence relationship.
[0025] 5 In some embodiments, perform syntactic analysis on the question sentence by using a preset Chinese natural language processing method to obtain the question sentence type in the question sentence, including:
[0026] Perform syntactic analysis on the question sentence by using a preset Chinese natural language processing method to obtain the question sentence type in the question sentence, including:
[0027] Use a preset induction and sorting method to determine the types involved in the question sentences in the document, and construct a custom question sentence type word group dictionary;
[0028] Perform word segmentation, part-of-speech tagging, and syntactic analysis on the question sentence by using a preset Chinese natural language processing method to obtain the type keywords of the question sentence;
[0029] Determine whether the type keywords match the type word groups in the custom question sentence type word group dictionary;
[0030] If they match, determine the type word group corresponding to the type keywords as the target question sentence type of the question sentence;
[0031] If they do not match, find type similar words through a second similarity calculation, and determine the type word group corresponding to the type similar words as the target question sentence type of the question sentence.
[0032] In some embodiments, the determination of whether the type keywords match the type word groups in the custom question sentence type word group dictionary includes:
[0033] Use a preset Aho-Corasick automaton to construct a trie of question sentence type word groups;
[0034] Based on the trie of question sentence type word groups, match the type keywords with the type word groups in the custom question sentence type word group dictionary.
[0035] In some embodiments, the obtaining of the answer corresponding to the to-be-query question sentence according to the question-answer correspondence relationship in the knowledge graph through the to-be-query keyword and the to-be-query question sentence type includes:
[0036] According to the to-be-query keyword, determine the connected to-be-query CVT composite nodes and form a CVT node set;
[0037] Determine an expected set according to the intersection formed by the set of CVT nodes;
[0038] Taking the type of the query question to be answered as a response condition, determine the answer corresponding to the query question in the expected set.
[0039] In a second aspect, the present invention further provides an intelligent question and answer generation device, including:
[0040] An acquisition module for acquiring questions and corresponding answers in a file;
[0041] A syntactic analysis module for performing syntactic analysis on the question by using a preset Chinese natural language processing method to obtain keywords, constraint conditions and question types in the question;
[0042] A question-answer correspondence determination module for constructing a question-answer correspondence between the question and the answer corresponding to the question by using a preset CVT composite node based on the keywords, constraint conditions and question types, and generating a knowledge graph of the question-answer correspondence;
[0043] A query module for acquiring a query question to be answered, performing syntactic analysis on the query question to be answered, determining query keywords and a query question type, and obtaining the answer corresponding to the query question to be answered through the query keywords and the query question type according to the question-answer correspondence in the knowledge graph.
[0044] In a third aspect, the present invention further provides an electronic device, including: a processor and a memory;
[0045] A computer-readable program executable by the processor is stored on the memory;
[0046] When the processor executes the computer-readable program, the steps in the above-mentioned intelligent question and answer generation method are implemented.
[0047] In a fourth aspect, the present invention further provides a computer-readable storage medium, where one or more programs are stored on the computer-readable storage medium, and the one or more programs can be executed by one or more processors to implement the steps in the above-mentioned intelligent question and answer generation method.
[0048] Compared with the prior art, the intelligent question-answering generation method, device, electronic device and storage medium provided by the present invention first obtain the questions and corresponding answers in the file, and then use a preset Chinese natural language processing method to perform syntactic analysis on the questions to obtain the keywords, constraints and question types in the questions. Subsequently, based on the keywords, constraints and question types, a preset CVT composite node is used to construct a question-answer correspondence relationship between the questions and the corresponding answers of the questions. When it is necessary to query the answer corresponding to a question, syntactic analysis is performed on the question to be queried to obtain the keyword to be queried and the question type to be queried, and then the answer corresponding to the question to be queried is obtained according to the question-answer correspondence relationship through the keyword to be queried and the question type to be queried; by analyzing the questions, an accurate correspondence relationship between the questions and the answers is established, achieving the purpose of quickly and accurately realizing question-answer pairing. BRIEF DESCRIPTION OF THE DRAWINGS
[0049] Figure 1 is a flowchart of an embodiment of the intelligent question-answering generation method provided by the present invention;
[0050] Figure 2 is a flowchart of an embodiment of step 102 in the intelligent question-answering generation method provided by the present invention;
[0051] Figure 3 is a flowchart of an embodiment of step 202 in the intelligent question-answering generation method provided by the present invention;
[0052] Figure 4 is a schematic diagram of the relationship of the keyword relationship extraction rule implemented in the intelligent question-answering generation method provided by the present invention;
[0053] Figure 5 is a flowchart of an embodiment of step 103 in the intelligent question-answering generation method provided by the present invention;
[0054] Figure 6 is a schematic structural diagram of an embodiment of the storage mode of questions and their answers in the knowledge base in the intelligent question-answering generation method provided by the present invention;
[0055] Figure 7 is a flowchart of an embodiment of step 104 in the intelligent question-answering generation method provided by the present invention;
[0056] Figure 8 is a schematic diagram of an embodiment of the intelligent question-answering generation device provided by the present invention;
[0057] Figure 9 is a schematic diagram of the operating environment of an embodiment of the electronic device provided by the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0058] In order to make the objectives, technical solutions and advantages of the present invention more clear and understandable, the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.
[0059] The intelligent question-answering generation method, device, electronic device and storage medium involved in the present invention precisely establish the question-answering relationship between questions and answers by performing syntactic analysis on questions, and generate query statements by extracting keywords and question types of questions. According to the knowledge base generated by the question-answering relationship, the answers corresponding to the questions are obtained through the query statements, and it can be applied to fields such as government, hospitals, enterprises and various institutions that involve the need to publicly announce or avoid repetitive reply labor to achieve the purpose of intelligent question-answering.
[0060] An embodiment of the present invention provides an intelligent question-answering generation method. Please refer to Figure 1 , including:
[0061] S101. Obtain the questions and corresponding answers in the file;
[0062] S102. Perform syntactic analysis on the question using a preset Chinese natural language processing method to obtain keywords, constraints and question types in the question;
[0063] S103. Based on the keywords, constraints and question types, use a preset CVT composite node to construct a question-answering correspondence between the question and the answer corresponding to the question, and generate a knowledge graph of the question-answering correspondence;
[0064] S104. Obtain the question to be queried, perform syntactic analysis on the question to be queried to determine the keyword to be queried and the question type to be queried, and obtain the answer corresponding to the question to be queried through the keyword to be queried and the question type to be queried according to the question-answering correspondence in the knowledge graph.
[0065] In this embodiment, first, the questions and corresponding answers in the file are obtained, and then a preset Chinese natural language processing method is used to perform syntactic analysis on the questions to obtain keywords, constraints and question types in the questions. Then, based on the keywords, constraints and question types, a preset CVT composite node is used to construct a question-answering correspondence between the questions and the answers corresponding to the questions. When it is necessary to query the answers corresponding to the questions, syntactic analysis is performed on the questions to be queried to obtain the keywords to be queried and the question types to be queried, and then the answers corresponding to the questions to be queried are obtained through the keyword to be queried and the question type to be queried according to the question-answering correspondence; by analyzing the questions, a precise correspondence between the questions and the answers is established, achieving the purpose of quickly and accurately realizing question-answer pairing.
[0066] In a specific embodiment, relevant Q&A pair texts recorded by the government center and various regulatory documents publicized on the government website are obtained.
[0067] It should be noted that LTP is the "Language Technology Platform (LTP)" developed by the Research Center for Social Computing and Information Retrieval at Harbin Institute of Technology. LTP provides a series of Chinese natural language processing tools, and users can use these tools to perform tasks such as word segmentation, part-of-speech tagging, and syntactic analysis on Chinese texts.
[0068] Furthermore, Compound Value Types (CVT nodes) are nodes of a composite value type, a type in Freebase, used to represent data, where each entry consists of multiple domains. The composite value type or CVT is used in Freebase to represent complex data. It may be a bit confusing at first, but CVT is a very important part of the Freebase schema, which can make it more accurately model complex relationships between topics. For example: The urban population changes over time. That is to say, when querying the population using Freebase, it at least implies querying the population at a specific time. Two values are involved, one is the number of people, and the other is the date. In this case, CVT becomes very useful. To model population data, a topic needs to be created, named something like "Vancouver's population in 1997", and then the information is submitted. CVT can be considered as a topic that does not require specifying a display name. Like ordinary topics, CVT has a GUID that can be independently referenced. However, the way Freebase clients view CVT is very different from ordinary topics. In most cases, each attribute of CVT should be a disambiguation attribute.
[0069] In some embodiments, refer to Figure 2 , the syntactic analysis of the question sentence is performed using a preset Chinese natural language processing method to obtain the keyword and constraint condition in the question sentence, including:
[0070] S201. Construct a custom word group dictionary according to the inherent phrase collocations involved in the document;
[0071] S202. Perform word segmentation, part-of-speech tagging, and syntactic analysis on the question sentence using a preset Chinese natural language processing method to obtain the keyword and constraint condition of the question sentence;
[0072] S203. Judge whether the keyword matches the phrase in the custom word group dictionary;
[0073] S204. If it matches, determine the keyword as the target keyword of the question sentence;
[0074] S205. If there is no match, find similar words through the first similarity calculation, and determine the similar words as the target keywords of the question sentence.
[0075] In this embodiment, the original texts are Q&A pairs and normative regulation texts, and there are a large number of restrictive conditions in the sentences, targeting a large number of different types of scenarios and populations. Therefore, from the perspective of grammatical components, there are a large number of attributive, adverbial, and complement structures in the above original texts as the restrictive premises for the establishment of a certain fact. By using the preset Chinese natural language processing method to perform syntactic analysis on the question sentence, according to the sentence components and the dependency analysis results, extracting the keyword relationship triples and restrictive conditions in the sentence can extract the facts in the Q&A pairs and normative regulations as completely as possible.
[0076] Furthermore, by constructing custom inherent phrase collocations, it is possible to avoid inaccurate keyword positioning caused by splitting the inherent collocation phrases when the question sentence is segmented. By comparing the matching degree between the keywords obtained by the Chinese natural language processing method and the phrases in the custom word dictionary, the target keywords are determined.
[0077] In some embodiments, please refer to Figure 3 , the use of the preset Chinese natural language processing method to perform word segmentation, part-of-speech tagging, and syntactic analysis on the question sentence to obtain the keywords and restrictive conditions of the question sentence, including:
[0078] S301. Use the preset Chinese natural language processing method to perform word segmentation, part-of-speech tagging, and syntactic analysis on the question sentence to obtain the keywords of the question sentence, the part-of-speech of the keywords, the association relationship between the keywords, and the syntactic structure;
[0079] S302. According to the association relationship between the keywords, perform keyword extraction on the question sentences with different syntactic structures to obtain the keywords and restrictive conditions of the question sentence.
[0080] In this embodiment, the keywords marked in the question sentence, the part-of-speech of the keywords, and the dependency relationship between the keywords can be obtained from the LTP analysis results. According to the keywords, the part-of-speech of the keywords, and the dependency relationship between the keywords, multiple triples of "keyword - attribute - attribute value" and "keyword - relationship - keyword" are extracted from the sentence. For the extraction rules, please refer to Figure 4 , then add CVT composite nodes to the above triples, make the keywords of the triples point to the CVT nodes, and finally add the relationship with the question type as the response, so that the CVT node of the question sentence points to the corresponding answer.
[0081] In some embodiments, please refer to Figure 5 , the establishment of the Q&A correspondence relationship between the question sentence and the answer corresponding to the question sentence by using the preset CVT composite node based on the keywords, restrictive conditions, and question type, including:
[0082] S501. Based on a preset Resource Description Framework, express the question in the form of a combination of triples, and store the keywords, constraints, and answers of the question through separate nodes.
[0083] S502. Construct a connection expression of the question between the nodes corresponding to the keywords and constraints and a preset CVT composite node.
[0084] S503. Using the question type as the response relationship, construct a connection between the connection expression of the question and the node corresponding to the answer to form a question-answer correspondence.
[0085] In this embodiment, in combination with the characteristics of the text, the conditional constraints of the question, and the complex and changeable identities and question scenarios of the questioners, refer to the storage methods of CVT composite nodes and RDF in Freebase to store household registration-related knowledge.
[0086] In a specific embodiment, taking "What materials are required for a newborn to be registered without taking the parents' surnames" as an example, please refer to Figure 6 , Figure 6 to represent the storage method of the question and its answer in the knowledge base. Among them, both the question keywords and constraints are keyword nodes, which are connected to the CVT composite node according to the relationship corresponding to the node attributes to form a triple; the answer is stored separately as a node, and forms a triple with the cvt composite node, and the relationship is the question type (for example, for what materials are required, the relationship between the cvt and the answer is "require materials").
[0087] Furthermore, store all the question-answer pair texts according to the Figure 6 knowledge representation method, and import the stored knowledge base into NEO4J to establish a household registration knowledge graph.
[0088] It should be noted that the Resource Description Framework (RDF) is a data model represented using XML syntax, used to describe the characteristics of Web resources and the relationships between resources. It was promulgated by the W3C on February 22, 1999. The main purpose of its formulation is to provide an infrastructure for various applications of metadata on the Web, enabling applications to exchange metadata on the Web to facilitate the automated processing of network resources. RDF is used in situations where information needs to be processed by applications rather than just displayed to people. RDF provides a general framework for expressing this information and enabling it to be exchanged between applications without losing semantics. Since it is a general framework, application designers can utilize off-the-shelf general RDF parsers. RDF assumes that any complex semantics can be expressed through the combination of several triples, and defines the form of such triples as "object-property-value" or "subject-predicate-object". Among them, resources that need to be public or general are bound with a recognizable Uniform Resource Identifer (URI).
[0089] In some embodiments, the syntactic analysis of the question sentence using a preset Chinese natural language processing method to obtain the question type in the question sentence includes:
[0090] Using a preset induction and sorting method to determine the types involved in the question sentence in the document and construct a custom question type word group dictionary;
[0091] Using a preset Chinese natural language processing method to perform word segmentation, part-of-speech tagging, and syntactic analysis on the question sentence to obtain the type keywords of the question sentence;
[0092] Determine whether the type keywords match the type word groups in the custom question type word group dictionary;
[0093] If they match, determine the type word group corresponding to the type keywords as the target question type of the question sentence;
[0094] If they do not match, find type similar words through the second similarity calculation, and determine the type word group corresponding to the type similar words as the target question type of the question sentence.
[0095] In some embodiments, the determination of whether the type keywords match the type word groups in the custom question type word group dictionary includes:
[0096] Using a preset Aho-Corasick automaton to construct a question type word group dictionary tree;
[0097] Based on the above question type phrase trie, match the type keywords with the type phrases in the custom question type phrase dictionary.
[0098] In this embodiment, a keyword dictionary is established and imported during question analysis to help extract keywords and constraint conditions in the sentence. In this design, LTP is used to segment the question, and an AC automaton is used to construct a trie to match the words in the question with the words in the keyword dictionary. When all matches in the trie fail, similarity calculation is used to find similar words.
[0099] In a specific embodiment, the question types involved in government documents may include five major categories: enumeration, entity, bool, process sorting, and maximum / minimum value, as well as 12 sub-categories: process, material, condition, time, location, cost, online handling, reservation, agency handling, urgent handling, collection, and noun explanation.
[0100] In some embodiments, please refer to Figure 7 , obtaining the answer corresponding to the to-be-query question through the to-be-query keyword and to-be-query question type according to the question-answer correspondence in the knowledge graph includes:
[0101] S701. Determine the connected to-be-query CVT composite nodes according to the to-be-query keyword and form a CVT node set;
[0102] S702. Determine the expected set according to the intersection formed by the CVT node set;
[0103] S703. Use the to-be-query question type as the response condition to determine the answer corresponding to the to-be-query question in the expected set.
[0104] In this embodiment, the final analysis result of the question is a dictionary composed of keywords and the question type id. Using the keyword as the entity node and the question type id as the relationship, construct a cypher query statement to retrieve and match the answer node in the NEO4J database.
[0105] In a specific embodiment, define a keyword dictionary {A, B, C}, and the answer query steps for question type D are as follows:
[0106] 1) Retrieve the attributes of the three nodes A, B, and C to determine the main entity and constraint conditions;
[0107] 2) Retrieve the CVT composite nodes connected to the three nodes A, B, and C respectively, and obtain sets E, F, and G;
[0108] 3) Take the intersection of the three sets E, F, and G to obtain set H, retrieve the answer node I connected by relationship D in set H, and output answer node I.
[0109] Under normal circumstances, the correct answer can be retrieved through the above steps. However, sometimes there may be situations such as incorrect recognition of the question keywords or missing question types. These are manifested as the following two situations in answer retrieval:
[0110] The set H is an empty set. At this time, the analysis result of the question is reconfirmed with the questioner, and the keyword dictionary {A, B, C} and the question type D are updated, and steps (1) to (3) are repeated;
[0111] There are multiple answer nodes I. Query the entity words and constraints connected to the CVT node in the set H, find the corresponding question, and ask the questioner whether they are asking this question. Update the keyword dictionary {A, B, C} and the question type D according to the answer, and repeat steps (1) to (3).
[0112] Based on the above intelligent question-answering generation method, an embodiment of the present invention also correspondingly provides an intelligent question-answering generation device 800. Please refer to Figure 8 , the intelligent question-answering generation device 800 includes an acquisition module 810, a syntactic analysis module 820, a question-answer correspondence determination module 830, and a query module 840.
[0113] The acquisition module 810 is used to acquire the questions and corresponding answers in the file;
[0114] The syntactic analysis module 820 is used to perform syntactic analysis on the question by using a preset Chinese natural language processing method to obtain the keywords, constraints, and question type in the question;
[0115] The question-answer correspondence determination module 830 is used to build the question-answer correspondence between the question and the answer corresponding to the question based on the keywords, constraints, and question type by using a preset CVT composite node, and generate a knowledge graph of the question-answer correspondence;
[0116] The query module 840 is used to acquire the question to be queried, perform syntactic analysis on the question to be queried, determine the keyword to be queried and the question type to be queried, and obtain the answer corresponding to the question to be queried through the keyword to be queried and the question type to be queried according to the question-answer correspondence in the knowledge graph.
[0117] As Figure 9 shown, based on the above intelligent question-answering generation method, the present invention also correspondingly provides an electronic device. The electronic device can be a computing device such as a mobile terminal, a desktop computer, a notebook, a palm computer, and a server. The electronic device includes a processor 910, a memory 920, and a display 930. Figure 9 Only some components of the electronic device are shown. However, it should be understood that it is not required to implement all the shown components, and more or fewer components can be alternatively implemented.
[0118] In some embodiments, the memory 920 may be an internal storage unit of the electronic device, such as a hard disk or memory of the electronic device. In other embodiments, the memory 920 may also be an external storage device of the electronic device, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) card, a Flash Card, etc. equipped on the electronic device. Further, the memory 920 may also include both an internal storage unit and an external storage device of the electronic device. The memory 920 is used to store application software installed on the electronic device and various types of data, such as program codes installed on the electronic device. The memory 920 may also be used to temporarily store data that has been output or will be output. In one embodiment, a smart question and answer generation program 940 is stored on the memory 920, and the smart question and answer generation program 940 can be executed by the processor 910, so as to implement the smart question and answer generation method of each embodiment of the present application.
[0119] In some embodiments, the processor 910 may be a central processing unit (CPU), a microprocessor, or other data processing chips, and is used to run the program codes stored in the memory 920 or process data, such as executing the smart question and answer generation method, etc.
[0120] In some embodiments, the display 930 may be an LED display, a liquid crystal display, a touch liquid crystal display, and an OLED (Organic Light-Emitting Diode) toucher, etc. The display 930 is used to display information on the smart question and answer generation device and to display a visual user interface. The components 910-930 of the electronic device communicate with each other through a system bus.
[0121] Of course, those of ordinary skill in the art can understand that all or part of the processes of implementing the methods in the above embodiments can be completed by instructing relevant hardware (such as a processor, a controller, etc.) through a computer program, and the program can be stored in a computer-readable storage medium. When the program is executed, it may include the processes of the above method embodiments. The storage medium may be a memory, a magnetic disk, an optical disk, etc.
[0122] The specific embodiments of the present invention described above do not constitute a limitation on the protection scope of the present invention. Any other corresponding changes and deformations made according to the technical concept of the present invention should be included in the protection scope of the claims of the present invention.
Claims
1. An intelligent question-answering generation method, characterized in that, Including: Obtain the questions and corresponding answers in the file; Perform syntactic analysis on the questions using a preset Chinese natural language processing method to obtain the keywords, constraints, and question types in the questions; Based on the keywords, constraints, and question types, use a preset CVT composite node to construct a question-answer correspondence between the questions and the corresponding answers, and generate a knowledge graph of the question-answer correspondence; Obtain a query question, perform syntactic analysis on the query question to determine the query keywords and query question type, and obtain the answer corresponding to the query question through the query keywords and query question type according to the question-answer correspondence in the knowledge graph; The step of using a preset CVT composite node to construct a question-answer correspondence between the questions and the corresponding answers based on the keywords, constraints, and question types includes: Based on a preset Resource Description Framework, express the questions in the form of triples and store the keywords, constraints, and answers of the questions through separate nodes; Construct a question connection expression between the nodes corresponding to the keywords and constraints and the preset CVT composite node; Using the question type as the response relationship, construct a connection between the question connection expression and the node corresponding to the answer to form a question-answer correspondence; The step of obtaining the answer corresponding to the query question through the query keywords and query question type according to the question-answer correspondence in the knowledge graph includes: Determine the connected query CVT composite nodes according to the query keywords and form a CVT node set; Determine an expected set according to the intersection formed by the CVT node set; Using the query question type as the response condition, determine the answer corresponding to the query question in the expected set.
2. The intelligent question-answering generation method according to claim 1, wherein The step of performing syntactic analysis on the questions using a preset Chinese natural language processing method to obtain the keywords and constraints in the questions includes: Construct a custom word dictionary according to the inherent phrase collocations involved in the file; Perform word segmentation, part-of-speech tagging, and syntactic analysis on the questions using a preset Chinese natural language processing method to obtain the keywords and constraints of the questions; Judge whether the keywords match the phrases in the custom word dictionary; If they match, determine the keywords as the target keywords of the questions; If they do not match, find similar words through the first similarity calculation and determine the similar words as the target keywords of the questions.
3. The intelligent question-answering generation method according to claim 2, wherein The step of performing word segmentation, part-of-speech tagging, and syntactic analysis on the questions using a preset Chinese natural language processing method to obtain the keywords and constraints of the questions includes: Perform word segmentation, part-of-speech tagging, and syntactic analysis on the questions using a preset Chinese natural language processing method to obtain the keywords of the questions, the part-of-speech of the keywords, the association relationship between the keywords, and the syntactic structure; According to the association relationship between the keywords, extract keywords from the questions with different syntactic structures to obtain the keywords and constraints of the questions.
4. The intelligent question-answering generation method according to claim 1, wherein The step of performing syntactic analysis on the questions using a preset Chinese natural language processing method to obtain the question types in the questions includes: Use a preset induction and organization method to determine the types involved in the questions in the document, and construct a custom question type phrase dictionary; Use a preset Chinese natural language processing method to segment, part-of-speech tag, and syntactic analyze the question to obtain the type keywords of the question; Determine whether the type keywords match the type phrases in the custom question type phrase dictionary; If they match, determine the type phrase corresponding to the type keywords as the target question type of the question; If they do not match, find type similar words through the second similarity calculation, and determine the type phrase corresponding to the type similar words as the target question type of the question.
5. The intelligent question and answer generation method according to claim 4, wherein The determination of whether the type keywords match the type phrases in the custom question type phrase dictionary includes: Use a preset Aho-Corasick automaton to construct a question type phrase dictionary trie; Based on the question type phrase dictionary trie, match the type keywords with the type phrases in the custom question type phrase dictionary.
6. An intelligent question-answering generation device, characterized in that, Include: An acquisition module for acquiring the questions and corresponding answers in the document; A syntactic analysis module for syntactically analyzing the question using a preset Chinese natural language processing method to obtain the keywords, constraints, and question type in the question; A question-answer correspondence determination module for constructing a question-answer correspondence between the question and the corresponding answer of the question based on the keywords, constraints, and question type, using a preset CVT composite node, and generating a knowledge graph of the question-answer correspondence; A query module for acquiring a query question, syntactically analyzing the query question to determine the query keywords and query question type, and obtaining the answer corresponding to the query question through the query keywords and query question type according to the question-answer correspondence in the knowledge graph; The construction of the question-answer correspondence between the question and the corresponding answer of the question based on the keywords, constraints, and question type, using a preset CVT composite node, includes: Based on a preset Resource Description Framework, express the question in a combination of triples and store the keywords, constraints, and answers of the question through separate nodes; Construct a question connection expression between the nodes corresponding to the keywords and constraints and a preset CVT composite node; Using the question type as the response relationship, construct a connection between the question connection expression and the node corresponding to the answer to form a question-answer correspondence; The obtaining of the answer corresponding to the query question through the query keywords and query question type according to the question-answer correspondence in the knowledge graph includes: According to the query keywords, determine the connected query CVT composite nodes and form a CVT node set; Determine the expected set according to the intersection formed by the CVT node set; Using the query question type as the response condition, determine the answer corresponding to the query question in the expected set.
7. An electronic device, characterized in that, Include: A processor and a memory; The memory stores a computer-readable program executable by the processor; When the processor executes the computer-readable program, it implements the steps in the intelligent question-and-answer generation method according to any one of claims 1-5.
8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the steps in the intelligent question-and-answer generation method according to any one of claims 1-5.
Citation Information
Patent Citations
Systems and methods for human inspired simple question answering (HISQA)
CN106649514A
Answer sentence generation method and device, computer equipment and storage medium
CN113626571A