CN112163076A - Knowledge question bank construction method, question and answer processing method, device, equipment and medium - Google Patents

Knowledge question bank construction method, question and answer processing method, device, equipment and medium Download PDF

Info

Publication number
CN112163076A
CN112163076A CN202011035112.2A CN202011035112A CN112163076A CN 112163076 A CN112163076 A CN 112163076A CN 202011035112 A CN202011035112 A CN 202011035112A CN 112163076 A CN112163076 A CN 112163076A
Authority
CN
China
Prior art keywords
knowledge
question
questions
user
answer
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202011035112.2A
Other languages
Chinese (zh)
Other versions
CN112163076B (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.)
Beijing ByteDance Network Technology Co Ltd
Original Assignee
Beijing ByteDance Network Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing ByteDance Network Technology Co Ltd filed Critical Beijing ByteDance Network Technology Co Ltd
Priority to CN202011035112.2A priority Critical patent/CN112163076B/en
Publication of CN112163076A publication Critical patent/CN112163076A/en
Application granted granted Critical
Publication of CN112163076B publication Critical patent/CN112163076B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/33Querying
    • G06F16/332Query formulation
    • G06F16/3329Natural language query formulation or dialogue systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/35Clustering; Classification
    • G06F16/355Class or cluster creation or modification
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/36Creation of semantic tools, e.g. ontology or thesauri
    • G06F16/367Ontology
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/22Matching criteria, e.g. proximity measures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/20Natural language analysis
    • G06F40/279Recognition of textual entities
    • G06F40/289Phrasal analysis, e.g. finite state techniques or chunking
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/30Semantic analysis
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/045Combinations of networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods

Abstract

The embodiment of the disclosure relates to a method for constructing a knowledge question bank, a method, a device, equipment and a medium for processing questions and answers, wherein the method for constructing the knowledge question bank comprises the following steps: acquiring different types of knowledge in the knowledge graph; wherein the different types of knowledge include node type knowledge and relationship type knowledge; generating questions corresponding to the knowledge and answers to the questions according to different types of knowledge; and constructing a knowledge question bank by using the generated questions and answers of the questions. According to the embodiment of the disclosure, the knowledge question bank is constructed in advance based on the knowledge graph, so that the determination efficiency of answers required by the user can be improved and the accuracy of answer feedback can be improved in the question and answer scene aiming at the knowledge graph.

Description

Knowledge question bank construction method, question and answer processing method, device, equipment and medium
Technical Field
The present disclosure relates to the field of knowledge graph technology, and in particular, to a method for constructing a knowledge question bank, a method, an apparatus, a device, and a medium for processing questions and answers.
Background
The knowledge graph is a visual description of knowledge in various fields, and is widely applied to the fields of intelligent search, intelligent question answering, personalized recommendation, content distribution and the like.
At present, in a knowledge question-answering scene based on a knowledge graph, semantic analysis is generally required to be performed on a problem input by a user, corresponding slot position information is determined, and then answers required by the user are determined by utilizing triple information in the knowledge graph in combination with the intention of the user. For example, the question input by the user is "what the occupation of user a is", and the semantic parsing result is: the subject is user a, the predicate is vocational, user a is used as an initial node of the triplet in the knowledge graph, and according to the vocational relationship, the corresponding end node can be determined as a basketball player, that is, the answer required by the user is "basketball player".
However, when the user question is complicated, for example, multiple entities in a knowledge graph are involved, or different knowledge fields are involved, and the user answer is determined through multi-slot parsing and triple query, the disadvantages of reduced efficiency of answer determination and reduced accuracy of answer feedback easily occur.
Disclosure of Invention
In order to solve the technical problems or at least partially solve the technical problems, embodiments of the present disclosure provide a knowledge problem base construction method, a question-answer processing method, an apparatus, a device, and a medium.
In a first aspect, an embodiment of the present disclosure provides a method for constructing a knowledge problem base, including:
acquiring different types of knowledge in the knowledge graph; wherein the different types of knowledge include node type knowledge and relationship type knowledge;
generating questions corresponding to the knowledge and answers to the questions according to the different types of knowledge;
and constructing a knowledge question bank by using the generated questions and answers of the questions.
In a second aspect, an embodiment of the present disclosure further provides a knowledge question answering processing method implemented based on a knowledge question bank constructed by any one of the knowledge question bank construction methods provided by the embodiments of the present disclosure, where the knowledge question answering processing method includes:
acquiring a user question, and matching a target question from a knowledge question bank according to the user question;
and taking the answer of the target question as the answer of the user question.
In a third aspect, an embodiment of the present disclosure further provides a device for constructing a knowledge problem base, including:
the knowledge acquisition module is used for acquiring different types of knowledge in the knowledge map; wherein the different types of knowledge include node type knowledge and relationship type knowledge;
the question and answer generating module is used for generating questions and answers of the questions corresponding to the knowledge according to the different types of knowledge;
and the question bank building module is used for building a knowledge question bank by using the generated questions and answers of the questions.
In a fourth aspect, an embodiment of the present disclosure further provides a knowledge question answering processing apparatus implemented based on a knowledge question bank constructed by any one of the knowledge question bank construction methods provided by the embodiments of the present disclosure, where the knowledge question answering processing apparatus includes:
the target question matching module is used for acquiring user questions and matching target questions from a knowledge question bank according to the user questions;
and the answer determining module is used for taking the answer of the target question as the answer of the user question.
In a fifth aspect, an embodiment of the present disclosure further provides an electronic device, where the electronic device includes: a processing device; a memory for storing the processing device executable instructions or programs; the processing device is configured to read the executable instruction or the program instruction from the memory, and execute the executable instruction or the program instruction to implement any one of the knowledge question bank constructing methods provided by the embodiments of the present disclosure, or to implement any one of the knowledge question answering processing methods provided by the embodiments of the present disclosure.
In a sixth aspect, the present disclosure further provides a computer-readable storage medium, where the storage medium stores a computer program or executable instructions, and when the computer program or the executable instructions are executed by a processing device, the method for constructing any knowledge question bank provided in the present disclosure is implemented, or any method for processing any knowledge question and answer provided in the present disclosure is implemented.
Compared with the prior art, the technical scheme provided by the embodiment of the disclosure has the following advantages: in the question-answering scene of the knowledge map, by constructing a knowledge question bank based on the knowledge map in advance, the knowledge problem base can cover all knowledge in the knowledge map, and after the user problems are obtained, the constructed knowledge problem base can be utilized to match target problems corresponding to the user problems, then the answer of the target question is used as the answer of the user question, when the answer of the user question is determined directly based on the knowledge graph is omitted, complex operation of slot position analysis is needed to be carried out on the user problems according to the multivariate array representation mode of the knowledge graph, the problem of low determining efficiency when the required answers of the users are determined directly based on the knowledge graph is solved, meanwhile, the problem that the accuracy of answer feedback is low due to the fact that complicated slot position analysis operation is prone to making mistakes is solved, the efficiency of determining answers required by users is improved, and the accuracy of answer feedback is improved.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and together with the description, serve to explain the principles of the disclosure.
In order to more clearly illustrate the embodiments or technical solutions in the prior art of the present disclosure, the drawings used in the description of the embodiments or prior art will be briefly described below, and it is obvious for those skilled in the art that other drawings can be obtained according to the drawings without inventive exercise.
Fig. 1 is a flowchart of a method for constructing a knowledge problem base according to an embodiment of the present disclosure;
FIG. 2 is a flow chart of another knowledge problem base construction method provided by the embodiment of the present disclosure;
FIG. 3 is a flow chart of a method for processing a knowledge question and answer according to an embodiment of the present disclosure;
FIG. 4 is a schematic diagram of a training architecture of a deep semantic matching model according to an embodiment of the present disclosure;
FIG. 5 is a flow chart of another method for processing a knowledge question and answer provided by an embodiment of the present disclosure;
fig. 6 is a schematic structural diagram of a knowledge problem base constructing apparatus according to an embodiment of the present disclosure;
fig. 7 is a schematic structural diagram of a knowledge question answering processing apparatus according to an embodiment of the present disclosure;
fig. 8 is a schematic structural diagram of an electronic device according to an embodiment of the present disclosure.
Detailed Description
In order that the above objects, features and advantages of the present disclosure may be more clearly understood, aspects of the present disclosure will be further described below. It should be noted that the embodiments and features of the embodiments of the present disclosure may be combined with each other without conflict.
In the following description, numerous specific details are set forth in order to provide a thorough understanding of the present disclosure, but the present disclosure may be practiced in other ways than those described herein; it is to be understood that the embodiments disclosed in the specification are only a few embodiments of the present disclosure, and not all embodiments.
Fig. 1 is a flowchart of a method for constructing a knowledge problem base according to an embodiment of the present disclosure, which may be applied to construct a knowledge problem base based on a knowledge graph, so that answers required by a user may be determined by using the knowledge problem base. The method for constructing the knowledge problem base provided by the embodiment of the disclosure can be executed by a knowledge problem base constructing device, and the device can be realized by adopting software and/or hardware and can be integrated on any electronic equipment with computing capability, such as a server and the like.
As shown in fig. 1, the method for constructing a knowledge problem base provided by the embodiment of the present disclosure may include:
s101, acquiring different types of knowledge in a knowledge graph; wherein the different types of knowledge include node type knowledge and relationship type knowledge.
The knowledge graph can be analyzed to determine each node and each edge in the knowledge graph, the node represents an entity or concept, the edge is formed by attributes or relations, and therefore knowledge in the knowledge graph is classified according to the node and the edge to obtain node type knowledge and relation type knowledge, and the effect of covering all knowledge in the knowledge graph is achieved, wherein the knowledge about the node attribute can be included in the node type knowledge or can be included in the relation type knowledge. The embodiment of the present disclosure does not have any limitation on the knowledge field related to the knowledge graph, that is, the technical solution provided by the embodiment of the present disclosure has wide applicability.
In particular, node type knowledge may include entity type knowledge and concept type knowledge, e.g., knowledge about an organization, knowledge about certain scientific concepts, etc.; the relationship type knowledge comprises non-cross relationship type knowledge and cross relationship type knowledge, wherein the non-cross relationship type knowledge refers to relationship type knowledge determined based on one edge in the knowledge graph, such as knowledge about a certain athlete's nationality, knowledge about a certain person's spouse, etc., cross-relationship type knowledge refers to relationship type knowledge determined based on at least two edges in the knowledge-graph having common nodes, for example, one edge of the map may represent that the professional of a character a is a basketball player, another edge of the map may represent that the nationality of the character a is country X, the cross-relationship type knowledge may be knowledge of a character whose occupation is a basketball player and whose nationality is country X, in other words, the cross-relationship type knowledge may refer to new knowledge formed by combining at least two relationship type knowledge having an intersection relationship in the knowledge map. By classifying and refining different knowledge in the knowledge graph, the comprehensiveness of the generation of subsequent questions can be ensured, and further, the answer required by a user can be fed back to any user question, and the answer feedback effect is ensured.
Optionally, before obtaining the knowledge of the relationship type, the method provided in the embodiment of the present disclosure further includes:
determining whether the same array elements exist between different arrays in the knowledge graph or not based on the array representation mode of the knowledge graph; the array representation mode of the knowledge graph can include, but is not limited to, a ternary array representation mode and the like, and can be determined according to actual conditions;
classifying the different arrays according to the determination result of whether the same array elements exist among the different arrays to obtain at least one array set; wherein each array set comprises at least one array; specifically, the arrays with the same array elements may be divided into an array set, and the arrays without the same array elements are independently used as an array set;
based on the at least one array set, relationship type knowledge is determined.
Specifically, if only one array is included in one array set, the non-cross relationship type knowledge may be determined based on the current array set, and if at least two arrays are included in one array set, the non-cross relationship type knowledge may be determined based on the current array set in addition to each array in the array set. Moreover, for at least two array sets with the same array elements, cross relationship type knowledge is determined based on the at least two array sets, and then a question generated based on the cross relationship type knowledge can correspond to a plurality of answers.
Taking the ternary array representation mode of the knowledge graph as an example, the triplets < character a, vocational, basketball players > and the triplets < character a, nationality, country X >, which belong to the triplets having the same array element-character a, two triplets can be divided into an array set 1, and then the cross relationship type knowledge can be determined: the profession is a basketball player and the nationality is a character in country X. If there are also other triplets (character B, professional, basketball player) and triplets (character B, nationality, country X), these two triplets can be divided into another set 2 of arrays due to the presence of the same array element-character B. Array set 1 and array set 2 include the same array elements: profession-basketball players, nationality-nation, then, based on the knowledge of the figure whose profession is basketball players and nationality is nation X, the question can be raised "what are the figures whose profession is basketball players and nationality is nation X? ", the corresponding answer includes person a and person B.
Further, for at least two array sets with the same array elements, the same array elements in the at least two array sets can be combined according to a preset combination strategy; and determining the cross relationship type knowledge according to the combined at least two array elements. The preset combination strategy may be determined according to actual requirements, and on the basis of ensuring comprehensiveness of knowledge determination, the embodiment of the present disclosure is not specifically limited, and may be, for example, a random combination between at least two array elements, or a combination of at least two array elements according to a statistical frequency of the array elements occurring in the user problem, for example, different array elements whose statistical frequency occurring in the user problem exceeds a frequency threshold may be preferentially combined, and the frequency threshold may be determined as the case may be.
By classifying the arrays in the knowledge graph before acquiring the relation type knowledge, the relation type knowledge in the knowledge graph can be refined, the comprehensiveness of knowledge determination is ensured, and the comprehensiveness of problems in a knowledge problem base is further ensured.
And S102, generating questions corresponding to the knowledge and answers to the questions according to different types of knowledge.
According to the different types of knowledge, the problems corresponding to the knowledge can be generated according to the preset problem sentence pattern, meanwhile, the answers of the problems are determined, and then the corresponding relations between the problems and the answers are stored. The specific question sentence pattern can be flexibly set according to the user question habit, and the embodiment of the disclosure is not particularly limited.
And S103, constructing a knowledge question bank by using the generated questions and answers of the questions.
And correspondingly storing the generated questions and answers to form a knowledge question bank covering all knowledge in the knowledge map. The knowledge question bank can index the questions in the bank by using an inverted index mode and a vectorized index mode, so that the questions can be conveniently recalled according to the questions of the user.
Optionally, constructing a knowledge problem base by using the generated questions and answers to the questions may include: removing the duplicate of the generated different problems; and constructing a knowledge question bank based on the deduplicated questions and answers of the questions. For example, each generated question may be semantically analyzed to determine the same question, such as the question "how are person a and person B a couple? "with question" how do character B and character a are a couple? "belong to the same problem" thus realize the simplification to the knowledge problem bank, remove the redundant data.
Further, constructing a knowledge problem base by using the generated questions and answers to the questions may further include: merging answers to the same question; and constructing a knowledge question bank based on the combined answers and the questions corresponding to the answers. That is, for the same question, if the answers of the questions are different, the answers may be combined to serve as the answer of the current same question, so as to ensure the comprehensiveness of the answer corresponding to the current same question. In addition, in the answer merging process, each answer can be verified based on corresponding knowledge in the knowledge graph according to the current question, namely whether the answer is matched with the question or not is determined; and merging answers based on the answers after the verification is successful, and removing the answers after the verification is failed so as to ensure the accuracy of the construction of the knowledge problem library.
According to the technical scheme of the embodiment of the disclosure, in a question-answer scene of a knowledge map, a knowledge problem base is constructed in advance based on the knowledge map, the knowledge problem base can cover all knowledge in the knowledge map, after a user question is obtained, the constructed knowledge problem base can be utilized to match a target question corresponding to the user question from the knowledge problem base, then the answer of the target question is used as the answer of the user question, the complex operation of slot position analysis on the user question according to a multivariate array representation mode of the knowledge map is omitted when the answer of the user question is directly determined based on the knowledge map, the problem of low determination efficiency when the answer of the user is determined directly based on the knowledge map is solved, meanwhile, the problem of low answer feedback accuracy caused by easy error of the complex slot position analysis operation is solved, and the determination efficiency of the answer required by the user is improved, the accuracy of answer feedback is improved.
Fig. 2 is a flowchart of another knowledge problem base construction method provided in the embodiment of the present disclosure, which is further optimized and expanded based on the above technical solution, and may be combined with the above optional embodiments. Specifically, the embodiments of the present disclosure are exemplified by refining the types of generated problems. As shown in fig. 2, the method may include:
s201, acquiring different types of knowledge in a knowledge graph; wherein the different types of knowledge include node type knowledge and relationship type knowledge.
S202, generating a node definition question and an answer of the question according to the node type knowledge.
The node type knowledge may include entity type knowledge and concept type knowledge, and accordingly, the generated node definition class questions may include entity definition class questions and concept definition class questions, such as "who is person a? "," what is the waveform dichotomy? ".
S203, generating an object inquiry question and an answer to the question according to the knowledge of the relation type; and/or generating a relationship question and an answer to the question according to the knowledge of the relationship type.
The relationship type knowledge includes non-cross relationship type knowledge and cross relationship type knowledge. Wherein, the non-cross relationship type knowledge refers to the relationship type knowledge determined based on one edge in the knowledge graph. For example, with respect to a player's knowledge of his or her nationality, the generated subject question category questions may include "where is the athlete's nationality? ", the generated relationship inquiry type question may include" is a certain athlete's nationality X nationality? "or" is country X the nationality of an athlete? "etc., e.g., regarding the knowledge of a person and his spouse, the generated subject query class question may be" who is the wife of person a? "," whose wife is character a? "etc., the generated relationship query class question may include" what relationship is person a and person B? "or" how do person a and person B are a couple? "and the like.
Cross relationship type knowledge refers to relationship type knowledge determined based on at least two edges in the knowledge-graph having a common node. For example, cross-relationship type knowledge is determined for the triad < character a, professional, basketball player > and triad < character a, nationality, country X in the knowledge graph: the profession is a basketball player and the nationality is a character in country X, and the generated subject question category questions may include "what are players in country X who are professional basketball players? "if further knowledge in the knowledge map satisfying" professional is basketball player and nationality is country X "is integrated, then the current question" which players are basketball players and nationality is country X? I.e. belonging to the multi-entity question type, the corresponding answer being a plurality of entities. It should be noted that, in the process of constructing the knowledge question bank, the generated question types are not limited to the above listed question types, and the question classifications may be flexibly changed and adjusted according to the statistical user question-answering habits, and should not be considered as specific limitations of the embodiments of the present disclosure.
By generating the questions corresponding to the knowledge and the answers to the questions according to the knowledge types in the knowledge graph, the refining of the knowledge in the knowledge graph and the comprehensive coverage of the knowledge in the knowledge graph can be realized. Meanwhile, different types of questions are generated, the questions in the knowledge question bank can be classified and managed, then in the process of determining the answer required by the user according to the user questions, the question types of the user questions can be determined, for example, sentence analysis or semantic analysis is performed on the user questions, and which of the node definition type questions, object inquiry type questions, relation inquiry type questions and the like the user questions belong to is determined, then corresponding question classification in the knowledge question bank is determined according to the question types of the user questions, further in the corresponding question classification of the knowledge question bank, the target questions corresponding to the user questions are matched, finally the answers of the target questions are used as the answer required by the user, and since all the questions do not need to be matched in the knowledge question bank, the efficiency of determining the answers required by the user can be further improved.
And S204, constructing a knowledge question bank by using the generated questions and answers of the questions.
According to the technical scheme of the embodiment of the disclosure, in a question-answer scene of a knowledge graph, a knowledge problem base is constructed in advance based on the knowledge graph, after a user problem is obtained, the constructed knowledge problem base can be used for matching a target problem corresponding to the user problem, then the answer of the target problem is used as the answer of the user problem, complex operation of slot position analysis is needed to be carried out on the user problem according to a multivariate array representation mode of the knowledge graph when the answer of the user problem is directly determined based on the knowledge graph is omitted, the problem of low determination efficiency when the answer required by the user is determined directly based on the knowledge graph is solved, meanwhile, the problem of low answer feedback accuracy caused by easy error of the complex slot position analysis operation is solved, the determination efficiency of the answer required by the user is improved, and the accuracy of the answer feedback is improved; in addition, in the process of constructing the knowledge problem base, different types of problems are generated according to knowledge types, so that the refining of knowledge in the knowledge map is ensured, the classification management of the problems in the knowledge problem base is realized, and the determination efficiency of answers required by the user is further improved.
Fig. 3 is a flowchart of a method for processing a question and answer according to an embodiment of the present disclosure, which may be applied to a case where answers required by a user are determined by using a predetermined knowledge question base. The knowledge problem base is constructed by using any method for constructing the knowledge problem base provided by the embodiment of the present disclosure, that is, the method for processing the knowledge problem answers provided by the embodiment of the present disclosure is executed in cooperation with the method for constructing the knowledge problem base provided by the embodiment of the present disclosure, and the contents not described in detail in the following embodiments may refer to the descriptions in the above embodiments.
The method for processing the knowledge question and answer provided by the embodiment of the disclosure can be executed by a knowledge question and answer processing device, which can be implemented by software and/or hardware and can be integrated on any electronic equipment with computing capability, such as a server and the like.
As shown in fig. 3, the method for processing a knowledge question and answer provided by the embodiment of the present disclosure includes:
s301, obtaining the user questions, and matching the target questions from the knowledge question bank according to the user questions.
S302, the answer of the target question is used as the answer of the user question.
Illustratively, the user questions may be obtained through a knowledge-graph question portal provided on the user terminal. The knowledge-graph question portal may be implemented using a standalone application that provides a user with question input controls, such as a text entry box or a voice entry box; the knowledge-graph question portal may also be integrated as a functionality control that may capture user questions in a particular application, which may include, but is not limited to, a browser, a video interaction application, and the like.
Taking the knowledge-graph problem entry as a functional control in a browser as an example, a user may input a current problem through a text or voice input box corresponding to the knowledge-graph problem entry on the browser, and submit the input to the electronic device for executing the embodiment of the present disclosure after the input is completed.
Illustratively, after the user questions are acquired, the target questions corresponding to the user questions may be determined by performing keyword matching on the user questions and questions in the knowledge question bank, or performing semantic similarity calculation on the user questions and questions in the knowledge question bank, or the like. For example, a problem in the knowledge problem base in which the number of matching keywords to the user problem exceeds a target number threshold may be determined as a target problem, or a problem in the knowledge problem base in which the semantic similarity to the user problem is greater than a target similarity threshold may be determined as a target problem, where both the target number threshold and the target similarity threshold may be flexibly valued. After the target question is determined, the answer of the target question in the knowledge question bank is determined, so that the answer required by the user can be quickly determined and can be fed back to the user terminal.
According to the technical scheme of the embodiment of the disclosure, in a question-answer scene of a knowledge map, a knowledge problem base is constructed in advance based on the knowledge map, the knowledge problem base can cover all knowledge in the knowledge map, after a user question is obtained, the constructed knowledge problem base can be utilized to match a target question corresponding to the user question from the knowledge problem base, then the answer of the target question is used as the answer of the user question, the complex operation of slot position analysis on the user question according to a multivariate array representation mode of the knowledge map is omitted when the answer of the user question is directly determined based on the knowledge map, the problem of low determination efficiency when the answer of the user is determined directly based on the knowledge map is solved, meanwhile, the problem of low answer feedback accuracy caused by easy error of the complex slot position analysis operation is solved, and the determination efficiency of the answer required by the user is improved, the accuracy of answer feedback is improved.
On the basis of the above technical solution, optionally, matching the target question from the knowledge question base according to the user question includes:
determining a candidate problem set from a knowledge problem library according to the user problems;
determining a target problem according to semantic similarity between the candidate problem in the candidate problem set and the user problem; the semantic similarity calculation can be realized by adopting any available semantic similarity calculation mode.
That is, in the embodiment of the present disclosure, the candidate problem set may be preliminarily screened based on the user problem according to a preset candidate problem set determination policy, and then the target problem is determined based on the candidate problem set, so as to improve the determination efficiency of the target problem and help to ensure the determination pertinence and accuracy of the answer required by the user. The preset candidate problem set determination strategy may include, but is not limited to: keyword matching between a user question and a question in a knowledge question bank, semantic similarity calculation between the user question and a question in the knowledge question bank, matching between a question type of the user question and a question type in the knowledge question bank, matching between entity information related to the user question and entity information related to the question in the knowledge question bank, and the like. Each of the candidate problem set determination strategies may be used alone or in combination, and the embodiments of the present disclosure are not limited specifically.
For example, a candidate question set may be determined according to at least one question in the knowledge question bank, where the number of matching keywords to the user question exceeds a candidate number threshold; determining a candidate question set according to at least one question in the knowledge question bank, wherein the semantic similarity between the question and the user question is greater than a candidate similarity threshold; determining a candidate question set according to at least one question in the knowledge question base, wherein the question type of the question belongs to the same type as that of the user question; the set of candidate questions may be determined based on at least one question in the knowledge question base that relates to the same entity information as the user question. The values of the candidate quantity threshold and the candidate similarity threshold can be flexibly set.
Optionally, determining a target problem according to semantic similarity between a candidate problem in the candidate problem set and a user problem, including:
using a deep semantic matching model, taking the candidate questions and the user questions in the candidate question set as input, and outputting semantic similarity between the candidate questions and the user questions in the candidate question set;
and determining the target problem according to the output semantic similarity.
The deep semantic matching model has the function of outputting semantic similarity between any two texts. The method has the advantages that the high-quality output of the deep semantic matching model is benefited, the calculation accuracy of the semantic similarity between the user question and the candidate questions in the candidate question set can be ensured, and the feedback effect of answers required by the user is further ensured. And the deep semantic matching model can be updated regularly to realize the optimization of the model effect.
Specifically, the candidate problem whose semantic similarity is greater than the target similarity threshold may be determined as the target problem. If at least two target questions are determined, the answers to the target questions may be ranked according to semantic similarity, and then the ranked answers may be fed back to the user, for example, the higher the corresponding target question has semantic similarity, the earlier the answer ranking is, or of course, the answer to the corresponding target question when the semantic similarity is the highest may be selected and fed back to the user.
Further, the embodiment of the present disclosure may further include a training process of the deep semantic matching model, which may include, for example:
acquiring a sample user question and a sample candidate question set, and acquiring semantic similarity between the sample candidate question and the sample user question in the sample candidate question set;
and taking the sample user question and the sample candidate question in the sample candidate question set as the input of model training, taking the semantic similarity between the sample candidate question and the sample user question as the output of the model training, and training to obtain the deep semantic matching model.
FIG. 4 shows, as an example, a training architecture diagram of a deep semantic matching model. As shown in fig. 4, a sample user question and a sample candidate question set are obtained, a pre-trained natural language representation model is used to perform vector representation on the sample user question and the sample candidate question in the sample candidate question set, then the representation vectors of the sample user question and the sample candidate question are input into a multilayer perceptron, and a neural network model is trained by combining semantic similarity between the sample candidate question and the sample user question. The multilayer perceptron is an example of a neural network and should not be construed as a specific limitation to the embodiments of the present disclosure. The natural language representation model is used to output a vector representation of an arbitrary text, and may include, but is not limited to, BERT (Bidirectional Encoder retrieval from transforms) model, Word2Vec model, and the like, and the model implementation principle may be implemented with reference to the related art. In the process of determining the expression vector of the sample user question and the expression vector of the sample candidate question, the sample user question and the sample candidate question can be input into the natural language expression model one by one, and corresponding vectors are respectively output; the sample user question and the sample candidate question can be simultaneously input into the natural language representation model, so that the fusion vector of the sample user question and the sample candidate question is output, and the accuracy of vector representation is improved.
And according to the training output setting of the deep semantic matching model, the determination result of whether the sample user question and the sample candidate question are semantically similar (namely whether semantic matching is performed) can also be directly used as the output of model training in the model training process, so that in the model application stage, based on the currently acquired user question and the candidate question set in the knowledge question base, whether the candidate questions in the user question and the candidate question set are semantically similar can be directly output, and further, the target question of the user question can be determined according to the model output result.
Optionally, determining a candidate question set from a knowledge question bank according to the user question includes:
using a semantic representation model to respectively carry out vectorization representation on the user questions and the questions in the knowledge question bank; the semantic representation model is used for vectorizing and representing any text, and may include but not be limited to BERT (Bidirectional Encoder retrieval from transforms) models, Word2Vec models, and the like, and the model implementation principle may be implemented by referring to the prior art;
determining the distance between the expression vector of the user question and the expression vector of the question in the knowledge question bank; such as cosine distance, etc.;
determining a candidate problem set from a knowledge problem base according to the determined distance; for example, a problem with a corresponding distance greater than a distance threshold may be determined as a candidate problem, and the distance threshold may be adaptively determined.
Fig. 5 is a flowchart of another knowledge question-answering processing method provided in the embodiment of the present disclosure, which is further optimized and expanded based on the above technical solution, and can be combined with the above optional embodiments. As shown in fig. 5, the method may include:
s401, obtaining user questions.
S402, determining entity information related to the user problem.
Exemplarily, word segmentation processing can be performed on the user question, the part of speech of each keyword is determined, the part of speech words are screened out, then the part of speech words are matched with an entity word bank, and entity information related to the user question, such as entity nouns, is determined; entity information related to the user question may also be determined using an entity link model for extracting entities from text, which may include, but is not limited to, an ID of an entity in a knowledge graph, entity description information, and entity category, among others. The prior art may be referred to for a specific implementation principle of the entity link model, and embodiments of the present disclosure are not particularly limited.
S403, determining first semantic similarity between the user question and the question in the knowledge question bank.
The semantic similarity calculation can be realized by adopting any available semantic similarity calculation mode in the prior art.
S404, determining a candidate problem set from a knowledge problem base according to the determined entity information and the relation between the first semantic similarity and the first similarity threshold.
Specifically, a question in the knowledge question bank, which relates to the same entity information as the user question and corresponds to a first semantic similarity greater than a first similarity threshold (i.e., equal to the candidate similarity threshold), may be determined as a candidate question. The problems in the currently determined candidate problem set not only relate to the same entity information as the user problems, but also the semantic similarity meets the primary screening condition, so that the determination pertinence of the candidate problem set is improved, and the determination accuracy and the determination efficiency of the target problem are improved.
S405, determining a second semantic similarity between the candidate questions in the candidate question set and the user questions.
The semantic similarity calculation between the candidate question and the user question can be realized by adopting any available semantic similarity calculation mode.
S406, determining a target problem from the candidate problem set according to the relation between the second semantic similarity and the second similarity threshold.
It should be noted that the calculation of the first semantic similarity and the calculation of the second semantic similarity (that is, the calculation is equal to the target similarity threshold) may be implemented by using the same semantic similarity calculation mode, or may be implemented by using different semantic similarity calculation modes; the values of the first similarity threshold and the second similarity threshold can be flexibly set, and preferably, the value of the first similarity threshold can be smaller than the second similarity threshold, so that the effect of screening problems from a knowledge problem library in a stepped manner is achieved. Moreover, the foregoing terms "first" and "second" do not have any ordinal limitation, but are merely used for the purpose of word differentiation.
And S407, taking the answer of the target question as the answer of the user question.
According to the technical scheme of the embodiment of the disclosure, in a question-answer scene of a knowledge graph, answers required by a user are determined by utilizing a predetermined knowledge question library, so that complex operation of slot position analysis on the user questions according to a multivariate array representation mode of the knowledge graph is omitted when the answers required by the user are determined directly based on the knowledge graph, the problem of low determination efficiency when the answers required by the user are determined directly based on the knowledge graph is solved, meanwhile, the problem of low answer feedback accuracy caused by easy error of the complex slot position analysis operation is solved, the determination efficiency of the answers required by the user is improved, and the accuracy of answer feedback is improved; in addition, in the process of determining the candidate problem set from the knowledge problem library, the candidate problem set is determined according to the entity information related to the user problems and the semantic similarity between the problems in the knowledge problem library and the user problems, so that the determination pertinence and the determination accuracy of the candidate problem set are ensured, and the determination efficiency and the determination accuracy of answers required by the user are further ensured; particularly, for entity-related user problems, entity information related to the user problems is used as a screening condition of a candidate problem set, so that the phenomenon that ambiguity exists among multiple entities to influence the accuracy of determination of a target problem and further influence the accuracy of determination of answers required by the user is avoided, the accuracy of determination of the target problem is ensured, and the accuracy of determination of answers required by the user is also ensured.
Fig. 6 is a schematic structural diagram of a device for constructing a knowledge problem base according to an embodiment of the present disclosure, which may be adapted to construct a knowledge problem base based on a knowledge graph, so that answers required by a user may be determined by using the knowledge problem base.
As shown in fig. 6, the knowledge problem base constructing apparatus provided in the embodiment of the present disclosure may include a knowledge obtaining module 501, a question and answer generating module 502, and a problem base constructing module 503, where:
a knowledge acquisition module 501, configured to acquire different types of knowledge in a knowledge graph; wherein the different types of knowledge include node type knowledge and relationship type knowledge;
a question and answer generating module 502 for generating questions and answers to the questions corresponding to different types of knowledge;
and a question bank constructing module 503, configured to construct a knowledge question bank using the generated questions and answers to the questions.
Optionally, the node type knowledge includes entity type knowledge and concept type knowledge;
the relationship type knowledge includes non-cross relationship type knowledge and cross relationship type knowledge.
Optionally, for the node type knowledge, the question and answer generating module 502 includes:
and the definition question and answer generating unit is used for generating the node definition question and the answer of the question according to the node type knowledge.
Optionally, for the knowledge of relationship type, the question and answer generating module 502 includes:
the object inquiry type question and answer generating unit is used for generating the object inquiry type question and the answer of the question according to the relation type knowledge; and/or
And the relation question and answer generating unit is used for generating the answers of the relation question and the question according to the relation type knowledge.
Optionally, the apparatus provided in the embodiment of the present disclosure further includes:
an array relationship determining module, configured to determine whether the same array elements exist between different arrays in the knowledge graph based on an array representation manner of the knowledge graph before the knowledge obtaining module 501 performs an operation of obtaining the relationship type knowledge;
the array set determining module is used for classifying different arrays according to the determination result of whether the same array elements exist among the different arrays to obtain at least one array set; wherein each array set comprises at least one array;
and the relation type knowledge determining module is used for determining the relation type knowledge according to the at least one array set.
The knowledge problem base construction device provided by the embodiment of the disclosure can execute any knowledge problem base construction method provided by the embodiment of the disclosure, and has corresponding functional modules and beneficial effects of the execution method. Reference may be made to the description of any method embodiment of the disclosure that may not be described in detail in the embodiments of the apparatus of the disclosure.
Fig. 7 is a schematic structural diagram of a knowledge question answering processing apparatus according to an embodiment of the present disclosure, which may be suitable for determining answers required by a user by using a predetermined knowledge question base. The knowledge problem base is constructed by using any method for constructing the knowledge problem base provided by the embodiment of the disclosure.
The knowledge question-answering processing device provided by the embodiment of the disclosure can be realized by adopting software and/or hardware, and can be integrated on any electronic equipment with computing capability, such as a server and the like.
As shown in fig. 7, the knowledge question-answering processing apparatus provided by the embodiment of the present disclosure may include a target question matching module 601 and an answer determining module 602, wherein:
the target question matching module 601 is used for acquiring user questions and matching target questions from the knowledge question bank according to the user questions;
an answer determining module 602, configured to use the answer of the target question as the answer of the user question.
Optionally, the target problem matching module 601 includes:
the candidate problem set determining unit is used for determining a candidate problem set from the knowledge problem library according to the user problem;
and the target problem determining unit is used for determining the target problem according to the semantic similarity between the candidate problem in the candidate problem set and the user problem.
Optionally, the candidate problem set determining unit includes:
the entity information determining subunit is used for determining entity information related to the user problem;
and the entity information utilization subunit is used for determining a candidate problem set from the knowledge problem library according to the entity information.
Optionally, the target problem determining unit includes:
the semantic similarity determining subunit is used for inputting the candidate questions in the candidate question set and the user questions by using the deep semantic matching model and outputting the semantic similarity between the candidate questions in the candidate question set and the user questions;
and the target problem determining subunit is used for determining the target problem according to the output semantic similarity.
Optionally, the candidate problem set determining unit includes:
the vector representation subunit is used for respectively carrying out vectorization representation on the user questions and the questions in the knowledge question bank by utilizing the semantic representation model;
a vector distance determining subunit, configured to determine a distance between a representation vector of a user question and a representation vector of a question in the knowledge question bank;
and the vector distance utilization subunit is used for determining a candidate problem set from the knowledge problem base according to the determined distance.
The knowledge question-answering processing device provided by the embodiment of the disclosure can execute any knowledge question-answering processing method provided by the embodiment of the disclosure, and has corresponding functional modules and beneficial effects of the execution method. Reference may be made to the description of any method embodiment of the disclosure that may not be described in detail in the embodiments of the apparatus of the disclosure.
Fig. 8 is a schematic structural diagram of an electronic device according to an embodiment of the present disclosure, which is used to exemplarily describe an electronic device for executing a knowledge question bank building method or for executing a knowledge question answering processing method in an example of the present disclosure. The electronic devices in the embodiments of the present disclosure may include, but are not limited to, mobile terminals such as mobile phones, notebook computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), in-vehicle terminals (e.g., car navigation terminals), and the like, and fixed terminals such as digital TVs, desktop computers, and the like. The electronic device shown in fig. 8 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present disclosure.
As shown in fig. 8, electronic device 800 may include a processing device (e.g., central processing unit, graphics processor, etc.) 801 that may perform various appropriate actions and processes in accordance with executable instructions or programs stored in a Read Only Memory (ROM)802 or loaded from storage 808 into a Random Access Memory (RAM) 803. In the RAM 803, various programs and data necessary for the operation of the electronic apparatus 800 are also stored. The processing apparatus 801, the ROM 802, and the RAM 803 are connected to each other by a bus 804. An input/output (I/O) interface 805 is also connected to bus 804.
Generally, the following devices may be connected to the I/O interface 805: input devices 806 including, for example, a touch screen, touch pad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; output devices 807 including, for example, a Liquid Crystal Display (LCD), speakers, vibrators, and the like; storage 808 including, for example, magnetic tape, hard disk, etc.; and a communication device 809. The communication means 809 may allow the electronic device 800 to communicate wirelessly or by wire with other devices to exchange data. While fig. 8 illustrates an electronic device 800 having various means, it is to be understood that not all illustrated means are required to be implemented or provided. More or fewer devices may alternatively be implemented or provided.
When the processing means of the electronic device reads the executable instructions or programs from the memory and executes them, the electronic device is caused to: acquiring different types of knowledge in the knowledge graph; wherein the different types of knowledge include node type knowledge and relationship type knowledge; generating questions corresponding to the knowledge and answers to the questions according to the different types of knowledge; and constructing a knowledge question bank by using the generated questions and answers of the questions.
Optionally, the node type knowledge includes entity type knowledge and concept type knowledge;
the relationship type knowledge includes non-cross relationship type knowledge and cross relationship type knowledge.
Optionally, for the node type knowledge, the processing device reads executable instructions or programs from the memory and when executing the executable instructions or programs, causes the electronic device to:
and generating a node definition question and an answer of the question according to the node type knowledge.
Optionally, for the knowledge of the relationship type, the processing device reads the executable instruction or program from the memory and when executing the executable instruction or program, causes the electronic device to:
generating object inquiry questions and answers of the questions according to the relation type knowledge; and/or
And generating a relation inquiry question and an answer of the question according to the relation type knowledge.
Optionally, the processing device reads the executable instructions or programs from the memory and, when executed, further causes the electronic device to:
determining whether the same array elements exist between different arrays in the knowledge graph or not based on the array representation mode of the knowledge graph;
classifying the different arrays according to the determination result of whether the same array elements exist among the different arrays to obtain at least one array set; wherein each array set comprises at least one array;
determining the relationship type knowledge based on the at least one array set.
Alternatively, when the processing means of the electronic device reads the executable instructions or programs from the memory and executes them, the electronic device is caused to: acquiring a user question, and matching a target question from a knowledge question bank according to the user question; and taking the answer of the target question as the answer of the user question.
Optionally, the processing device reads the executable instructions or programs from the memory and when executing them, causes the electronic device to:
determining a candidate question set from the knowledge question bank according to the user question;
and determining the target question according to the semantic similarity between the candidate question and the user question in the candidate question set.
Optionally, the processing device reads the executable instructions or programs from the memory and when executing them, causes the electronic device to:
determining entity information related to the user question;
and determining the candidate question set from the knowledge question bank according to the entity information.
Optionally, the processing device reads the executable instructions or programs from the memory and when executing them, causes the electronic device to:
using a deep semantic matching model, taking the candidate questions in the candidate question set and the user questions as input, and outputting semantic similarity between the candidate questions in the candidate question set and the user questions;
and determining the target problem according to the output semantic similarity.
Optionally, the processing device reads the executable instructions or programs from the memory and when executing them, causes the electronic device to:
vectorizing and representing the user questions and the questions in the knowledge question bank by utilizing a semantic representation model;
determining a distance between the representation vector of the user question and the representation vectors of the questions in the knowledge question bank;
and determining the candidate question set from the knowledge question bank according to the determined distance.
In particular, the processes described above with reference to the flow diagrams may be implemented as computer software programs or executable instructions according to embodiments of the present disclosure. For example, embodiments of the present disclosure include a computer program product comprising a computer program carried on a non-transitory computer readable medium, the computer program containing program code for performing the method illustrated by the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network through the communication means 809, or installed from the storage means 808, or installed from the ROM 802. The computer program, when executed by the processing apparatus 801, performs the above-described functions defined in the methods of the embodiments of the present disclosure.
It should be noted that the computer readable medium in the present disclosure can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present disclosure, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In contrast, in the present disclosure, a computer readable signal medium may comprise a propagated data signal with computer readable program code embodied therein, either in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: electrical wires, optical cables, RF (radio frequency), etc., or any suitable combination of the foregoing.
In some embodiments, the clients, servers may communicate using any currently known or future developed network Protocol, such as HTTP (HyperText Transfer Protocol), and may interconnect with any form or medium of digital data communication (e.g., a communications network). Examples of communication networks include a Local Area Network (LAN), a Wide Area Network (WAN), the internet (e.g., the internet), and peer-to-peer networks (e.g., an ad hoc peer-to-peer network), as well as any currently known or future developed network.
The computer readable medium may be embodied in the electronic device; or may exist separately without being assembled into the electronic device.
The computer-readable medium carries one or more computer programs (or executable instructions) that, when executed by a processing device, cause the processing device to: acquiring different types of knowledge in the knowledge graph; wherein the different types of knowledge include node type knowledge and relationship type knowledge; generating questions corresponding to the knowledge and answers to the questions according to the different types of knowledge; and constructing a knowledge question bank by using the generated questions and answers of the questions.
Optionally, when the computer program or the executable instructions are executed by the processing device, the processing device is caused to:
optionally, the node type knowledge includes entity type knowledge and concept type knowledge;
the relationship type knowledge includes non-cross relationship type knowledge and cross relationship type knowledge.
Optionally, for the node type knowledge, when the computer program or executable instructions are executed by a processing device, the processing device is caused to:
and generating a node definition question and an answer of the question according to the node type knowledge.
Optionally, when the computer program or the executable instructions are executed by the processing device, the processing device is caused to:
generating object inquiry questions and answers of the questions according to the relation type knowledge; and/or
And generating a relation inquiry question and an answer of the question according to the relation type knowledge.
Optionally, when the computer program or the executable instructions are executed by the processing device, the processing device is further caused to:
determining whether the same array elements exist between different arrays in the knowledge graph or not based on the array representation mode of the knowledge graph;
classifying the different arrays according to the determination result of whether the same array elements exist among the different arrays to obtain at least one array set; wherein each array set comprises at least one array;
determining the relationship type knowledge based on the at least one array set.
Alternatively, the computer-readable medium carries one or more computer programs (or executable instructions) that, when executed by a processing device, cause the processing device to:
acquiring a user question, and matching a target question from a knowledge question bank according to the user question;
and taking the answer of the target question as the answer of the user question.
Optionally, when the computer program or the executable instructions are executed by the processing device, the processing device is caused to:
determining a candidate question set from the knowledge question bank according to the user question;
and determining the target question according to the semantic similarity between the candidate question and the user question in the candidate question set.
Optionally, when the computer program or the executable instructions are executed by the processing device, the processing device is caused to:
determining entity information related to the user question;
and determining the candidate question set from the knowledge question bank according to the entity information.
Optionally, when the computer program or the executable instructions are executed by the processing device, the processing device is caused to:
using a deep semantic matching model, taking the candidate questions in the candidate question set and the user questions as input, and outputting semantic similarity between the candidate questions in the candidate question set and the user questions;
and determining the target problem according to the output semantic similarity.
Optionally, when the computer program or the executable instructions are executed by the processing device, the processing device is caused to:
vectorizing and representing the user questions and the questions in the knowledge question bank by utilizing a semantic representation model;
determining a distance between the representation vector of the user question and the representation vectors of the questions in the knowledge question bank;
and determining the candidate question set from the knowledge question bank according to the determined distance.
Computer program code for carrying out operations for the present disclosure may be written in any combination of one or more programming languages, including but not limited to an object oriented programming language such as Java, Smalltalk, C + +, and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may operate over any of a variety of networks: including a Local Area Network (LAN) or a Wide Area Network (WAN), to the user's computer, or may be connected to an external computer (for example, through the internet using an internet service provider).
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The modules or units described in the embodiments of the present disclosure may be implemented by software or hardware. The names of modules or units do not in some cases form a limitation of the modules or units themselves, for example, the knowledge acquisition module may also be described as a "module for acquiring different types of knowledge in a knowledge graph".
The functions described herein above may be performed, at least in part, by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field Programmable Gate Arrays (FPGAs), Application Specific Integrated Circuits (ASICs), Application Specific Standard Products (ASSPs), systems on a chip (SOCs), Complex Programmable Logic Devices (CPLDs), and the like.
In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
It is noted that, in this document, relational terms such as "first" and "second," and the like, may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
The foregoing are merely exemplary embodiments of the present disclosure, which enable those skilled in the art to understand or practice the present disclosure. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the disclosure. Thus, the present disclosure is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (14)

