Method and apparatus for constructing a domain-specific knowledge graph
By receiving and evaluating the correlation between entity words of a specific profession and candidate object words, a knowledge graph is constructed, and a computer model is trained, solving the problem of constructing a professional knowledge graph and realizing efficient and professional knowledge graph generation.
Patent Information
- Application Number
- CN202111342967.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-12
- Publication Date
- 2025-12-05
- Estimated Expiration
- 2041-11-12
AI Technical Summary
Building highly specialized knowledge graphs faces challenges such as insufficient authoritative corpus sources, high expert verification costs, small sample sizes, and limitations in mining techniques, resulting in significant construction difficulties.
By receiving entity words describing a specific profession, generating and evaluating candidate object words associated with them, determining matching word pairs based on the degree of association, constructing a knowledge graph, and optimizing the process by training a computer model.
By efficiently building professional knowledge graphs while reducing labor costs, the professionalism and accuracy of the knowledge graphs have been improved.
Smart Images

Figure CN114090698B_ABST
Abstract
Description
Technical Field
[0001] Embodiments of this disclosure relate to the field of computers, and more specifically to methods and apparatus for constructing knowledge graphs for a particular profession, methods and apparatus for training computer models for constructing knowledge graphs, electronic devices, and computer-readable storage media. Background Technology
[0002] Knowledge graphs, also known as knowledge bases, are used to describe various entities that exist in the real world, the relationships between entities, and the attributes of each entity. Currently, knowledge graphs are widely used in fields such as search, artificial intelligence, and deep learning.
[0003] In many highly specialized fields (such as the medical field), knowledge graphs will play a crucial role in digitization and intelligentization. Therefore, there is a desire to construct high-quality, highly specialized knowledge graphs. Summary of the Invention
[0004] According to exemplary embodiments of this disclosure, a scheme for constructing a professional knowledge graph is provided.
[0005] In a first aspect of this disclosure, a method for constructing a knowledge graph for a specific profession is provided. The method includes: receiving a first word describing an entity within the specific profession; generating multiple word pairs based on the received first word and a plurality of stored second words, wherein the plurality of second words respectively describe multiple candidate objects within the specific profession in a given object type associated with the entity; evaluating the plurality of word pairs according to the degree of association between the entity and the plurality of candidate objects within the specific profession; and determining, based on the evaluation results, a second word matching the first word for use in constructing the knowledge graph.
[0006] In a second aspect of this disclosure, a method for training a computer model for constructing a knowledge graph is provided. The method includes: receiving a first sample dataset, wherein the first sample dataset includes multiple pairs of first words consisting of a first word and a second word, the first word describing an entity of a specific profession, and the second word describing an object of a specific profession that matches the entity in a given object type; receiving a second sample dataset, wherein the second sample dataset includes multiple pairs of second words consisting of a first word and a third word, the third word describing an object of a specific profession that does not match the entity in a given object type; and training a computer model based on the first sample dataset and the second sample dataset.
[0007] In a third aspect of this disclosure, an apparatus for constructing a knowledge graph for a specific profession is provided. The apparatus includes: a receiving module configured to receive a first word describing an entity of the specific profession; a generating module configured to generate multiple word pairs based on the received first word and a plurality of stored second words, wherein the plurality of second words respectively describe multiple candidate objects of the specific profession in a given object type associated with the entity; an evaluation module configured to evaluate the multiple word pairs according to the relevance of the entity and the plurality of candidate objects in the specific profession; and a determining module configured to determine, based on the evaluation results, a second word matching the first word for use in constructing the knowledge graph.
[0008] In a fourth aspect of this disclosure, an apparatus is provided for training a computer model for constructing a knowledge graph. The apparatus includes: a first receiving module configured to receive a first sample dataset, wherein the first sample dataset includes multiple pairs of first words consisting of a first word and a second word, the first word describing an entity of a specific profession, and the second word describing an object of a specific profession that matches the entity in a given object type; a second receiving module configured to receive a second sample dataset, wherein the second sample dataset includes multiple pairs of second words consisting of a first word and a third word, the third word describing an object of a specific profession that does not match the entity in a given object type; and a model training module configured to train a computer model based on the first sample dataset and the second sample dataset.
[0009] In a fifth aspect of this disclosure, an electronic device is provided. The electronic device includes one or more processors; and a storage device for storing one or more programs, which, when executed by the one or more processors, cause the one or more processors to implement the methods according to the first and second aspects of this disclosure.
[0010] In a sixth aspect of this disclosure, a computer-readable storage medium is provided. A computer program is stored on this computer-readable storage medium, which, when executed by a processor, implements the methods according to the first and second aspects of this disclosure.
[0011] In a seventh aspect of this disclosure, a computer program product is provided. The computer program product is stored in a non-transitory computer storage medium and includes machine-executable instructions that, when executed by a device, cause the device to perform the methods according to the first and second aspects of this disclosure.
[0012] It should be understood that the description in the Summary of the Invention is not intended to limit the key or essential features of the embodiments of this disclosure, nor is it intended to restrict the scope of this disclosure. Other features of this disclosure will become readily apparent from the following description. Attached Figure Description
[0013] The above and other features, advantages, and aspects of the embodiments of this disclosure will become more apparent from the accompanying drawings and the following detailed description. In the drawings, the same or similar reference numerals denote the same or similar elements, wherein:
[0014] Figure 1 A schematic diagram is shown illustrating an example environment in which embodiments of the present disclosure can be implemented;
[0015] Figure 2 A flowchart illustrating a method for constructing a knowledge graph for a specific profession according to an embodiment of the present disclosure is shown;
[0016] Figure 3 A flowchart illustrating a method for training a computer model for constructing a knowledge graph according to embodiments of the present disclosure is shown;
[0017] Figure 4 A block diagram of an apparatus for constructing a knowledge graph for a specific profession, according to an embodiment of the present disclosure, is shown.
[0018] Figure 5 A block diagram of an apparatus for training a computer model for constructing a knowledge graph according to embodiments of the present disclosure is shown; and
[0019] Figure 6 A block diagram of a computing device that can implement embodiments of the present disclosure is shown. Detailed Implementation
[0020] Embodiments of this disclosure will now be described in more detail with reference to the accompanying drawings. While some embodiments of this disclosure are shown in the drawings, it should be understood that this disclosure can be implemented in various forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided to provide a more thorough and complete understanding of this disclosure. It should be understood that the accompanying drawings and embodiments of this disclosure are for illustrative purposes only and are not intended to limit the scope of protection of this disclosure.
[0021] In the description of embodiments of this disclosure, the term "comprising" and similar terms should be understood as open-ended inclusion, i.e., "including but not limited to". The term "based on" should be understood as "at least partially based on". The term "one embodiment" or "the embodiment" should be understood as "at least one embodiment". The terms "first", "second", etc., may refer to different or the same objects. Other explicit and implicit definitions may also be included below.
[0022] Knowledge graphs are essentially a structured representation of knowledge, which can contain entities within various domains, relationships (or attributes) associated with those entities, and objects (or attribute values) that have the aforementioned relationships with those entities. An "entity" can refer, for example, to a technical term in a specific professional field, typically describing a concept with specialized meaning. An "object" can refer, for example, to an object that is associated with an entity within a specific professional field.
[0023] Taking the medical field as an example, an "entity" can be a disease name, a body organ, etc., while an "object" can be the type or system to which a disease belongs, the part or system to which an organ belongs, etc. For example, in the knowledge entry "The disease system of the common cold is the respiratory system" in the subject-verb-object (SPO) form, it includes the subject "common cold" which describes the entity, the predicate "disease system" which describes the relationship, and the object "respiratory system" which describes the object.
[0024] Currently, the demand for specialized knowledge graphs is increasing. Compared with building general knowledge graphs, the main differences in building specialized knowledge graphs are: 1) Reliable sources of specialized corpora need to be more authoritative, and the carriers of this authoritative knowledge are mostly unstructured; 2) The process of expert verification is costly, the sample size is generally small, and the requirements for extraction techniques are higher; 3) Specialized fields are relatively closed, and the use of more mining techniques and methods is limited in the knowledge construction process, making it more difficult to build a more complete specialized knowledge graph.
[0025] When constructing a specialized medical knowledge graph, existing solutions require a large number of structured knowledge entries. In a medical example, an ideal SPO knowledge entry would be something like "the disease system of the common cold is the respiratory system," as mentioned above. However, such directly related statements are difficult to find in various professional books.
[0026] To address the significant demand for structured data in traditional methods, this disclosure proposes a technical solution for constructing knowledge graphs for specific professions. This solution can determine object terms associated with entity terms describing a specific profession within a given object type, thereby establishing relationships between entity terms and object terms for constructing a professional knowledge graph. Thus, embodiments of this disclosure can efficiently construct professional knowledge graphs while effectively reducing labor costs.
[0027] The embodiments of this disclosure will now be described in detail with reference to the accompanying drawings. It should be understood that, although for ease of illustration, the various embodiments of this disclosure are primarily described using the medical field as an example, those skilled in the art should understand that the various embodiments of this disclosure are equally applicable to other professional fields. Other fields may include, for example, transportation, food, specific disciplines, etc., and are not limited thereto.
[0028] Figure 1 A schematic diagram of an example environment 100 that can be implemented according to embodiments of the present disclosure is shown. The example environment 100 includes input text 110, a computing device 120, and a knowledge graph 130.
[0029] The computing device 120 can receive input text 110 from multiple data sources. The input text 110 may include, for example, technical terms 112 in the form of words. Taking the medical field as an example, technical terms 112 may include, for example, disease names such as "cold-type common cold," "myocardial infarction," and "gallstones."
[0030] like Figure 1 As shown, computing device 120 includes database 122, which stores professional knowledge 124. "Professional knowledge" can, for example, include a set of candidate object words that have a potential relationship with professional terms in a specific profession. Continuing with the medical field as an example, when the potential relationship is "belonging to a system," candidate object words could be, for example, "respiratory system," "digestive system," or "cardiovascular system." In this case, it can also be said that "respiratory system," "digestive system," and "cardiovascular system" are candidate object words whose object type is "belonging to a system."
[0031] The computing device 120 also includes a graph construction model 126. The graph construction model 126 is trained using a large number of training samples 128. For example, a specialized graph construction model can be trained based on a general graph construction model using a large number of training samples specific to a particular field. The specific training method will be described in detail below.
[0032] The graph construction model 126 evaluates word pairs composed of the input professional term 112 and multiple candidate words in the database 122 to determine candidate words that match the professional term 112. For example, when the input professional term 112 is "cold-type common cold" and the candidate words are "respiratory system," "digestive system," and "cardiovascular system," three word pairs are formed: "cold-type common cold; respiratory system," "cold-type common cold; digestive system," and "cold-type common cold, cardiovascular system." The graph construction model 126 evaluates these three word pairs and ultimately determines that "cold-type common cold" and "respiratory system" have a higher correlation in their respective systems.
[0033] The computing device 120 ultimately generates a knowledge graph 130 in the form of SPO based on the evaluation results of the graph construction model 126, including professional entities 132, professional relationships 134, and professional objects 136. For example, based on the above example, a knowledge graph in the form of SPO such as "cold-type common cold" (professional entity), "belonging system" (professional relationship), and "respiratory system" (professional object) is constructed.
[0034] Figure 2 A flowchart of a method 200 for constructing a knowledge graph for a specific profession, according to an embodiment of the present disclosure, is shown. Method 200 can be... Figure 1 The computing device 120 in the middle is implemented.
[0035] In box 210, computing device 120 receives a first word describing an entity of a specific profession. For example, the word "cold-type common cold" describes the entity "cold-type common cold" in the "medical profession".
[0036] In box 220, computing device 120 generates multiple word pairs based on the received first word and multiple stored second words, wherein the multiple second words describe multiple candidate objects of a specific profession within a given object type associated with the entity. For example, when the given object type is "belonging to a system," the candidate object words could be "respiratory system," "digestive system," "cardiovascular system," etc. As another example, when the given object type is "belonging to a type," the candidate object words could be "viral type," "bacterial type," "infectious type," etc. Yet another example, when the given object type is "belonging to a part," the candidate object words could be "chest," "head," "pharynx," etc.
[0037] In box 230, computing device 120 evaluates multiple word pairs based on the relevance of entities and multiple candidate objects in a specific field.
[0038] In some embodiments, the computing device 120 determines the score of the corresponding word pair based on the relevance of the entity to each candidate object in a particular profession, and evaluates the word pair based on the determined score.
[0039] For example, in the three word pairs “cold-type common cold; respiratory system”, “cold-type common cold; digestive system”, and “cold-type common cold; cardiovascular system”, the computing device 120 determines the score of each of the three word pairs based on the degree of association between the two words in the word pair, according to the professional knowledge 124 in the database 122.
[0040] In some embodiments, the computing device 120 first converts the first word and the second word contained in the word pair into a first vector representation and a second vector representation, then concatenates the first vector representation and the second vector representation, and finally determines the score of the word pair based on a similarity comparison. The score range is, for example, between 0 and 1.
[0041] In some embodiments, the computing device 120 determines the second word in the word pair with the highest score as the matching second word.
[0042] In some embodiments, the computing device 120 determines the second word in a word pair that has a score exceeding a predetermined threshold as the matching second word. The threshold score is, for example, 0.5.
[0043] In box 240, computing device 120, based on the evaluation results, determines a second word that matches the first word for use in constructing a knowledge graph. In this paper, "constructing a knowledge graph" refers, for example, establishing a connection between the first and second words. This connection could be, for example, a mapping relationship between data.
[0044] In the above example, it was ultimately determined that within the "medical profession," the term representing the object that matches the term "cold-type common cold" in the given type "system" is "respiratory system." This establishes the association between the first term "cold-type common cold" and the second term "respiratory system" within the specific "medical profession."
[0045] Figure 3 A flowchart of a method 300 for training a computer model for constructing a knowledge graph according to an embodiment of the present disclosure is shown. Method 300 can be... Figure 1 The computing device 120 in the middle is implemented.
[0046] At box 310, computing device 120 receives a first sample dataset, wherein the first sample dataset includes multiple first word pairs consisting of a first word and a second word, the first word describing an entity of a specific profession, and the second word describing an object of a specific profession that matches the entity in a given object type.
[0047] At box 320, computing device 120 receives a second sample dataset, wherein the second sample dataset includes multiple pairs of second words consisting of a first word and a third word, the third word describing a specific specialty object that does not match an entity in a given object type.
[0048] Continuing with the medical profession as an example, if the first word describing the entity is "cold," the second word could be, for example, "respiratory system disease." In this case, the phrase "cold; respiratory system disease" forms a positive sample for training the model. Simultaneously, the third word could be, for example, "digestive system disease," "cardiovascular disease," or "immune system disease." In this case, the phrase "cold; digestive system disease," "cold; cardiovascular disease," or "cold; immune system disease" forms a negative sample for training the model.
[0049] At box 330, computing device 120 trains a computer model based on the first and second sample datasets. In this way, the model can be trained for a specific field, thereby obtaining a model for constructing a knowledge graph.
[0050] There are several ways to train a model. For example, you can first input all word pairs from a first sample dataset as positive samples, and then input all word pairs from a second sample dataset as negative samples. Of course, you can also change the input order of the samples, for example, by alternately inputting some positive samples and some negative samples.
[0051] Training a model can involve retraining an untrained model or optimizing a trained general-domain model for a specific field. Here, "general-domain model" refers to a model that is not trained for a specific professional field.
[0052] In some embodiments, the ratio of the first word pair in the first sample dataset to the second word pair in the second sample dataset is 1:3. In other words, the ratio of the number of positive samples to the number of negative samples is 1:3.
[0053] In some embodiments, the computer model includes: an encoding layer configured to convert a first word and a second word in a first word pair into two vector representations, or to convert a first word and a third word in a second word pair into two vector representations; a matching layer configured to connect the two vector representations to form a similarity comparator; and an output layer configured to output a similarity score based on the result of the matching layer.
[0054] Figure 4 A block diagram of an apparatus 400 for constructing a knowledge graph for a specific profession, according to an embodiment of the present disclosure, is shown. The apparatus 400 may be included in... Figure 1 The computing device 120 or is implemented as the computing device 120.
[0055] like Figure 4As shown, the apparatus 400 includes a receiving module 410 configured to receive a first word describing an entity of a specific profession. The apparatus 400 also includes a generation module 420 configured to generate multiple word pairs based on the received first word and a plurality of stored second words, wherein the plurality of second words respectively describe multiple candidate objects of a specific profession in a given object type associated with the entity. The apparatus 400 further includes an evaluation module 430 configured to evaluate the plurality of word pairs based on the relevance of the entity and the plurality of candidate objects in the specific profession. The apparatus 400 also includes a determination module 440 configured to determine, based on the evaluation results, a second word matching the first word for use in constructing a knowledge graph.
[0056] In some embodiments, the evaluation module 430 may also be configured to: determine the score of the corresponding word pair based on the relevance of the entity to each candidate object in the specific profession; and evaluate the word pair based on the determined score.
[0057] In some embodiments, the evaluation module 430 may also be configured to: convert the first word and the second word contained in the word pair into a first vector representation and a second vector representation; connect the first vector representation and the second vector representation; and determine the score of the word pair based on a similarity comparison.
[0058] In some embodiments, the determining module 440 may also be configured to determine the second word in the word pair with the highest score as the matching second word.
[0059] In some embodiments, the determining module 440 may also be configured to determine the second word in a word pair that has a score exceeding a predetermined threshold as the matching second word.
[0060] In some embodiments, the evaluation module 430 may also be configured to evaluate multiple word pairs using a preset computer model.
[0061] In some embodiments, where the specific specialty involves the medical specialty, the entity includes the name of the disease, and the given object type includes the type, the part, and the system.
[0062] Figure 5 A block diagram of an apparatus 500 for training a computer model for constructing a knowledge graph according to an embodiment of the present disclosure is shown. The apparatus 500 may be included in... Figure 1 The computing device 120 or is implemented as the computing device 120.
[0063] like Figure 5As shown, the device 500 includes a first receiving module 510 configured to receive a first sample dataset, wherein the first sample dataset includes multiple first word pairs consisting of a first word and a second word, where the first word describes an entity of a specific profession, and the second word describes an object of a specific profession that matches the entity in a given object type. The device 500 also includes a second receiving module 520 configured to receive a second sample dataset, wherein the second sample dataset includes multiple second word pairs consisting of the first word and a third word, where the third word describes an object of a specific profession that does not match the entity in a given object type. The device 500 also includes a model training module 530 configured to train a computer model based on the first and second sample datasets.
[0064] In some embodiments, the ratio of the first word pair in the first sample dataset to the second word pair in the second sample dataset is 1:3.
[0065] In some embodiments, the computer model includes: an encoding layer configured to convert a first word and a second word in a first word pair into two vector representations, or to convert a first word and a third word in a second word pair into two vector representations; a matching layer configured to connect the two vector representations to form a similarity comparator; and an output layer configured to output a similarity score based on the result of the matching layer.
[0066] It should be understood that although the above description mainly uses the medical profession as an example, the embodiments of this application are not limited to this and can also be applied to other professional fields.
[0067] Figure 6 A schematic block diagram of an example device 600 that can be used to implement embodiments of the present disclosure is shown. Device 600 can be used to implement... Figure 1 The computing device 120. As shown, the device 600 includes a computing unit 610, which can perform various appropriate actions and processes according to computer program instructions stored in read-only memory (ROM) 620 or loaded from storage unit 680 into random access memory (RAM) 630. The RAM 630 may also store various programs and data required for the operation of the device 600. The computing unit 610, ROM 620, and RAM 630 are interconnected via a bus 640. An input / output (I / O) interface 650 is also connected to the bus 640.
[0068] Multiple components in device 600 are connected to I / O interface 650, including: input unit 660, such as keyboard, mouse, etc.; output unit 670, such as various types of monitors, speakers, etc.; storage unit 680, such as disk, optical disk, etc.; and communication unit 690, such as network card, modem, wireless transceiver, etc. Communication unit 690 allows device 600 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.
[0069] The computing unit 610 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the computing unit 610 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 610 performs the various methods and processes described above, such as method 200. For example, in some embodiments, method 200 may be implemented as a computer software program tangibly contained in a machine-readable medium, such as storage unit 680. In some embodiments, part or all of the computer program may be loaded and / or installed on device 600 via ROM 620 and / or communication unit 690. When the computer program is loaded into RAM 630 and executed by the computing unit 610, one or more steps of method 200 described above may be performed. Alternatively, in other embodiments, the computing unit 610 may be configured to perform method 200 by any other suitable means (e.g., by means of firmware).
[0070] The functions described above in this document can be performed at least in part by one or more hardware logic components. For example, exemplary types of hardware logic components that can be used, without limitation, include: field programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), complex programmable logic devices (CPLDs), and so on.
[0071] The program code used to implement the methods of this disclosure may be written in any combination of one or more programming languages. This program code may be provided to a processor or controller of a general-purpose computer, special-purpose computer, or other programmable data processing apparatus, such that when executed by the processor or controller, the program code causes the functions / operations specified in the flowcharts and / or block diagrams to be implemented. The program code may be executed entirely on a machine, partially on a machine, as a standalone software package partially on a machine and partially on a remote machine, or entirely on a remote machine or server.
[0072] In the context of this disclosure, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0073] Furthermore, although the operations are described in a specific order, this should be understood as requiring that such operations be performed in the specific order shown or in sequential order, or requiring that all illustrated operations be performed to achieve the desired result. In certain environments, multitasking and parallel processing may be advantageous. Similarly, although several specific implementation details are included in the above discussion, these should not be construed as limiting the scope of this disclosure. Certain features described in the context of individual embodiments may also be implemented in combination in a single implementation. Conversely, various features described in the context of a single implementation may also be implemented individually or in any suitable sub-combination in multiple implementations.
[0074] Although the subject matter has been described using language specific to structural features and / or methodological logic, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. Rather, the specific features and actions described above are merely illustrative examples of implementing the claims.
Claims
1. A method for constructing a knowledge graph of a specific specialty, comprising: receiving a first term describing an entity of a specific specialty; generating a plurality of term pairs based on the received first term and a plurality of stored second terms, wherein the plurality of second terms respectively describe a plurality of candidate objects of the specific specialty in a given object type related to the entity; evaluating the plurality of term pairs according to a relevance of the entity and the plurality of candidate objects in the specific specialty using a pre-set computer model; and determining a second term matching the first term based on a result of the evaluation for constructing the knowledge graph.
2. The method of claim 1, wherein evaluating the plurality of term pairs further comprises: determining a score of a respective term pair according to a relevance of the entity and each candidate object in the specific specialty; and evaluating the term pair based on the determined score.
3. The method of claim 2, wherein determining a score of a respective term pair further comprises: transforming the first term and the second term contained in the term pair into a first vector representation and a second vector representation; concatenating the first vector representation and the second vector representation; and determining the score of the term pair according to a similarity comparison.
4. The method of claim 2, wherein determining a second term matching the first term further comprises: determining the second term in the term pair with the highest score as the matching second term.
5. The method of claim 2, wherein determining a second term matching the first term further comprises: determining the second term in the term pair with a score exceeding a predetermined threshold as the matching second term.
6. The method of claim 1, wherein in a case that the specific specialty relates to a medical specialty, the entity comprises a disease name, and the given object type comprises a belonging type, a belonging site, and a belonging system.
7. A method for training a computer model for constructing a knowledge graph, the computer model can be used to evaluate a relevance of an entity and an object in a specific specialty, comprising: receiving a first sample dataset, wherein the first sample dataset comprises a plurality of first term pairs each consisting of a first term and a second term, the first term describing the entity of the specific specialty, and the second term describing an object of the specific specialty matching the entity in a given object type; receiving a second sample dataset, wherein the second sample dataset comprises a plurality of second term pairs each consisting of the first term and a third term, the third term describing an object of the specific specialty not matching the entity in the given object type; training the computer model based on the first sample dataset and the second sample dataset.
8. The method of claim 7, wherein a ratio of the first term pairs in the first sample dataset to the second term pairs in the second sample dataset is 1:
3.
9. The method of claim 7, wherein the computer model comprises: an encoding layer configured to transform the first term and the second term in the first term pair into two vector representations, or transform the first term and the third term in the second term pair into two vector representations; a matching layer configured to concatenate the two vector representations to form a similarity comparator; an output layer configured to output a similarity score based on a result of the matching layer.
10. An apparatus for constructing a knowledge graph of a specific specialty, comprising: a receiving module configured to receive a first term describing an entity of a specific specialty; a generating module configured to generate a plurality of term pairs based on the received first term and a plurality of stored second terms, wherein the plurality of second terms respectively describe a plurality of candidate objects of the specific specialty in a given object type related to the entity; an evaluating module configured to evaluate the plurality of term pairs according to a correlation degree of the entity and the plurality of candidate objects in the specific specialty using a preset computer model; and a determining module configured to determine a second term matching the first term based on a result of the evaluation for constructing the knowledge graph.
11. The apparatus of claim 10, wherein the evaluating module is further configured to: determine a score of a corresponding term pair according to the correlation degree of the entity and each candidate object in the specific specialty; and evaluate the term pair based on the determined score.
12. The apparatus of claim 11, wherein the evaluating module is further configured to: transform the first term and the second term contained in the term pair into a first vector representation and a second vector representation; concatenate the first vector representation and the second vector representation; determine the score of the term pair according to a similarity comparison.
13. The apparatus of claim 11, wherein the determining module is further configured to: determine the second term in the term pair with the highest score as the matching second term.
14. The apparatus of claim 11, wherein the determining module is further configured to: determine the second term in the term pair with a score exceeding a predetermined threshold as the matching second term.
15. The apparatus of claim 10, wherein in a case where the specific specialty relates to a medical specialty, the entity comprises a disease name, and the given object type comprises a belonging type, a belonging part, and a belonging system.
16. An apparatus for training a computer model for constructing a knowledge graph, the computer model being used to evaluate a correlation degree of an entity and an object in a specific specialty, comprising: a first receiving module configured to receive a first sample data set, wherein the first sample data set comprises a plurality of first term pairs each consisting of a first term and a second term, the first term describing the entity of the specific specialty, and the second term describing an object of the specific specialty matching the entity in a given object type; and a training module configured to train the computer model based on the first sample data set. a second receiving module configured to receive a second sample dataset, wherein the second sample dataset comprises a plurality of second word pairs composed of the first word and a third word, the third word describing a specific professional object that does not match the entity in the given object type; a model training module configured to train the computer model based on the first sample dataset and the second sample dataset.
17. The apparatus of claim 16, wherein a ratio of the first word pairs in the first sample dataset to the second word pairs in the second sample dataset is 1:
3.
18. The apparatus of claim 16, wherein the computer model comprises: an encoding layer configured to convert the first and second words in the first word pair into two vector representations, or convert the first and third words in the second word pair into two vector representations; a matching layer configured to concatenate the two vector representations to form a similarity comparator; an output layer configured to output a similarity score based on a result of the matching layer.
19. An electronic device, the device comprising: one or more processors; and a storage device for storing one or more programs, which, when executed by the one or more processors, cause the one or more processors to implement the method of any one of claims 1-9.
20. A computer-readable storage medium having stored thereon a computer program, which, when executed by a processor, implements the method of any one of claims 1-9.
21. A computer program product, stored in a non-transitory computer storage medium and comprising machine executable instructions, which, when executed by a device, cause the device to perform the method of any one of claims 1-9.
Citation Information
Patent Citations
Method, device and equipment for obtaining data model in knowledge graph and medium
CN109815343A
Text rhetoric sentence generation method, device and apparatus and readable storage medium
CN111914568A