CN109543018A - Answer generation method, device, electronic equipment and storage medium - Google Patents

Answer generation method, device, electronic equipment and storage medium Download PDF

Info

Publication number
CN109543018A
CN109543018A CN201811422591.6A CN201811422591A CN109543018A CN 109543018 A CN109543018 A CN 109543018A CN 201811422591 A CN201811422591 A CN 201811422591A CN 109543018 A CN109543018 A CN 109543018A
Authority
CN
China
Prior art keywords
knowledge
answer
intermediate path
entity
user
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.)
Pending
Application number
CN201811422591.6A
Other languages
Chinese (zh)
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.)
Volkswagen China Investment Co Ltd
Mobvoi Innovation Technology Co Ltd
Original Assignee
Beijing Yushanzhi Information Technology 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 Beijing Yushanzhi Information Technology Co Ltd filed Critical Beijing Yushanzhi Information Technology Co Ltd
Priority to CN201811422591.6A priority Critical patent/CN109543018A/en
Publication of CN109543018A publication Critical patent/CN109543018A/en
Pending legal-status Critical Current

Links

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The embodiment of the invention discloses a kind of answer generation method, device, electronic equipment and storage mediums.This method comprises: obtaining the source entity in customer problem;If it is determined that cannot directly parse the attribute information of source entity in customer problem, then according at least one the recurrence entity excavated by least two relating attribute information corresponding with source entity and source entity, obtain at least two knowledge triples, wherein, at least two knowledge triples include: at least one intermediate path knowledge triple and at least one answer knowledge triple;Answer corresponding with customer problem is generated according to the intermediate path knowledge triple and the answer knowledge triple.Through the above technical solution, question answering system can provide resolving relevant to customer problem when being directed to above-mentioned customer problem, it is more specifically more rigorous to make the answer provided, and then user is made to be easier to understand the answer of Receiver Problem, be not in due to thinking jumping characteristic caused by confuse and feel.

Description

Answer generation method and device, electronic equipment and storage medium
Technical Field
The present invention relates to information processing technologies, and in particular, to an answer generation method and apparatus, an electronic device, and a storage medium.
Background
The Question Answering System (QA) is a high-level form of information retrieval System that can answer questions posed by users in natural language with accurate and concise natural language. The main reason for the rise of research is the need of people to acquire information quickly and accurately. However, in the specific implementation process, the inventor finds that the answers given by the question-answering system in the prior art sometimes have thought jumping problems, which easily confuse the questioner.
Disclosure of Invention
In view of this, embodiments of the present invention provide an answer generating method, apparatus, electronic device and storage medium, so that answers given by a question-answering system are more rigorous and more specific.
In order to solve the above problems, embodiments of the present invention mainly provide the following technical solutions:
in a first aspect, an embodiment of the present invention provides an answer generating method, where the method includes:
acquiring a source entity in a user question;
if it is determined that the attribute information of the source entity cannot be directly resolved in the user question, obtaining at least two knowledge triples according to at least one recursive entity mined by at least two associated attribute information corresponding to the source entity and the source entity, wherein the at least two knowledge triples include: at least one intermediate path knowledge triple and at least one answer knowledge triple;
and generating an answer corresponding to the user question according to the intermediate path knowledge triple and the answer knowledge triple.
In a second aspect, an embodiment of the present invention further provides an answer generating apparatus, where the apparatus includes:
the source entity acquisition module is used for acquiring a source entity in a user problem;
a knowledge triplet obtaining module, configured to, if it is determined that the attribute information of the source entity cannot be directly resolved in the user question, obtain at least two knowledge triples according to at least one recursive entity mined by at least two associated attribute information corresponding to the source entity and the source entity, where the at least two knowledge triples include: at least one intermediate path knowledge triple and at least one answer knowledge triple;
and the answer generating module is used for generating an answer corresponding to the user question according to the intermediate path knowledge triple and the answer knowledge triple.
In a third aspect, an embodiment of the present invention further provides an electronic device, including: at least one processor; and at least one memory, bus connected with the processor; the processor and the memory complete mutual communication through the bus; the processor is configured to call the program instructions in the memory to execute the answer generation method according to any embodiment of the present invention.
In a fourth aspect, embodiments of the present invention further provide a non-transitory computer-readable storage medium storing computer instructions for causing a computer to execute the answer generation method according to any embodiment of the present invention.
By the technical scheme, the technical scheme provided by the embodiment of the invention at least has the following advantages: :
when determining that the attribute information of the problem source entity cannot be directly analyzed in the user problem, the embodiment of the invention carries out entity mining on the user problem, further obtains all intermediate path knowledge triples and answer knowledge triples associated with the user problem, and then generates an answer corresponding to the user problem according to the obtained all intermediate path knowledge triples and answer knowledge triples. Through the technical scheme, the question-answering system provides an analysis process related to the user question aiming at the user question, so that the given answer is more precise, the user can understand the answer of the received question more easily, and the puzzling feeling caused by thinking jumping can be avoided.
The foregoing description is only an overview of the technical solutions of the embodiments of the present invention, and the embodiments of the present invention can be implemented according to the content of the description in order to make the technical means of the embodiments of the present invention more clearly understood, and the detailed description of the embodiments of the present invention is provided below in order to make the foregoing and other objects, features, and advantages of the embodiments of the present invention more clearly understandable.
Drawings
Various other advantages and benefits will become apparent to those of ordinary skill in the art upon reading the following detailed description of the preferred embodiments. The drawings are only for purposes of illustrating the preferred embodiments and are not to be construed as limiting the embodiments of the invention. Also, like reference numerals are used to refer to like parts throughout the drawings. In the drawings:
fig. 1 is a flowchart illustrating an answer generation method according to an embodiment of the present invention;
fig. 2 is a flowchart illustrating an answer generation method according to a second embodiment of the present invention;
fig. 3 is a flowchart illustrating an answer generation method according to a third embodiment of the present invention;
fig. 4 is a schematic structural diagram illustrating an answer generating apparatus according to a fourth embodiment of the present invention;
fig. 5 shows a schematic structural diagram of an electronic device according to a fifth embodiment of the present invention.
Detailed Description
Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
Example one
Fig. 1 is a flowchart of an answer generation method provided in an embodiment of the present invention, which is applicable to a case where a question answering system answers to a recursive question, and the method can be executed by an answer generation apparatus provided in an embodiment of the present invention, and the apparatus can be implemented in software and/or hardware, and can be generally integrated in a processor. As shown in fig. 1, the method of the embodiment of the present invention specifically includes:
and S110, acquiring a source entity in the user problem.
The source entity in the user question is the initial entity involved in the user question, and the recursive problem is the first entity word in the recursive problem, for example, the recursive problem is the "what XX of XX is" form of problem, for example, "what is the constellation of XX wife" is a recursive problem, and the source entity is "XX".
S120, if it is determined that the attribute information of the source entity cannot be directly analyzed in the user problem, acquiring at least two knowledge triples according to at least two pieces of associated attribute information corresponding to the source entity and at least one recursive entity mined by the source entity, wherein the at least two knowledge triples include: at least one intermediate path knowledge triple and at least one answer knowledge triple.
The fact that the attribute information of the source entity cannot be directly analyzed in the user question means that the user question does not directly ask about the attribute information of the source entity (for example, the question "what the constellation of the XX week is" directly asks about the attribute information of the source entity), but indirectly asks about the attribute information of other entities related to the source entity, and for example, "what the constellation of the XX week wife" asks about the constellation of the other entities related to the "XX week" of the source entity "the constellation of the XX week" refers to the constellation attribute information of the "XX (the XX week wife)". The problem of not being able to directly resolve the attribute information of the source entity may also be referred to as a recursive problem.
If it is determined that the attribute information of the source entity cannot be directly analyzed in the user problem, the entity in the user problem needs to be mined, taking what the constellation of the wife of the user problem "week XX" is as an example, two pieces of associated attribute information corresponding to the source entity "week XX" are "wife" and "constellation", and then a recursive entity "kunxx" is mined according to the associated attribute information and the source entity "week XX", and then two knowledge triples, namely "week XX-wife-kunxx" and "kunxx-constellation-shiseqin", are obtained in the knowledge base, wherein the "week XX-wife-kunxx" is intermediate path knowledge and the "kunxx-constellation-shisex" is answer knowledge triples.
The recursion entity 'Kun XX' is obtained by inquiring a knowledge base according to a source entity 'week XX' and attribute information 'wife' directly associated with the source entity ', namely, an intermediate path knowledge triple' week XX-wife-Kun XX 'is inquired in the knowledge base, and then a recursion entity' Kun XX 'is excavated, so that a user problem can be updated to what' Kun XX 'constellation is', and then the knowledge base is inquired according to the recursion entity 'Kun XX' and the attribute information 'constellation', and an answer knowledge triple 'Kun XX-constellation-Shi base' is obtained.
And S130, generating an answer corresponding to the user question according to the intermediate path knowledge triple and the answer knowledge triple.
According to the intermediate path knowledge triple and the answer knowledge triple, a complete answer corresponding to the user question can be generated, wherein the dialect week XX can be generated according to the intermediate path knowledge triple 'West XX-wife-Kun XX', the dialect week XX can be generated according to the answer knowledge triple 'Kun XX-constellation-Shi base', the constellation of the dialect week XX is Shi base ', and then the corresponding answer' West XX 'wife' corresponding to the constellation of the user question 'West XX' is Kun XX 'and the constellation of the Kun XX is Shi base' are generated by combining the two dialects.
It should be noted that, the above example is a case of single-line recursion once, and the above method is also applicable to a case of single-line recursion multiple times, that is, at least three knowledge triples are obtained in the knowledge base according to at least three pieces of associated attribute information corresponding to the source entity and at least two recursion entities mined by the source entity, where at least two knowledge triples are intermediate path knowledge triples, and one knowledge triplet is an answer knowledge triplet.
Meanwhile, the method is also suitable for the condition that at least two recursive entities are mined in one recursive process, namely the number of answer knowledge triples corresponding to the user question is at least two. Taking the example of the user problem "how long the previous time of the wang XX is" as an example, the attribute information of the source entity "wang XX" cannot be directly analyzed in the user problem, the associated attribute information corresponding to the source entity "wang XX" is "previous time" and "age", two recursive entities "sinus XX" and "lie XX" can be mined according to the source entity "wang XX" and the attribute information "previous time", that is, the intermediate path knowledge triples "wang XX-previous time-sinus XX" and "wang XX-previous time-lie XX" are acquired, and then the user problem becomes "how long the age of the sinus XX is" and "how long the age of the lie XX is", then the two answer triples "XX-age-49" and "lie XX-age-47" can be acquired in the knowledge base, so that the intermediate path knowledge triples "wang XX-previous time-sinus XX" and "XX-previous time-lie XX" can be acquired according to the intermediate path knowledge triples, and answer knowledge triplets "sinus XX-age-49" and "lie XX-age-47", there are 2 bits of predecessor who generated the answer "wang XX" corresponding to the user question, sinus XX and lie XX respectively. Sinus XX 49 years old this year; plum XX is 47 years old this year.
According to the answer generation method provided by the embodiment of the invention, when the attribute information of the problem source entity cannot be directly analyzed in the user problem, entity mining is carried out on the user problem, all intermediate path knowledge triples and answer knowledge triples related to the user problem are further obtained, and then an answer corresponding to the user problem is generated according to all the obtained intermediate path knowledge triples and answer knowledge triples. Through the technical scheme, the question-answering system provides an analysis process related to the user question aiming at the user question, so that the given answer is more precise, the user can understand the answer of the received question more easily, and the puzzling feeling caused by thinking jumping can be avoided.
Example two
Fig. 2 is a flowchart of an answer generation method according to a second embodiment of the present invention. On the basis of the above technical solution, if it is determined that the attribute information of the source entity cannot be directly analyzed in the user problem, the embodiment of the present invention obtains at least two knowledge triples according to at least two pieces of associated attribute information corresponding to the source entity and at least one recursion entity mined by the source entity, specifically:
acquiring the source entity as a current entity of the user question;
judging whether the attribute information of the current entity in the user problem can be directly analyzed;
if not, mining at least one recursion entity based on the current entity in the user problem, obtaining at least one intermediate path knowledge triple formed by the current entity and the at least one recursion entity, and correspondingly updating the user problem according to the at least one recursion entity, wherein the current entity of each updated user problem is the corresponding recursion entity;
returning to execute the operation of judging whether the attribute information of the current entity in the user problems can be directly analyzed or not for each updated user problem until the judgment result corresponding to each user problem is yes;
and retrieving an attribute value according to the attribute information of the current entity of each user question, and acquiring an answer knowledge triple corresponding to each user question and formed by the current entity and the attribute value.
Further, the answer generating method provided in this embodiment, after obtaining at least one intermediate path knowledge triplet formed by the current entity and at least one recursive entity, further includes:
if the source entity is determined to be included in the at least one intermediate path knowledge triple, constructing a corresponding intermediate path character string according to the at least one intermediate path knowledge triple;
if the intermediate path knowledge triples do not include the source entity and the number of the acquired intermediate path knowledge triples is one, the intermediate path knowledge triples are spliced to the corresponding intermediate path character strings, and then the corresponding intermediate path character strings are updated;
and if the intermediate path knowledge triples do not comprise the source entity and the number of the acquired intermediate path knowledge triples is at least two, respectively splicing each intermediate path knowledge triplet to the corresponding intermediate path character string, and then generating the intermediate path character string corresponding to each intermediate path knowledge triplet.
Further, generating an answer corresponding to the user question according to the intermediate path knowledge triple and the answer knowledge triple, specifically:
if the number of the intermediate path character strings is determined to be one, the answer knowledge triad is spliced to the corresponding intermediate path character strings to generate answer character strings, and answers corresponding to the user questions are generated according to the answer character strings;
if the number of the intermediate path character strings is determined to be at least two, splicing the at least two answer knowledge triads to the corresponding intermediate path character strings, and then generating at least two sub-answer character strings; and generating an answer corresponding to the user question according to the at least two sub-answer character strings.
As shown in fig. 2, the method provided in the embodiment of the present invention specifically includes:
s210, acquiring a source entity in the user problem.
S220, acquiring the source entity as the current entity of the user problem.
And S230, judging whether the attribute information of the current entity in the user problem can be directly analyzed, if not, executing S240, and if so, executing S2100.
As an optional implementation manner of this embodiment, it may be determined that the attribute information of the source entity cannot be directly analyzed in the user problem, specifically that:
extracting original attribute information corresponding to a source entity from a user question;
and if the original attribute information comprises at least two standard attribute information, determining that the attribute information of the source entity cannot be directly analyzed in the user problem.
The original attribute information refers to attribute information other than the source entity in the user question, for example, what the constellation of wives of the user question "XX week" is "the original attribute information corresponding to the source entity" XX week "is" the constellation of wives ", and further, for example, how large the age of the previous of the user question" XX king "is" the original attribute information corresponding to the source entity "XX king" is "the age of the previous".
The standard attribute information refers to unique attribute information stored in the knowledge base, such as "wife", "constellation", "previous", "age", and the like.
If the original attribute information corresponding to the source entity in the user problem comprises at least two standard attribute information, the attribute information of the source entity cannot be directly analyzed in the user problem. For example, if the original attribute information is "wife constellation" and includes two standard attribute information "wife" and "constellation", it may be determined that the attribute information of the source entity "XX" cannot be directly resolved in the user problem, and a recursive entity needs to be mined in the user problem.
S240, mining at least one recursion entity based on the current entity in the user problem, obtaining at least one intermediate path knowledge triple formed by the current entity and the at least one recursion entity, and correspondingly updating the user problem according to the at least one recursion entity, wherein the updated current entity of each user problem is the corresponding recursion entity.
Taking the user problem "what the constellation of the wife of the week XX is" as an example, the attribute information of the current entity "week XX" cannot be directly resolved in the user problem, and then the recursive entity based on the current entity "week XX" is mined in the user problem.
As a specific implementation manner of this embodiment, mining at least one recursive entity based on a current entity in a user problem may specifically be:
matching the user problem with a set recursion problem template, and determining a recursion problem in the user problem directly associated with the current entity;
and searching according to the current entity and the attribute information in the recursion problem, and determining at least one entity corresponding to the search result as a recursion entity based on the current entity.
Firstly, constructing some simple recursive problem templates, such as recursive problem templates like 'wife of XX' and 'prodigy of XX', according to knowledge in a knowledge base; matching the user question with the preset recursive question templates to determine the recursive question directly associated with the current entity, for example, using the user question "what the constellation of wives in the week XX" matches with the recursive question template to determine the recursive question directly associated with the current entity "week XX" as "wives in the week XX"; and then, searching can be carried out in a knowledge base according to the current entity ' week XX ' and the attribute information ' wife ' in the recursion problem, wherein the searching result is ' week XX-wife-Kun XX ', the entity corresponding to the searching result is ' Kun XX ', and the Kun XX ' is a recursion entity based on the current entity ' week XX '.
For another example, by matching the user question "how big the age of the previous of the king XX is" with the recursion question template, it may be determined that the recursion question directly associated with the current entity "king XX" is "the previous of the king XX", and then the search may be performed in the knowledge base according to the current entity "king XX" and the attribute information "previous" in the recursion question, the search results are "king XX-previous-sinus XX" and "king XX-previous-plum XX", the entities corresponding to the search results are "sinus XX" and "plum XX", and "sinus XX" and "plum XX" are the recursion entity based on the current entity "king XX".
Further, the at least one intermediate path knowledge triplet made up of the current entity and the at least one recursive entity is "week XX-wife-queen XX"; or "wang XX-prodighure-sinus XX" and "wang XX-prodighure-plum XX".
Furthermore, the user problem is correspondingly updated to be 'what the constellation of the QuinXX' according to at least one recursive entity, and the current entity is updated to be 'QuinXX'; alternatively, "how big the age of sinus XX is" and "how big the age of lie XX is", the current entity is updated to "sinus XX" and "lie XX".
It should be noted that, in the case that at least two recursive entities can be mined in one recursion of the entity, the number of updated user questions corresponding to the user questions before the recursion is the same as the number of recursive entities.
S250, determining the number of at least one intermediate path knowledge triplet including a current entity and at least one recursive entity and whether the at least one intermediate path knowledge triplet includes a source entity, if it is determined that the at least one intermediate path knowledge triplet includes the source entity, performing S260, if it is determined that the intermediate path knowledge triplet does not include the source entity and the number of the acquired intermediate path knowledge triplets is one, performing S270, and if it is determined that the intermediate path knowledge triplet does not include the source entity and the number of the acquired intermediate path knowledge triplets is at least two, performing S280.
And S260, constructing a corresponding intermediate path character string according to the at least one intermediate path knowledge triple, and executing S290.
And S270, after the middle path knowledge triad is spliced to the corresponding middle path character string, updating the corresponding middle path character string, and executing S290.
And S280, after the intermediate path knowledge triplets are respectively spliced to the corresponding intermediate path character strings, generating intermediate path character strings respectively corresponding to the intermediate path knowledge triplets, and executing S290.
And judging the acquired intermediate path knowledge triples, and creating or updating intermediate path character strings corresponding to the intermediate path knowledge triples according to the judgment result.
Taking the user question "what the ethnicity of the mother of the husband who opens XX" as an example, the source entity is "open XX", the first entity recursion acquires an intermediate path knowledge triplet "open XX-husband-old XX", and then the user question is updated "what the ethnicity of the mother of old XX" is ", the current entity is" old XX ", the second entity recursion acquires an intermediate path knowledge triplet" old XX-mother-huxx ", and then the user question is updated" what the ethnicity of huxx "is".
For the acquired intermediate path knowledge triple "XX-husband-old XX", which contains the source entity "XX", a corresponding intermediate path character string "XX-husband-old XX" is constructed after the intermediate path knowledge triple is acquired; for the acquired intermediate path knowledge triple "old XX-mom-huxx", which does not include the source entity "piece XX", after the intermediate path knowledge triple is acquired, the intermediate path knowledge triple is spliced to the corresponding intermediate path character string "piece XX-husband-old XX", and then the corresponding intermediate path character string "piece XX-husband-old XX # # # old XX-mom-huxx" is updated.
Taking the user problem of how big the age of the previous of the king XX is as an example, the source entity is the king XX, the first entity recursively acquires two intermediate path knowledge triples including the source entity "king XX", and further respectively constructs a corresponding intermediate path character string 1 "king XX-previous-sinus XX" and an intermediate path character string 2 "king XX-previous-plum XX".
Taking the user problem of the age of the former of the mother of the sinus XX as an example, the middle path character string constructed according to the middle path knowledge triplets "sinus XX-mother-king XX" obtained by the first entity recursion is "sinus XX-mother-king XX", the second entity recursion obtains two middle path knowledge triplets "wang XX-former-sinus XX" and "wang XX-former-li XX", the two middle path knowledge triplets do not contain a source entity and are two in number, and then the middle path knowledge triplets "wang XX-former-sinus XX" and "wang XX-former-li XX" are spliced to the corresponding middle path character string "sinus XX-mother-wang XX", and then middle paths corresponding to the middle path knowledge triplets ("wang XX-former-sinus XX" and "wang XX-former-li XX") are generated respectively The diameter string 1 "sinus XX-mother-king XX # # # king XX-predecessor-sinus XX" and the middle path string 2 "sinus XX-mother-king XX # # # king XX-predecessor-lie XX".
Wherein, "# # ##" is a separator between different intermediate path knowledge triplets in the intermediate path character string, and is a self-defined separator, which is not specifically limited in this embodiment.
And S290, returning to execute the operation of judging whether the attribute information of the current entity in the user question can be directly analyzed or not for each updated user question until the judgment result corresponding to each user question is yes.
And judging whether the attribute information of the current entity of each user question can be directly analyzed or not again aiming at each updated user question until entity recursion can not be carried out in the user question any more, and directly analyzing the attribute information of the current entity of each user question, for example, what the ethnic group of HuXX is when the user question is updated, and then determining an answer knowledge triple corresponding to the user question.
And S2100, retrieving attribute values according to the attribute information of the current entity of each user question, and acquiring an answer knowledge triple corresponding to each user question and formed by the current entity and the attribute values.
Taking the user question "what the ethnicity of the mother of the husband who opens XX" as an example, the user question is finally "what the ethnicity of the hogfx", and the attribute value is retrieved according to the attribute information "ethnicity" of the current entity "hogfx", and the corresponding answer knowledge triple "hogfx-ethnicity-han nationality" is obtained.
Taking the user question "how long the age of the former doctor of the mother of the sinus XX is" as an example, the user question is finally "how long the age of the sinus XX is" and "how long the age of the plum XX is", attribute values are retrieved according to the current entities "sinus XX" and "plum XX" and the attribute information "age", respectively, and corresponding answer knowledge triples "sinus XX-age-49" and "plum XX-age-47" are obtained.
S2110, determining whether the number of the middle path character strings is one, if so, executing S2120, and if not, executing S2130.
S2120, generating an answer character string after the answer knowledge triad is spliced to the corresponding middle path character string, and generating an answer corresponding to the user question according to the answer character string.
S2130, after the at least two answer knowledge triads are spliced to the corresponding middle path character strings, generating at least two sub-answer character strings; and generating an answer corresponding to the user question according to the at least two sub-answer character strings.
After the answer knowledge triples corresponding to the user questions are obtained, the number of the intermediate path character strings is judged, and then a specific scheme for generating answers corresponding to the user questions is determined.
Taking the user question "what the ethnicity of the mother of the husband who opens XX" as an example, the number of the middle path character strings is one, and then the answer knowledge triple "hu XX-ethnicity-han" is spliced after the middle path character string "open XX-husband-old XX # # # old XX-mom-huxx", and the answer character string "open XX-husband-old XX # # -nax # # # old XX-mom-huxx-ethnicity-han" is generated. Further, an answer corresponding to the user question is generated according to an answer string "zhangxx-husband-chen XX # # # chen XX-mom-huxx # # # huxx-ethnicity-han" that "zhang XX is a husband XX, mam of chen XX is huxx, ethnicity of huxx is han".
Taking the user question "how old the predecessor of the mother of the sinus XX is", as an example, the number of the middle path character strings is two, namely a middle path character string 1 "sinus XX-mother-king XX # # # king XX-predecessor-sinus XX" and a middle path character string 2 "sinus XX-mother-king XX # # # king XX-predecessor-lie XX", respectively splicing the answer knowledge triples "sinus XX-age-49" and "lie XX-age-47" to the corresponding middle path character strings to generate at least two sub-answer character strings, namely, the sub-answer string 1 "sinus XX-mom-king XX # # # king XX-prostrate-sinus XX # # # sinus XX-age-49" and the sub-answer string 2 "sinus XX-mom-king XX # # # king XX-prostrate-plum XX # # # plum XX-age-47".
Further, the answer "the mom of the sinus XX is the king XX, the previous doctor of the king XX is the sinus XX, and the age of the sinus XX is 49" generated according to the sub-answer character string corresponding to the user question; the mother of the sinus XX is king XX, the prodger of king XX is lie XX, the age of lie XX is 47 ". The answer string 1 "sinus XX-mom-king XX # # # king XX-fual-sinus XX # # # sinus XX-age-49" and the sub-answer string 2 "sinus XX-mom-king XX # # # king XX-fual-plum XX # # # li XX-age-47" are spliced into the answer string "sinus XX-mom-king XX-fual-king XX # # # king XX-fual-sinus XX-age-49 @ @ sinus XX-mom-king XX-XX # # # XX-produk-XX-age-47", then the answer corresponding to the user question is generated according to the answer string, that the mom of the sinus XX is the king XX, that of the sinus XX is 49; the mother of the sinus XX is king XX, the prodger of king XX is lie XX, the age of lie XX is 47 ".
The "@ @ @ is a separator between different answers in the answer character string, and is a self-defined separator, which is not specifically limited in this embodiment.
In the technical scheme, when the question-answering system answers the user questions which cannot directly analyze the attribute information of the source entity, the question-answering system provides an analysis process related to the user questions, so that the given answers are more precise and clearer in logic, the user can understand the answers of the received questions more easily, and the puzzling feeling caused by thinking jumping cannot occur.
EXAMPLE III
Fig. 3 is a flowchart of an answer generation method according to a third embodiment of the present invention. On the basis of the above technical solution, for a case that at least two recursive entities can be mined in at least one entity recursive process, the generating an answer corresponding to the user question according to the at least two sub-answer character strings in the above embodiment specifically includes:
generating a reasoning character string and a conclusion character string corresponding to the user question according to at least two sub-answer character strings, wherein the reasoning character string is composed of the intermediate path knowledge triplets, and the conclusion character string is composed of the answer knowledge triplets;
generating inference dialogues and conclusion dialogues respectively according to the inference character strings and the conclusion character strings;
and using the reasoning dialect and the conclusion dialect as answers corresponding to the user question.
Further, generating an inference character string corresponding to the user question according to the at least two sub-answer character strings, specifically:
acquiring at least two intermediate path character strings corresponding to the at least two sub answer character strings;
correspondingly combining the intermediate path knowledge triplets at corresponding positions in the at least two intermediate path character strings to generate the reasoning character string, wherein,
if the intermediate path knowledge triples at the corresponding positions in the at least two intermediate path character strings are determined to be the same, the inference knowledge triples at the corresponding positions in the inference character strings are the intermediate path knowledge triples;
and if the intermediate path knowledge triplets at the corresponding positions in the at least two intermediate path character strings are different, the inference knowledge triplets at the corresponding positions in the inference character strings are all the intermediate path knowledge triplets at the corresponding positions in the at least two intermediate path character strings.
As shown in fig. 3, the method provided in the embodiment of the present invention specifically includes:
s310, obtaining a source entity in the user question.
And S320, acquiring the source entity as the current entity of the user problem.
S330, judging whether the attribute information of the current entity in the user problem can be directly analyzed, if not, executing S340, and if so, executing S3100.
S340, mining at least one recursion entity based on the current entity in the user problem, obtaining at least one intermediate path knowledge triple formed by the current entity and the at least one recursion entity, and correspondingly updating the user problem according to the at least one recursion entity, wherein the updated current entity of each user problem is the corresponding recursion entity.
S350, determining the number of at least one intermediate path knowledge triple composed of a current entity and at least one recursive entity and whether the at least one intermediate path knowledge triple includes a source entity, if the at least one intermediate path knowledge triple includes a source entity, executing S360, if the intermediate path knowledge triple does not include the source entity and the number of the acquired intermediate path knowledge triples is one, executing S370, and if the intermediate path knowledge triple does not include the source entity and the number of the acquired intermediate path knowledge triples is at least two, executing S380.
And S360, constructing a corresponding intermediate path character string according to the at least one intermediate path knowledge triple, and executing S390.
And S370, after the intermediate path knowledge triad is spliced to the corresponding intermediate path character string, updating the corresponding intermediate path character string, and executing S390.
And S380, after the intermediate path knowledge triplets are respectively spliced to the corresponding intermediate path character strings, generating intermediate path character strings respectively corresponding to the intermediate path knowledge triplets, and executing S390.
And S390, returning to execute the operation of judging whether the attribute information of the current entity in the user problem can be directly analyzed or not for each updated user problem until the judgment result corresponding to each user problem is yes.
And S3100, retrieving attribute values according to the attribute information of the current entity of each user question, and acquiring an answer knowledge triple corresponding to each user question and formed by the current entity and the attribute values.
S3110, if the number of the intermediate path character strings is determined to be at least two, splicing at least two answer knowledge triads to the corresponding intermediate path character strings, and then generating at least two sub-answer character strings.
For the explanation of S310-S3110, please refer to the above embodiments, which are not repeated herein.
And S3120, acquiring at least two intermediate path character strings corresponding to the at least two sub answer character strings.
Taking the user question "how big the age of the former of the mother of the sinus XX is" as an example, the generated sub-answer character strings are respectively the sub-answer character string 1 "sinus XX-mother-king XX # # # king XX-former-sinus XX # # # sinus XX-age-49" and the sub-answer character string 2 "sinus XX-mother-king XX # # # XX-former-plum XX # # # plum XX-age-47".
Further, the intermediate path character strings corresponding to the sub-answer character strings are an intermediate path character string 1 of "sinus XX-mom-wang XX # # # wang XX-previous-sinus XX" and an intermediate path character string 2 of "sinus XX-mom-wang XX # # # wang XX-previous-plum XX".
It should be noted that the lengths of the multiple sub-answer character strings generated for the same user question are the same, that is, the number of knowledge triples included in each sub-answer character string is the same, and further, the length of each intermediate path character string is also the same, and the number of intermediate path knowledge triples included in each intermediate path character string is the same.
S3130, correspondingly combining the intermediate path knowledge triplets at the corresponding positions in the at least two intermediate path character strings to generate an inference character string.
If the intermediate path knowledge triples at the corresponding positions in the at least two intermediate path character strings are determined to be the same, the inference knowledge triples at the corresponding positions in the inference character strings are the intermediate path knowledge triples;
and if the intermediate path knowledge triples at the corresponding positions in the at least two intermediate path character strings are different, the inference knowledge triples at the corresponding positions in the inference character strings are all the intermediate path knowledge triples at the corresponding positions in the at least two intermediate path character strings.
And merging all the intermediate path character strings to generate inference character strings, namely constructing the inference character strings according to the intermediate path knowledge triples in all the intermediate path character strings, wherein the merging mode is to merge the intermediate path knowledge triples at corresponding positions in all the intermediate path character strings in a one-to-one correspondence manner, if all the intermediate path knowledge triples in all the intermediate path character strings are different, the number of the intermediate path knowledge triples in the inference character strings is just the product of the number of the intermediate path knowledge triples in each intermediate path character string and the number of the intermediate path character strings, and if all the intermediate path character strings have the same intermediate path knowledge triples at corresponding positions, one of the intermediate path knowledge triples is selected.
Taking the example of the intermediate path character string 1 "sinus XX-mom-wang XX # # # wang XX-predecessor-sinus XX" and the intermediate path character string 2 "sinus XX-mom-wang XX # # # wang XX-predecessor-lie XX", each intermediate path character string includes two intermediate path character strings, the positions of intermediate path knowledge triplets from the character string start to the character string end are set to be 1 and 2 in sequence, it is known that the intermediate path triplet knowledge at the position 1 is the same and the position 2 is different in the intermediate path character string 1 and the intermediate path character string 2, and further, when the inference character string is generated, the inference character string is "sinus XX-mom-wang XX" at the position 1 and "separator XX-predecessor-sinus XX & & & wang XX-predecessor-lie XX" at the position 2 (a separator is used between different intermediate path knowledge triplets & & XX), thus, the inference character string is 'sinus XX-mother-king XX # # # king XX-former-sinus XX & & king XX-former-plum XX'.
Assuming that there are three intermediate path character strings, namely, "wang XX-predecessor-sinus XX # # # sinus XX-daughter-sinus XX 1", "wang XX-predecessor-sinus XX # # # sinus XX-daughter-sinus XX 2" and "wang XX-predecessor-plum XX # # # plum XX-daughter-plum XX" as known, two identical intermediate path knowledge triples at position 1 are different, and three different ones at position 2 are different, but the first entities of the two intermediate path knowledge triples are the same, when generating the inference character, one of the two identical intermediate path knowledge triples at position 1 is selected and then a different one is added, namely, "wang XX-predecessor-sinus XX & & wang XX-predecessor-plum XX", three different intermediate paths at position 2, but two different intermediate path knowledge triplets that are identical to the first entity may be arranged together when ordering, namely "sinus XX-daughter-sinus XX1& & sinus XX-daughter-sinus XX2& & li XX-daughter-plum XX", the former arrangement being favorable for generating a corresponding answer conversation as compared to "sinus XX-daughter-sinus XX1& & li XX-daughter-li XX & & sinus XX-daughter-sinus XX 2".
S3140, obtaining at least two answer knowledge triples corresponding to the at least two sub-answer character strings, and generating a conclusion character string according to the at least two answer knowledge triples.
Answer knowledge triplets 'sinus XX-age-49' and 'li XX-age-47' corresponding to the sub-answer string 1 'sinus XX-mom-king XX # # # king XX-predecessor-sinus XX # # # sinus XX-age-49' and the sub-answer string 2 'sinus XX-mom-king XX # # # king XX-predecessor-li XX # # # li XX-age-47' are obtained, and a conclusion string 'sinus XX-age-49 @ @ li XX-age-47' is generated according to the answer knowledge triplets 'sinus XX-age-49' and 'li XX-age-47' (separation between different answer knowledge triplets by means of a separator @ @).
S3150, respectively generating reasoning dialogs and conclusion dialogs according to the reasoning character strings and the conclusion character strings, and taking the reasoning dialogs and the conclusion dialogs as answers corresponding to the user questions.
The mother who generates inference terminology 'sinus XX according to inference character string' sinus XX-mother-king XX # # # king XX-predecessor-sinus XX & & king XX-predecessor-plum XX 'is king XX, and the predecessor of king XX has two digits, namely sinus XX and plum XX', respectively.
The conclusion utterance "the age of sinus XX is 49 and the age of plum XX is 47" is generated from the conclusion string "sinus XX-age-49 @ @ li XX-age-47".
And then the reasoning dialect and the conclusion dialect are combined, and the mother of the sinus XX is the Wang XX, and two predecessors of the Wang XX have the sinus XX and the Li XX respectively. The age of the sinus XX is 49 and the age of the plum XX is 47 "as an answer corresponding to the user question" how old the previous age of the mother of the sinus XX is ".
According to the technical scheme provided by the embodiment of the invention, when the question-answering system answers the recursive question, the question-answering system does not only provide the final answer of the recursive question, but also provides an analysis process related to the recursive question, so that the given answer is more precise and clearer in logic, the user can understand the answer of the received question more easily, and the puzzling feeling caused by thinking jumping can be avoided.
Example four
Fig. 4 is a schematic structural diagram of an answer generating device according to a fourth embodiment of the present invention, which is applicable to a case where a question and answer system answers to a recursive question, and the device can be implemented in software and/or hardware, and can be generally integrated in a processor. As shown in fig. 4, the apparatus specifically includes: a source entity acquisition module 410, a knowledge triplet acquisition module 420, and an answer generation module 430, wherein,
a source entity obtaining module 410, configured to obtain a source entity in a user question;
a knowledge triplet obtaining module 420, configured to, if it is determined that the attribute information of the source entity cannot be directly resolved in the user question, obtain at least two knowledge triples according to at least one recursive entity mined by at least two associated attribute information corresponding to the source entity and the source entity, where the at least two knowledge triples include: at least one intermediate path knowledge triple and at least one answer knowledge triple;
an answer generating module 430, configured to generate an answer corresponding to the user question according to the intermediate path knowledge triplet and the answer knowledge triplet.
According to the answer generation device provided by the embodiment of the invention, when the attribute information of the question source entity cannot be directly analyzed in the user question, entity mining is carried out on the user question, all intermediate path knowledge triples and answer knowledge triples related to the user question are further obtained, and then an answer corresponding to the user question is generated according to all the obtained intermediate path knowledge triples and answer knowledge triples. Through the technical scheme, the question-answering system provides an analysis process related to the user question aiming at the user question, so that the given answer is more precise, the user can understand the answer of the received question more easily, and the puzzling feeling caused by thinking jumping can be avoided.
Further, the knowledge triple obtaining module 420 is specifically configured to extract, in the user question, original attribute information corresponding to the source entity;
and if the original attribute information comprises at least two standard attribute information, determining that the attribute information of the source entity cannot be directly analyzed in the user problem.
Further, the knowledge triple obtaining module 420 specifically includes:
a current entity obtaining unit, configured to obtain the source entity as a current entity of the user question;
the analysis judging unit is used for judging whether the attribute information of the current entity in the user problem can be directly analyzed;
a recursion unit, configured to, if it is determined that attribute information of a current entity in the user problem cannot be directly resolved, mine at least one recursion entity based on the current entity in the user problem, obtain at least one intermediate path knowledge triple composed of the current entity and the at least one recursion entity, and correspondingly update the user problem according to the at least one recursion entity, where a current entity of each updated user problem is the corresponding recursion entity;
the circulating recursion unit is used for returning and executing the operation of judging whether the attribute information of the current entity in the user problems can be directly analyzed or not aiming at each updated user problem until the judgment result corresponding to each user problem is yes;
and the answer knowledge triple acquiring unit is used for retrieving the attribute value according to the attribute information of the current entity of each user question and acquiring the answer knowledge triple corresponding to each user question and formed by the current entity and the attribute value.
Further, the recursion unit is specifically configured to match the user question with a set recursion question template, and determine a recursion question in the user question that is directly associated with the current entity;
and searching according to the current entity and the attribute information in the recursion problem, and determining at least one entity corresponding to a search result as the recursion entity based on the current entity.
On the basis of the above technical solution, the knowledge triple obtaining module 420 further includes: the intermediate path character string construction updating unit is used for constructing a corresponding intermediate path character string according to at least one intermediate path knowledge triple after at least one intermediate path knowledge triple composed of the current entity and at least one recursive entity is obtained and if the at least one intermediate path knowledge triple is determined to comprise the source entity;
if the intermediate path knowledge triples do not include the source entity and the number of the acquired intermediate path knowledge triples is one, the intermediate path knowledge triples are spliced to the corresponding intermediate path character strings, and then the corresponding intermediate path character strings are updated;
and if the intermediate path knowledge triples do not comprise the source entity and the number of the acquired intermediate path knowledge triples is at least two, respectively splicing each intermediate path knowledge triplet to the corresponding intermediate path character string, and then generating the intermediate path character string corresponding to each intermediate path knowledge triplet.
Correspondingly, the answer generating module 430 specifically includes: a first answer generating unit and a second answer generating unit, wherein,
the first answer generating unit is used for splicing the three answer knowledge groups into the corresponding intermediate path character strings to generate answer character strings if the number of the intermediate path character strings is determined to be one, and generating answers corresponding to the user questions according to the answer character strings;
the second answer generating unit is used for generating at least two sub-answer character strings after splicing the at least two answer knowledge triads to the corresponding intermediate path character strings if the number of the intermediate path character strings is determined to be at least two; and generating an answer corresponding to the user question according to the at least two sub-answer character strings.
Further, the second answer generating unit is specifically configured to generate an inference character string and a conclusion character string corresponding to the user question according to the at least two sub-answer character strings, where the inference character string is formed by the intermediate path knowledge triplet, and the conclusion character string is formed by the answer knowledge triplet;
generating inference dialogues and conclusion dialogues respectively according to the inference character strings and the conclusion character strings;
and using the reasoning dialect and the conclusion dialect as answers corresponding to the user question.
Further, the second answer generating unit is specifically configured to obtain at least two intermediate path character strings corresponding to the at least two sub-answer character strings;
correspondingly combining the intermediate path knowledge triplets at corresponding positions in the at least two intermediate path character strings to generate the reasoning character string, wherein,
if the intermediate path knowledge triples at the corresponding positions in the at least two intermediate path character strings are determined to be the same, the inference knowledge triples at the corresponding positions in the inference character strings are the intermediate path knowledge triples;
and if the intermediate path knowledge triplets at the corresponding positions in the at least two intermediate path character strings are different, the inference knowledge triplets at the corresponding positions in the inference character strings are all the intermediate path knowledge triplets at the corresponding positions in the at least two intermediate path character strings.
Since the answer generating device described in the embodiment of the present invention is a device capable of executing the answer generating method described in the embodiment of the present invention, based on the answer generating method described in the embodiment of the present invention, those skilled in the art can understand the specific implementation manner and various variations of the answer generating device described in the embodiment of the present invention, and therefore, how to implement the answer generating method described in the embodiment of the present invention by the answer generating device is not described in detail herein. The scope of the present application is not limited to the embodiments of the present invention, and other embodiments of the present invention will be described in detail.
EXAMPLE five
An embodiment of the present invention provides an electronic device, as shown in fig. 5, including: at least one processor (processor) 51; and at least one memory (memory)52, a bus 53 connected to the processor 51; wherein,
the processor 51 and the memory 52 complete mutual communication through the bus 53;
the memory 52, which is a non-transitory computer-readable storage medium, may be used for storing software programs, computer-executable programs, and modules, such as program instructions/modules corresponding to an answer generation method in the embodiment of the present invention (for example, shown in fig. 4: the source entity obtaining module 410, the knowledge triplet obtaining module 420, and the answer generation module 430). The processor 51 is configured to call program instructions/modules in the memory 52 to execute the steps in an answer generation method in the above-described method embodiment.
The memory 52 may include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function; the storage data area may store data created according to use of the electronic device, and the like. Further, the memory 52 may include high speed random access memory, and may also include non-transitory memory, such as at least one magnetic disk storage device, flash memory device, or other non-transitory solid state storage device. In some embodiments, the memory 52 may optionally include memory located remotely from the processor 51, which may be connected to the terminal device via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
EXAMPLE six
An embodiment of the present invention provides a non-transitory computer-readable storage medium, where the non-transitory computer-readable storage medium stores computer instructions, and the computer instructions enable the computer to execute an answer generation method provided in each of the above method embodiments, where the method includes: .
Acquiring a source entity in a user question;
if it is determined that the attribute information of the source entity cannot be directly resolved in the user question, obtaining at least two knowledge triples according to at least one recursive entity mined by at least two associated attribute information corresponding to the source entity and the source entity, wherein the at least two knowledge triples include: at least one intermediate path knowledge triple and at least one answer knowledge triple;
and generating an answer corresponding to the user question according to the intermediate path knowledge triple and the answer knowledge triple.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
In a typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include forms of volatile memory in a computer readable medium, Random Access Memory (RAM) and/or non-volatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). The memory is an example of a computer-readable medium.
Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), Digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, a computer readable medium does not include a transitory computer readable medium such as a modulated data signal and a carrier wave.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in the process, method, article, or apparatus that comprises the element.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The above embodiments are merely examples of the present application, and are not intended to limit the present application, and the technical features of the embodiments may be combined and arranged within the scope of the present invention. Various modifications and changes may occur to those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.

Claims (11)

1. An answer generation method, comprising:
acquiring a source entity in a user question;
if it is determined that the attribute information of the source entity cannot be directly resolved in the user question, obtaining at least two knowledge triples according to at least one recursive entity mined by at least two associated attribute information corresponding to the source entity and the source entity, wherein the at least two knowledge triples include: at least one intermediate path knowledge triple and at least one answer knowledge triple;
and generating an answer corresponding to the user question according to the intermediate path knowledge triple and the answer knowledge triple.
2. The method of claim 1, wherein the determining that the attribute information of the source entity cannot be directly resolved in the user question comprises:
extracting original attribute information corresponding to the source entity in the user question;
and if the original attribute information comprises at least two standard attribute information, determining that the attribute information of the source entity cannot be directly analyzed in the user problem.
3. The method of claim 1, wherein if it is determined that the attribute information of the source entity cannot be directly resolved in the user question, obtaining at least two knowledge triples based on at least one recursive entity mined from at least two associated attribute information corresponding to the source entity and the source entity comprises:
acquiring the source entity as a current entity of the user question;
judging whether the attribute information of the current entity in the user problem can be directly analyzed;
if not, mining at least one recursion entity based on the current entity in the user problem, obtaining at least one intermediate path knowledge triple formed by the current entity and the at least one recursion entity, and correspondingly updating the user problem according to the at least one recursion entity, wherein the current entity of each updated user problem is the corresponding recursion entity;
returning to execute the operation of judging whether the attribute information of the current entity in the user problems can be directly analyzed or not for each updated user problem until the judgment result corresponding to each user problem is yes;
and retrieving an attribute value according to the attribute information of the current entity of each user question, and acquiring an answer knowledge triple corresponding to each user question and formed by the current entity and the attribute value.
4. The method of claim 3, wherein mining at least one recursive entity based on the current entity in the user question comprises:
matching the user problem with a set recursion problem template, and determining a recursion problem in the user problem directly associated with the current entity;
and searching according to the current entity and the attribute information in the recursion problem, and determining at least one entity corresponding to a search result as the recursion entity based on the current entity.
5. The method of claim 3, further comprising, after said obtaining at least one intermediate path knowledge triplet comprised of said current entity and at least one said recursive entity:
if the source entity is determined to be included in the at least one intermediate path knowledge triple, constructing a corresponding intermediate path character string according to the at least one intermediate path knowledge triple;
if the intermediate path knowledge triples do not include the source entity and the number of the acquired intermediate path knowledge triples is one, the intermediate path knowledge triples are spliced to the corresponding intermediate path character strings, and then the corresponding intermediate path character strings are updated;
and if the intermediate path knowledge triples do not comprise the source entity and the number of the acquired intermediate path knowledge triples is at least two, respectively splicing each intermediate path knowledge triplet to the corresponding intermediate path character string, and then generating the intermediate path character string corresponding to each intermediate path knowledge triplet.
6. The method of claim 5, wherein generating an answer corresponding to the user question from the intermediate path knowledge triplets and the answer knowledge triplets comprises:
if the number of the intermediate path character strings is determined to be one, the answer knowledge triad is spliced to the corresponding intermediate path character strings to generate answer character strings, and answers corresponding to the user questions are generated according to the answer character strings;
if the number of the intermediate path character strings is determined to be at least two, splicing the at least two answer knowledge triads to the corresponding intermediate path character strings, and then generating at least two sub-answer character strings; and generating an answer corresponding to the user question according to the at least two sub-answer character strings.
7. The method of claim 6, wherein generating an answer corresponding to the user question from the at least two sub-answer strings comprises:
generating a reasoning character string and a conclusion character string corresponding to the user question according to the at least two sub-answer character strings, wherein the reasoning character string is composed of the intermediate path knowledge triplets, and the conclusion character string is composed of the answer knowledge triplets;
generating inference dialogues and conclusion dialogues respectively according to the inference character strings and the conclusion character strings;
and using the reasoning dialect and the conclusion dialect as answers corresponding to the user question.
8. The method according to claim 7, wherein the generating an inference string corresponding to the user question from the at least two sub-answer strings comprises:
acquiring at least two intermediate path character strings corresponding to the at least two sub answer character strings;
correspondingly combining the intermediate path knowledge triplets at corresponding positions in the at least two intermediate path character strings to generate the reasoning character string, wherein,
if the intermediate path knowledge triples at the corresponding positions in the at least two intermediate path character strings are determined to be the same, the inference knowledge triples at the corresponding positions in the inference character strings are the intermediate path knowledge triples;
and if the intermediate path knowledge triplets at the corresponding positions in the at least two intermediate path character strings are different, the inference knowledge triplets at the corresponding positions in the inference character strings are all the intermediate path knowledge triplets at the corresponding positions in the at least two intermediate path character strings.
9. An answer generating apparatus, comprising:
the source entity acquisition module is used for acquiring a source entity in a user problem;
a knowledge triplet obtaining module, configured to, if it is determined that the attribute information of the source entity cannot be directly resolved in the user question, obtain at least two knowledge triples according to at least one recursive entity mined by at least two associated attribute information corresponding to the source entity and the source entity, where the at least two knowledge triples include: at least one intermediate path knowledge triple and at least one answer knowledge triple;
and the answer generating module is used for generating an answer corresponding to the user question according to the intermediate path knowledge triple and the answer knowledge triple.
10. An electronic device, comprising:
at least one processor;
and at least one memory, bus connected with the processor; wherein,
the processor and the memory complete mutual communication through the bus;
the processor is configured to call program instructions in the memory to perform the answer generation method of any one of claims 1 to 8.
11. A non-transitory computer-readable storage medium storing computer instructions for causing a computer to perform the answer generation method of any one of claims 1 to 8.
CN201811422591.6A 2018-11-23 2018-11-23 Answer generation method, device, electronic equipment and storage medium Pending CN109543018A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811422591.6A CN109543018A (en) 2018-11-23 2018-11-23 Answer generation method, device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811422591.6A CN109543018A (en) 2018-11-23 2018-11-23 Answer generation method, device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN109543018A true CN109543018A (en) 2019-03-29

Family

ID=65850351

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811422591.6A Pending CN109543018A (en) 2018-11-23 2018-11-23 Answer generation method, device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN109543018A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112035609A (en) * 2020-08-20 2020-12-04 出门问问信息科技有限公司 Intelligent dialogue method and device and computer readable storage medium
WO2021012878A1 (en) * 2019-07-19 2021-01-28 平安科技(深圳)有限公司 Medical domain knowledge graph question and answer processing method, apparatus, device, and storage medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104462504A (en) * 2014-12-19 2015-03-25 北京奇虎科技有限公司 Method and device for providing reasoning process data in search
CN106919655A (en) * 2017-01-24 2017-07-04 网易(杭州)网络有限公司 A kind of answer provides method and apparatus

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104462504A (en) * 2014-12-19 2015-03-25 北京奇虎科技有限公司 Method and device for providing reasoning process data in search
CN106919655A (en) * 2017-01-24 2017-07-04 网易(杭州)网络有限公司 A kind of answer provides method and apparatus

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2021012878A1 (en) * 2019-07-19 2021-01-28 平安科技(深圳)有限公司 Medical domain knowledge graph question and answer processing method, apparatus, device, and storage medium
CN112035609A (en) * 2020-08-20 2020-12-04 出门问问信息科技有限公司 Intelligent dialogue method and device and computer readable storage medium
CN112035609B (en) * 2020-08-20 2024-04-05 出门问问创新科技有限公司 Intelligent dialogue method, intelligent dialogue device and computer-readable storage medium

Similar Documents

Publication Publication Date Title
US20210192288A1 (en) Method and apparatus for processing data
CN111176996A (en) Test case generation method and device, computer equipment and storage medium
US10296659B2 (en) Search query intent
CN110969012A (en) Text error correction method and device, storage medium and electronic equipment
CN111736840A (en) Compiling method and running method of applet, storage medium and electronic equipment
CN109978044B (en) Training data generation method and device, and model training method and device
CN111143551A (en) Text preprocessing method, classification method, device and equipment
CN109299276B (en) Method and device for converting text into word embedding and text classification
CN111552640A (en) Code detection method, device, equipment and storage medium
CN112995749A (en) Method, device and equipment for processing video subtitles and storage medium
CN109543018A (en) Answer generation method, device, electronic equipment and storage medium
CN113408254A (en) Page form information filling method, device, equipment and readable medium
CN110286776A (en) Input method, device, electronic equipment and the storage medium of character combination information
CN112287130A (en) Searching method, device and equipment for graphic questions
CN110968500A (en) Test case execution method and device
CN109635175B (en) Page data splicing method and device, readable storage medium and electronic equipment
CN110704742B (en) Feature extraction method and device
CN114911814A (en) Consultation service method and system based on knowledge resource library updating
CN113221173A (en) Ciphertext processing method, device, equipment and storage medium
JP2016051367A (en) Data analysis device, data analysis method, and program
CN106951427B (en) Data extraction method and device for business object
CN110942306A (en) Data processing method and device and electronic equipment
CN117111902B (en) AI intelligent software development method and device
CN112579855B (en) Feature code extraction method and device for WeChat article
CN112232035B (en) Article generation method and device, electronic equipment and storage medium

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
TA01 Transfer of patent application right

Effective date of registration: 20211119

Address after: 210038 8th floor, building D11, Hongfeng science and Technology Park, Nanjing Economic and Technological Development Zone, Jiangsu Province

Applicant after: New Technology Co.,Ltd.

Applicant after: VOLKSWAGEN (CHINA) INVESTMENT Co.,Ltd.

Address before: 100080 Room 501, 5th floor, NO.67, North Fourth Ring Road West, Haidian District, Beijing

Applicant before: Beijing Yufanzhi Information Technology Co.,Ltd.

TA01 Transfer of patent application right
RJ01 Rejection of invention patent application after publication

Application publication date: 20190329

RJ01 Rejection of invention patent application after publication