1. A method for constructing a knowledge problem bank is characterized by comprising the following steps:
acquiring different types of knowledge in the knowledge graph; wherein the different types of knowledge include node type knowledge and relationship type knowledge;
generating questions corresponding to the knowledge and answers to the questions according to the different types of knowledge;
and constructing a knowledge question bank by using the generated questions and answers of the questions.
2. The method of claim 1, wherein:
the node type knowledge comprises entity type knowledge and concept type knowledge;
the relationship type knowledge includes non-cross relationship type knowledge and cross relationship type knowledge.
3. The method according to claim 1 or 2, wherein for the node type knowledge, the generating a question corresponding to the knowledge and an answer to the question according to the different types of knowledge comprises:
and generating a node definition question and an answer of the question according to the node type knowledge.
4. The method according to claim 1 or 2, wherein for the knowledge of the relationship type, the generating a question corresponding to the knowledge and an answer to the question according to the knowledge of the different types comprises:
generating object inquiry questions and answers of the questions according to the relation type knowledge; and/or
And generating a relation inquiry question and an answer of the question according to the relation type knowledge.
5. The method of claim 1 or 2, prior to obtaining the relationship type knowledge, further comprising:
determining whether the same array elements exist between different arrays in the knowledge graph or not based on the array representation mode of the knowledge graph;
classifying the different arrays according to the determination result of whether the same array elements exist among the different arrays to obtain at least one array set; wherein each array set comprises at least one array;
determining the relationship type knowledge based on the at least one array set.
6. A knowledge question and answer processing method realized based on a knowledge question bank constructed by the knowledge question bank construction method of any one of claims 1 to 5, the knowledge question and answer processing method comprising:
acquiring a user question, and matching a target question from a knowledge question bank according to the user question;
and taking the answer of the target question as the answer of the user question.
7. The method of claim 6, wherein matching target questions from a knowledge question bank based on the user questions comprises:
determining a candidate question set from the knowledge question bank according to the user question;
and determining the target question according to the semantic similarity between the candidate question and the user question in the candidate question set.
8. The method of claim 7, wherein determining a set of candidate questions from the knowledge question base based on the user question comprises:
determining entity information related to the user question;
and determining the candidate question set from the knowledge question bank according to the entity information.
9. The method of claim 7, wherein determining the target question according to semantic similarity between the candidate questions in the candidate question set and the user question comprises:
using a deep semantic matching model, taking the candidate questions in the candidate question set and the user questions as input, and outputting semantic similarity between the candidate questions in the candidate question set and the user questions;
and determining the target problem according to the output semantic similarity.
10. The method of claim 7, wherein determining a set of candidate questions from the knowledge question base based on the user question comprises:
vectorizing and representing the user questions and the questions in the knowledge question bank by utilizing a semantic representation model;
determining a distance between the representation vector of the user question and the representation vectors of the questions in the knowledge question bank;
and determining the candidate question set from the knowledge question bank according to the determined distance.
11. A knowledge problem base construction apparatus, comprising:
the knowledge acquisition module is used for acquiring different types of knowledge in the knowledge map; wherein the different types of knowledge include node type knowledge and relationship type knowledge;
the question and answer generating module is used for generating questions and answers of the questions corresponding to the knowledge according to the different types of knowledge;
and the question bank building module is used for building a knowledge question bank by using the generated questions and answers of the questions.
12. A question-answer processing apparatus realized based on a knowledge question bank constructed by the knowledge question bank construction method according to any one of claims 1 to 5, the question-answer processing apparatus comprising:
the target question matching module is used for acquiring user questions and matching target questions from a knowledge question bank according to the user questions;
and the answer determining module is used for taking the answer of the target question as the answer of the user question.
13. An electronic device, comprising:
a processing device;
a memory for storing the processing device executable instructions or programs;
the processing device is configured to read the executable instructions or the program from the memory, and execute the executable instructions or the program to implement the method for constructing a knowledge question bank according to any one of claims 1 to 5, or to implement the method for processing a question and answer according to any one of claims 6 to 10.
14. A computer-readable storage medium, characterized in that the storage medium stores a computer program or executable instructions, which when executed by a processing device, implements the knowledge question bank constructing method of any one of claims 1 to 5, or implements the question-answer processing method of any one of claims 6 to 10.
CN202011035112.2A 2020-09-27 2020-09-27 Knowledge question bank construction method, question and answer processing method, device, equipment and medium Active CN112163076B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011035112.2A CN112163076B (en) 2020-09-27 2020-09-27 Knowledge question bank construction method, question and answer processing method, device, equipment and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011035112.2A CN112163076B (en) 2020-09-27 2020-09-27 Knowledge question bank construction method, question and answer processing method, device, equipment and medium

Publications (2)

Publication Number Publication Date
CN112163076A true CN112163076A (en) 2021-01-01
CN112163076B CN112163076B (en) 2022-09-13

Family

ID=73861035

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011035112.2A Active CN112163076B (en) 2020-09-27 2020-09-27 Knowledge question bank construction method, question and answer processing method, device, equipment and medium

Country Status (1)

Country Link
CN (1) CN112163076B (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113298488A (en) * 2021-04-30 2021-08-24 五八有限公司 Method and device for constructing industry problem library, electronic equipment and computer readable medium
CN113590844A (en) * 2021-08-09 2021-11-02 北京智源人工智能研究院 Knowledge graph-based question-answer library generation method and device, electronic equipment and storage medium
CN113806558A (en) * 2021-09-22 2021-12-17 湖北天天数链技术有限公司 Question selection method, knowledge graph construction method and device and electronic equipment
CN116628167A (en) * 2023-06-08 2023-08-22 四维创智(北京)科技发展有限公司 Response determination method and device, electronic equipment and storage medium
CN117113092A (en) * 2023-10-24 2023-11-24 北京睿企信息科技有限公司 Question expansion method based on question-answering task model and storage medium

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20160171376A1 (en) * 2014-12-12 2016-06-16 International Business Machines Corporation Inferred Facts Discovered through Knowledge Graph Derived Contextual Overlays
CN105956052A (en) * 2016-04-27 2016-09-21 青岛海尔软件有限公司 Building method of knowledge map based on vertical field
US20160378851A1 (en) * 2015-06-25 2016-12-29 International Business Machines Corporation Knowledge Canvassing Using a Knowledge Graph and a Question and Answer System
CN109726274A (en) * 2018-12-29 2019-05-07 北京百度网讯科技有限公司 Problem generation method, device and storage medium
CN110399457A (en) * 2019-07-01 2019-11-01 吉林大学 A kind of intelligent answer method and system
CN110837550A (en) * 2019-11-11 2020-02-25 中山大学 Knowledge graph-based question and answer method and device, electronic equipment and storage medium
CN110888988A (en) * 2018-08-17 2020-03-17 北京搜狗科技发展有限公司 Method, device and equipment for generating question and answer information
CN111125309A (en) * 2019-12-23 2020-05-08 中电云脑(天津)科技有限公司 Natural language processing method and device, computing equipment and storage medium
CN111506721A (en) * 2020-04-22 2020-08-07 福州大学 Question-answering system and construction method for domain knowledge graph

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20160171376A1 (en) * 2014-12-12 2016-06-16 International Business Machines Corporation Inferred Facts Discovered through Knowledge Graph Derived Contextual Overlays
US20160378851A1 (en) * 2015-06-25 2016-12-29 International Business Machines Corporation Knowledge Canvassing Using a Knowledge Graph and a Question and Answer System
CN105956052A (en) * 2016-04-27 2016-09-21 青岛海尔软件有限公司 Building method of knowledge map based on vertical field
CN110888988A (en) * 2018-08-17 2020-03-17 北京搜狗科技发展有限公司 Method, device and equipment for generating question and answer information
CN109726274A (en) * 2018-12-29 2019-05-07 北京百度网讯科技有限公司 Problem generation method, device and storage medium
CN110399457A (en) * 2019-07-01 2019-11-01 吉林大学 A kind of intelligent answer method and system
CN110837550A (en) * 2019-11-11 2020-02-25 中山大学 Knowledge graph-based question and answer method and device, electronic equipment and storage medium
CN111125309A (en) * 2019-12-23 2020-05-08 中电云脑(天津)科技有限公司 Natural language processing method and device, computing equipment and storage medium
CN111506721A (en) * 2020-04-22 2020-08-07 福州大学 Question-answering system and construction method for domain knowledge graph

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
李裕礞: "基于用户画像的神经网络对话模型研究", 《中国优秀硕士论文全文数据库》 *
李裕礞: "基于用户画像的神经网络对话模型研究", 《中国优秀硕士论文全文数据库》, 7 June 2018 (2018-06-07), pages 10 - 25 *

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113298488A (en) * 2021-04-30 2021-08-24 五八有限公司 Method and device for constructing industry problem library, electronic equipment and computer readable medium
CN113590844A (en) * 2021-08-09 2021-11-02 北京智源人工智能研究院 Knowledge graph-based question-answer library generation method and device, electronic equipment and storage medium
CN113806558A (en) * 2021-09-22 2021-12-17 湖北天天数链技术有限公司 Question selection method, knowledge graph construction method and device and electronic equipment
CN113806558B (en) * 2021-09-22 2024-03-26 湖北天天数链技术有限公司 Question selection method, knowledge graph construction device and electronic equipment
CN116628167A (en) * 2023-06-08 2023-08-22 四维创智(北京)科技发展有限公司 Response determination method and device, electronic equipment and storage medium
CN116628167B (en) * 2023-06-08 2024-04-05 四维创智(北京)科技发展有限公司 Response determination method and device, electronic equipment and storage medium
CN117113092A (en) * 2023-10-24 2023-11-24 北京睿企信息科技有限公司 Question expansion method based on question-answering task model and storage medium
CN117113092B (en) * 2023-10-24 2024-01-23 北京睿企信息科技有限公司 Question expansion method based on question-answering task model and storage medium

Also Published As

Publication number Publication date
CN112163076B (en) 2022-09-13

Similar Documents

Publication Publication Date Title
CN112163076B (en) Knowledge question bank construction method, question and answer processing method, device, equipment and medium
CN110096584B (en) Response method and device
WO2021135455A1 (en) Semantic recall method, apparatus, computer device, and storage medium
CN103970791B (en) A kind of method, apparatus for recommending video from video library
CN104462056A (en) Active knowledge guidance based on deep document analysis
CN111324700A (en) Resource recall method and device, electronic equipment and computer-readable storage medium
CN115271071A (en) Knowledge graph entity alignment method, system and equipment based on graph neural network
CN115270717A (en) Method, device, equipment and medium for detecting vertical position
CN111008213A (en) Method and apparatus for generating language conversion model
CN112765424B (en) Data query method, device, equipment and computer readable medium
CN110300329B (en) Video pushing method and device based on discrete features and electronic equipment
CN116894188A (en) Service tag set updating method and device, medium and electronic equipment
CN116912734A (en) Video abstract data set construction method, device, medium and electronic equipment
EP4322066A1 (en) Method and apparatus for generating training data
CN112182179B (en) Entity question-answer processing method and device, electronic equipment and storage medium
CN116957006A (en) Training method, device, equipment, medium and program product of prediction model
CN112509581B (en) Error correction method and device for text after voice recognition, readable medium and electronic equipment
CN111754984B (en) Text selection method, apparatus, device and computer readable medium
CN111626044B (en) Text generation method, text generation device, electronic equipment and computer readable storage medium
CN114020896A (en) Intelligent question and answer method, system, electronic equipment and storage medium
CN112906372A (en) Text simplification method, device, equipment and storage medium
CN111339770A (en) Method and apparatus for outputting information
CN111597441A (en) Information processing method and device and electronic equipment
CN112445959A (en) Retrieval method, retrieval device, computer-readable medium and electronic device
CN114385781B (en) Interface file recommendation method, device, equipment and medium based on statement model

Legal Events

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