CN112287095A - Method and device for determining answers to questions, computer equipment and storage medium - Google Patents

Method and device for determining answers to questions, computer equipment and storage medium Download PDF

Info

Publication number
CN112287095A
CN112287095A CN202011600408.4A CN202011600408A CN112287095A CN 112287095 A CN112287095 A CN 112287095A CN 202011600408 A CN202011600408 A CN 202011600408A CN 112287095 A CN112287095 A CN 112287095A
Authority
CN
China
Prior art keywords
entity
relationship
answer
target
determining
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202011600408.4A
Other languages
Chinese (zh)
Inventor
籍焱
王殿胜
唐红武
权桁
薄满辉
谭智隆
侯珺
李睿
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China Travelsky Mobile Technology Co Ltd
Original Assignee
China Travelsky Mobile 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 China Travelsky Mobile Technology Co Ltd filed Critical China Travelsky Mobile Technology Co Ltd
Priority to CN202011600408.4A priority Critical patent/CN112287095A/en
Publication of CN112287095A publication Critical patent/CN112287095A/en
Pending legal-status Critical Current

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/36Creation of semantic tools, e.g. ontology or thesauri
    • G06F16/367Ontology
    • 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/04Architecture, e.g. interconnection topology
    • G06N3/049Temporal neural networks, e.g. delay elements, oscillating neurons or pulsed inputs
    • 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

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Computational Linguistics (AREA)
  • General Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Artificial Intelligence (AREA)
  • Mathematical Physics (AREA)
  • Health & Medical Sciences (AREA)
  • General Health & Medical Sciences (AREA)
  • Data Mining & Analysis (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Molecular Biology (AREA)
  • Biophysics (AREA)
  • Biomedical Technology (AREA)
  • Computing Systems (AREA)
  • Software Systems (AREA)
  • Evolutionary Computation (AREA)
  • Databases & Information Systems (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Human Computer Interaction (AREA)
  • Animal Behavior & Ethology (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The application provides a method, a device, computer equipment and a storage medium for determining answers to questions, relates to the technical field of natural language processing, and is used for improving the accuracy of determining answers to the questions. The method mainly comprises the following steps: inputting the target problem into an entity relationship identification model to identify a core entity and a relationship corresponding to the target problem, wherein the entity relationship identification model is obtained by training an entity label and a relationship label respectively corresponding to the sample problem and the sample problem; matching entity nodes corresponding to the core entities from the knowledge graph; selecting a relation path with the highest relation matching degree with the target problem from relation paths corresponding to entity nodes corresponding to the core entities in the knowledge graph; and determining the answer corresponding to the relationship path with the highest similarity as the answer of the target question.

Description

Method and device for determining answers to questions, computer equipment and storage medium
Technical Field
The present application relates to the field of natural language processing technologies, and in particular, to a method and an apparatus for determining answers to questions, a computer device, and a storage medium.
Background
Knowledge-graph-based Question Answering (KBQA) can fully apply entities in a Knowledge graph and associated information between the entities, deeply understand semantic information of a user and obtain a best matching answer, and has recently received extensive attention from academic and industrial fields. In the KBQA task, a text character string of a natural language question is mapped to a triple in a knowledge map through various methods, and finally a text character string representing the answer of the question is generated.
In the stage of entity identification and relationship extraction, the method separates the two steps, treats the two steps as two independent subproblems to solve the two steps independently, and then merges the results. However, there is an association relationship between the two steps, and association information between the sub-problems is ignored, which results in a decrease in accuracy of the result.
Disclosure of Invention
The embodiment of the application provides a method and a device for determining answers to questions, computer equipment and a storage medium, which are used for improving the accuracy of determining answers to questions.
The embodiment of the invention provides a method for determining answers to questions, which comprises the following steps:
inputting a target problem into an entity relationship identification model to identify a core entity and a relationship corresponding to the target problem, wherein the entity relationship identification model is obtained by training an entity label and a relationship label respectively corresponding to a sample problem and the sample problem;
matching entity nodes corresponding to the core entities from a knowledge graph, wherein the knowledge graph comprises a plurality of entity nodes, and each entity node represents a subject entity;
selecting a relation path with the highest relation matching degree with the target problem from relation paths corresponding to entity nodes corresponding to the core entities in the knowledge graph;
and determining the answer corresponding to the relationship path with the highest matching degree as the answer of the target question.
The embodiment of the invention provides a device for determining answers to questions, which comprises:
the identification module is used for inputting a target problem into an entity relationship identification model to identify a core entity and a relationship corresponding to the target problem, wherein the entity relationship identification model is obtained by training an entity label and a relationship label respectively corresponding to a sample problem and the sample problem;
the matching module is used for matching entity nodes corresponding to the core entities from a knowledge graph, the knowledge graph comprises a plurality of entity nodes, and each entity node represents a subject entity;
the selecting module is used for selecting a relation path with the highest relation matching degree with the target problem from relation paths corresponding to entity nodes corresponding to the core entities in the knowledge graph;
and the determining module is used for determining the answer corresponding to the relationship path with the highest matching degree as the answer of the target question.
A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, the processor implementing the above method of determining answers to questions when executing the computer program.
A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the above-mentioned method of determining answers to questions.
The invention provides a method, a device, computer equipment and a storage medium for determining answers to questions, wherein a target question is input into an entity relationship recognition model to recognize a core entity and a relationship corresponding to the target question, and entity nodes corresponding to the core entity are matched from a knowledge graph, wherein the knowledge graph comprises a plurality of entity nodes, and each entity node represents a subject entity; finally, selecting a relation path with the highest relation matching degree with the target problem from relation paths corresponding to entity nodes corresponding to the core entities in the knowledge graph; and determining the answer corresponding to the relationship path with the highest matching degree as the answer of the target question. Compared with the prior art that the entity identification and the relation extraction are carried out separately, the entity relation identification model is obtained by training according to the sample question and the entity label and the relation label respectively corresponding to the sample question, so that the core entity and the relation corresponding to the target question can be directly extracted through the entity relation identification model, the incidence relation between the core entity and the relation is improved, then the answer corresponding to the target question is determined from the knowledge graph based on the identified core entity and the relation, and the accuracy of determining the answer to the question can be improved through the invention.
Drawings
FIG. 1 is a flowchart of a method for determining answers to questions according to one embodiment of the present application;
FIG. 2 is a schematic diagram of an internal structure of an entity relationship identification model according to an embodiment of the present application;
FIG. 3 is a schematic view of a knowledge-graph structure according to an embodiment of the present application;
FIG. 4 is a flowchart of a method for determining answers to questions according to one embodiment of the present application;
FIG. 5 is a diagram illustrating constraint annotation results provided in accordance with an embodiment of the present application;
fig. 6 is a block diagram illustrating an apparatus for determining answers to questions according to an embodiment of the present disclosure;
fig. 7 is a schematic diagram of a computer device according to an embodiment of the present application.
Detailed Description
In order to better understand the technical solutions described above, the technical solutions of the embodiments of the present application are described in detail below with reference to the drawings and the specific embodiments, and it should be understood that the specific features of the embodiments and the embodiments of the present application are detailed descriptions of the technical solutions of the embodiments of the present application, and are not limitations of the technical solutions of the present application, and the technical features of the embodiments and the embodiments of the present application may be combined with each other without conflict.
Referring to fig. 1, a method for determining answers to questions in a first embodiment of the present invention is shown, which is applicable to various fields, such as civil aviation, but is not limited thereto. The method specifically comprises the steps of S01-S04.
And S01, inputting the target question into the entity relationship recognition model to recognize the core entity and the relationship corresponding to the target question.
The core entity is a core word in the target problem, and the relationship is an associated attribute relationship corresponding to the core entity. For example, the target question is "who the originator of company A is
Figure DEST_PATH_IMAGE001
", the core entity of the target problem is" company a "; the corresponding relationship of the core entities is { inception time, headquarters location, originator, company type.
In the embodiment of the invention, the entity relationship recognition model is obtained by training according to the entity label and the relationship label respectively corresponding to the sample problem and the sample problem; preferably, about 10000 labeled sample questions are used for training, and each sample question can be labeled with an entity label and a relation label corresponding to the sample question; in the present invention, those skilled in the art can understand that the sample problem is implemented as a character string.
In particular, the internal structure of the entity relationship recognition modelAs shown in fig. 2, after inputting the sample question "where the bus at the capital airport" first, the sample question is first expressed in vector form by Word Embedding (preferably implemented as "Word Embedding in fig. 2" Word Embedding layer ") and (preferably, the words in the Word Embedding representation are all single words, such as" capital, field, large, bar, bus, where,
Figure 622265DEST_PATH_IMAGE001
"; in this way, the ill effects of word segmentation errors can be reduced), and then pass through a first coding layer (Encoder, preferably implemented as "coding layer Bert-wm Multi-Head orientation layer" in fig. 2), which obtains the enhanced semantic vectors of each word in the word vector form of the input sample problem in different semantic spaces through a Multi-Head Attention mechanism, and linearly combines the enhanced semantic vectors of each word. Then, a second coding layer (preferably implemented as a "coding layer BiLSTM layer" in fig. 2) is further performed, where the preferred coding layer is a bidirectional long-and-short-term neural network, and a sequence labeling (an entity label and a relationship label corresponding to a sample problem, that is, a CRF layer in fig. 2) task is introduced to adjust the representation capability inside the entity relationship model, which is beneficial to improving the accuracy of the whole model; finally, respectively inputting hidden layer vectors obtained by the coding layer into an entity classifier and a relation classifier to finally obtain a core entity e and a relation set of the sample problem<R>。
In the field of machine learning, multi-task learning refers to learning a plurality of related tasks together, and simultaneously learning related information of the plurality of tasks. Aiming at two subproblems of core entities and relation identification in the question sentence, the invention considers the subproblems as related tasks which are related to each other to study together, and mutually supplements the learned domain related knowledge in the learning process, thereby improving the accuracy of question answering.
And S02, matching entity nodes corresponding to the core entities from the knowledge graph.
The knowledge graph comprises a plurality of entity nodes, each entity node represents a subject entity, the nodes and the node connecting edges can be the relations between the entities, and the nodes connected with the entity nodes can be answer nodes or intermediate nodes (connecting relations). Taking the knowledge graph shown in fig. 3 as an example, "company a" is an entity node in the knowledge graph, and a corresponding relation of connecting edges between company a and "wang" is an "originator"; the relation corresponding to the connecting edge between the company "a" and the company "1995.5.1" is "initial time"; the 'branch location' is an intermediate node, namely, the locations of the branches in the city A and the city B can be found through the node. Specifically, "wang ming" in fig. 3 is the answer to find the originator of company a, "1995.5.1" is the answer to find the starting time of company a, "district C of city a" is the answer to find the branch location of company a in city a, "district D of city B" is the answer to find the branch location of company a in city B.
In one embodiment provided by the invention, after the core entities and the relations are obtained, a knowledge subgraph can be generated to find the correct answer in the knowledge graph. The knowledge subgraph is mainly divided into two parts: topic entities, relationship paths. When the length of the relation path is greater than 1, an intermediate entity is needed to establish the connection relation between the two entities.
And S03, selecting a relation path with the highest relation matching degree with the target problem from the relation paths corresponding to the entity nodes corresponding to the core entity in the knowledge graph.
Given a question, the process of finding an answer is the process of generating a knowledge sub-graph. Firstly, the core entities in the question are corresponded to the knowledge graph, for each entity in the knowledge graph, an alias set of the entity needs to be constructed in advance, all names which can be mentioned by the entity are included, the alias set is generated according to various data sources such as encyclopedia, navigation department, airport official networks, documents and the like, and the core entities can be linked to nodes in the knowledge graph by the alias set, so that the topic entities in the knowledge graph are obtained.
When knowing thatAfter the knowledge subgraph contains the subject entity, the next effective action is the relationship path of the expanded knowledge subgraph, and the generated relationship set is extracted according to the relationship<R>For each R in the setnAll relationships associated with the node are associated with RnAnd calculating a semantic matching degree to obtain a relation matching score, and for a set of a plurality of relations, selecting the highest relation path from all the scores as a final relation path, wherein the final relation path score is equal to the product of each relation matching score.
For example, if the target question is "company a stands by" year, "the core entity corresponding to the target question determined in step S01 is" company a, "and the relationship is" standing time. As shown in fig. 3, the relationship path determined to have the highest degree of matching through matching is "company a" - "origination time" - "1995.5.1", that is, the answer node "1995.5.1" of the relationship path determined to have the highest degree of matching is the answer to the target question.
And S04, determining the answer corresponding to the relationship path with the highest matching degree as the answer of the target question.
The invention provides a method for determining answer to a question, which comprises the steps of firstly inputting a target question into an entity relationship recognition model to recognize a core entity and a relationship corresponding to the target question, and then matching entity nodes corresponding to the core entity from a knowledge graph, wherein the knowledge graph comprises a plurality of entity nodes, and each entity node represents a subject entity; finally, selecting a relation path with the highest relation matching degree with the target problem from relation paths corresponding to entity nodes corresponding to the core entities in the knowledge graph; and determining the answer corresponding to the relationship path with the highest matching degree as the answer of the target question. Compared with the prior art that the entity identification and the relation extraction are carried out separately, the entity relation identification model is obtained by training according to the sample question and the entity label and the relation label respectively corresponding to the sample question, so that the core entity and the relation corresponding to the target question can be directly extracted through the entity relation identification model, the incidence relation between the core entity and the relation is improved, then the answer corresponding to the target question is determined from the knowledge graph based on the identified core entity and the relation, and the accuracy of determining the answer to the question can be improved through the invention.
Referring to fig. 4, a method for determining answers to questions in a first embodiment of the present invention is shown, which is applicable to various fields, such as the field of conversational question answering, for example, the field of civil aviation, and the embodiment of the present invention is not limited specifically. The method specifically comprises the steps of S10-S50.
S10, inputting the target problem into the entity relationship recognition model, recognizing the core entity and relationship corresponding to the target problem, and recognizing the restriction condition corresponding to the target problem.
The entity relationship recognition model is obtained by training according to the entity labels and the relationship labels corresponding to the sample problems respectively.
In the stage of entity identification and relationship extraction, the invention provides a mode based on multi-task learning, two interconnected subproblems are put together for learning, and schema information in a civil aviation knowledge graph is introduced. For example, for the entity "duty free store", its attributes are "place", "business hours", "contact phone number", etc., so if the core entity of the question sentence is identified as "duty free store", the relation of the question sentence should be one or more of the attributes inherent to "duty free store" such as "place", "business hours", "contact phone number", etc., instead of the attributes inherent to "duty free store" such as "approach point", "age", etc. Therefore, compared with the method that entity identification and relation extraction are regarded as two independent subtasks for carrying out, the multitask learning-based method provided by the invention can enable the module to automatically learn the internal relations, so that the accuracy of the result is higher and more reasonable.
In an embodiment provided by the present invention, the identifying the constraint condition corresponding to the target problem includes: and inputting the target problem into a limiting condition recognition model to obtain a limiting condition corresponding to the target problem, wherein the limiting condition model is obtained by training according to the sample problem and the attribute labels corresponding to the characters in the sample problem. The attribute labels comprise a limitation label and a non-limitation label, the limitation label comprises a plurality of category labels, and the category labels contain limitation categories and limitation category positions.
It should be noted that, in the face of some complex target questions, it is necessary to identify the constraint conditions in the target questions to better understand the intentions in the question and obtain more accurate answers. The limiting condition recognition model in the embodiment of the invention is obtained by training a long-short time memory network (LSTM) and a Conditional Random Field (CRF) model, and then the limiting condition recognition is carried out based on the limiting condition recognition model obtained by training. The constraint recognition model is shown in fig. 5, firstly, a target problem is converted into a vector sequence through an embedding layer, then the vector sequence is input into two bidirectional LSTM, the forward and backward outputs of each time sequence in the LSTM are spliced, and finally, a result is predicted through a random condition field (CRF).
Specifically, the limitation condition may be set as required. For example, in the question-answer sentence in the civil aviation field, the restriction conditions can be divided into 8 major categories, and the specific categories can be shown in table 1. Referring to Table 1, the label of the first word in the target question can only be "B-" or "O", rather than "I-"; the sequence "O I-label" is illegal because "I-label" must be preceded by "B-label" and the two labels should be of the same type. Here, the label category is in the form of "BIO", where "B" represents a constraint header, "I" represents a constraint non-header, and "O" represents a non-constraint.
Figure 8247DEST_PATH_IMAGE002
And S20, matching entity nodes corresponding to the core entities from the knowledge graph.
The knowledge graph comprises a plurality of entity nodes, and each entity node represents a subject entity. Step S20, step S02 are the same, and the embodiment of the present invention is not described herein again.
And S30, selecting a relation path with the highest relation matching degree with the target problem from the relation paths corresponding to the entity nodes corresponding to the core entity in the knowledge graph.
It should be noted that, the contents of step S30 and step S03 are the same, and the embodiment of the present invention is not described herein again.
And S40, selecting an answer corresponding to the limiting condition from the relationship path with the highest matching degree.
Compared with a mode of manually constructing rules and templates, the automatic identification method based on the neural network and the conditional random field has higher coverage rate and portability in the identification of the limiting conditions. For example "where smoking rooms near A12 gate
Figure 991247DEST_PATH_IMAGE001
"it is difficult to build templates to identify places in question sentences because the same semantics can make a series of statements such as" i am now at gate a12, telling i the nearest smoking room ", and it is difficult to completely cover all syntactic forms by manually defining templates. The automatic identification method provided by the invention can extract grammatical features in the question through the neural network model, predict the result through the conditional random field, convert the identification process of the constraint condition into a sequence labeling task, add the constraint condition into the final query graph, identify semantic information in the question, process the implicit expression and finally identify the limit condition in the question, so that the accuracy of determining the answer to the question can be improved through the limit condition in the embodiment of the invention.
And S50, determining the answer corresponding to the limiting condition as the answer of the target question.
According to the method for determining the answer to the question, provided by the embodiment of the invention, after the core entity, the relation and the constraint condition are obtained, a knowledge subgraph can be generated to find the correct answer in the knowledge graph. The knowledge subgraph is mainly divided into three parts: subject entities, relationship paths, constraint functions. When the length of the relation path is greater than 1, an intermediate entity is needed to establish the connection relation between the two entities, and the constraint function is mapped by the constraint condition.
In an embodiment of the present invention, if the target problem corresponds to a plurality of relationships, the method further includes: selecting a relation path with the highest path score from relation paths corresponding to entity nodes corresponding to the core entity in the knowledge graph; the path score is equal to a product of each of the relationship matching scores corresponding to the target problem. Namely, when the knowledge subgraph contains the subject entity, the next effective action is the relationship path of the expanded knowledge subgraph, and the relationship set generated by the relationship extraction is used<R>For each R thereinnAll relationships associated with the node are associated with RnAnd calculating a semantic matching degree to obtain a relation matching score, and for a set of a plurality of relations, selecting the highest relation path from all the scores as a final relation path, wherein the final relation path score is equal to the product of each relation matching score.
In an embodiment provided by the present invention, after identifying the constraint condition corresponding to the target issue, the method further includes: determining whether the limiting condition is a legal constraint; selecting an answer corresponding to the limiting condition from the relationship path with the highest matching degree, wherein the answer comprises the following steps: and if the limiting condition is legal constraint, selecting an answer corresponding to the limiting condition from the relationship path with the highest matching degree.
In an application scenario in the civil aviation field provided by the invention, the main process is as follows: and (4) identifying a core entity, extracting a relation, identifying a limiting condition, and constructing a knowledge subgraph to generate an answer. The embodiment is oriented to the real-time property, the dynamic property and the diversity of the civil aviation field data, and is mainly aimed at the characteristics of wide sources, various forms, timeliness and the like presented by the information of airports, flights and airlines, firstly, a civil aviation field knowledge map is constructed, and data can be newly added, modified and linguistic data can be configured in real time through a management terminal; then, processing the target problem by a semantic analysis method based on multi-task learning to obtain a core entity and a relation of the question; then obtaining the restriction condition of the question through a restriction condition recognition model (bidirectional long-time memory cyclic neural network and conditional random field); and finally, generating a knowledge subgraph according to the core entity, the relation, the limiting condition and the knowledge graph, and finally obtaining an answer corresponding to the target question.
It should be understood that, the sequence numbers of the steps in the foregoing embodiments do not imply an execution sequence, and the execution sequence of each process should be determined by its function and inherent logic, and should not constitute any limitation to the implementation process of the embodiments of the present invention.
In one embodiment, an apparatus for determining answers to questions is provided, and the apparatus for determining answers to questions corresponds to the method for determining answers to questions in the above embodiments. As shown in fig. 6, the functional modules of the apparatus for determining answers to questions are described in detail as follows:
the identification module 10 is configured to input a target problem into an entity relationship identification model to identify a core entity and a relationship corresponding to the target problem, where the entity relationship identification model is obtained by training an entity tag and a relationship tag corresponding to a sample problem and the sample problem, respectively;
a matching module 20, configured to match an entity node corresponding to the core entity from a knowledge graph, where the knowledge graph includes a plurality of entity nodes, and each entity node represents a subject entity;
a selecting module 30, configured to select a relationship path with a highest relationship matching degree with the target problem from relationship paths corresponding to entity nodes corresponding to the core entity in the knowledge graph;
and the determining module 40 is configured to determine an answer corresponding to the relationship path with the highest matching degree as an answer to the target question.
Further, the identification module 10 is further configured to identify a constraint condition corresponding to the target problem;
the selecting module 30 is further configured to select an answer corresponding to the limiting condition from the relationship path with the highest matching degree;
the determining module 40 is further configured to determine an answer corresponding to the limiting condition as an answer to the target question.
The recognition module 10 is specifically configured to input the target problem into a constraint condition recognition model to obtain a constraint condition corresponding to the target problem, where the constraint condition model is obtained by training according to a sample problem and an attribute label corresponding to each word in the sample problem.
Further, the determining module 40 is further configured to determine whether the limiting condition is a legal constraint;
the selecting module 30 is further configured to select an answer corresponding to the limiting condition from the relationship path with the highest matching degree if the limiting condition is legal constraint.
Specifically, the attribute tags include a constraint tag and a non-constraint tag, the constraint tag includes a plurality of category tags, and the category tags include a constraint category and a constraint category position.
Further, the selecting module 30 is further configured to select a relationship path with the highest path score from relationship paths corresponding to entity nodes corresponding to the core entity in the knowledge graph; the path score is equal to a product of each of the relationship matching scores corresponding to the target problem.
For specific limitations of the apparatus for determining answers to questions, reference may be made to the above limitations of the method for determining answers to questions, which are not described herein again. The various modules in the above-described apparatus may be implemented in whole or in part by software, hardware, and combinations thereof. The modules can be embedded in a hardware form or independent from a processor in the computer device, and can also be stored in a memory in the computer device in a software form, so that the processor can call and execute operations corresponding to the modules.
In one embodiment, a computer device is provided, which may be a server, the internal structure of which may be as shown in fig. 7. The computer device includes a processor, a memory, a network interface, and a database connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device comprises a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of an operating system and computer programs in the non-volatile storage medium. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program is executed by a processor to implement a method of determining answers to questions.
In one embodiment, a computer device is provided, comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, the processor implementing the following steps when executing the computer program:
inputting a target problem into an entity relationship identification model to identify a core entity and a relationship corresponding to the target problem, wherein the entity relationship identification model is obtained by training an entity label and a relationship label respectively corresponding to a sample problem and the sample problem;
matching entity nodes corresponding to the core entities from a knowledge graph, wherein the knowledge graph comprises a plurality of entity nodes, and each entity node represents a subject entity;
selecting a relation path with the highest relation matching degree with the target problem from relation paths corresponding to entity nodes corresponding to the core entities in the knowledge graph;
and determining the answer corresponding to the relationship path with the highest matching degree as the answer of the target question.
In one embodiment, a computer-readable storage medium is provided, having a computer program stored thereon, which when executed by a processor, performs the steps of:
inputting a target problem into an entity relationship identification model to identify a core entity and a relationship corresponding to the target problem, wherein the entity relationship identification model is obtained by training an entity label and a relationship label respectively corresponding to a sample problem and the sample problem;
matching entity nodes corresponding to the core entities from a knowledge graph, wherein the knowledge graph comprises a plurality of entity nodes, and each entity node represents a subject entity;
selecting a relation path with the highest relation matching degree with the target problem from relation paths corresponding to entity nodes corresponding to the core entities in the knowledge graph;
and determining the answer corresponding to the relationship path with the highest matching degree as the answer of the target question.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware instructions of a computer program, which can be stored in a non-volatile computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. Any reference to memory, storage, database, or other medium used in the embodiments provided herein may include non-volatile and/or volatile memory, among others. Non-volatile memory can include read-only memory (ROM), Programmable ROM (PROM), Electrically Programmable ROM (EPROM), Electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDRSDRAM), Enhanced SDRAM (ESDRAM), Synchronous Link DRAM (SLDRAM), Rambus Direct RAM (RDRAM), direct bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
It will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-mentioned division of the functional units and modules is illustrated, and in practical applications, the above-mentioned function distribution may be performed by different functional units and modules according to needs, that is, the internal structure of the apparatus is divided into different functional units or modules to perform all or part of the above-mentioned functions.
The above examples are only intended to illustrate the technical solution of the present invention, but not to limit it; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications and substitutions do not substantially depart from the spirit and scope of the embodiments of the present invention, and are intended to be included within the scope of the present invention.

Claims (10)

1. A method of determining answers to questions, the method comprising:
inputting a target problem into an entity relationship identification model to identify a core entity and a relationship corresponding to the target problem, wherein the entity relationship identification model is obtained by training an entity label and a relationship label respectively corresponding to a sample problem and the sample problem;
matching entity nodes corresponding to the core entities from a knowledge graph, wherein the knowledge graph comprises a plurality of entity nodes, and each entity node represents a subject entity;
selecting a relation path with the highest relation matching degree with the target problem from relation paths corresponding to entity nodes corresponding to the core entities in the knowledge graph;
and determining the answer corresponding to the relationship path with the highest matching degree as the answer of the target question.
2. The method of determining answers to questions of claim 1, further comprising:
identifying a limiting condition corresponding to the target problem;
the determining the answer corresponding to the relationship path with the highest matching degree as the answer of the target question includes:
selecting an answer corresponding to the limiting condition from the relationship path with the highest matching degree;
and determining the answer corresponding to the limiting condition as the answer of the target question.
3. The method for determining answers to questions as claimed in claim 2, wherein said identifying constraints corresponding to said target questions comprises:
and inputting the target problem into a limiting condition recognition model to obtain a limiting condition corresponding to the target problem, wherein the limiting condition model is obtained by training according to the sample problem and the attribute labels corresponding to the characters in the sample problem.
4. The method for determining answers to questions as claimed in claim 2 or 3, wherein after said identifying of the constraint condition corresponding to said target question, said method further comprises:
determining whether the limiting condition is a legal constraint;
selecting an answer corresponding to the limiting condition from the relationship path with the highest matching degree, wherein the answer comprises the following steps:
and if the limiting condition is legal constraint, selecting an answer corresponding to the limiting condition from the relationship path with the highest matching degree.
5. The method for determining answers to questions as set forth in claim 3, wherein said attribute tags include constraint tags and non-constraint tags, said constraint tags including a plurality of category tags, said category tags including a constraint category and a constraint category position.
6. The method of claim 1, wherein if the target question corresponds to a plurality of relationships, the method further comprises:
selecting a relation path with the highest path score from relation paths corresponding to entity nodes corresponding to the core entity in the knowledge graph; the path score is equal to a product of each of the relationship matching scores corresponding to the target problem.
7. An apparatus for determining answers to questions, the apparatus comprising:
the identification module is used for inputting a target problem into an entity relationship identification model to identify a core entity and a relationship corresponding to the target problem, wherein the entity relationship identification model is obtained by training an entity label and a relationship label respectively corresponding to a sample problem and the sample problem;
the matching module is used for matching entity nodes corresponding to the core entities from a knowledge graph, the knowledge graph comprises a plurality of entity nodes, and each entity node represents a subject entity;
the selecting module is used for selecting a relation path with the highest relation matching degree with the target problem from relation paths corresponding to entity nodes corresponding to the core entities in the knowledge graph;
and the determining module is used for determining the answer corresponding to the relationship path with the highest matching degree as the answer of the target question.
8. The apparatus for determining an answer to a question according to claim 7,
the identification module is further used for identifying the limiting conditions corresponding to the target problems;
the selecting module is further configured to select an answer corresponding to the limiting condition from the relationship path with the highest matching degree;
the determining module is further configured to determine an answer corresponding to the limiting condition as an answer to the target question.
9. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor implements the method of determining answers to questions as claimed in any one of claims 1 to 6 when executing the computer program.
10. A computer-readable storage medium, in which a computer program is stored, which, when being executed by a processor, carries out a method of determining answers to questions as claimed in any one of claims 1 to 6.
CN202011600408.4A 2020-12-30 2020-12-30 Method and device for determining answers to questions, computer equipment and storage medium Pending CN112287095A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011600408.4A CN112287095A (en) 2020-12-30 2020-12-30 Method and device for determining answers to questions, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011600408.4A CN112287095A (en) 2020-12-30 2020-12-30 Method and device for determining answers to questions, computer equipment and storage medium

Publications (1)

Publication Number Publication Date
CN112287095A true CN112287095A (en) 2021-01-29

Family

ID=74426283

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011600408.4A Pending CN112287095A (en) 2020-12-30 2020-12-30 Method and device for determining answers to questions, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN112287095A (en)

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112966122A (en) * 2021-03-03 2021-06-15 平安科技(深圳)有限公司 Corpus intention identification method and device, storage medium and computer equipment
CN113468314A (en) * 2021-08-31 2021-10-01 阿里巴巴达摩院(杭州)科技有限公司 Relationship prediction and question-answering method and device, electronic equipment and computer storage medium
CN114201603A (en) * 2021-11-04 2022-03-18 阿里巴巴(中国)有限公司 Entity classification method, device, storage medium, processor and electronic device
CN114722823A (en) * 2022-03-24 2022-07-08 华中科技大学 Method and device for constructing aviation knowledge graph and computer readable medium
CN114818683A (en) * 2022-06-30 2022-07-29 北京宝兰德软件股份有限公司 Operation and maintenance method and device based on mobile terminal
CN115033679A (en) * 2022-08-10 2022-09-09 深圳联友科技有限公司 Method for searching automobile maintenance data based on knowledge graph
WO2022227162A1 (en) * 2021-04-25 2022-11-03 平安科技(深圳)有限公司 Question and answer data processing method and apparatus, and computer device and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110137919A1 (en) * 2009-12-09 2011-06-09 Electronics And Telecommunications Research Institute Apparatus and method for knowledge graph stabilization
CN108427707A (en) * 2018-01-23 2018-08-21 深圳市阿西莫夫科技有限公司 Nan-machine interrogation's method, apparatus, computer equipment and storage medium
CN109492077A (en) * 2018-09-29 2019-03-19 北明智通(北京)科技有限公司 The petrochemical field answering method and system of knowledge based map
CN109857846A (en) * 2019-01-07 2019-06-07 阿里巴巴集团控股有限公司 The matching process and device of user's question sentence and knowledge point

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110137919A1 (en) * 2009-12-09 2011-06-09 Electronics And Telecommunications Research Institute Apparatus and method for knowledge graph stabilization
CN108427707A (en) * 2018-01-23 2018-08-21 深圳市阿西莫夫科技有限公司 Nan-machine interrogation's method, apparatus, computer equipment and storage medium
CN109492077A (en) * 2018-09-29 2019-03-19 北明智通(北京)科技有限公司 The petrochemical field answering method and system of knowledge based map
CN109857846A (en) * 2019-01-07 2019-06-07 阿里巴巴集团控股有限公司 The matching process and device of user's question sentence and knowledge point

Cited By (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112966122A (en) * 2021-03-03 2021-06-15 平安科技(深圳)有限公司 Corpus intention identification method and device, storage medium and computer equipment
WO2022183547A1 (en) * 2021-03-03 2022-09-09 平安科技(深圳)有限公司 Corpus intention recognition method and apparatus, storage medium, and computer device
CN112966122B (en) * 2021-03-03 2024-05-10 平安科技(深圳)有限公司 Corpus intention recognition method and device, storage medium and computer equipment
WO2022227162A1 (en) * 2021-04-25 2022-11-03 平安科技(深圳)有限公司 Question and answer data processing method and apparatus, and computer device and storage medium
CN113468314A (en) * 2021-08-31 2021-10-01 阿里巴巴达摩院(杭州)科技有限公司 Relationship prediction and question-answering method and device, electronic equipment and computer storage medium
CN113468314B (en) * 2021-08-31 2022-02-08 阿里巴巴达摩院(杭州)科技有限公司 Relationship prediction and question-answering method and device, electronic equipment and computer storage medium
CN114201603A (en) * 2021-11-04 2022-03-18 阿里巴巴(中国)有限公司 Entity classification method, device, storage medium, processor and electronic device
CN114722823A (en) * 2022-03-24 2022-07-08 华中科技大学 Method and device for constructing aviation knowledge graph and computer readable medium
CN114722823B (en) * 2022-03-24 2023-04-14 华中科技大学 Method and device for constructing aviation knowledge graph and computer readable medium
CN114818683A (en) * 2022-06-30 2022-07-29 北京宝兰德软件股份有限公司 Operation and maintenance method and device based on mobile terminal
CN115033679A (en) * 2022-08-10 2022-09-09 深圳联友科技有限公司 Method for searching automobile maintenance data based on knowledge graph
CN115033679B (en) * 2022-08-10 2023-01-13 深圳联友科技有限公司 Method for searching automobile maintenance data based on knowledge graph

Similar Documents

Publication Publication Date Title
CN112287095A (en) Method and device for determining answers to questions, computer equipment and storage medium
CN109582949B (en) Event element extraction method and device, computing equipment and storage medium
US11948058B2 (en) Utilizing recurrent neural networks to recognize and extract open intent from text inputs
US20230169270A1 (en) Entity linking method and apparatus
CN111159385B (en) Template-free general intelligent question-answering method based on dynamic knowledge graph
CN110826335B (en) Named entity identification method and device
CN104679826B (en) The method and system of context identification based on disaggregated model
CN109857846B (en) Method and device for matching user question and knowledge point
CN111191275A (en) Sensitive data identification method, system and device
WO2022174496A1 (en) Data annotation method and apparatus based on generative model, and device and storage medium
CN111723569A (en) Event extraction method and device and computer readable storage medium
CN110377733A (en) A kind of text based Emotion identification method, terminal device and medium
CN114676255A (en) Text processing method, device, equipment, storage medium and computer program product
CN113268560A (en) Method and device for text matching
CN114580424A (en) Labeling method and device for named entity identification of legal document
CN113947086A (en) Sample data generation method, training method, corpus generation method and apparatus
CN115115984A (en) Video data processing method, apparatus, program product, computer device, and medium
CN111783425B (en) Intention identification method based on syntactic analysis model and related device
CN116522905B (en) Text error correction method, apparatus, device, readable storage medium, and program product
CN115115432B (en) Product information recommendation method and device based on artificial intelligence
WO2022262080A1 (en) Dialogue relationship processing method, computer and readable storage medium
CN112487154B (en) Intelligent search method based on natural language
CN115658845A (en) Intelligent question-answering method and device suitable for open-source software supply chain
CN112989003B (en) Intention recognition method, device, processing equipment and medium
Ajees et al. A named entity recognition system for Malayalam using conditional random fields

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
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20210129