CN109840255A - Reply document creation method, device, equipment and storage medium - Google Patents

Reply document creation method, device, equipment and storage medium Download PDF

Info

Publication number
CN109840255A
CN109840255A CN201910020809.3A CN201910020809A CN109840255A CN 109840255 A CN109840255 A CN 109840255A CN 201910020809 A CN201910020809 A CN 201910020809A CN 109840255 A CN109840255 A CN 109840255A
Authority
CN
China
Prior art keywords
enquirement
keyword
text
syntactic structure
answer
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201910020809.3A
Other languages
Chinese (zh)
Other versions
CN109840255B (en
Inventor
金戈
徐亮
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ping An Technology Shenzhen Co Ltd
Original Assignee
Ping An Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Ping An Technology Shenzhen Co Ltd filed Critical Ping An Technology Shenzhen Co Ltd
Priority to CN201910020809.3A priority Critical patent/CN109840255B/en
Publication of CN109840255A publication Critical patent/CN109840255A/en
Application granted granted Critical
Publication of CN109840255B publication Critical patent/CN109840255B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

The present invention relates to natural language processing technique fields, disclose a kind of answer document creation method, device, equipment and storage medium, it the described method comprises the following steps: the enquirement text being handled by bidirectional circulating neural network, obtain context data corresponding with each enquirement keyword;According to each enquirement keyword and context data corresponding with each enquirement keyword, obtains target and reply syntactic structure and word extracting rule associated with target answer syntactic structure;Association content corresponding with each enquirement keyword is searched in graphic data base, according to each enquirement keyword and the association content production Methods tables of data found;Syntactic structure, the word extracting rule and the relation database table, which are replied, according to the target generates answer text.The present invention can be improved the accuracy to text resolution, and can be improved the compatible degree putd question between text and answer text.

Description

Reply document creation method, device, equipment and storage medium
Technical field
The present invention relates to semantic analytic technique field more particularly to a kind of answer document creation method, device, equipment and deposit Storage media.
Background technique
Question answering system refers to, the system for replying text can be automatically generated according to the enquirement text that user inputs, in intelligence The technical fields such as customer service, machine chat are widely used.In question answering system, user input enquirement text be usually according to Natural language is write as, since natural language cannot directly be understood by computer, therefore needs according to spatial term specification language Justice indicates (formal meaning representation), and computer could be indicated according to formal semantics, be proposed to user The problem of understood, such computer can to user propose the problem of answer.Generation specification in the prior art Semantic expressiveness is usually to look into according to the structuring that structured query language (Structured Query Language, SQL) is write as Sentence is ask, however, the grammatical sequence of structured query sentence itself limits, is understood with the diversity of natural language to a certain extent It can not agree with, so that being easy to appear deviation to the parsing result for puing question to text, and lead to the answer text generated and put question to text Between compatible degree it is also not high, be not able to satisfy user's needs.
Summary of the invention
The main purpose of the present invention is to provide a kind of answer document creation method, device, equipment and storage medium, purports Solving how to improve the technical issues of replying text and put question to the compatible degree between text of generation.
To achieve the above object, the present invention provides a kind of answer document creation method, the answer document creation methods The following steps are included:
Extract the enquirement keyword putd question in text;
The enquirement text is handled by bidirectional circulating neural network, is obtained on corresponding with each enquirement keyword Context data;
According to each enquirement keyword and context data corresponding with each enquirement keyword, obtains target and reply grammer knot Structure and word extracting rule associated with target answer syntactic structure;
Association content corresponding with each enquirement keyword is searched in graphic data base, according to each enquirement keyword and is looked into The association content production Methods tables of data found;
Syntactic structure, the word extracting rule and the relation database table, which are replied, according to the target generates answer text This.
Preferably, the bidirectional circulating neural network includes the first one-way circulation neural network and the second one-way circulation nerve Network;
The enquirement text is handled by bidirectional circulating neural network, is obtained on corresponding with each enquirement keyword The step of context data, specifically includes:
Each context data for puing question to keyword is extracted by the first one-way circulation neural network;
Each context data for puing question to keyword is extracted by the second one-way circulation neural network;
According to context data corresponding with each enquirement keyword and context data, generate corresponding with each enquirement keyword Context data.
Preferably, it according to each enquirement keyword and context data corresponding with each enquirement keyword, obtains target and answers It the step of multiple syntactic structure and word extracting rule associated with target answer syntactic structure, specifically includes:
According to each enquirement keyword and context data corresponding with each enquirement keyword, object question grammer knot is obtained Structure;
According to the object question syntactic structure, multiple corresponding answer syntactic structures are searched;
One of the multiple answer syntactic structure is randomly selected, replies syntactic structure as target;
Syntactic structure is replied according to the target, word associated with target answer syntactic structure is obtained and extracts rule Then.
Preferably, it according to each enquirement keyword and context data corresponding with each enquirement keyword, obtains target and mentions The step of asking syntactic structure specifically includes:
According to each enquirement keyword, multiple syntactic structure trees to be selected are obtained;
According to each enquirement keyword and context data corresponding with each enquirement keyword, the multiple language to be selected is chosen One of method structure tree, using the syntactic structure tree to be selected of selection as object question syntactic structure.
Preferably, it according to each enquirement keyword and context data corresponding with each enquirement keyword, chooses described more One of a syntactic structure tree to be selected, using the syntactic structure tree to be selected of selection as the step of object question syntactic structure, It specifically includes:
According to context data corresponding with each enquirement keyword, the corresponding part of speech of each enquirement keyword is obtained;
According to each enquirement keyword and part of speech corresponding with each enquirement keyword, the multiple syntax tree to be selected is calculated Respective fiducial probability;
Maximum one of fiducial probability in the multiple syntax tree to be selected is chosen, using the syntax tree to be selected of selection as target Put question to syntactic structure.
Preferably, extract in the step of puing question to the enquirement keyword in text, the enquirement keyword include interrogative with And non-interrogative;
Association content corresponding with each enquirement keyword is searched in graphic data base, according to each enquirement keyword and is looked into It the step of association content production Methods tables of data found, specifically includes:
According to each interrogative, association content corresponding with each non-interrogative is searched in graphic data base;
According to each non-interrogative and the association content production Methods tables of data found.
Preferably, according to each interrogative, the step for being associated with content corresponding with each non-interrogative is searched in graphic data base Suddenly, it specifically includes:
Node corresponding with the first determiner is searched in graphic data base, using the node found as start node;
According to the interrogative, lookup relationship type is determined;
According to the start node and the lookup relationship type, destination node is searched in graphic data base;
Using the corresponding content of the destination node found as association content corresponding with first determiner.
In addition, to achieve the above object, the present invention also proposes a kind of answer text generating apparatus, comprising:
Extraction module, for extracting the enquirement keyword putd question in text;
Module is obtained, for being handled by bidirectional circulating neural network the enquirement text, is obtained and each enquirement The corresponding context data of keyword;
The acquisition module is also used to according to each enquirement keyword and context data corresponding with each enquirement keyword, It obtains target and replies syntactic structure and word extracting rule associated with target answer syntactic structure;
Generation module searches association content corresponding with each enquirement keyword in graphic data base, is closed according to each enquirement Keyword and the association content production Methods tables of data found;
The generation module is also used to reply syntactic structure, the word extracting rule and the relationship according to the target Tables of data, which generates, replies text.
In addition, to achieve the above object, the present invention also proposes a kind of answer text generation equipment, the answer text generation Equipment includes: that the answer text that can run on the memory and on the processor of memory, processor and being stored in is raw At program, the step of answer text generator is arranged for carrying out answer document creation method as described above.
In addition, to achieve the above object, the present invention also proposes a kind of storage medium, answer is stored on the storage medium Text generator, the answer text generator realize answer text generation side as described above when being executed by processor The step of method.
In technical solution of the present invention, the extracted enquirement keyword putd question in text;Pass through bidirectional circulating neural network The enquirement text is handled, context data corresponding with each enquirement keyword is obtained;According to each enquirement keyword with And context data corresponding with each enquirement keyword, it obtains target and replies syntactic structure and reply grammer knot with the target The associated word extracting rule of structure;Association content corresponding with each enquirement keyword is searched in graphic data base, according to each The association content production Methods tables of data puing question to keyword and finding;Syntactic structure, institute's predicate are replied according to the target Language extracting rule and the relation database table, which generate, replies text, conducive to the accuracy improved to text resolution, and can be improved It puts question to text and replies the compatible degree between text.
Detailed description of the invention
Fig. 1 is the structural representation of the answer text generation equipment for the hardware running environment that the embodiment of the present invention is related to Figure;
Fig. 2 is the flow diagram that the present invention replies document creation method first embodiment;
Fig. 3 is the flow diagram that the present invention replies document creation method second embodiment;
Fig. 4 is the flow diagram that the present invention replies document creation method 3rd embodiment;
Fig. 5 is the flow diagram that the present invention replies document creation method fourth embodiment;
Fig. 6 is the structural block diagram for the first embodiment that the present invention replies text generating apparatus.
The embodiments will be further described with reference to the accompanying drawings for the realization, the function and the advantages of the object of the present invention.
Specific embodiment
It should be appreciated that described herein, specific examples are only used to explain the present invention, is not intended to limit the present invention.
Referring to Fig.1, Fig. 1 is the answer text generation device structure for the hardware running environment that the embodiment of the present invention is related to Schematic diagram.
As shown in Figure 1, the answer text generation equipment may include: processor 1001, such as central processing unit (Central Processing Unit, CPU), communication bus 1002, user interface 1003, network interface 1004, memory 1005.Wherein, communication bus 1002 is for realizing the connection communication between these components.User interface 1003 may include display Shield (Display), input unit such as keyboard (Keyboard), optional user interface 1003 can also include the wired of standard Interface, wireless interface.Network interface 1004 optionally may include standard wireline interface and wireless interface (such as Wireless Fidelity (WIreless-FIdelity, WI-FI) interface).Memory 1005 can be the random access memory (Random of high speed Access Memory, RAM), it is also possible to stable nonvolatile memory (Non-Volatile Memory, NVM), example Such as magnetic disk storage.Memory 1005 optionally can also be the storage device independently of aforementioned processor 1001.
It will be understood by those skilled in the art that structure shown in Fig. 1 is not constituted to the limit for replying text generation equipment It is fixed, it may include perhaps combining certain components or different component layouts than illustrating more or fewer components.
As shown in Figure 1, as may include operating system, network communication mould in a kind of memory 1005 of storage medium Block, Subscriber Interface Module SIM and answer text generator.
In answer text generation equipment shown in Fig. 1, network interface 1004 is mainly used for being counted with network server According to communication;User interface 1003 is mainly used for carrying out data interaction with user;The present invention replies the processing in text generation equipment Device 1001, memory 1005 can be set in replying text generation equipment, and the answer text generation equipment passes through processor The answer text generator stored in 1001 calling memories 1005, and it is raw to execute answer text provided in an embodiment of the present invention At method.
The embodiment of the invention provides a kind of answer document creation methods, are that the present invention replies text life referring to Fig. 2, Fig. 2 At the flow diagram of method first embodiment.
In the present embodiment, the answer document creation method the following steps are included:
Step S100: the enquirement keyword putd question in text is extracted;
It should be noted that the enquirement text is the text for recording user and proposing problem, and specifically, the enquirement text Originally it can be inputted, can also be inputted by user speech by user's text.The enquirement keyword is to be able to reflect the enquirement text The word of this content, for example, put question to text " What is the name of the president in America? " in, it mentions The enquirement keyword taken may include " what ", " name ", " president " and " America ", it will be understood that, extraction Puing question in keyword may include interrogative and non-interrogative, wherein according to the classification in English Grammar, " what " is query Word, " name " and " president " and " America " are non-interrogative, and the enquirement keyword can also only include non-query Word.
In the concrete realization, enquirement text can be divided by segmenting method (such as segmenting method based on dictionary) Word processing, to obtain puing question to keyword, all words that can have both obtained word segmentation processing, can also root as keyword is putd question to According to factors such as parts of speech, word is obtained to word segmentation processing and carries out a degree of screening, it is crucial as puing question to that obtained word will be screened Word.
Step S200: being handled the enquirement text by bidirectional circulating neural network, is obtained crucial with each enquirement The corresponding context data of word;
It should be noted that the context data refers to, it is able to reflect the data of each context for puing question to keyword.It can The case where understanding, often will appear polysemy in natural language, such as: it is dynamic that " can " in English both can be used as mood Word expression " can ", can also be used as noun indicates " can ", by obtaining context data in this step, contains conducive to word Justice is correctly parsed, and then is conducive to the syntactic structure that text is putd question in correct parsing.Recognition with Recurrent Neural Network (Recurrent Neural Network, RNN) it is a kind of artificial neural network that the connection of node orientation is cyclic, Recognition with Recurrent Neural Network is usually used in locating Reason includes the information of sequential structure, can be used for extracting the data in text with certain feature.However, the circulation nerve net of standard Network generally can not access to following contextual information in processing sequence in timing.Bidirectional circulating neural network (Bidirectional Recurrent Neural Network, BRNN) is a kind of improved Recognition with Recurrent Neural Network, two-way Recognition with Recurrent Neural Network is usually superimposed by the Recognition with Recurrent Neural Network of two standards and is formed, every in such bidirectional circulating neural network One training sequence can be respectively formed two Recognition with Recurrent Neural Network in the opposite direction.Bidirectional circulating neural network and standard Recognition with Recurrent Neural Network is compared, and it is more accurate to extract to the context data in text.
The present invention for by Two-way Cycle neural network to the specific steps that are handled of enquirement text with no restriction, In the concrete realization, the bidirectional circulating neural network may include the first one-way circulation neural network and the second one-way circulation mind Through network, the step S200 be can specifically include: extract each enquirement keyword by the first one-way circulation neural network Context data;Each context data for puing question to keyword is extracted by the second one-way circulation neural network;According to it is each The corresponding context data of keyword and context data are putd question to, context data corresponding with each enquirement keyword is generated.Specifically, It can be by the way that each context data for puing question to keyword and context data be simply merged, to obtain each enquirement keyword Context data.
Step S300: according to each enquirement keyword and context data corresponding with each enquirement keyword, target is obtained Reply syntactic structure and word extracting rule associated with target answer syntactic structure;
Refer to it should be noted that the target replies syntactic structure, syntactic structure used by the answer text of generation, The target syntactic structure be specifically as follows " subject (subject, S)+predicate (predicate, P)+object (O, object)".The word extracting rule refers to, for the rule that the vocabulary of answer text extracts, specifically, this implementation Refer in example, from the rule for extracting vocabulary in relation database table (referring to following step S400).
In the concrete realization, multiple answer syntactic structures, and corresponding different answer syntactic structure setting should be preset Corresponding word extracting rule, and syntactic structure and corresponding word extracting rule associated storage can will be replied, for mentioning When target being taken to reply syntactic structure, associated word extracting rule can be obtained by incidence relation.And in natural language In question and answer, put question to text and reply text usually there is the corresponding relationship in syntactic structure, therefore further using put question to text and Reply corresponding relationship of the text in syntactic structure, the available syntactic structure for replying text and using.Text is putd question to according to part This, the enquirement text that will directly can also be obtained according to each enquirement keyword and context data corresponding with each enquirement keyword This syntactic structure replies syntactic structure as the target, for example, for puing question to text " What is the name Of the president in America? ", can be answered using syntactic structure identical with the enquirement text, for example, answering Multiple text can be " Trump is the name of the president in America ".
It is worth noting that, the enquirement keyword extracted in the step s 100 can not include the query putd question in text Word, this will not influence the parsing to text grammer structure is putd question to, such as: according to sequence " the What is the name of of word Sequence " the is the name of the president in of the president in America " or word America " carries out syntax parsing, can obtain essentially identical syntactic structure.
It will be appreciated that by this present embodiment, parsing to syntactic structure is utilized and is obtained by Two-way Cycle neural network The context data taken enables the target obtained to reply syntactic structure and is consistent with context of co-text, is conducive to improve to text The accuracy of this parsing.
Step S400: searching association content corresponding with each enquirement keyword in graphic data base, is closed according to each enquirement Keyword and the association content production Methods tables of data found;
It should be noted that the graphic data base is to utilize the relation information between Graphics Application theory storage entity Database, the graphic data base are specially the side by the relationship between the node and presentation-entity of presentation-entity, formation Object diagram (graph), to realize modeling, wherein node and side can have the attribute of oneself.Different entities are according to different type Relationship get up, to form complicated object diagram.With the relationship type modeled using the relational implementation passed through between table and table Database is compared, and the connection in graphic data base between object is more direct, thus, graphic data base can have anti-faster Answer speed.In the present embodiment, the described image database of use is specifically as follows Neo4J etc..The association content refers to, is scheming There is in graphic data library with enquirement keyword the content of particular kind of relationship, it will be understood that, there is particular kind of relationship with keyword is putd question to Content, usually can be used for put question to text answer.The relation database table refers to, is able to reflect each enquirement keyword And the table of the relationship between corresponding association content can will put question to keyword as the relationship number in the concrete realization According to the column name of table, and using corresponding association content as train value, specifically, the relation database table can be as follows:
One example of 1 relation database table of table
Table is referred to, in relation database table as above, the first row record is column name, and subsequent each row record is column Value.It is worth noting that, the enquirement keyword extracted in the step s 100 can not include put question to text in interrogative, i.e., on The column for arranging entitled " What " can not included in table, it will be understood that, in this case, by being extracted in relation database table Answer text equally can be generated in word.
Step S500: it is raw that syntactic structure, the word extracting rule and the relation database table are replied according to the target At answer text.
It should be noted that the data in relation database table can not be arranged according to mode shown in table 1, for according to not With the relation database table that mode arranges, the word extracting rule should be pointedly according to the given alignment side of relation database table Formula setting, could take the word in the relation database table, accurately in this way to generate answer text.
In the concrete realization, generation can be extracted from the relation database table according to the word extracting rule and replies text The word used required for this will generate the word used required for replying text and arrange according to target answer syntactic structure Column, it can obtain the answer text.Specifically, if enquirement text is " What is the name of the President in America? ", the relation database table is as shown in table 1, and it is " subject+meaning that the target, which replies syntactic structure, Language+object+attribute ", extracting rule are as follows: subject be " name " column in other maximum train values of column name relevance, object, Attribute is to be determined according to column name, then available answer text " Trump is the name of the president in America".Wherein, according to extracting rule, size in " name " column with other column name relevances can pass through inquiry Preset lexical relation table obtains, and the preset lexical relation table can pass through the company between statistical graph database interior joint Connect situation acquisition.
It will be appreciated that replying text is to reply syntactic structure, the word according to the target by this present embodiment Extracting rule and the relation database table generate, and can be improved the compatible degree for replying text and natural language on grammatical form, And it can make to reply the form of thinking that text is more in line with natural person on replying rule, and then be conducive to improve and put question to text and answer Compatible degree between multiple text.
In the present embodiment, the extracted enquirement keyword putd question in text;It is mentioned by bidirectional circulating neural network to described It asks that text is handled, obtains context data corresponding with each enquirement keyword;According to each enquirement keyword and with respectively mention It asks keyword corresponding context data, obtain target answer syntactic structure and replies syntactic structure with the target and is associated Word extracting rule;Association content corresponding with each enquirement keyword is searched in graphic data base, it is crucial according to each enquirement Word and the association content production Methods tables of data found;Syntactic structure is replied according to the target, the word extracts rule It is then generated with the relation database table and replies text, conducive to the accuracy improved to text resolution, and can be improved enquirement text And reply the compatible degree between text.
It is the flow diagram that the present invention replies document creation method second embodiment with reference to Fig. 3, Fig. 3.
Based on above-mentioned first embodiment, in the present embodiment, the step S300 can specifically include following steps:
Step S310: according to each enquirement keyword and context data corresponding with each enquirement keyword, target is obtained Put question to syntactic structure;
It should be noted that the object question syntactic structure refers to, the grammer knot of the enquirement text as Target Acquisition Structure.It will be appreciated that the case where often will appear polysemy in natural language, such as: " can " in English both can be used as feelings Modal verb expression " can ", can also be used as noun indicates " can ", by obtaining context data in this step, is conducive to word Meaning correctly parsed, and then be conducive to the syntactic structure that text is putd question in correct parsing.In the concrete realization, the context Data may include that can embody each part of speech for puing question to keyword and can embody rhetoric relationship between each enquirement keyword Data.
Step S320: according to the object question syntactic structure, multiple corresponding answer syntactic structures are searched;
It should be noted that syntactic structure correspondence mappings relation table can be pre-established, the syntactic structure correspondence mappings Relation table can embody the corresponding relationship putd question between syntactic structure and answer syntactic structure.In this way, passing through query grammar structure Correspondence mappings relation table can find answer syntactic structure according to the object question syntactic structure.
It will be appreciated that can usually be made using a variety of different clause in natural language for same question sentence Answer, for example, for put question to text " What is the name of the president in America? ", can be with It replies " Trump is. ", " Trump is the name of the president. " can also be replied.It can be seen that according to A variety of possible answer syntactic structures can be set in a kind of enquirement syntactic structure, for choosing.
Step S330: randomly selecting one of the multiple answer syntactic structure, replies syntactic structure as target;
It will be appreciated that obtaining target by way of randomly selecting in this step and replying syntactic structure, can be improved and answer The multiple diversity of text in form, thus make that the answers text generated is closer to manually to reply as a result, to improve use Family experience.
Step S340: replying syntactic structure according to the target, obtains associated with target answer syntactic structure Word extracting rule.
It will be appreciated that first passing through extraction in the present embodiment and obtaining target answer syntactic structure, answered further according to the target Multiple syntactic structure, obtains word extracting rule, so that before being randomly selected, it is only necessary to obtain multiple answer grammer knots Structure is conducive to reduce the calculation amount that the present embodiment is realized in this way without obtaining multiple word extracting rules.
In the present embodiment, target is obtained by way of first randomly selecting and replies syntactic structure, then obtain word and extract rule Then, it can be improved and reply text diversity in form, so that the answer text generated be made to be closer to manually to reply As a result, to improve user experience, and calculation amount can be reduced.
It is the flow diagram that the present invention replies document creation method 3rd embodiment with reference to Fig. 4, Fig. 4.
Based on above-mentioned second embodiment, in the present embodiment, the step S310 can specifically include following steps:
Step S311: according to each enquirement keyword, multiple syntactic structure trees to be selected are obtained;
It should be noted that the syntactic structure tree to be selected refers in tree-shaped syntactic structure.In the concrete realization, described Syntactic structure tree to be selected can put question to keyword between the sequence putd question in text, enquirement keyword in form by each On the factors such as rhetoric relationship obtain, the syntactic structure tree to be selected can specifically be obtained by the methods of context-free approach. It will be appreciated that the ambiguity of text generally can not be thoroughly excluded by the syntactic structure of Program Generating, thus it is obtainable to be selected Syntactic structure tree is usually multiple.Further, the multiple syntactic structure tree to be selected can be obtained using different algorithms.
Step S312: according to each enquirement keyword and context data corresponding with each enquirement keyword, described in selection One of multiple syntactic structure trees to be selected, using the syntactic structure tree to be selected of selection as object question syntactic structure.
It will be appreciated that can more accurately determine each enquirement keyword in puing question to text according to the context data Meaning, so as to select one of the multiple syntactic structure tree to be selected as object question syntactic structure accordingly.
The present invention for selection target put question to syntactic structure concrete mode with no restriction, specifically, the step S312 It may include steps of: according to context data corresponding with each enquirement keyword, obtaining the corresponding word of each enquirement keyword Property;According to each enquirement keyword and part of speech corresponding with each enquirement keyword, the respective of the multiple syntax tree to be selected is calculated Fiducial probability;Choose maximum one of fiducial probability in the multiple syntax tree to be selected, using the syntax tree to be selected of selection as Object question syntactic structure.Since in natural language, the same word may have multiple parts of speech, therefore be determined by context data Each part of speech for puing question to keyword is used as the possible disagreement of grammatical item conducive to each enquirement keyword of exclusion, to be conducive to correct The syntactic structure of ground parsing question text.In the concrete realization, it can be realized based on Markov chain to each word for puing question to keyword Property analysis, thus obtain it is each put question to keyword part of speech.
In the present embodiment, by obtaining multiple syntactic structure trees to be selected, and according to each enquirement keyword and with each enquirement The corresponding context data of keyword therefrom chooses object question syntactic structure, conducive to avoiding to the solution for puing question to text grammer structure Mistake is analysed, to be conducive to improve the compatible degree putd question between text and answer text.
It is the flow diagram that the present invention replies document creation method fourth embodiment with reference to Fig. 5, Fig. 5.
Based on above-mentioned first embodiment, in the present embodiment, in the step S100, the enquirement keyword includes doubting Ask that word and non-interrogative, the step S400 can specifically include following steps:
S410: according to each interrogative, association content corresponding with each non-interrogative is searched in graphic data base;
It will be appreciated that usually requiring to carry out for interrogative to answering for natural language, for example, in English " when " answers, and needs the time for replying, answers to " where ", needs to reply place, and answers to " what ", it usually needs answers Tautonomy claims.In the present embodiment, association content is searched in graphic data base according to each interrogative, the association content searched can be made More agree between text with puing question to, to be conducive to improve the compatible degree putd question between text and answer text.
Concrete mode of the present invention for searching related content according to interrogative with no restriction, specifically, can use figure The included search function in graphic data library, realizes the lookup to association content.More targetedly to be looked into graphic data base Association content corresponding with each non-interrogative is looked for, this step can specifically include: searching in graphic data base and limits with first The corresponding node of word, using the node found as start node;According to the interrogative, lookup relationship type is determined;Root According to the start node and the lookup relationship type, destination node is searched in graphic data base;The target that will be found The corresponding content of node is as association content corresponding with first determiner.It will be appreciated that in graphic data base, connection Side between different nodes usually has attribute, the attribute on the side between different nodes, the relationship being able to reflect between node Type.Determine lookup relationship type by interrogative, and node searched with relationship type according to lookup, can more added with Pointedly realize the lookup to association content.
S420: according to each non-interrogative and the association content production Methods tables of data found.
It should be noted that in the present embodiment related content cannot be being found in graphic data base according to interrogative In the case where, in the relation database table of generation, interrogative can be without corresponding association content.As shown in Table 1 above, interrogative Related content can be other interrogatives, reply the answer content that may include in text for other interrogatives, this Sample is conducive to answer that the query of user more fully hereinafter.
In the present embodiment, by searching the related content of non-interrogative according to interrogative, the association content searched can be made More agree between text with puing question to, to be conducive to improve the compatible degree putd question between text and answer text.
In addition, the embodiment of the present invention also proposes a kind of storage medium, answer text generation is stored on the storage medium Program, it is described to reply the step that answer document creation method as described above is realized when text generator is executed by processor Suddenly.
It is the structural block diagram that the present invention replies text generating apparatus first embodiment referring to Fig. 6, Fig. 6.
As shown in fig. 6, the answer text generating apparatus that the embodiment of the present invention proposes includes:
Extraction module 100, for extracting the enquirement keyword putd question in text;
Module 200 is obtained, for handling by bidirectional circulating neural network the enquirement text, obtaining and respectively mentioning Ask keyword corresponding context data;
The acquisition module 200 is also used to according to each enquirement keyword and context number corresponding with each enquirement keyword According to acquisition target replies syntactic structure and word extracting rule associated with target answer syntactic structure;
Generation module 300 searches association content corresponding with each enquirement keyword, according to each enquirement in graphic data base Keyword and the association content production Methods tables of data found;
The generation module 300 is also used to reply syntactic structure, the word extracting rule and described according to the target Relation database table, which generates, replies text.
The present invention replies the other embodiments of text generating apparatus or specific implementation and can refer to above-mentioned each method and implement Example, details are not described herein again.
It should be noted that, in this document, the terms "include", "comprise" or its any other variant are intended to non-row His property includes, so that the process, method, article or the system that include a series of elements not only include those elements, and And further include other elements that are not explicitly listed, or further include for this process, method, article or system institute it is intrinsic Element.In the absence of more restrictions, the element limited by sentence "including a ...", it is not excluded that including being somebody's turn to do There is also other identical elements in the process, method of element, article or system.
The serial number of the above embodiments of the invention is only for description, does not represent the advantages or disadvantages of the embodiments.
Through the above description of the embodiments, those skilled in the art can be understood that above-described embodiment side Method can be realized by means of software and necessary general hardware platform, naturally it is also possible to by hardware, but in many cases The former is more preferably embodiment.Based on this understanding, technical solution of the present invention substantially in other words does the prior art The part contributed out can be embodied in the form of software products, which is stored in a storage medium In (such as read-only memory/random access memory, magnetic disk, CD), including some instructions are used so that a terminal device (can To be mobile phone, computer, server, air conditioner or the network equipment etc.) execute method described in each embodiment of the present invention.
The above is only a preferred embodiment of the present invention, is not intended to limit the scope of the invention, all to utilize this hair Equivalent structure or equivalent flow shift made by bright specification and accompanying drawing content is applied directly or indirectly in other relevant skills Art field, is included within the scope of the present invention.

Claims (10)

1. a kind of answer document creation method, which is characterized in that the answer document creation method the following steps are included:
Extract the enquirement keyword putd question in text;
The enquirement text is handled by bidirectional circulating neural network, obtains context corresponding with each enquirement keyword Data;
According to each enquirement keyword and context data corresponding with each enquirement keyword, obtain target reply syntactic structure with And word extracting rule associated with target answer syntactic structure;
Association content corresponding with each enquirement keyword is searched in graphic data base, according to each enquirement keyword and is found Association content production Methods tables of data;
Syntactic structure, the word extracting rule and the relation database table, which are replied, according to the target generates answer text.
2. replying document creation method as described in claim 1, which is characterized in that the bidirectional circulating neural network includes the One one-way circulation neural network and the second one-way circulation neural network;
The enquirement text is handled by bidirectional circulating neural network, obtains context corresponding with each enquirement keyword The step of data, specifically includes:
Each context data for puing question to keyword is extracted by the first one-way circulation neural network;
Each context data for puing question to keyword is extracted by the second one-way circulation neural network;
According to context data corresponding with each enquirement keyword and context data, generate above and below corresponding with each enquirement keyword Literary data.
3. as described in claim 1 reply document creation method, which is characterized in that according to each enquirement keyword and with respectively mention It asks keyword corresponding context data, obtain target answer syntactic structure and replies syntactic structure with the target and is associated Word extracting rule the step of, specifically include:
According to each enquirement keyword and context data corresponding with each enquirement keyword, object question syntactic structure is obtained;
According to the object question syntactic structure, multiple corresponding answer syntactic structures are searched;
One of the multiple answer syntactic structure is randomly selected, replies syntactic structure as target;
Syntactic structure is replied according to the target, obtains word extracting rule associated with target answer syntactic structure.
4. as claimed in claim 3 reply document creation method, which is characterized in that according to each enquirement keyword and with respectively mention The step of asking keyword corresponding context data, obtaining object question syntactic structure, specifically includes:
According to each enquirement keyword, multiple syntactic structure trees to be selected are obtained;
According to each enquirement keyword and context data corresponding with each enquirement keyword, the multiple grammer knot to be selected is chosen One of paper mulberry, using the syntactic structure tree to be selected of selection as object question syntactic structure.
5. as claimed in claim 4 reply document creation method, which is characterized in that according to each enquirement keyword and with respectively mention It asks keyword corresponding context data, one of the multiple syntactic structure tree to be selected is chosen, by the language to be selected of selection The step of method structure tree is as object question syntactic structure, specifically includes:
According to context data corresponding with each enquirement keyword, the corresponding part of speech of each enquirement keyword is obtained;
According to each enquirement keyword and part of speech corresponding with each enquirement keyword, the respective of the multiple syntax tree to be selected is calculated Fiducial probability;
Maximum one of fiducial probability in the multiple syntax tree to be selected is chosen, using the syntax tree to be selected of selection as object question Syntactic structure.
6. replying document creation method as described in claim 1, which is characterized in that extract the enquirement keyword putd question in text The step of in, the enquirement keyword includes interrogative and non-interrogative;
Association content corresponding with each enquirement keyword is searched in graphic data base, according to each enquirement keyword and is found Association content production Methods tables of data the step of, specifically include:
According to each interrogative, association content corresponding with each non-interrogative is searched in graphic data base;
According to each non-interrogative and the association content production Methods tables of data found.
7. replying document creation method as claimed in claim 6, which is characterized in that according to each interrogative, in graphic data base It the step of middle lookup corresponding with each non-interrogative association content, specifically includes:
Node corresponding with the first determiner is searched in graphic data base, using the node found as start node;
According to the interrogative, lookup relationship type is determined;
According to the start node and the lookup relationship type, destination node is searched in graphic data base;
Using the corresponding content of the destination node found as association content corresponding with first determiner.
8. a kind of answer text generating apparatus characterized by comprising
Extraction module, for extracting the enquirement keyword putd question in text;
Module is obtained, for being handled by bidirectional circulating neural network the enquirement text, is obtained crucial with each enquirement The corresponding context data of word;
The acquisition module is also used to be obtained according to each enquirement keyword and context data corresponding with each enquirement keyword Target replies syntactic structure and word extracting rule associated with target answer syntactic structure;
Generation module searches association content corresponding with each enquirement keyword, according to each enquirement keyword in graphic data base And the association content production Methods tables of data found;
The generation module is also used to reply syntactic structure, the word extracting rule and the relation data according to the target Table, which generates, replies text.
9. a kind of answer text generation equipment, which is characterized in that the answer text generation equipment includes: memory, processor And it is stored in the answer text generator that can be run on the memory and on the processor, the answer text generation Program is arranged for carrying out the step of answer document creation method as described in any one of claims 1 to 7.
10. a kind of storage medium, which is characterized in that be stored with answer text generator, the answer on the storage medium The step as described in any one of claim 1 to 7 for replying document creation method is realized when text generator is executed by processor Suddenly.
CN201910020809.3A 2019-01-09 2019-01-09 Reply text generation method, device, equipment and storage medium Active CN109840255B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910020809.3A CN109840255B (en) 2019-01-09 2019-01-09 Reply text generation method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910020809.3A CN109840255B (en) 2019-01-09 2019-01-09 Reply text generation method, device, equipment and storage medium

Publications (2)

Publication Number Publication Date
CN109840255A true CN109840255A (en) 2019-06-04
CN109840255B CN109840255B (en) 2023-09-19

Family

ID=66883726

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910020809.3A Active CN109840255B (en) 2019-01-09 2019-01-09 Reply text generation method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN109840255B (en)

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110309378A (en) * 2019-06-28 2019-10-08 深圳前海微众银行股份有限公司 A kind of processing method that problem replies, apparatus and system
CN110309282A (en) * 2019-06-14 2019-10-08 北京奇艺世纪科技有限公司 A kind of answer determines method and device
CN110931012A (en) * 2019-10-12 2020-03-27 深圳壹账通智能科技有限公司 Reply message generation method and device, computer equipment and storage medium
WO2022068197A1 (en) * 2020-09-30 2022-04-07 平安科技(深圳)有限公司 Conversation generation method and apparatus, device, and readable storage medium
CN117033664A (en) * 2023-09-28 2023-11-10 腾讯科技(深圳)有限公司 Service sequence diagram generation method, device, computer equipment and storage medium
CN117610506A (en) * 2023-11-24 2024-02-27 中国人民解放军军事科学院系统工程研究院 Text information extraction method and device
CN117610506B (en) * 2023-11-24 2024-04-30 中国人民解放军军事科学院系统工程研究院 Text information extraction method and device

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105068661A (en) * 2015-09-07 2015-11-18 百度在线网络技术(北京)有限公司 Man-machine interaction method and system based on artificial intelligence
CN106469212A (en) * 2016-09-05 2017-03-01 北京百度网讯科技有限公司 Man-machine interaction method based on artificial intelligence and device
CN106997399A (en) * 2017-05-24 2017-08-01 海南大学 A kind of classification question answering system design method that framework is associated based on data collection of illustrative plates, Information Atlas, knowledge mapping and wisdom collection of illustrative plates
CN108595494A (en) * 2018-03-15 2018-09-28 腾讯科技(深圳)有限公司 The acquisition methods and device of reply message
WO2018226404A1 (en) * 2017-06-09 2018-12-13 Microsoft Technology Licensing, Llc Machine reasoning based on knowledge graph

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105068661A (en) * 2015-09-07 2015-11-18 百度在线网络技术(北京)有限公司 Man-machine interaction method and system based on artificial intelligence
CN106469212A (en) * 2016-09-05 2017-03-01 北京百度网讯科技有限公司 Man-machine interaction method based on artificial intelligence and device
WO2018040501A1 (en) * 2016-09-05 2018-03-08 北京百度网讯科技有限公司 Man-machine interaction method and apparatus based on artificial intelligence
CN106997399A (en) * 2017-05-24 2017-08-01 海南大学 A kind of classification question answering system design method that framework is associated based on data collection of illustrative plates, Information Atlas, knowledge mapping and wisdom collection of illustrative plates
WO2018226404A1 (en) * 2017-06-09 2018-12-13 Microsoft Technology Licensing, Llc Machine reasoning based on knowledge graph
CN108595494A (en) * 2018-03-15 2018-09-28 腾讯科技(深圳)有限公司 The acquisition methods and device of reply message

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110309282A (en) * 2019-06-14 2019-10-08 北京奇艺世纪科技有限公司 A kind of answer determines method and device
CN110309378A (en) * 2019-06-28 2019-10-08 深圳前海微众银行股份有限公司 A kind of processing method that problem replies, apparatus and system
CN110309378B (en) * 2019-06-28 2023-06-09 深圳前海微众银行股份有限公司 Method, device and system for processing question replies
CN110931012A (en) * 2019-10-12 2020-03-27 深圳壹账通智能科技有限公司 Reply message generation method and device, computer equipment and storage medium
WO2022068197A1 (en) * 2020-09-30 2022-04-07 平安科技(深圳)有限公司 Conversation generation method and apparatus, device, and readable storage medium
CN117033664A (en) * 2023-09-28 2023-11-10 腾讯科技(深圳)有限公司 Service sequence diagram generation method, device, computer equipment and storage medium
CN117033664B (en) * 2023-09-28 2024-01-09 腾讯科技(深圳)有限公司 Service sequence diagram generation method, device, computer equipment and storage medium
CN117610506A (en) * 2023-11-24 2024-02-27 中国人民解放军军事科学院系统工程研究院 Text information extraction method and device
CN117610506B (en) * 2023-11-24 2024-04-30 中国人民解放军军事科学院系统工程研究院 Text information extraction method and device

Also Published As

Publication number Publication date
CN109840255B (en) 2023-09-19

Similar Documents

Publication Publication Date Title
CN111353310B (en) Named entity identification method and device based on artificial intelligence and electronic equipment
US11640515B2 (en) Method and neural network system for human-computer interaction, and user equipment
Cotterell et al. CoNLL-SIGMORPHON 2017 shared task: Universal morphological reinflection in 52 languages
CN105701253B (en) The knowledge base automatic question-answering method of Chinese natural language question semanteme
CN109783618B (en) Attention mechanism neural network-based drug entity relationship extraction method and system
Grishman Information extraction
RU2564629C1 (en) Method of clustering of search results depending on semantics
JP5936698B2 (en) Word semantic relation extraction device
CN109840255A (en) Reply document creation method, device, equipment and storage medium
US20160147737A1 (en) Question answering system and method for structured knowledgebase using deep natual language question analysis
CN109408811B (en) Data processing method and server
CN109783806B (en) Text matching method utilizing semantic parsing structure
AU2009279767A1 (en) Systems and methods for concept mapping
KR102292040B1 (en) System and method for extracting knowledge based on machine reading
US20140180728A1 (en) Natural Language Processing
CN112328800A (en) System and method for automatically generating programming specification question answers
JP2011118689A (en) Retrieval method and system
CN108491399B (en) Chinese-English machine translation method based on context iterative analysis
Hutajulu et al. Text Data Processing in Requirement Specifications as a Reference for Similarities Between Use Case Diagrams and Use Case Descriptions for Smart Sleeping Lamp Application Documents
CN112380848B (en) Text generation method, device, equipment and storage medium
CN117271558A (en) Language query model construction method, query language acquisition method and related devices
US20210182549A1 (en) Natural Language Processing (NLP) Pipeline for Automated Attribute Extraction
US20220366135A1 (en) Extended open information extraction system
CN109992651A (en) A kind of problem target signature automatic identification and abstracting method
CN114154496A (en) Coal prison classification scheme comparison method and device based on deep learning BERT model

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant