CN108717441B - Method and device for determining predicates corresponding to problem templates - Google Patents

Method and device for determining predicates corresponding to problem templates Download PDF

Info

Publication number
CN108717441B
CN108717441B CN201810468186.1A CN201810468186A CN108717441B CN 108717441 B CN108717441 B CN 108717441B CN 201810468186 A CN201810468186 A CN 201810468186A CN 108717441 B CN108717441 B CN 108717441B
Authority
CN
China
Prior art keywords
predicate
answer
question
determining
target
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.)
Active
Application number
CN201810468186.1A
Other languages
Chinese (zh)
Other versions
CN108717441A (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.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent 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 Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN201810468186.1A priority Critical patent/CN108717441B/en
Publication of CN108717441A publication Critical patent/CN108717441A/en
Application granted granted Critical
Publication of CN108717441B publication Critical patent/CN108717441B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/30Semantic analysis
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/20Natural language analysis
    • G06F40/205Parsing
    • G06F40/216Parsing using statistical methods

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Health & Medical Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Computational Linguistics (AREA)
  • General Health & Medical Sciences (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Probability & Statistics with Applications (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses a method and a device for determining predicates corresponding to a problem template. Wherein, the method comprises the following steps: acquiring a target question template and answer information with a corresponding relation, and acquiring predicate and content information with a corresponding relation; determining predicates corresponding to each piece of answer information according to the similarity between each piece of answer information and the content information in the answer information; and determining the predicate with the maximum number of corresponding answer information in the predicates as the target predicate corresponding to the target question template. The method and the device solve the technical problem of low efficiency in determining the predicates corresponding to the problem templates in the prior art.

Description

Method and device for determining predicates corresponding to problem templates
Technical Field
The invention relates to the field of computers, in particular to a method and a device for determining predicates corresponding to a problem template.
Background
In the related art, a rule method, namely a manual handwriting rule, is usually adopted when the intent of the template is processed to make a mapping rule. Such as: the problems that you are big today, how many years you are, what year you are born in which year, how big you are this year, how many years you are this year are mapped to be the 'years', but the defect of the scheme is very obvious: limited by manual experience and may not be perfect. If the user turns to say: how old you are, if the question is not within the rules, then the sentence cannot be processed. The current technical problem is mainly that artificial knowledge and ability are limited, and the user's inquiry methods are very different and various. Therefore, a manual solution may only deal with some cases, not all cases, and no support is provided without the rules summarized by the manual. In addition, excessive labor can also increase the budget of expenditure for the team, which is a practice with half the effort and cost, and has no good effect.
In view of the above problems, no effective solution has been proposed.
Disclosure of Invention
The embodiment of the invention provides a method and a device for determining predicates corresponding to problem templates, which are used for at least solving the technical problem of low efficiency in determining the predicates corresponding to the problem templates in the related art.
According to an aspect of the embodiments of the present invention, there is provided a method for determining a predicate corresponding to a question template, including: acquiring a target question template and answer information with a corresponding relation, and acquiring predicate and content information with a corresponding relation; determining a predicate corresponding to each answer message according to the similarity between each answer message and the content message in the answer messages; and determining the predicate with the maximum number of corresponding answer information in the predicates as the target predicate corresponding to the target question template.
According to another aspect of the embodiments of the present invention, there is provided an apparatus for determining a predicate corresponding to a question template, including: the first acquisition module is used for acquiring a target question template and answer information with corresponding relations, and acquiring predicate and content information with corresponding relations; the first determining module is used for determining predicates corresponding to each piece of answer information according to the similarity between each piece of answer information and the content information in the answer information; and the second determining module is used for determining the predicate with the maximum number of corresponding answer information in the predicates as the target predicate corresponding to the target question template.
According to another aspect of the embodiments of the present invention, there is also provided a storage medium, characterized in that the storage medium stores therein a computer program, wherein the computer program is configured to execute the method described in any one of the above when executed.
According to another aspect of the embodiments of the present invention, there is also provided an electronic apparatus, including a memory and a processor, wherein the memory stores therein a computer program, and the processor is configured to execute the method described in any one of the above through the computer program.
In the embodiment of the invention, the target question template and the answer information with corresponding relations are obtained, and the predicate and the content information with corresponding relations are obtained; determining a predicate corresponding to each answer message according to the similarity between each answer message and the content message in the answer messages; the method comprises the steps of determining predicates with the largest number of corresponding answer information in the predicates as a mode of target predicates corresponding to a target question template, obtaining the target question template and answer information with corresponding relations and predicates and content information with corresponding relations, establishing the corresponding relations between the answer information and the predicates according to the similarity between the answer information and the content information, determining the predicates with the largest number of corresponding answer information as positions corresponding to the target question template, automatically voting the predicates according to the similarity for each target question template in a voting mode, establishing the corresponding relations between the target question templates and the predicates with the highest votes, and automatically determining the predicates corresponding to the question templates for the question templates, so that the technical effect of improving the efficiency of determining the predicates corresponding to the question templates is achieved, and the technical problem that the predication efficiency of determining the predicates corresponding to the question templates in the related technology is low is solved.
Drawings
The accompanying drawings, which are included to provide a further understanding of the invention and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the invention and together with the description serve to explain the invention and do not constitute a limitation of the invention. In the drawings:
FIG. 1 is a schematic diagram of a method for determining predicates corresponding to an optional question template according to an embodiment of the present invention;
FIG. 2 is a schematic diagram of an application environment of a method for determining predicates corresponding to an optional question template according to an embodiment of the present invention;
FIG. 3 is a schematic diagram of a method for determining predicates corresponding to an alternative problem template according to an alternative embodiment of the present invention;
FIG. 4 is a schematic diagram of a method for determining predicates corresponding to an alternative problem template according to an alternative embodiment of the invention;
FIG. 5 is a schematic diagram of an apparatus for determining predicates corresponding to an alternative problem template according to an embodiment of the present invention;
FIG. 6 is a schematic diagram of an application scenario of a method for determining a predicate corresponding to an optional question template according to an embodiment of the present invention; and
FIG. 7 is a schematic diagram of an alternative electronic device according to an embodiment of the invention.
Detailed Description
In order to make the technical solutions of the present invention better understood, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It should be noted that the terms "first," "second," and the like in the description and claims of the present invention and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the invention described herein are capable of operation in other sequences than those illustrated or described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
According to an aspect of the embodiments of the present invention, there is provided a method for determining a predicate corresponding to a question template, as shown in fig. 1, the method includes:
s102, acquiring a target question template and answer information with a corresponding relation, and acquiring predicate and content information with a corresponding relation;
s104, determining predicates corresponding to each answer message according to the similarity between each answer message and the content message in the answer messages;
and S106, determining the predicate with the maximum number of the corresponding answer information in the predicates as the target predicate corresponding to the target question template.
Optionally, in this embodiment, the method for determining the predicate corresponding to the question template may be applied to a hardware environment formed by the device 202 shown in fig. 2. As shown in fig. 2, the device 202 acquires a target question template and answer information having a correspondence relationship, and acquires predicate and content information having a correspondence relationship; determining predicates corresponding to each answer message according to the similarity between each answer message and the content message in the answer messages; and determining the predicate with the maximum number of corresponding answer information in the predicates as the target predicate corresponding to the target question template.
Optionally, in this embodiment, the method for determining the predicate corresponding to the question template may be, but is not limited to, applied in a scenario of determining the correspondence between the question template and the predicate. The method for determining the predicates corresponding to the problem templates can be applied to various types of applications, such as online education applications, instant messaging applications, community space applications, game applications, shopping applications, browser applications, financial applications, multimedia applications, live broadcast applications, medical applications, interactive applications of intelligent hardware and the like (wherein the intelligent hardware can be but is not limited to intelligent home equipment, intelligent wearable equipment, intelligent vehicles and the like). Specifically, the method can be applied to, but not limited to, a scenario in which a correspondence between a problem template and a predicate is determined in the browser application, or can also be applied to, but not limited to, a scenario in which a correspondence between a problem template and a predicate is determined in the game application, so as to improve efficiency in determining the predicate corresponding to the problem template. The above is only an example, and this is not limited in this embodiment.
Optionally, in this embodiment, the method for determining the predicate corresponding to the question template may be applied to, but not limited to, a natural language processing scenario. Such as: the method comprises the steps of giving a natural language Question (Query), conducting semantic understanding and analysis on the Question, and then conducting Query and reasoning by using a knowledge base to obtain an Answer (Answer).
For example: as shown in FIG. 3, with a knowledge-graph of some of Liu, there is now one user asking: who a wife who has a certain Liu. The template after template generation processing of this Query is: who the wife of singer is, and if the predicate that maps the template is wife, who the wife of singer corresponds to wife. An entity with singer as Liu is found in a Knowledge Base (KB), a predicate as wife, a result as Ju can be found, and finally a result as Ju is returned.
Optionally, in this embodiment, the information triplets in the knowledge graph are generally represented as: subject (subject), predicate (predicate), object (object), both of which are generally entities, and predicate indicates a relationship between two entities or an attribute of the subject. Wherein an entity refers to a basic unit representing a concept. Such as: from a data processing perspective, an objective thing in the real world can be referred to as an entity, which is any distinguishable, identifiable thing in the real world. An entity may refer to a person, such as a teacher, a student, etc., or an object, such as a book, a warehouse, etc. It may refer not only to an accessible objective object, but also to an abstract event, such as a performance, football game, etc.
Alternatively, in this embodiment, the template may be a general sentence pattern with an extended example, and the question template is a general question sentence pattern with an extended example. Such as: for problem 1: who the wife of zhang san is, question 2: who the wife of lie four is, question 3: wife of wangwei, question 4: the wife of Zhao six says who, though the subject language is different, who is asked who whose wife is, then questions 1 through 4 can be generalized to the same question template: [ person ] who wife.
Optionally, in this embodiment, the target question template and the answer information having the corresponding relationship may be obtained from a question-answer pair obtained in advance, such as: 600 ten thousand question-answer pairs are obtained in advance, and the questions in the 600 ten thousand question-answer pairs are converted into question templates one by one. And integrating the converted question templates, wherein one or more questions may correspond to the same question template, and determining answers corresponding to the one or more questions as answer information corresponding to the template, so as to obtain a target question template and answer information with corresponding relations.
Optionally, in this embodiment, the predicate and the content information with a correspondence relationship may be, but are not limited to, obtained from a knowledge base, and the predicate and the content information with a correspondence relationship may be, but are not limited to, integrated according to a subject, or integrated according to the predicate.
For example: taking disease knowledge as an example, 9600 pieces of disease-related knowledge are acquired as a knowledge base, predicates of the 9600 pieces of disease-related knowledge are extracted from each piece of disease-related knowledge, the knowledge is used as content information corresponding to the predicates, the same predicates can be extracted from a plurality of pieces of knowledge, the predicates are integrated, one or more pieces of content information corresponding to each predicate are obtained, and therefore predicates and content information with corresponding relations are obtained. Or, the related knowledge can be integrated according to the subject, then the predicate is extracted under each subject, the corresponding relation between the predicate and the content information is established, and the subject, the predicate and the content information with the corresponding relation are determined as the predicate and the content information with the corresponding relation.
In an alternative embodiment, as shown in fig. 4, taking the disease field as an example, 600 ten thousand question-answer pairs are obtained, and the target question template and the answer information having the corresponding relationship are extracted from the 600 ten thousand question-answer pairs. 9600 pieces of relevant knowledge of diseases are acquired as a knowledge base, and predicates and content information with corresponding relations are extracted from the knowledge base. And determining a predicate corresponding to each piece of answer information according to the similarity between each piece of answer information and the content information in the answer information, counting the number of the answer information corresponding to each predicate, and determining the predicate with the largest number of corresponding answer information in the predicates as a target predicate corresponding to the target question template.
It can be seen that through the above steps, target question templates and answer information having a corresponding relationship, and predicates and content information having a corresponding relationship are obtained, a corresponding relationship between each answer information and the predicates is established according to the similarity between each answer information and the content information, the predicates with the largest number of corresponding answer information are determined as positions corresponding to the target question templates, so that the predicates are automatically voted according to the similarity for each target question template in a voting manner, a corresponding relationship between each target question template and the predicates with the highest number of votes is established, and the predicates corresponding to the question templates are automatically determined for the question templates, so that the technical effect of improving the efficiency of determining the predicates corresponding to the question templates is achieved, and the technical problem of low efficiency in determining the predicates corresponding to the question templates in the related technology is solved.
As an alternative, the obtaining of the target question template and the answer information having the corresponding relationship includes:
s1, converting each question in a question-answer pair into a question template, wherein the question-answer pair is a question and an answer with a corresponding relationship;
s2, obtaining different problem templates from the problem templates to obtain target problem templates;
and S3, determining answers corresponding to the questions belonging to the target question template as answer information corresponding to the target question template to obtain the target question template and the answer information with corresponding relations.
Optionally, in this embodiment, in the process of converting a question into a question template, a situation that multiple questions are converted into the same question template may occur, for example: the problems of how to treat scapulohumeral periarthritis, what treatment modes of cervical spondylosis are, how to treat chicken pox and the like can be converted into the same problem template: [ sickname ] how to treat. That is, it may be possible for M questions to be converted into Q mutually different question templates, where Q is less than or equal to M, and the Q mutually different question templates are determined as target question templates.
Optionally, in this embodiment, all answers corresponding to the questions converted into the same question template are determined as the answer information corresponding to the question. For example: the problems are as follows: how to treat scapulohumeral periarthritis and what treatment methods of cervical spondylosis are, what treatment chickenpox is converted into a target problem template: [ sickname ] how to treat. The problems are that: how to prevent scapulohumeral periarthritis, what prevention mode of cervical spondylopathy have, how to prevent chicken pox and convert into target problem template: [ sickname ] how to prevent. Then, the corresponding answer 1 of how to treat scapulohumeral periarthritis, the corresponding answer 2 of the treatment mode of cervical spondylosis and the corresponding answer 3 of how to treat varicella can be determined as target question templates: [ sickname ] how to treat the corresponding answer information, and determine which corresponding answers 4 and 5 correspond to scapulohumeral periarthritis prevention and cervical spondylosis prevention modes and which answer 6 corresponds to varicella prevention as target question templates: [ sickname ] how to prevent the corresponding answer information. Obtaining a target problem template with a corresponding relation: [ sickname ] how to treat and answer information: answer 1, answer 2, answer 3, and target question template with correspondence: [ sickname ] how to prevent and answer information: answer 4, answer 5, answer 6.
As an alternative, obtaining mutually different problem templates from the problem templates, and obtaining the target problem template includes:
s1, obtaining different problem templates from problem templates;
s2, problem templates of which the problem template types belong to binary fact problems in different problem templates are obtained;
and S3, determining the problem templates with the maximum target number corresponding to the problem templates of the binary factual problem as the target problem templates.
Optionally, in this embodiment, a Binary Factual Question (BFQ) generally refers to a Question asking about an attribute of an aspect of an entity.
Optionally, in this embodiment, 200 templates with the highest frequency and belonging to the BFQ problem may be selected from the massive target problem templates.
As an optional scheme, the obtaining the predicate and the content information having a correspondence relationship includes:
s1, acquiring knowledge data of a target field;
s2, establishing a knowledge graph of the target field according to the knowledge data;
s3, obtaining a subject, a predicate and an object with corresponding relations from the information triples of the knowledge graph;
and S4, determining the predicate and the object with the corresponding relation as the predicate and the content information with the corresponding relation, or determining the predicate and the object with the corresponding relation under the subject as the predicate and the content information with the corresponding relation corresponding to the subject.
Optionally, in this embodiment, the knowledge graph is also called a scientific knowledge graph, and is called knowledge domain visualization or knowledge domain mapping map in the book intelligence field, and is a series of various graphs displaying the relationship between the knowledge development process and the structure, and the knowledge resources and their carriers are described by using visualization technology, and the knowledge and their interrelations are mined, analyzed, constructed, drawn, and displayed.
For example: 9600 pieces of relevant knowledge data in the disease field are obtained, and keyword extraction is also carried out on the content of the 9600 pieces of original data. Such as: the predicates of scapulohumeral periarthritis include: treatment, common symptoms, complications and the like, wherein the keyword extraction result of the predicate 'treatment' is as follows: pain relief, adhesion, medication, surgery, traditional Chinese medicine; the keyword extraction result of the predicate of 'common symptom' is as follows: chronic, pain, spread, limited shoulder joint movement, shoulder soreness, limited shoulder movement, shoulder pain.
Optionally, in this embodiment, the predicates and the content information having the correspondence relationship may be, but are not limited to, classified according to a subject, that is, each piece of knowledge data extracts the subject, the predicates and the content information, the knowledge data are classified according to the subject, the knowledge data of the same subject are integrated together, each subject corresponds to the predicates, and each predicate corresponds to the content information. Alternatively, the predicates and content information having the corresponding relationship may also be, but not limited to, distinguished by no subject, that is, one predicate and content information having the corresponding relationship is extracted from each piece of knowledge data.
Optionally, in this embodiment, the predicate corresponding to each answer information may be determined, but is not limited to be determined, by one of the following manners:
in a first mode, when a predicate and an object with a corresponding relationship are determined as the predicate and the content information with the corresponding relationship, determining a first similarity of the content information corresponding to each answer information and each first predicate, wherein the first predicate is the predicate in the predicate and the content information with the corresponding relationship;
and determining the corresponding first predicate with the highest first similarity as the predicate corresponding to each answer message.
In a second mode, under the condition that the predicates and the objects with the corresponding relation under the subject are determined as the predicates and the content information with the corresponding relation corresponding to the subject, second predicates and content information with the corresponding relation are obtained, wherein the second predicates correspond to the same subject with each piece of answer information;
determining a second similarity of the content information corresponding to each answer information and each second predicate;
and determining the corresponding second predicate with the highest second similarity as the predicate corresponding to each answer message.
As an optional scheme, determining a predicate corresponding to each piece of answer information according to a similarity between each piece of answer information and content information in the answer information includes:
s1, extracting keywords from each answer message to obtain each answer message and a first keyword set with corresponding relations;
s2, extracting keywords from the content information corresponding to each predicate to obtain content information and a second keyword set with corresponding relations;
s3, respectively obtaining the similarity between the first keyword set corresponding to each answer message and the second keyword set corresponding to each content message, and determining the similarity between the first keyword set and the second keyword set as the similarity between each answer message and each content message;
and S4, determining the predicate corresponding to the target content information with the highest similarity between the answer information as the predicate corresponding to each answer information.
Alternatively, in the present embodiment, the manner of determining the similarity of each answer information and the content information may include, but is not limited to, determining the similarity between the keyword of each answer information and the keyword of the content information.
Optionally, in this embodiment, the manner of determining the similarity between the keywords may include, but is not limited to: and acquiring Jack card similarity between the keywords. For two sets x and y, the Jack similarity calculation formula is
Figure BDA0001662598520000101
I.e., jaccard similarity J is the intersection of the two sets divided by the union of the two sets.
It should be noted that other similarity calculation methods may be used in the above calculation of the similarity, for example, a calculation method based on a word vector may be used.
As an optional solution, after determining the predicate with the largest number of corresponding answer information in the predicates as the target predicate corresponding to the target question template, the method further includes:
s1, acquiring a first answer corresponding to a first question input by a user by using a target question template and a target predicate which have a corresponding relation;
and S2, returning the first answer to the user as response information of the first question.
Optionally, in this embodiment, further natural language processing may be performed by using the obtained target problem template and target predicate having a corresponding relationship, for example: obtain answers to questions posed by the user, and so on.
As an optional solution, the obtaining, by using the target question template and the target predicate having a correspondence relationship, a first answer corresponding to the first question input by the user includes:
s1, acquiring a first question input by a user, and extracting a first subject from the first question;
s2, converting the first question into a first question template;
s3, acquiring a first predicate corresponding to the first question template from the target question template and the target predicate which have the corresponding relation;
s4, acquiring a knowledge graph corresponding to the first subject from a knowledge base in the field to which the first question belongs;
and S5, acquiring answer information corresponding to the first predicate from the knowledge graph corresponding to the first subject, and determining the answer information corresponding to the first predicate as a first answer.
Optionally, in this embodiment, after the target question template and the target predicate having a corresponding relationship are obtained, a predicate prediction may be performed on the question input by the user quickly, the first question input by the user is converted into the first question template, the first predicate corresponding to the first question template is predicted from the target question template and the target predicate having a corresponding relationship, and then the answer information corresponding to the first predicate is obtained from the knowledge graph corresponding to the subject of the first question and is returned to the user as the first answer.
It should be noted that, for simplicity of description, the above-mentioned method embodiments are described as a series of acts or combination of acts, but those skilled in the art will recognize that the present invention is not limited by the order of acts, as some steps may occur in other orders or concurrently in accordance with the invention. Further, those skilled in the art should also appreciate that the embodiments described in the specification are preferred embodiments and that the acts and modules referred to are not necessarily required by the invention.
Through the above description of the embodiments, those skilled in the art can clearly understand that the method according to the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but the former is a better implementation mode in many cases. Based on such understanding, the technical solutions of the present invention may be embodied in the form of a software product, which is stored in a storage medium (e.g., ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal device (e.g., a mobile phone, a computer, a server, or a network device) to execute the method according to the embodiments of the present invention.
According to another aspect of the embodiments of the present invention, there is also provided an apparatus for determining a predicate corresponding to a problem template, for implementing the method for determining a predicate corresponding to a problem template, as shown in fig. 5, the apparatus includes:
a first obtaining module 52, configured to obtain a target question template and answer information having a corresponding relationship, and obtain a predicate and content information having a corresponding relationship;
a first determining module 54, configured to determine a predicate corresponding to each piece of answer information according to a similarity between each piece of answer information and the content information in the answer information;
and a second determining module 56, configured to determine the predicate with the largest number of corresponding answer information in the predicates as the target predicate corresponding to the target question template.
Optionally, in this embodiment, the apparatus for determining a predicate corresponding to the question template may be applied to a hardware environment formed by the device 202 shown in fig. 2. As shown in fig. 2, the device 202 acquires a target question template and answer information having a correspondence relationship, and acquires predicate and content information having a correspondence relationship; determining predicates corresponding to each answer message according to the similarity between each answer message and the content message in the answer messages; and determining the predicate with the maximum number of corresponding answer information in the predicates as the target predicate corresponding to the target question template.
Optionally, in this embodiment, the apparatus for determining a predicate corresponding to the question template may be applied to, but not limited to, a scenario of determining a correspondence between the question template and the predicate. The method for determining the predicates corresponding to the problem templates can be applied to various types of applications, such as online education applications, instant messaging applications, community space applications, game applications, shopping applications, browser applications, financial applications, multimedia applications, live broadcast applications, medical applications, interactive applications of intelligent hardware and the like (wherein the intelligent hardware can be but is not limited to intelligent home equipment, intelligent wearable equipment, intelligent vehicles and the like). Specifically, the method can be applied to, but not limited to, a scenario in which a correspondence between a problem template and a predicate is determined in the browser application, or can also be applied to, but not limited to, a scenario in which a correspondence between a problem template and a predicate is determined in the game application, so as to improve efficiency in determining the predicate corresponding to the problem template. The above is only an example, and this is not limited in this embodiment.
Optionally, in this embodiment, the determination device of the predicate corresponding to the question template may be applied to, but not limited to, a natural language processing scenario. Such as: the method comprises the steps of (KB-QA) Knowledge Base Question Answering, giving a natural language Question (Query), performing semantic understanding and analysis on the Question, and further performing Query and reasoning by using a Knowledge Base to obtain an Answer (Answer).
For example: as shown in FIG. 3, there is a knowledge graph of some part of Liu, and now there is a user asking: who a wife who has a certain Liu. The template after template generation processing of this Query is: who the wife of grandmother [ singer ] is, and if the predicate that maps the template is wife, so who the wife of grandmother [ singer ] corresponds to wife. An entity with singer being some Liu is found in a Knowledge Base (KB), a predicate being wife, a result being some Zhu can be found, and finally a result being some Zhu is returned.
Optionally, in this embodiment, the information triplets in the knowledge graph are generally represented as: subject (subject), predicate (predicate), object (object), both of which are generally entities, and predicate indicates a relationship between two entities or an attribute of the subject. Wherein an entity refers to a basic unit representing a concept. Such as: from a data processing perspective, an objective thing in the real world can be referred to as an entity, which is any distinguishable, identifiable thing in the real world. An entity may refer to a person, such as a teacher, a student, etc., or an object, such as a book, a warehouse, etc. It may refer not only to an accessible objective object, but also to an abstract event, such as a performance, football game, etc.
Alternatively, in this embodiment, the template may be a general sentence pattern with an extended example, and the question template is a general question sentence pattern with an extended example. Such as: for problem 1: who the wife who yesan is, question 2: wife of lie four is who, question 3: who the wife of wangwu is, question 4: the wife of zhao, who said all said to ask who and wife who, although the subject language is different, can generalize the questions 1 to 4 into the same question template: [ person ] who the wife is.
Optionally, in this embodiment, the target question template and the answer information having the corresponding relationship may be obtained from a question-answer pair obtained in advance, such as: 600 ten thousand question-answer pairs are obtained in advance, and the questions in the 600 ten thousand question-answer pairs are converted into question templates one by one. And integrating the converted question templates, wherein one or more questions may correspond to the same question template, and determining answers corresponding to the one or more questions as answer information corresponding to the template, so as to obtain a target question template and answer information with corresponding relations.
Optionally, in this embodiment, the predicate and the content information having a correspondence relationship may be, but are not limited to, obtained from a knowledge base, and the predicate and the content information having a correspondence relationship may be, but are not limited to, integrated according to a subject, or may also be, but is not limited to, integrated according to the predicate.
For example: taking disease knowledge as an example, 9600 pieces of disease-related knowledge are acquired as a knowledge base, predicates of the 9600 pieces of disease-related knowledge are extracted from each piece of disease-related knowledge, the knowledge is used as content information corresponding to the predicates, the same predicates can be extracted from a plurality of pieces of knowledge, the predicates are integrated, one or more pieces of content information corresponding to each predicate are obtained, and therefore predicates and content information with corresponding relations are obtained. Or, the related knowledge can be integrated according to the subject, then the predicate is extracted under each subject, the corresponding relation between the predicate and the content information is established, and the subject, the predicate and the content information with the corresponding relation are determined as the predicate and the content information with the corresponding relation.
In an alternative embodiment, as shown in fig. 4, taking the disease field as an example, 600 ten thousand question-answer pairs are obtained, and the target question template and the answer information having the corresponding relationship are extracted from the 600 ten thousand question-answer pairs. 9600 pieces of relevant knowledge of diseases are acquired as a knowledge base, and predicates and content information with corresponding relations are extracted from the knowledge base. And determining a predicate corresponding to each piece of answer information according to the similarity between each piece of answer information and the content information in the answer information, counting the number of the answer information corresponding to each predicate, and determining the predicate with the largest number of the corresponding answer information in the predicates as a target predicate corresponding to the target question template.
Therefore, through the device, the target question template and the answer information with corresponding relations and the predicates and the content information with corresponding relations are obtained, the corresponding relations between the answer information and the predicates are established according to the similarity between the answer information and the content information, the predicates with the largest number of the corresponding answer information are determined to be the positions corresponding to the target question templates, the predicates are automatically voted according to the similarity for each target question template in a voting mode, the corresponding relations between the target question templates and the predicates with the highest number of votes are established, the predicates corresponding to the question templates are automatically determined for the question templates, the technical effect of improving the efficiency of determining the predicates corresponding to the question templates is achieved, and the technical problem that the efficiency of determining the predicates corresponding to the question templates in the related technology is low is solved.
As an optional solution, the first obtaining module includes:
the first conversion unit is used for converting each question in the question-answer pair into a question template, wherein the question-answer pair is a question and an answer with corresponding relations;
the first acquisition unit is used for acquiring different problem templates from the problem templates to obtain target problem templates;
and the first determining unit is used for determining the answer corresponding to the question belonging to the target question template as the answer information corresponding to the target question template to obtain the target question template and the answer information with corresponding relations.
Optionally, in this embodiment, in the process of converting a question into a question template, a situation that multiple questions are converted into the same question template may occur, for example: the problems of how to treat scapulohumeral periarthritis, what treatment modes of cervical spondylosis are, how to treat chicken pox and the like can be converted into the same problem template: [ sickname ] how to treat. That is, it may be possible for M questions to be converted into Q mutually different question templates, where Q is less than or equal to M, and the Q mutually different question templates are determined as target question templates.
Optionally, in this embodiment, all answers corresponding to the questions converted into the same question template are determined as the answer information corresponding to the question. For example: the problems are that: how to treat scapulohumeral periarthritis and what treatment modes of cervical spondylosis are, what treatment modes of varicella are converted into target problem templates: [ sickname ] how to treat. The problems are as follows: how to prevent scapulohumeral periarthritis, what prevention mode of cervical spondylopathy have, how to prevent chicken pox and convert into target problem template: [ sickname ] how to prevent. Then, the corresponding answer 1 of how to treat scapulohumeral periarthritis, the corresponding answer 2 of the treatment mode of cervical spondylosis and the corresponding answer 3 of how to treat chicken pox can be determined as target question templates: [ sickname ] how to treat the corresponding answer information, and determine which corresponding answers 4 and 5 correspond to scapulohumeral periarthritis prevention and cervical spondylosis prevention modes and which answer 6 corresponds to varicella prevention as target question templates: [ sickname ] how to prevent the corresponding answer information. Obtaining a target problem template with a corresponding relation: [ sickname ] how to treat and respond to information: answer 1, answer 2, answer 3, and a target question template with a correspondence: [ sickname ] how to prevent and answer information: answer 4, answer 5, answer 6.
As an optional solution, the first obtaining unit includes:
the first obtaining subunit is used for obtaining mutually different problem templates from the problem templates;
a second obtaining subunit, configured to obtain problem templates in mutually different problem templates, where the problem template types belong to a binary fact problem;
and the determining subunit is used for determining the problem template with the maximum target number corresponding to the problem template with the binary fact type problem as the target problem template.
Optionally, in this embodiment, a Binary Factual Question (BFQ) generally refers to a Question of inquiring about an attribute of an aspect of an entity.
Optionally, in this embodiment, 200 templates with the highest frequency and belonging to the BFQ problem may be selected from the massive target problem templates.
As an optional solution, the first obtaining module includes:
a second acquisition unit configured to acquire knowledge data of the target domain;
the establishing unit is used for establishing a knowledge graph of the target field according to the knowledge data;
the third acquisition unit is used for acquiring the subject, the predicate and the object with corresponding relations from the information triple of the knowledge graph;
and a second determining unit, configured to determine the predicate and the object having a correspondence relationship as the predicate and the content information having a correspondence relationship, or determine the predicate and the object having a correspondence relationship under the subject as the predicate and the content information having a correspondence relationship corresponding to the subject.
Optionally, in this embodiment, the knowledge graph is also called a scientific knowledge graph, and is called knowledge domain visualization or knowledge domain mapping map in the book intelligence field, and is a series of various graphs displaying the relationship between the knowledge development process and the structure, and the knowledge resources and their carriers are described by using visualization technology, and the knowledge and their interrelations are mined, analyzed, constructed, drawn, and displayed.
For example: 9600 pieces of relevant knowledge data in the disease field are obtained, and keyword extraction is also carried out on the content of the 9600 pieces of original data. Such as: the predicates of scapulohumeral periarthritis include: treatment, common symptoms, complications and the like, wherein the keyword extraction result of the predicate 'treatment' is as follows: pain relief, adhesion, medication, surgery, traditional Chinese medicine; the keyword extraction result of the predicate of 'common symptom' is as follows: chronic, pain, spread, limited shoulder joint movement, shoulder soreness, limited shoulder movement, shoulder pain.
Optionally, in this embodiment, the predicates and the content information having the correspondence relationship may be, but are not limited to, classified according to subjects, that is, each piece of knowledge data extracts a subject, a predicate, and content information, and each piece of knowledge data is classified according to a subject, the knowledge data of the same subject are integrated together, each subject corresponds to a predicate, and each predicate corresponds to content information. Alternatively, the predicates and content information having the corresponding relationship may also be, but not limited to, distinguished by no subject, that is, one predicate and content information having the corresponding relationship is extracted from each piece of knowledge data.
Optionally, in this embodiment, the second determining module is configured to: under the condition that predicates and objects with corresponding relations are determined as predicates and content information with corresponding relations, determining first similarity of content information corresponding to each answer information and each first predicate, wherein the first predicate is one of the predicates and the content information with corresponding relations; and determining the corresponding first predicate with the highest first similarity as the predicate corresponding to each answer message.
Optionally, in this embodiment, the second determining module is configured to: under the condition that the predicates and the objects with the corresponding relations under the subjects are determined as the predicates and the content information with the corresponding relations corresponding to the subjects, second predicates and content information with the corresponding relations are obtained, wherein the second predicates correspond to the same subjects with each answer information; determining a second similarity of the content information corresponding to each answer information and each second predicate; and determining the corresponding second predicate with the highest second similarity as the predicate corresponding to each answer information.
As an alternative, the second determining module includes:
a first extraction unit, configured to extract a keyword from each answer information, to obtain each answer information and a first keyword set having a correspondence relationship;
the second extraction unit is used for extracting keywords from the content information corresponding to each predicate to obtain content information and a second keyword set which have corresponding relations;
a fourth obtaining unit, configured to obtain a similarity between the first keyword set corresponding to each piece of answer information and the second keyword set corresponding to each piece of content information, and determine the similarity between the first keyword set and the second keyword set as a similarity between each piece of answer information and each piece of content information;
and a third determining unit, configured to determine, as the predicate corresponding to each piece of answer information, the predicate corresponding to the piece of target content information having the highest similarity between the pieces of answer information.
Alternatively, in the present embodiment, the manner of determining the similarity of each answer information and the content information may include, but is not limited to, determining the similarity between the keyword of each answer information and the keyword of the content information.
Optionally, in this embodiment, the manner of determining the similarity between the keywords may include, but is not limited to: and acquiring Jack card similarity between the keywords. For two sets x and y, the Jack similarity is calculated by the formula
Figure BDA0001662598520000191
I.e., jaccard similarity J is the intersection of the two sets divided by the union of the two sets.
It should be noted that when the similarity is calculated, other similarity calculation methods may be used, for example, a calculation method based on a word vector may be used.
As an optional solution, the apparatus further includes:
the second obtaining module is used for obtaining a first answer corresponding to a first question input by a user by utilizing the target question template and the target predicate which have the corresponding relation;
and the returning module is used for returning the first answer to the user as response information of the first question.
Optionally, in this embodiment, further natural language processing may be performed by using the obtained target problem template and target predicate having a corresponding relationship, for example: obtain answers to questions posed by the user, and so on.
As an optional scheme, the second obtaining module includes:
a fifth acquiring unit, configured to acquire a first question input by a user, and extract a first subject from the first question;
the second conversion unit is used for converting the first question into a first question template;
a sixth obtaining unit, configured to obtain a first predicate corresponding to the first problem template from the target problem template and the target predicate having a correspondence relationship;
a seventh obtaining unit, configured to obtain a knowledge graph corresponding to the first subject from a knowledge base in a field to which the first question belongs;
and the eighth acquiring unit is used for acquiring the answer information corresponding to the first predicate from the knowledge graph corresponding to the first subject, and determining the answer information corresponding to the first predicate as the first answer.
Optionally, in this embodiment, after the target question template and the target predicate having a corresponding relationship are obtained, a predicate prediction may be performed on the question input by the user quickly, the first question input by the user is converted into the first question template, the first predicate corresponding to the first question template is predicted from the target question template and the target predicate having a corresponding relationship, and then the answer information corresponding to the first predicate is obtained from the knowledge graph corresponding to the subject of the first question and is returned to the user as the first answer.
The application environment of the embodiment of the present invention may refer to the application environment in the above embodiment, but is not limited to this embodiment, and details thereof are not described again in this embodiment. The embodiment of the invention provides an optional specific application example of the connection method for implementing the real-time communication.
As an alternative embodiment, the method for determining the predicate corresponding to the question template may be applied to, but is not limited to, a scenario in which an answer corresponding to a received question is determined in natural language processing as shown in fig. 6. In the scene, a template intention mining method based on a knowledge question-answer library is provided, a mapping relation between a template and predicates of the knowledge library is found, the real intention (prediction predicates) of a user is understood, and then answers are found in a database according to the predicates. The method comprises the steps of generating a template corresponding to each problem, then mapping the template and predicates by using a knowledge graph-based template intention mining method, adopting algorithms of keyword extraction, jack similarity calculation and voting in the mapping method, finally selecting predicates with the highest votes as predicates of the template, and finally integrating the mapping relations between all the templates and the predicates.
Optionally, in this embodiment, the existing knowledge based on the knowledge-graph is adopted, the query and the answer of the mined related field are combined, the predicate is predicted by a voting method, and finally, a mapping relationship between the template and the predicate with the most votes is obtained as a supplement of the existing knowledge base. After the processing, any query can find the predicate corresponding to the template by finding the mapping relation of the template in the knowledge base, and finally, an answer is found in the database. Obviously, the method is more intelligent and effective, and can cope with massive inquiry methods of users under the condition of sufficient data quantity.
Optionally, in this scenario, a mapping method for predicting template intentions based on a knowledge graph is provided, where a user queries a query to directly generate a template, then a predicate corresponding to the template can be found by the method based on the knowledge graph through a mapping process from the template to the predicate, and finally a predicate result of a corresponding entity is found in the knowledge graph as a result of the query.
Optionally, in this scenario, the method described above may be applied to template mining in various fields of the dobby intelligent assistant. When a certain field is newly built, a large amount of corpus of the field and a large amount of related entities of the field may be collected, but the user's question methods are changeable, and limited sentences may not include all question methods. Therefore, the role of the template on a field is very important, and a good template can cover the varied question method of the field, so that the template suitable for the field is very important to be mined through the corpus and the related entities. For an existing field, if some questions and related entities are found to be incapable of supporting, the templates can also be mined through the questions and the related entities, and the recall rate and the semantic understanding capability of the field are improved. Therefore, the mining capability of the template is very important for the existing field as well as the new field.
The method is mainly applied to answers of chatting terminals of products and related knowledge questions and answers, and is very important to the fields of health, diseases and the like, and is also very important to the knowledge questions and answers in the general field. After the query in any field comes, a corresponding template can be generated, then the predicates of the corresponding template can be found through the trained mapping relation, answers can be conveniently found through the corresponding entities and the predicates, and the answers are returned to the user.
In order to illustrate how to use the knowledge graph to perform template intent prediction in this scenario, by way of example, in this embodiment, 600 ten thousand qa pairs (question-answer pairs) related to diseases are mined, and 9600 pieces of related knowledge of diseases are used as KB, so as to obtain mapping relationships between templates and corresponding predicates in the disease fields. As shown in fig. 6, the whole process includes the following steps:
step 1, template excavation: first, 600 ten thousand queries of template mining are performed, (the entities are 9600 diseases), that is, the conversion from query to template is completed. ( Such as to obtain: [ sick _ name ], [ sick _ name ] how to treat, \8230;, etc. )
Step 2, finding out a BFQ template of the top 200: the knowledge question-answering supports the BFQ problem, so that 200 templates with the highest frequency and belonging to the BFQ problem can be selected from a large quantity of templates. ( Such as selecting: how the [ sick _ name ] is treated, which symptoms of the [ sick _ name ], of \8230 )
And 3, recalling all answer of each template and extracting answer keywords: all answers for each template are found to be the basis for voting. And the lengthy answers are subjected to keyword extraction. (for example, "[ sic _ name ] how to treat" the answer of this query has hundreds, it is 1. The scapulohumeral periarthritis should be treated later in western medicine and scapulohumeral periarthritis generally adopt the medication and operation treatment, the medication mainly lets patient take anti-inflammatory analgesic drugs orally, but most of patients will relapse after stopping medicine, and the treatment of applying the operation method is easy to cause the adhesion, so the treatment of scapulohumeral periarthritis generally recommends Chinese medicine treatment method 2 \8230, then carry on the keyword extraction to each answer, for example, the keyword extraction result of the first answer is as follows: scapulohumeral periarthritis, medicine, operation, oral taking, pain relieving, relapse, adhesion, chinese medicine). The keyword extraction here can use Textrank4 algorithm to extract 50 keywords in each session.
Step 4, carrying out predicate and keyword extraction on 9600 pieces of original data, and taking the data as KB: for convenience of processing, the content of 9600 pieces of original data is also subjected to keyword extraction. For example, the predicates of scapulohumeral periarthritis include treatment, common symptoms and complications of 8230A '8230', wherein the keyword extraction result of the predicate of 'treatment' is pain relieving, adhesion, medicine, operation and traditional Chinese medicine, and the keyword extraction result of the predicate of 'common symptoms' is chronic, pain, diffusion, shoulder joint activity limitation, shoulder pain, shoulder motion limitation and shoulder pain.
Step 5, template intention voting: each answer to a template will only vote on an intention, and finally the intention that is voted the highest for a template is its predicted intention or true intention, such as: [ mock _ name)]How to treat { predicate "treatment":30, predicate "die": 20, predicate "common cause":10 \8230; }, then for this template [ sine _ name; ]]The final voting result is "treatment" for how to treat, that is, the template asks about the treatment-related information. And each template has hundreds of thousands of answers, each answer needs to calculate the Jack card similarity of each intention of the KB, a predicate with the highest similarity is voted according to the calculation result, and finally the predicate with the highest statistical vote after the answers are voted is used as the prediction intention result of the template. (e.g., a first template, such as a scapulohumeral periarthritis,the key words of Chinese medicine need to be calculated with the key words of all possible predicates of the entity 'scapulohumeral periarthritis' corresponding to KB (for two sets x and y, the calculation formula of Jack similarity is as follows
Figure BDA0001662598520000231
I.e., the intersection of the two sets divided by the sum of the two sets), the choice with the highest score, e.g., the first answer and predicate "treatment" with the highest score, and finally hundreds or thousands of answers individually vote for "treatment": 500 tickets, "common symptoms": 100 tickets, "complications": 50 Ticket 82308230, the final predicted intent result of the first template can be selected as: "treatment").
According to another aspect of the embodiments of the present invention, there is also provided an electronic apparatus for implementing determination of a predicate corresponding to the problem template, as shown in fig. 7, the electronic apparatus includes: one or more processors 702 (only one of which is shown in the figure), in which a computer program is stored, a memory 704, in which a sensor 706, an encoder 708 and a transmission means 710 are arranged to carry out the steps of any of the above-described method embodiments by means of the computer program.
Optionally, in this embodiment, the electronic apparatus may be located in at least one network device of a plurality of network devices of a computer network.
Optionally, in this embodiment, the processor may be configured to execute the following steps by a computer program:
s1, acquiring a target question template and answer information with a corresponding relation, and acquiring predicates and content information with a corresponding relation;
s2, determining predicates corresponding to each answer message according to the similarity between each answer message and the content message in the answer messages;
and S3, determining the predicate with the maximum number of corresponding answer information in the predicates as the target predicate corresponding to the target question template.
Alternatively, it can be understood by those skilled in the art that the structure shown in fig. 7 is only an illustration, and the electronic device may also be a terminal device such as a smart phone (e.g., an Android phone, an iOS phone, etc.), a tablet computer, a palm computer, and a Mobile Internet Device (MID), PAD, etc. Fig. 7 is a diagram illustrating a structure of the electronic device. For example, the electronic device may also include more or fewer components (e.g., network interfaces, display devices, etc.) than shown in FIG. 7, or have a different configuration than shown in FIG. 7.
The memory 702 may be used to store software programs and modules, such as program instructions/modules corresponding to the method and apparatus for determining predicates corresponding to the problem templates in the embodiments of the present invention, and the processor 704 executes various functional applications and data processing by running the software programs and modules stored in the memory 702, so as to implement the control method for the target component described above. The memory 702 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 702 can further include memory located remotely from the processor 704, which can be connected to the terminal over a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The transmission device 710 is used for receiving or transmitting data via a network. Examples of the network may include a wired network and a wireless network. In one example, the transmission device 710 includes a Network adapter (NIC) that can be connected to a router via a Network cable and other Network devices to communicate with the internet or a local area Network. In one example, the transmission device 710 is a Radio Frequency (RF) module, which is used to communicate with the internet in a wireless manner.
The memory 702 is used, among other things, for storing application programs.
An embodiment of the present invention further provides a storage medium having a computer program stored therein, wherein the computer program is configured to perform the steps in any of the method embodiments described above when executed.
Alternatively, in the present embodiment, the storage medium may be configured to store a computer program for executing the steps of:
s1, acquiring a target question template and answer information with a corresponding relation, and acquiring predicates and content information with a corresponding relation;
s2, determining predicates corresponding to each answer message according to the similarity between each answer message and the content message in the answer messages;
and S3, determining the predicate with the maximum number of corresponding answer information in the predicates as the target predicate corresponding to the target question template.
Optionally, the storage medium is further configured to store a computer program for executing the steps included in the method in the foregoing embodiment, which is not described in detail in this embodiment.
Alternatively, in this embodiment, a person skilled in the art may understand that all or part of the steps in the various methods in the foregoing embodiments may be implemented by a program instructing hardware related to the terminal device, where the program may be stored in a computer-readable storage medium, and the storage medium may include: flash disks, read-Only memories (ROMs), random Access Memories (RAMs), magnetic or optical disks, and the like.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
The integrated unit in the above embodiments, if implemented in the form of a software functional unit and sold or used as a separate product, may be stored in the above computer-readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for causing one or more computer devices (which may be personal computers, servers, network devices, etc.) to execute all or part of the steps of the method according to the embodiments of the present invention.
In the above embodiments of the present invention, the description of each embodiment has its own emphasis, and reference may be made to the related description of other embodiments for parts that are not described in detail in a certain embodiment.
In the several embodiments provided in the present application, it should be understood that the disclosed client may be implemented in other manners. The above-described apparatus embodiments are merely illustrative, and for example, the division of the units is only one type of logical functional division, and other divisions may be implemented in practice, for example, multiple units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed coupling or direct coupling or communication connection between each other may be an indirect coupling or communication connection through some interfaces, units or modules, and may be electrical or in other forms.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one position, or may be distributed on multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit may be implemented in the form of hardware, or may also be implemented in the form of a software functional unit.
The foregoing is only a preferred embodiment of the present invention, and it should be noted that, for those skilled in the art, various modifications and decorations can be made without departing from the principle of the present invention, and these modifications and decorations should also be regarded as the protection scope of the present invention.

Claims (15)

1. A method for determining predicates corresponding to a problem template is characterized by comprising the following steps:
acquiring a target question template and answer information with a corresponding relation, and acquiring predicate and content information with a corresponding relation;
determining a predicate corresponding to each answer message according to the similarity between each answer message and the content message in the answer messages;
and determining the predicate with the maximum number of corresponding answer information in the predicates as the target predicate corresponding to the target question template.
2. The method of claim 1, wherein obtaining the target question template and the answer information having a correspondence comprises:
converting each question in a question-answer pair into a question template, wherein the question-answer pair is a question and an answer with corresponding relations;
obtaining different problem templates from the problem templates to obtain the target problem template;
and determining answers corresponding to the questions belonging to the target question template as the answer information corresponding to the target question template, so as to obtain the target question template and the answer information with corresponding relations.
3. The method of claim 2, wherein obtaining mutually different problem templates from the problem templates, and obtaining the target problem template comprises:
acquiring the mutually different problem templates from the problem templates;
obtaining a problem template of which the problem template type belongs to a binary fact problem in the mutually different problem templates;
and determining the problem templates with the maximum corresponding target number of the problem templates of the binary reality type problems as the target problem templates.
4. The method of claim 1, wherein obtaining predicate and content information having a correspondence comprises:
acquiring knowledge data of a target field;
establishing a knowledge graph of the target field according to the knowledge data;
obtaining a subject, a predicate and an object with corresponding relations from the information triples of the knowledge graph;
and determining the predicate and the object with the corresponding relationship as the predicate and the content information with the corresponding relationship, or determining the predicate and the object with the corresponding relationship under the subject as the predicate and the content information with the corresponding relationship corresponding to the subject.
5. The method of claim 4, wherein determining the predicate corresponding to each piece of answer information according to the similarity between the each piece of answer information and the content information comprises:
under the condition that predicates and objects with corresponding relations are determined as the predicates and the content information with the corresponding relations, determining a first similarity of the content information corresponding to each answer information and each first predicate, wherein the first predicate is the predicate in the predicates and the content information with the corresponding relations;
and determining the corresponding first predicate with the highest first similarity as the predicate corresponding to each answer message.
6. The method of claim 4, wherein determining the predicate corresponding to each piece of answer information according to the similarity between the each piece of answer information and the content information comprises:
under the condition that a predicate and an object with a corresponding relation under the subject are determined as the predicate and the content information with the corresponding relation corresponding to the subject, acquiring a second predicate and content information with a corresponding relation, wherein the second predicate corresponds to the same subject as each answer information;
determining a second similarity of the content information corresponding to each answer information and each second predicate;
and determining the corresponding second predicate with the highest second similarity as the predicate corresponding to each answer information.
7. The method of claim 1, wherein determining the predicate corresponding to each piece of answer information according to the similarity between the each piece of answer information and the content information comprises:
extracting keywords from each answer message to obtain each answer message and a first keyword set with corresponding relation;
extracting keywords from the content information corresponding to each predicate to obtain the content information and a second keyword set with corresponding relations;
respectively obtaining the similarity between a first keyword set corresponding to each answer message and a second keyword set corresponding to each content message, and determining the similarity between the first keyword set and the second keyword set as the similarity between each answer message and the content message;
and determining a predicate corresponding to the target content information with the highest similarity between each piece of answer information as the predicate corresponding to each piece of answer information.
8. The method according to any one of claims 1 to 6, wherein after determining the predicate with the largest number of corresponding answer information in the predicates as the target predicate corresponding to the target question template, the method further comprises:
acquiring a first answer corresponding to a first question input by a user by using the target question template and the target predicate which have a corresponding relation;
and returning the first answer to the user as response information of the first question.
9. The method of claim 8, wherein obtaining a first answer corresponding to a first question input by a user using the target question template and the target predicate having a correspondence relationship comprises:
acquiring a first question input by a user, and extracting a first subject from the first question;
converting the first question into a first question template;
acquiring a first predicate corresponding to the first question template from the target question template and the target predicate which have a corresponding relation;
acquiring a knowledge graph corresponding to the first subject from a knowledge base in the field to which the first question belongs;
and acquiring answer information corresponding to the first predicate from a knowledge graph corresponding to the first subject, and determining the answer information corresponding to the first predicate as the first answer.
10. An apparatus for determining a predicate corresponding to a question template, the apparatus comprising:
the first acquisition module is used for acquiring a target question template and answer information with corresponding relations, and acquiring predicates and content information with corresponding relations;
the first determining module is used for determining predicates corresponding to each answer information according to the similarity between each answer information and the content information in the answer information;
and the second determining module is used for determining the predicate with the maximum number of corresponding answer information in the predicates as the target predicate corresponding to the target question template.
11. The apparatus of claim 10, wherein the first obtaining module comprises:
the first conversion unit is used for converting each question in a question-answer pair into a question template, wherein the question-answer pair is a question and an answer with corresponding relations;
a first obtaining unit, configured to obtain problem templates that are different from each other from the problem templates to obtain the target problem template;
a first determining unit, configured to determine an answer corresponding to a question belonging to the objective question template as the answer information corresponding to the objective question template, so as to obtain the objective question template and the answer information that have a correspondence relationship.
12. The apparatus of claim 10, wherein the first obtaining module comprises:
a second acquisition unit configured to acquire knowledge data of the target domain;
the establishing unit is used for establishing a knowledge graph of the target field according to the knowledge data;
the third acquisition unit is used for acquiring a subject, a predicate and an object which have corresponding relations from the information triples of the knowledge graph;
and a second determining unit, configured to determine a predicate and an object having a correspondence relationship as the predicate and the content information having the correspondence relationship, or determine the predicate and the object having the correspondence relationship under the subject as the predicate and the content information having the correspondence relationship corresponding to the subject.
13. The apparatus of claim 10, wherein the second determining module comprises:
a first extraction unit, configured to extract a keyword from each piece of answer information, so as to obtain each piece of answer information and a first keyword set having a corresponding relationship;
the second extraction unit is used for extracting keywords from the content information corresponding to each predicate to obtain the content information and a second keyword set with corresponding relations;
a fourth obtaining unit, configured to obtain a similarity between a first keyword set corresponding to each answer information and a second keyword set corresponding to each content information, and determine a similarity between the first keyword set and the second keyword set as a similarity between each answer information and the content information;
and a third determining unit, configured to determine, as the predicate corresponding to each piece of answer information, a predicate corresponding to the target content information with the highest similarity between each piece of answer information.
14. A storage medium, in which a computer program is stored, wherein the computer program is arranged to perform the method of any of claims 1 to 9 when executed.
15. An electronic device comprising a memory and a processor, characterized in that the memory has stored therein a computer program, the processor being arranged to execute the method of any of claims 1 to 9 by means of the computer program.
CN201810468186.1A 2018-05-16 2018-05-16 Method and device for determining predicates corresponding to problem templates Active CN108717441B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810468186.1A CN108717441B (en) 2018-05-16 2018-05-16 Method and device for determining predicates corresponding to problem templates

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810468186.1A CN108717441B (en) 2018-05-16 2018-05-16 Method and device for determining predicates corresponding to problem templates

Publications (2)

Publication Number Publication Date
CN108717441A CN108717441A (en) 2018-10-30
CN108717441B true CN108717441B (en) 2023-01-17

Family

ID=63900077

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810468186.1A Active CN108717441B (en) 2018-05-16 2018-05-16 Method and device for determining predicates corresponding to problem templates

Country Status (1)

Country Link
CN (1) CN108717441B (en)

Families Citing this family (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109947914B (en) 2019-02-21 2023-08-18 扬州大学 Automatic software defect question-answering method based on template
CN110110096B (en) * 2019-05-13 2021-07-09 上海松鼠课堂人工智能科技有限公司 Artificial intelligence K12 knowledge graph making management system and implementation method
CN110309321B (en) * 2019-07-10 2021-05-18 电子科技大学 Knowledge representation learning method based on graph representation learning
CN110597957B (en) * 2019-09-11 2022-04-22 腾讯科技(深圳)有限公司 Text information retrieval method and related device
CN110807325B (en) * 2019-10-18 2023-05-26 腾讯科技(深圳)有限公司 Predicate identification method, predicate identification device and storage medium
CN110991183B (en) * 2019-12-06 2023-07-04 北京百度网讯科技有限公司 Predicate determination method, predicate determination device, predicate determination equipment and predicate determination storage medium
CN111538844B (en) * 2020-03-20 2022-03-25 华为技术有限公司 Target field knowledge base generation and problem solution method and device
CN113761144A (en) * 2020-11-16 2021-12-07 北京沃东天骏信息技术有限公司 Response information determining method and device
CN115129828A (en) * 2021-03-25 2022-09-30 科沃斯商用机器人有限公司 Human-computer interaction method and device, intelligent robot and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1794233A (en) * 2005-12-28 2006-06-28 刘文印 Network user interactive asking answering method and its system
CN106934012A (en) * 2017-03-10 2017-07-07 上海数眼科技发展有限公司 A kind of question answering in natural language method and system of knowledge based collection of illustrative plates
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
CN107729468A (en) * 2017-10-12 2018-02-23 华中科技大学 Answer extracting method and system based on deep learning

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007141090A (en) * 2005-11-21 2007-06-07 Fuji Xerox Co Ltd Question answering system, data retrieval method and computer program
KR102033395B1 (en) * 2014-11-20 2019-10-18 한국전자통신연구원 Question answering system and method for structured knowledge-base using deep natrural language question analysis

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1794233A (en) * 2005-12-28 2006-06-28 刘文印 Network user interactive asking answering method and its system
CN106934012A (en) * 2017-03-10 2017-07-07 上海数眼科技发展有限公司 A kind of question answering in natural language method and system of knowledge based collection of illustrative plates
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
CN107729468A (en) * 2017-10-12 2018-02-23 华中科技大学 Answer extracting method and system based on deep learning

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
基于谓词逻辑的答疑***;冯小萍等;《现代工业经济和信息化》;20150501(第09期);全文 *

Also Published As

Publication number Publication date
CN108717441A (en) 2018-10-30

Similar Documents

Publication Publication Date Title
CN108717441B (en) Method and device for determining predicates corresponding to problem templates
Gu et al. Visualizing the intellectual structure and evolution of electronic health and telemedicine research
Iwakabe et al. From single-case studies to practice-based knowledge: Aggregating and synthesizing case studies
CN110765272B (en) Knowledge graph-based signing method and device, computer equipment and computer storage medium
Gong et al. Time–frequency cross mutual information analysis of the brain functional networks underlying multiclass motor imagery
Ward et al. Treatment effectiveness and its correlates in a marriage and family therapy training clinic
US20170357770A1 (en) Health risk cloud analysis system capable of integrating gene information and acquired lifestyle
Gu et al. Discovering and visualizing knowledge evolution of chronic disease research driven by emerging technologies
Noar et al. eHealth applications: An introduction and overview
CN105701330B (en) Health and fitness information processing method and system
CN113362938A (en) Medical information pushing method and device, electronic equipment and storage medium
CN110516153B (en) Intelligent video pushing method and device, storage medium and electronic device
CN111667029A (en) Clustering method, device, equipment and storage medium
CN116702743A (en) Text similarity detection method and device, electronic equipment and storage medium
CN116502261A (en) Data desensitization method and device for retaining data characteristics
Real et al. An immersive virtual reality curriculum for pediatric hematology clinicians on shared decision-making for hydroxyurea in sickle cell anemia
Qiao et al. [Retracted] Rehabilitation Treatment of Muscle Strain in Athlete Training under Intelligent Intervention
CN115760306A (en) Customized insurance product recommendation method and system based on user health condition
CN115620886A (en) Data auditing method and device
Fausto et al. Scientific literature on Twitter as a subject research: Findings based on bibliometric analysis
CN113792130A (en) Intelligent robot online question-answer interaction system
CN109448857B (en) Medical consultation information aggregation analysis method
CN113761147A (en) Logic editor-based questionnaire question display method and device and electronic equipment
Yangöz et al. Hotspots and global trends of nursing research on telehealth from 2012 to 2021: a bibliometric analysis by CiteSpace
CN112035567A (en) Data processing method and device and computer readable 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
GR01 Patent grant
GR01 Patent grant