CN112528037B - Side relation prediction method, device, equipment and storage medium based on knowledge graph - Google Patents
Side relation prediction method, device, equipment and storage medium based on knowledge graph Download PDFInfo
- Publication number
- CN112528037B CN112528037B CN202011406864.5A CN202011406864A CN112528037B CN 112528037 B CN112528037 B CN 112528037B CN 202011406864 A CN202011406864 A CN 202011406864A CN 112528037 B CN112528037 B CN 112528037B
- Authority
- CN
- China
- Prior art keywords
- knowledge
- nodes
- graph
- node
- model
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
- 238000000034 method Methods 0.000 title claims abstract description 50
- 239000013598 vector Substances 0.000 claims abstract description 84
- 238000012545 processing Methods 0.000 claims abstract description 22
- 230000002776 aggregation Effects 0.000 claims abstract description 18
- 238000004220 aggregation Methods 0.000 claims abstract description 18
- 239000003550 marker Substances 0.000 claims abstract description 15
- 238000012549 training Methods 0.000 claims abstract description 11
- 230000015654 memory Effects 0.000 claims description 19
- 230000006870 function Effects 0.000 claims description 13
- 230000008569 process Effects 0.000 claims description 7
- 230000004913 activation Effects 0.000 claims description 5
- 230000000873 masking effect Effects 0.000 claims 1
- 238000013135 deep learning Methods 0.000 abstract description 2
- 238000004364 calculation method Methods 0.000 description 7
- 238000004590 computer program Methods 0.000 description 7
- 238000010586 diagram Methods 0.000 description 7
- 208000024891 symptom Diseases 0.000 description 5
- 238000004891 communication Methods 0.000 description 4
- 238000010276 construction Methods 0.000 description 4
- 238000004458 analytical method Methods 0.000 description 3
- 201000010099 disease Diseases 0.000 description 3
- 208000037265 diseases, disorders, signs and symptoms Diseases 0.000 description 3
- 239000004973 liquid crystal related substance Substances 0.000 description 3
- 238000012986 modification Methods 0.000 description 3
- 230000004048 modification Effects 0.000 description 3
- 238000003058 natural language processing Methods 0.000 description 3
- 238000007418 data mining Methods 0.000 description 2
- 230000003993 interaction Effects 0.000 description 2
- 230000000007 visual effect Effects 0.000 description 2
- 206010028748 Nasal obstruction Diseases 0.000 description 1
- 206010033425 Pain in extremity Diseases 0.000 description 1
- 206010057190 Respiratory tract infections Diseases 0.000 description 1
- 206010046306 Upper respiratory tract infection Diseases 0.000 description 1
- 238000013528 artificial neural network Methods 0.000 description 1
- 230000002457 bidirectional effect Effects 0.000 description 1
- 230000001413 cellular effect Effects 0.000 description 1
- 238000011217 control strategy Methods 0.000 description 1
- 238000013523 data management Methods 0.000 description 1
- 230000001419 dependent effect Effects 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 238000003745 diagnosis Methods 0.000 description 1
- 229940079593 drug Drugs 0.000 description 1
- 239000003814 drug Substances 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 230000010365 information processing Effects 0.000 description 1
- 238000010801 machine learning Methods 0.000 description 1
- 230000005012 migration Effects 0.000 description 1
- 238000013508 migration Methods 0.000 description 1
- 238000005065 mining Methods 0.000 description 1
- 238000010295 mobile communication Methods 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 238000003672 processing method Methods 0.000 description 1
- 238000004549 pulsed laser deposition Methods 0.000 description 1
- 230000001953 sensory effect Effects 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/30—Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
- G06F16/36—Creation of semantic tools, e.g. ontology or thesauri
- G06F16/367—Ontology
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N5/00—Computing arrangements using knowledge-based models
- G06N5/04—Inference or reasoning models
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- General Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- Data Mining & Analysis (AREA)
- Computational Linguistics (AREA)
- Physics & Mathematics (AREA)
- Animal Behavior & Ethology (AREA)
- Life Sciences & Earth Sciences (AREA)
- Databases & Information Systems (AREA)
- Artificial Intelligence (AREA)
- Evolutionary Computation (AREA)
- Computing Systems (AREA)
- Mathematical Physics (AREA)
- Software Systems (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The application discloses a side relation prediction method, device and equipment based on a knowledge graph and a storage medium, and relates to the technical field of deep learning and the technical field of knowledge graph. The method comprises the following steps: acquiring a first knowledge graph, wherein the first knowledge graph is constructed based on structured data and unstructured data in the target knowledge field; acquiring a first knowledge representation model, wherein the first knowledge representation model is generated by training a first BERT model through a corpus data set of the target knowledge field; and inputting the marker word vectors and the position word vectors of the plurality of nodes of the first knowledge graph into a second BERT model for information aggregation processing to obtain the edge relation information between the plurality of nodes of the first knowledge graph and the respective neighbor nodes. By using the method and the device, the side relationship information among the nodes in the knowledge graph can be obtained.
Description
Technical Field
The application relates to the technical field of deep learning and the technical field of knowledge maps, in particular to a side relationship prediction method, a side relationship prediction device, a side relationship prediction equipment and a storage medium based on a knowledge map.
Background
Knowledge Graph (knowledgegraph) generally refers to a semantic network capable of revealing relationships between entities, and based on means such as data mining, information processing, graph drawing and the like, a visual Graph is utilized to vividly display a complex Knowledge field, so that a development rule of the Knowledge field can be embodied to a certain extent. The knowledge representation (knowledge representation) is a description of the knowledge that includes a computer-acceptable data structure for describing the knowledge. Knowledge reasoning (Knowledge Inference) generally refers to the process of simulating human intelligent reasoning modes in a computer or an intelligent system, and performing machine thinking and solving problems by using formalized knowledge according to a reasoning control strategy. In the knowledge reasoning calculation, the complete knowledge base is required to be relied on for reasoning prediction, taking the medical knowledge field as an example, diagnosis, doctor advice, medication and the like in the medical field are all dependent on manual knowledge storage and experience, corresponding conclusion is obtained through reasoning calculation, the knowledge reasoning modeling can be utilized to realize the knowledge reasoning calculation, and the scheme adopted at present mainly comprises 1) rule-based knowledge reasoning, 2) knowledge reasoning based on the migration of a spectrogram of a knowledge graph and 3) knowledge reasoning based on distributed representation, and the schemes are required to rely on complete knowledge graph information to realize reasoning prediction, so that the requirements on the consistency and completeness of the knowledge graph are higher. However, the knowledge graph construction cost in the current professional field is high, the completeness is difficult to ensure, and the accuracy of knowledge reasoning calculation is low.
Disclosure of Invention
The application provides a side relationship prediction method, device and equipment based on a knowledge graph and a storage medium, which are used for solving at least one technical problem.
According to a first aspect of the present application, there is provided a knowledge-graph-based side relationship prediction method, including:
acquiring a first knowledge graph which is constructed based on structured data and unstructured data in the target knowledge field;
acquiring a first knowledge representation model, wherein the first knowledge representation model is generated by training a first BERT model through a corpus data set in the target knowledge field;
inputting the first knowledge graph into a first knowledge representation model to obtain labeled word vectors of a plurality of nodes in the output first knowledge graph;
according to the distances between a plurality of nodes in the first knowledge graph and the respective neighbor nodes, position word vectors of the nodes are respectively determined;
and inputting the marker word vectors and the position word vectors of the plurality of nodes of the first knowledge graph into a second BERT model for information aggregation processing to obtain the side relation information between the plurality of nodes of the first knowledge graph and the respective neighbor nodes.
According to a second aspect of the present application, there is provided a side relationship prediction apparatus based on a knowledge graph, including:
the map acquisition module is used for acquiring a first knowledge map which is constructed based on the structured data and the unstructured data in the target knowledge field;
the model acquisition module is used for acquiring a first knowledge representation model which is generated by training a first BERT model through a corpus data set in the target knowledge field;
the marking word vector acquisition module is used for inputting the first knowledge graph into the first knowledge representation model to obtain marking word vectors of a plurality of nodes in the output first knowledge graph;
the position word vector determining module is used for determining position word vectors of the nodes according to the distances between the nodes in the first knowledge graph and the neighboring nodes;
the side relation information acquisition module is used for inputting the marker word vectors and the position word vectors of the plurality of nodes of the first knowledge graph into the second BERT model to perform information aggregation processing, so as to obtain side relation information between the plurality of nodes of the first knowledge graph and the respective neighbor nodes.
According to a third aspect of the present application, there is provided an electronic device comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method as described above.
According to a fourth aspect of the present application, there is provided a non-transitory computer readable storage medium storing computer instructions for causing a computer to perform the method as described above.
According to a fifth aspect of the present application, there is provided a computer program product comprising computer instructions which, when executed by a processor, implement a method as described above.
According to the embodiment of the application, unstructured data are added when the knowledge graph is constructed, so that graph information is as comprehensive as possible, the completeness of the constructed knowledge graph is improved, the word vectors of the nodes are subjected to aggregation processing by using the BERT model, the side relation information among the nodes in the graph can be obtained, the side relation information in knowledge pushing is supplemented, and the accuracy of side relation prediction is improved.
It should be understood that the description of this section is not intended to identify key or critical features of the embodiments of the application or to delineate the scope of the application. Other features of the present application will become apparent from the description that follows.
Drawings
The drawings are for better understanding of the present solution and do not constitute a limitation of the present application. Wherein:
FIG. 1 is a block flow diagram of a knowledge-graph-based side relationship prediction method in an embodiment of the present application;
FIG. 2 is a schematic illustration of a medical knowledge-graph according to an embodiment of the present application;
FIG. 3 is a schematic diagram of processing logic for obtaining inter-node edge relationship information according to an embodiment of the present application;
FIG. 4 is a block diagram of a knowledge-graph-based side relationship prediction apparatus according to an embodiment of the present application;
fig. 5 is a block diagram of an electronic device implementing a knowledge-graph-based side relationship prediction method according to an embodiment of the present application.
Detailed Description
Exemplary embodiments of the present application are described below in conjunction with the accompanying drawings, which include various details of the embodiments of the present application to facilitate understanding, and should be considered as merely exemplary. Accordingly, one of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the present application. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
Fig. 1 shows a flow chart of a knowledge-based side relationship prediction method according to an embodiment of the present application, where the method includes:
s101, acquiring a first knowledge graph which is constructed based on structured data and unstructured data in the target knowledge field;
s102, acquiring a first knowledge representation model, wherein the first knowledge representation model is generated by training a first BERT model through a corpus data set in the target knowledge field;
s103, inputting the first knowledge graph into a first knowledge representation model to obtain labeled word vectors of a plurality of nodes in the output first knowledge graph;
s104, determining position word vectors of the nodes according to the distances between the nodes in the first knowledge graph and the respective neighbor nodes;
s105, the marker word vectors and the position word vectors of the plurality of nodes of the first knowledge graph are input into a second BERT model to be subjected to information aggregation processing, and edge relation information between the plurality of nodes of the first knowledge graph and the respective neighbor nodes is obtained.
According to the embodiment of the application, unstructured data are added when the knowledge graph is constructed, so that information loss during graph construction can be reduced, information in the graph is as comprehensive as possible, the completeness of the constructed knowledge graph is improved, word vectors of nodes are subjected to aggregation processing by using the BERT model, edge relation information among the nodes in the graph can be obtained, the edge relation information in knowledge pushing is supplemented, the accuracy of edge relation prediction can be improved, and the accuracy of knowledge reasoning can be improved.
Briefly described herein, the BERT model is an unsupervised natural language processing (Natural Language Processing, NLP) training model, which is collectively referred to as "Bidirectional Encoder Representation from Transformers", i.e., the bi-directional Encoder of the transducer, which is structurally an encoding part of the transducer tool. The training of the BERT model framework may include two stages, a model pre-training stage in which the model may be trained unsupervised using a large amount of data, and a model fine-tuning (fine-tune) stage in which the model is fine-tuned for a particular task to achieve a good effect.
In some embodiments of the present application, optionally, after inputting the first knowledge-graph into the first knowledge representation model, for a first node in the first knowledge-graph, the first knowledge representation model calculates a word vector (unbedding) of the first node and word vectors of one or more neighboring nodes of the first node, and splices the calculated word vectors to obtain a labeled word vector (token unbedding) of the first node. By using the mode to process each node in the knowledge graph, the marking word vector of each node can be obtained and used for calculation of the subsequent step.
In some embodiments of the present application, optionally, the distance between the first node and the neighboring node is a number of edges between the first node and one or more neighboring nodes of the first node, and the position word vector (position embedding) of the first node is the same as the dimension of the marker word vector of the first node, and each dimension corresponds to the number of edges. By using the mode to process each node in the knowledge graph, the position word vector of each node can be obtained and used for calculation in the subsequent step.
In some embodiments of the present application, optionally, the information aggregation process includes learning semantic information and graph structure relationships of a plurality of nodes of the first knowledge-graph through an Attention Mask (Attention Mask) tool of the second BERT model, and obtaining side relationship information between the nodes in the first knowledge-graph. Information aggregation can be realized by using the BERT model as an aggregation function, and side relation information among nodes can be obtained.
In some embodiments of the present application, optionally, after obtaining the side relationship information between the plurality of nodes of the first knowledge-graph and the respective neighboring nodes, the method further includes: and inputting the side relation information into an activation function to calculate the confidence coefficient of each side relation, and reserving the side relation with the confidence coefficient greater than or equal to a threshold value. The side relation with low confidence coefficient can be omitted, the quality of the side relation information can be improved, and the accuracy of knowledge reasoning can be improved.
In some embodiments of the present application, optionally, the first knowledge-graph comprises a medical knowledge-graph; the structured data comprises different types of entities in the medical field and attribute data associated with each entity; unstructured data includes long text description data of the medical field; the corpus data set of the target knowledge field comprises Chinese medical corpus long text. According to the embodiment of the application, the existing corpus data in the medical field are utilized, required knowledge in the medical field can be obtained through the structured data and unstructured data mining technology, and the data obtaining cost is reduced.
In some embodiments of the present application, optionally, the first BERT model is a BERT model to be trained, and the second BERT model is a pre-trained BERT model. The first BERT model and the second BERT model are not the same model, and the corresponding steps can be respectively finished.
By utilizing the at least one embodiment of the application, the graph neural network can be constructed based on entity semantics and incomplete knowledge base structure information, the side relation information of the knowledge base is supplemented, and the accuracy of side relation prediction is improved.
The foregoing describes various implementations of embodiments of the present application, at least one of which may be applied in various knowledge domains, such as news, architecture, medical, military, etc. The processing procedure of the embodiments of the present application will be described below by way of specific examples, taking the "medical field" as an example. Applications in other knowledge domains may employ data in corresponding domains, with specific processing and procedures being similar.
Fig. 2 schematically shows a schematic diagram of a medical knowledge graph in the medical field, and in order to implement the side relationship prediction method based on the medical knowledge graph according to the embodiment of the present application, the following operation steps may be performed.
Firstly, constructing a medical knowledge graph (or called medical knowledge graph)
For knowledge reasoning application, domain knowledge graphs need to be constructed. The embodiment constructs a required medical field knowledge graph based on the structured data and the unstructured data.
(1) Structured data and unstructured data are acquired.
The structured data may be captured from, for example, an authoritative medical drape site, processed, and incorporated into a map after the necessary data management.
Unstructured data may be obtained from, for example, medical authoritative books, where medical knowledge may be mined using machine learning techniques such as entity identification, side-relationship mining, and the like.
(2) And constructing a medical knowledge graph based on the obtained structured data and unstructured data.
Referring to fig. 2, the constructed knowledge graph may include different types of entities and related attributes of each entity, the entities may include entities such as diseases, symptoms, examinations, procedures, signs, and the like, wherein some of the entity attributes may include a structured description and an unstructured description, such as "the main" symptom of a disease "including both structured symptom entities and unstructured long text descriptions, which may be stored in two attribute fields, respectively.
(II) generating a medical knowledge representation model
In this embodiment, the BERT model may be trained by using a chinese medical corpus data set, the BERT model framework to be trained inputs a chinese medical corpus long text, unsupervised training learning is performed, the produced model may learn related information about semantics and entities in the medical field, which may be referred to as a medical knowledge representation model, and the output of the model is a word vector of the medical text.
For example, inputting a plurality of semantic close or frequently co-occurring medical terms into a trained medical knowledge representation model results in a higher similarity of word vectors, while inputting semantic non-close terms results in a lower similarity of word vectors, such as: the word vectors corresponding to "cold" and "cold" (or "upper respiratory tract infection") are relatively close, while the word vectors corresponding to "cold" and "leg pain" are less similar.
(III) acquiring edge relation information among nodes
Fig. 3 schematically illustrates a logic diagram of a process of acquiring inter-node edge relationship information according to an embodiment of the present application. Firstly, calculating word vectors for node and neighbor node information in a medical knowledge graph by using the medical knowledge representation model, and splicing.
For example, the "cold" is a node of a disease, and its attribute nodes may include a node of occurrence site "nose" and a node of symptom "nasal obstruction", and word vectors may be calculated for the above 3 node information, and then the word vectors of the 3 nodes are spliced together, for example, as A, B, C, and after the splicing, for example, "a (separator) B (separator) C (separator)", as a marker word vector of "cold" is obtained.
Wherein, the cold node is a central node (or called a core node), and the nose node and the nose plug node are neighbor nodes (or called adjacent nodes) of the cold. The number of the nodes adjacent to the specific splicing can be determined according to the number of first-order nodes around the central node, wherein the first-order nodes refer to nodes with edges directly connected, and the nodes indirectly connected are not included. It should be noted that each node in the graph may be regarded as a central node, and its neighboring nodes are neighboring nodes corresponding to the central node.
Then, a position word vector representation is obtained according to the distance between the nodes and the neighbor nodes, wherein the distance between the nodes can be represented by the number of interval edges between the nodes.
Specifically, the position word vector is consistent with the aforementioned label word vector in dimension, and the number of the interval edges is recorded in different dimension positions, for example, "ABC" described above, wherein a is a core node, B, C is an adjacent node, B is separated from a by 1 edge, C is separated from a by 2 edges, and the dimension of the label word vector is 3, where:
the position word vector of A is [0, 0],
the position word vector of B is [0,1,0],
the position word vector of C is [0, 2].
Then, the marker word vector and the position word vector of the node are transmitted into a pre-trained BERT model to be subjected to information aggregation (or information aggregation), so that the correlation between the center node and the neighbor nodes, namely the side relationship between the nodes, such as whether the node A and the node B have a synonym relationship, whether the node B is a symptom of the A, and the like, can be captured.
The information aggregation processing is specifically to learn semantic information and graph structure relations of a plurality of nodes of the map through an attention covering tool of the BERT model, obtain side relation information among the nodes in the map, and can realize side relation modeling among the nodes of the map.
And finally, transmitting the output result into an activation function such as a sigmoid function to calculate the side relation confidence coefficient among the nodes, wherein the confidence coefficient is greater than or equal to a threshold value, and the side relation is considered to exist.
For example, assuming that a central node is a, a node of an edge relationship to be predicted is X, a neighbor node of a is B, C, then A, B, C, X nodes are transmitted into a knowledge representation model to calculate a marker word vector and a position word vector, the marker word vector and the position word vector are spliced and then transmitted into a BERT model to perform information aggregation calculation, an output result is transmitted into a sigmoid function to calculate edge relationship confidence degrees of the nodes a and X, and if the confidence degrees are greater than or equal to a threshold value, the node a and the node X are considered to have the edge relationship.
It can be seen that, in the embodiment of the application, unstructured long text with attribute knowledge description is added when a knowledge graph is constructed, so that information loss caused during graph construction can be reduced, semantic features of the unstructured long text attribute information can be fully utilized in a modeling stage, graph structure information modeling of the knowledge graph is combined, semantic and structural relations between self nodes and neighbor nodes are modeled by using BERT as an aggregation function, side relation information can be supplemented, accuracy of side relation prediction is improved, and accuracy of knowledge reasoning can be improved.
The specific arrangements and implementations of the embodiments of the present application have been described above from a variety of angles by way of various embodiments. Corresponding to the processing method of at least one embodiment, an embodiment of the present application further provides a knowledge-graph-based side relationship prediction apparatus 100, referring to fig. 4, which includes:
the map acquisition module 110 is configured to acquire a first knowledge map, where the first knowledge map is constructed based on structured data and unstructured data in the target knowledge domain;
the model obtaining module 120 is configured to obtain a first knowledge representation model, where the first knowledge representation model is generated by training a first BERT model through a corpus data set of the target knowledge domain;
the tagged word vector obtaining processing module 130 is configured to input the first knowledge graph into the first knowledge representation model, and obtain tagged word vectors of a plurality of nodes in the output first knowledge graph;
the position word vector determining module 140 is configured to determine position word vectors of the nodes according to distances between the plurality of nodes in the first knowledge graph and respective neighboring nodes;
the side relationship information obtaining module 150 is configured to input the marker word vectors and the position word vectors of the plurality of nodes of the first knowledge-graph into the second BERT model for information aggregation processing, so as to obtain side relationship information between the plurality of nodes of the first knowledge-graph and respective neighboring nodes.
Optionally, for a first node in the first knowledge graph, the first knowledge representation model is used for calculating word vectors of the first node and word vectors of one or more neighboring nodes of the first node, and splicing the calculated word vectors to obtain a labeled word vector of the first node.
Optionally, the distance between the first node and the neighboring node is the number of edges between the first node and one or more neighboring nodes of the first node, and the position word vector of the first node is the same as the dimension of the marker word vector of the first node, and each dimension corresponds to the number of edges.
Optionally, the second BERT model is used for learning semantic information and graph structure relations of a plurality of nodes of the first knowledge graph through the attention covering tool to obtain side relation information among the nodes in the first knowledge graph.
Optionally, the side relationship prediction apparatus 100 further includes: and the confidence coefficient processing module is used for inputting the side relation information into the activation function to calculate the confidence coefficient of each side relation, and reserving the side relation with the confidence coefficient larger than or equal to the threshold value.
The functions of each module in each apparatus of the embodiments of the present application may refer to the processing correspondingly described in the foregoing method embodiments, which is not described herein again.
According to embodiments of the present application, there is also provided an electronic device, a readable storage medium and a computer program product. As shown in fig. 5, a block diagram of an electronic device according to a knowledge-graph-based side relationship prediction method according to an embodiment of the present application is shown. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular telephones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be exemplary only, and are not meant to limit implementations of the application described and/or claimed herein.
As shown in fig. 5, the electronic device includes: one or more processors 1001, memory 1002, and interfaces for connecting the components, including a high-speed interface and a low-speed interface. The various components are interconnected using different buses and may be mounted on a common motherboard or in other manners as desired. The processor may process instructions executing within the electronic device, including instructions stored in or on memory to display graphical information of a graphical user interface (Graphical User Interface, GUI) on an external input/output device, such as a display device coupled to the interface. In other embodiments, multiple processors and/or multiple buses may be used, if desired, along with multiple memories and multiple memories. Also, multiple electronic devices may be connected, each providing a portion of the necessary operations (e.g., as a server array, a set of blade servers, or a multiprocessor system). One processor 1001 is illustrated in fig. 5.
Memory 1002 is a non-transitory computer-readable storage medium provided herein. The memory stores instructions executable by the at least one processor to cause the at least one processor to perform the knowledge-graph-based side relationship prediction methods provided herein. The non-transitory computer readable storage medium of the present application stores computer instructions for causing a computer to perform the knowledge-graph-based side relationship prediction method provided by the present application. The computer program product of the present application comprises computer instructions which, when executed by a processor, provide a knowledge-graph based side relationship prediction method.
The memory 1002 is used as a non-transitory computer readable storage medium, and may be used to store non-transitory software programs, non-transitory computer-executable programs, and modules, such as program instructions/modules (e.g., the graph acquisition module 110, the model acquisition module 120, the tag word vector acquisition module 130, the location word vector determination module 140, and the side relationship information acquisition module 150 shown in fig. 4) corresponding to the knowledge-graph-based side relationship prediction method in the embodiments of the present application. The processor 1001 executes various functional applications of the server and data processing by executing non-transitory software programs, instructions, and modules stored in the memory 1002, that is, implements the knowledge-graph-based side relationship prediction method in the above-described method embodiment.
Memory 1002 may include a storage program area that may store an operating system, at least one application program required for functionality, and a storage data area; the storage data area may store data created from the analysis of search results, the use of processing electronics, and the like. In addition, the memory 1002 may include high-speed random access memory, and may also include non-transitory memory, such as at least one magnetic disk storage device, flash memory device, or other non-transitory solid-state storage device. In some embodiments, memory 1002 optionally includes memory remotely located relative to processor 1001, which may be connected to analysis processing electronics of the search results via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The electronic device corresponding to the side relationship prediction method based on the knowledge graph in the embodiment of the application may further include: an input device 1003 and an output device 1004. The processor 1001, the memory 1002, the input device 1003, and the output device 1004 may be connected by a bus or other means, which is exemplified in the embodiment of fig. 5 of the present application.
The input device 1003 may receive input numeric or character information and generate key signal inputs related to user settings and function control of the search result analysis processing electronics, such as a touch screen, keypad, mouse, trackpad, touch pad, pointer stick, one or more mouse buttons, track ball, joystick, etc. input devices. The output means 1004 may include a display device, auxiliary lighting means (e.g., LEDs), tactile feedback means (e.g., vibration motors), and the like. The display device may include, but is not limited to, a liquid crystal display (Liquid Crystal Display, LCD), a light emitting diode (Light Emitting Diode, LED) display, and a plasma display. In some implementations, the display device may be a touch screen.
Various implementations of the systems and techniques described here can be implemented in digital electronic circuitry, integrated circuitry, application specific integrated circuits (Application Specific Integrated Circuits, ASIC), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs, the one or more computer programs may be executed and/or interpreted on a programmable system including at least one programmable processor, which may be a special purpose or general-purpose programmable processor, that may receive data and instructions from, and transmit data and instructions to, a storage system, at least one input device, and at least one output device.
These computing programs (also referred to as programs, software applications, or code) include machine instructions for a programmable processor, and may be implemented in a high-level procedural and/or object-oriented programming language, and/or in assembly/machine language. As used herein, the terms "machine-readable medium" and "computer-readable medium" refer to any computer program product, apparatus, and/or device (e.g., magnetic discs, optical disks, memory, programmable logic devices (programmable logic device, PLDs)) used to provide machine instructions and/or data to a programmable processor, including a machine-readable medium that receives machine instructions as a machine-readable signal. The term "machine-readable signal" refers to any signal used to provide machine instructions and/or data to a programmable processor.
To provide for interaction with a user, the systems and techniques described here can be implemented on a computer having: a display device (e.g., CRT (Cathode Ray Tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and pointing device (e.g., a mouse or trackball) by which a user can provide input to the computer. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic input, speech input, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a background component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such background, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local area network (Local Area Network, LAN), wide area network (Wide Area Network, WAN) and the internet.
The computer system may include a client and a server. The client and server are typically remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other.
It should be appreciated that various forms of the flows shown above may be used to reorder, add, or delete steps. For example, the steps described in the present application may be performed in parallel, sequentially, or in a different order, provided that the desired results of the technical solutions disclosed in the present application can be achieved, and are not limited herein.
The above embodiments do not limit the scope of the application. It will be apparent to those skilled in the art that various modifications, combinations, sub-combinations and alternatives are possible, depending on design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present application are intended to be included within the scope of the present application.
Claims (14)
1. A side relation prediction method based on a knowledge graph comprises the following steps:
acquiring a first knowledge graph, wherein the first knowledge graph is constructed based on structured data and unstructured data of a target knowledge domain, and the first knowledge graph at least comprises: medical knowledge-graph, the structured data comprising at least: different types of entities in the medical field and attribute data associated with each entity, the unstructured data comprising at least: long text description data of the medical field;
acquiring a first knowledge representation model, wherein the first knowledge representation model is generated by training a first BERT model through a corpus data set of the target knowledge field, and the corpus data set of the target knowledge field comprises a Chinese medical corpus long text;
inputting the first knowledge graph into the first knowledge representation model to obtain the output labeled word vectors of a plurality of nodes in the first knowledge graph;
according to the distances between a plurality of nodes in the first knowledge graph and respective neighbor nodes, position word vectors of the nodes are respectively determined;
and inputting the marker word vectors and the position word vectors of the plurality of nodes of the first knowledge graph into a second BERT model for information aggregation processing to obtain the edge relation information between the plurality of nodes of the first knowledge graph and the respective neighbor nodes.
2. The method of claim 1, wherein after the first knowledge-graph is input into the first knowledge-representation model, the first knowledge-representation model calculates word vectors of the first node and word vectors of one or more neighboring nodes of the first node for a first node in the first knowledge-graph, and concatenates the calculated word vectors to obtain a labeled word vector of the first node.
3. The method of claim 2, wherein the distance between the first node and a neighboring node is a number of edges between the first node and one or more neighboring nodes of the first node, a position word vector of the first node is the same as a dimension of a marker word vector of the first node, and each dimension corresponds to the number of edges.
4. The method of claim 1, wherein the information aggregation process comprises: and learning semantic information and graph structure relations of a plurality of nodes of the first knowledge graph through an attention covering tool of the second BERT model, and obtaining side relation information among the nodes in the first knowledge graph.
5. The method of claim 1, after obtaining side relationship information between a plurality of nodes of the first knowledge-graph and respective neighboring nodes, the method further comprising:
inputting the side relation information into an activation function to calculate the confidence coefficient of each side relation, and reserving the side relation with the confidence coefficient being greater than or equal to a threshold value.
6. The method according to any one of claims 1-5, wherein,
the first BERT model is a BERT model to be trained, and the second BERT model is a pre-trained BERT model.
7. A knowledge-graph-based side relationship prediction apparatus, comprising:
the map acquisition module is used for acquiring a first knowledge map, the first knowledge map is constructed based on structured data and unstructured data of the target knowledge field, and the first knowledge map at least comprises: medical knowledge-graph, the structured data comprising at least: different types of entities in the medical field and attribute data associated with each entity, the unstructured data comprising at least: long text description data of the medical field;
the model acquisition module is used for acquiring a first knowledge representation model, wherein the first knowledge representation model is generated by training a first BERT model through a corpus data set of the target knowledge field, and the corpus data set of the target knowledge field comprises a Chinese medical corpus long text;
the labeled word vector acquisition module is used for inputting the first knowledge graph into the first knowledge representation model to obtain labeled word vectors of a plurality of nodes in the output first knowledge graph;
the position word vector determining module is used for determining position word vectors of the nodes according to the distances between the nodes in the first knowledge graph and the neighboring nodes;
and the side relation information acquisition module is used for inputting the marker word vectors and the position word vectors of the plurality of nodes of the first knowledge graph into a second BERT model to perform information aggregation processing, so as to obtain side relation information between the plurality of nodes of the first knowledge graph and the respective neighbor nodes.
8. The apparatus of claim 7, wherein, for a first node in the first knowledge-graph, the first knowledge representation model is configured to calculate a word vector of the first node and word vectors of one or more neighboring nodes of the first node, and splice the calculated word vectors to obtain a labeled word vector of the first node.
9. The apparatus of claim 8, wherein a distance between the first node and a neighboring node is a number of edges between the first node and one or more neighboring nodes of the first node, a position word vector of the first node is the same as a dimension of a marker word vector of the first node, each dimension corresponding to the number of edges.
10. The apparatus of claim 7, wherein the second BERT model is configured to learn semantic information and graph structure relationships of a plurality of nodes of the first knowledge-graph through an attention masking tool to obtain side relationship information between the nodes in the first knowledge-graph.
11. The apparatus of claim 7, further comprising:
and the confidence coefficient processing module is used for inputting the side relation information into an activation function to calculate the confidence coefficient of each side relation, and reserving the side relation with the confidence coefficient larger than or equal to a threshold value.
12. The device according to any one of claims 7-11, wherein,
the first BERT model is a BERT model to be trained, and the second BERT model is a pre-trained BERT model.
13. An electronic device, comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-6.
14. A non-transitory computer readable storage medium storing computer instructions for causing a computer to perform the method of any one of claims 1-6.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011406864.5A CN112528037B (en) | 2020-12-04 | 2020-12-04 | Side relation prediction method, device, equipment and storage medium based on knowledge graph |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011406864.5A CN112528037B (en) | 2020-12-04 | 2020-12-04 | Side relation prediction method, device, equipment and storage medium based on knowledge graph |
Publications (2)
Publication Number | Publication Date |
---|---|
CN112528037A CN112528037A (en) | 2021-03-19 |
CN112528037B true CN112528037B (en) | 2024-04-09 |
Family
ID=74998486
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202011406864.5A Active CN112528037B (en) | 2020-12-04 | 2020-12-04 | Side relation prediction method, device, equipment and storage medium based on knowledge graph |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN112528037B (en) |
Families Citing this family (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113139483B (en) * | 2021-04-28 | 2023-09-29 | 北京百度网讯科技有限公司 | Human behavior recognition method, device, apparatus, storage medium, and program product |
CN113204961B (en) * | 2021-05-31 | 2023-12-19 | 平安科技(深圳)有限公司 | Language model construction method, device, equipment and medium for NLP task |
CN113628726B (en) * | 2021-08-10 | 2023-12-26 | 海南榕树家信息科技有限公司 | Traditional Chinese medicine diagnosis and treatment recommendation system and method based on graph neural network and electronic equipment |
CN114168799B (en) * | 2021-11-26 | 2024-06-11 | 四川云从天府人工智能科技有限公司 | Method, device and medium for acquiring characteristics of node adjacency in graph data structure |
CN114490884B (en) * | 2021-12-21 | 2023-06-06 | 北京三快在线科技有限公司 | Method, device, electronic equipment and storage medium for determining entity association relation |
CN114880551B (en) * | 2022-04-12 | 2023-05-02 | 北京三快在线科技有限公司 | Method and device for acquiring upper and lower relationship, electronic equipment and storage medium |
CN116150392A (en) * | 2022-12-12 | 2023-05-23 | 首都师范大学 | Threat information knowledge graph processing method, threat information knowledge graph processing device, threat information knowledge graph processing equipment and storage medium |
CN116523039B (en) * | 2023-04-26 | 2024-02-09 | 华院计算技术(上海)股份有限公司 | Continuous casting knowledge graph generation method and device, storage medium and terminal |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2017185887A1 (en) * | 2016-04-29 | 2017-11-02 | Boe Technology Group Co., Ltd. | Apparatus and method for analyzing natural language medical text and generating medical knowledge graph representing natural language medical text |
CN110390023A (en) * | 2019-07-02 | 2019-10-29 | 安徽继远软件有限公司 | A kind of knowledge mapping construction method based on improvement BERT model |
DE202020102105U1 (en) * | 2020-04-16 | 2020-04-29 | Robert Bosch Gmbh | Device for the automated generation of a knowledge graph |
CN111475658A (en) * | 2020-06-12 | 2020-07-31 | 北京百度网讯科技有限公司 | Knowledge representation learning method, device, equipment and storage medium |
-
2020
- 2020-12-04 CN CN202011406864.5A patent/CN112528037B/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2017185887A1 (en) * | 2016-04-29 | 2017-11-02 | Boe Technology Group Co., Ltd. | Apparatus and method for analyzing natural language medical text and generating medical knowledge graph representing natural language medical text |
CN110390023A (en) * | 2019-07-02 | 2019-10-29 | 安徽继远软件有限公司 | A kind of knowledge mapping construction method based on improvement BERT model |
DE202020102105U1 (en) * | 2020-04-16 | 2020-04-29 | Robert Bosch Gmbh | Device for the automated generation of a knowledge graph |
CN111475658A (en) * | 2020-06-12 | 2020-07-31 | 北京百度网讯科技有限公司 | Knowledge representation learning method, device, equipment and storage medium |
Non-Patent Citations (2)
Title |
---|
基于LCN的医疗知识问答模型;马满福;刘元喆;李勇;王霞;贾海;史彦斌;张小康;;西南大学学报(自然科学版)(10);全文 * |
基于自然语言处理的临床合理用药知识图谱构建;张小亮;***;王永庆;郭建军;刘云;;中华医学图书情报杂志(09);全文 * |
Also Published As
Publication number | Publication date |
---|---|
CN112528037A (en) | 2021-03-19 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN112528037B (en) | Side relation prediction method, device, equipment and storage medium based on knowledge graph | |
CN112507040B (en) | Training method and device for multivariate relation generation model, electronic equipment and medium | |
US20210407642A1 (en) | Drug recommendation method and device, electronic apparatus, and storage medium | |
CN111681726B (en) | Processing method, device, equipment and medium of electronic medical record data | |
CN112347769B (en) | Entity recognition model generation method and device, electronic equipment and storage medium | |
CN111710412B (en) | Diagnostic result verification method and device and electronic equipment | |
CN111522994B (en) | Method and device for generating information | |
CN112560479B (en) | Abstract extraction model training method, abstract extraction device and electronic equipment | |
CN111985240B (en) | Named entity recognition model training method, named entity recognition method and named entity recognition device | |
CN111967256B (en) | Event relation generation method and device, electronic equipment and storage medium | |
CN112528660B (en) | Method, apparatus, device, storage medium and program product for processing text | |
US12008313B2 (en) | Medical data verification method and electronic device | |
CN113868519B (en) | Information searching method, device, electronic equipment and storage medium | |
EP3629253A1 (en) | Method and apparatus for generating training data for vqa system, and medium | |
CN111966782B (en) | Multi-round dialogue retrieval method and device, storage medium and electronic equipment | |
CN113792115A (en) | Entity correlation determination method and device, electronic equipment and storage medium | |
CN113553411B (en) | Query statement generation method and device, electronic equipment and storage medium | |
CN113590775B (en) | Diagnosis and treatment data processing method and device, electronic equipment and storage medium | |
CN112507705B (en) | Position code generation method and device and electronic equipment | |
CN112329429B (en) | Text similarity learning method, device, equipment and storage medium | |
CN111462894B (en) | Medical conflict detection method and device, electronic equipment and storage medium | |
CN116030235A (en) | Target detection model training method, target detection device and electronic equipment | |
JP2024526395A (en) | How to train an end-to-end sensitive text recall model, How to recall sensitive text | |
CN116127319A (en) | Multi-mode negative sample construction and model pre-training method, device, equipment and medium | |
CN113392220B (en) | Knowledge graph generation method and device, computer equipment and storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |