Artificial Intelligence-Based Knowledge Generation Method, Apparatus, Device, and Storage Medium
Through the entity chain finger, fusion and screening modules, the generation of negative statements combined with the first and second knowledge graphs is solved, the problem of lack of negative statements of the knowledge graph is improved, the scale and quality of the knowledge graph is improved, and the accuracy of information retrieval and intelligent question-and-answer is improved.
Patent Information
- Application Number
- CN202111260888.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-10-28
- Publication Date
- 2025-07-29
- Estimated Expiration
- 2041-10-28
AI Technical Summary
The existing knowledge graph lacks negative statement knowledge and cannot successfully perform applications such as information retrieval and intelligent question-and-answer applications.
Through the physical chain reference, fusion, screening and generation modules, negative statement knowledge is automatically generated, and information from the first and second knowledge graphs is combined to generate negative statements in the third knowledge graph.
It improves the scale and quality of the knowledge graph, reduces ambiguity in information retrieval and intelligent question-and-answer, and improves the accuracy of the application.
Smart Images

Figure CN114282002B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to artificial intelligence technology, and in particular, to a knowledge generation method, apparatus, electronic device, computer-readable storage medium, and computer program product based on artificial intelligence. Background Art
[0002] Artificial Intelligence (AI) is a comprehensive technology in computer science. By studying the design principles and implementation methods of various intelligent machines, machines are enabled to have functions of perception, reasoning, and decision-making. Artificial intelligence technology is an interdisciplinary subject, involving a wide range of fields, such as natural language processing technology and machine learning / deep learning. With the development of technology, artificial intelligence technology will be applied in more fields and play an increasingly important role.
[0003] A knowledge graph is one of the important applications in the field of artificial intelligence. The knowledge graph occupies an important position in applications such as information retrieval and intelligent question answering. However, most of the knowledge graphs only store positive statement knowledge and default unincluded statements as unknown statements.
[0004] In related technologies, the knowledge graph faces the pressure of lacking negative statement knowledge and cannot smoothly carry out other applications based on the knowledge graph. Summary of the Invention
[0005] Embodiments of the present application provide a knowledge generation method, apparatus, electronic device, computer-readable storage medium, and computer program product based on artificial intelligence, which can automatically and accurately generate negative statement knowledge.
[0006] The technical solution of the embodiments of the present application is implemented as follows:
[0007] Embodiments of the present application provide a knowledge generation method based on artificial intelligence, and the method includes:
[0008] Based on a first entity in a first knowledge graph, entity linking processing is performed on a second knowledge graph to obtain a second entity associated with the first entity in the second knowledge graph;
[0009] Fusion processing is performed on the first knowledge graph and the second knowledge graph to obtain a third knowledge graph including the first entity and the second entity;
[0010] Based on the first entity and the second entity, screening processing is performed on a plurality of first candidate entities included in the third knowledge graph to obtain a plurality of similar entities corresponding to the first entity and the second entity;
[0011] Based on the statement relationships of the multiple similar entities in the third knowledge graph, perform prediction processing on the first entity based on negative relationships to obtain the negative statement knowledge of the first entity.
[0012] An embodiment of the present application provides an artificial intelligence-based knowledge generation device, and the device includes:
[0013] An entity linking module, configured to perform entity linking processing on a second knowledge graph based on a first entity in a first knowledge graph to obtain a second entity associated with the first entity in the second knowledge graph;
[0014] A fusion module, configured to perform fusion processing on the first knowledge graph and the second knowledge graph to obtain a third knowledge graph including the first entity and the second entity;
[0015] A screening module, configured to perform screening processing on multiple first candidate entities included in the third knowledge graph based on the first entity and the second entity to obtain multiple similar entities corresponding to the first entity and the second entity;
[0016] A generation module, configured to perform prediction processing on the first entity based on negative relationships based on the statement relationships of the multiple similar entities in the third knowledge graph to obtain the negative statement knowledge of the first entity.
[0017] In the above technical solution, the entity linking module is further configured to perform clustering processing on multiple second candidate entities included in the second knowledge graph to obtain multiple candidate entity sets; [[ID=2,0]]
[0018] Perform matching processing on the multiple candidate entity sets based on the first entity in the first knowledge graph to obtain a target entity set matching the first entity;
[0019] Perform screening processing on the second candidate entities included in the target entity set based on the first entity to obtain a second entity associated with the first entity in the second knowledge graph.
[0020] In the above technical solution, the entity linking module is further configured to determine a first similarity between the first entity and a second candidate entity included in the target entity set;
[0021] Use the second candidate entity corresponding to the maximum first similarity as the second entity associated with the first entity in the second knowledge graph.
[0022] In the above technical solution, the entity linking module is further configured to determine a name similarity between the first entity and a second candidate entity included in the target entity set;
[0023] Determine the semantic similarity between the first entity and the second candidate entity;
[0024] Perform a weighted summation process on the name similarity and the semantic similarity to obtain a first similarity between the first entity and the second candidate entity.
[0025] In the above technical solution, the entity chain pointing module is further configured to perform feature extraction processing on the first entity to obtain the semantic features of the first entity;
[0026] Perform feature extraction processing on the second candidate entity to obtain the semantic features of the second candidate entity;
[0027] Perform a similarity process on the semantic features of the first entity and the semantic features of the second candidate entity to obtain the semantic similarity between the first entity and the second candidate entity.
[0028] In the above technical solution, the screening module is further configured to determine a second similarity between the first entity and a first candidate entity included in the third knowledge graph;
[0029] When the second similarity is greater than the similarity threshold, use the first candidate entity as the similar entity corresponding to the first entity and the second entity.
[0030] In the above technical solution, the screening module is further configured to determine the name similarity between the first entity and a first candidate entity included in the third knowledge graph;
[0031] Determine the semantic similarity between the first entity and the first candidate entity;
[0032] Determine the structural similarity between the first entity and the first candidate entity;
[0033] Perform a weighted summation process on the structural similarity, the name similarity, and the semantic similarity to obtain a second similarity between the first entity and the first candidate entity included in the third knowledge graph.
[0034] In the above technical solution, the screening module is further configured to determine a first statement relationship of the first entity in the third knowledge graph and determine a second statement relationship of the first candidate entity in the third knowledge graph;
[0035] Perform an intersection logic process on the first statement relationship and the second statement relationship to obtain an intersection feature value;
[0036] Perform a union logic process on the first statement relationship and the second statement relationship to obtain a union feature value;
[0037] Use the ratio of the union eigenvalue to the intersection eigenvalue as the structural similarity between the first entity and the first candidate entity.
[0038] In the above technical solution, the generation module is further configured to perform the following processing on any statement relationship of the multiple similar entities in the third knowledge graph:
[0039] Perform statistical processing on the statement relationships of the multiple similar entities to obtain the expected value of the first entity for the statement relationship;
[0040] When the expected value is greater than the expected value threshold, determine the negative statement knowledge of the first entity based on the negative relationship of the statement relationship.
[0041] In the above technical solution, the generation module is further configured to determine the number of similar entities among the multiple similar entities that contain the statement relationship, and determine the total number of the multiple similar entities;
[0042] Use the ratio of the quantity to the total quantity as the expected value of the first entity for the statement relationship.
[0043] In the above technical solution, before using the ratio of the quantity to the total quantity as the expected value of the first entity for the statement relationship, the generation module is further configured to perform a functional processing on the relationship of the first entity to obtain first pointing information of the first entity as the head entity;
[0044] Perform an inverse functional processing on the relationship of the first entity to obtain second pointing information of the first entity as the tail entity;
[0045] Based on the first pointing information and the ratio, determine the expected value of the first entity as the head entity for the statement relationship, where the expected value of the first entity as the head entity for the statement relationship is positively correlated with the ratio and negatively correlated with the first pointing information;
[0046] Based on the second pointing information and the ratio, determine the expected value of the first entity as the tail entity for the statement relationship, where the expected value of the first entity as the tail entity for the statement relationship is positively correlated with the ratio and negatively correlated with the second pointing information.
[0047] An embodiment of the present application provides an electronic device for knowledge generation, and the electronic device includes:
[0048] A memory for storing executable instructions;
[0049] A processor, when executing the executable instructions stored in the memory, implements the knowledge generation method based on artificial intelligence provided by the embodiments of the present application.
[0050] The embodiments of the present application provide a computer-readable storage medium storing executable instructions, which when executed by a processor, implement the knowledge generation method based on artificial intelligence provided by the embodiments of the present application.
[0051] The embodiments of the present application provide a computer program product, including a computer program or instructions, characterized in that when the computer program or instructions are executed by a processor, the knowledge generation method based on artificial intelligence provided by the embodiments of the present application is implemented.
[0052] The embodiments of the present application have the following beneficial effects:
[0053] By fusing the first knowledge graph and the second knowledge graph to expand the expressive power of the third knowledge graph, and generating negative statement knowledge of the first entity based on the statement relationship of similar entities in the third knowledge graph, the automatic and accurate generation of negative statement knowledge is realized, the pressure brought by the lack of negative statement knowledge is reduced, and the scale and quality of the knowledge graph are improved based on the generated negative statement knowledge. Description of the Drawings
[0054] Figure 1 is a schematic diagram of the application scenario of the knowledge generation system provided by the embodiments of the present application;
[0055] Figure 2 is a schematic diagram of the structure of the electronic device for knowledge generation provided by the embodiments of the present application;
[0056] Figures 3 - 5 is a schematic flowchart of the knowledge generation method based on artificial intelligence provided by the embodiments of the present application;
[0057] Figure 6 is a schematic diagram of the third knowledge graph provided by the embodiments of the present application;
[0058] Figure 7 is a schematic flowchart of the negative statement generation method provided by the embodiments of the present application;
[0059] Figure 8 is a schematic diagram of the structure of the entity linking module provided by the embodiments of the present application;
[0060] Figure 9 is a schematic diagram of the multi-perspective graph modeling provided by the embodiments of the present application. Detailed Embodiments
[0061] In order to make the purpose, technical solutions and advantages of this application clearer, the application will be further described in detail below with reference to the accompanying drawings. The described embodiments should not be regarded as limiting this application. All other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.
[0062] In the following description, the terms "first\second" are only used to distinguish similar objects and do not represent a specific order for the objects. It can be understood that "first\second" can be interchanged with a specific order or sequence where permitted, so that the embodiments of the present application described herein can be implemented in an order other than that illustrated or described herein.
[0063] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein are only for the purpose of describing the embodiments of this application and are not intended to limit this application.
[0064] The relevant data collection and processing in the embodiments of this application should be strictly in accordance with the requirements of relevant laws and regulations when applied in examples, and the informed consent or separate consent of the personal information subject should be obtained. Subsequent data use and processing should be carried out within the scope of authorization of laws and regulations and the personal information subject.
[0065] Before further describing the embodiments of the present application in detail, the nouns and terms involved in the embodiments of the present application are explained. The nouns and terms involved in the embodiments of the present application are subject to the following interpretations.
[0066] 1) Knowledge Graph: This modern theory achieves multidisciplinary integration by combining theories and methods from disciplines such as applied mathematics, graphics, information visualization, and information science with methods like citation analysis and co-occurrence analysis. This approach uses visual graphs to vividly display the core structure, development history, cutting-edge fields, and overall knowledge architecture of a discipline. A knowledge graph consists of interconnected entities and their corresponding attributes. In other words, a knowledge graph consists of individual pieces of knowledge, each represented as an entity triple (i.e., a Subject-Predicate-Object (SPO) triple).
[0067] 2) Declarative relationships: These are descriptions used to represent relationships within each piece of knowledge in the knowledge graph, such as the (predicate, object) pair and the (predicate) contained in an SPO triple. For example, the (predicate, pregnant women) in (Vitamin K1 injection, use with caution, pregnant women) represents a declarative relationship, as does the (alias) in (Formaldehyde solution, alias, formalin).
[0068] 3) Entity: Things that objectively exist and can be distinguished from each other, such as "dog", "cat", etc.; at the same time, an entity is also the basic unit of a knowledge graph and an important language unit for carrying information in text.
[0069] 4) Negative Statement Knowledge: Abbreviated as negative statement, which is opposite to the positive statement in the knowledge graph and refers to a statement knowledge with a negative meaning. For example, <Object A, won an award, Nobel Prize>, indicating that "Object A has never won the Nobel Prize".
[0070] 5) Closed World Assumption: The given knowledge graph is complete and error-free.
[0071] 6) Open World Assumption: There are many unlabeled links in the given knowledge graph, and there are a certain number of potential errors.
[0072] In related technologies, general knowledge graphs play an important role in applications such as information retrieval and intelligent question answering. However, most of the current knowledge graphs only store positive statements and default statements that are not included as unknown statements. For example, the open-source knowledge graph Wikidata contains the positive statement "Object B won the Wolf Prize in Physics", but does not include the statement "Object B won the Nobel Prize". Therefore, the statement "Object B won the Nobel Prize" is considered unknown. When applied to the Knowledge Base Question Answering (KBQA) task, related questions involved will be regarded as unanswerable questions. However, in reality, the reason for the absence of this statement is that it is actually a negative statement, that is, "Object B actually did not win the Nobel Prize". Therefore, correctly distinguishing the truth or falsehood of a statement helps to improve the expressive ability of the knowledge graph, and at the same time, clear negative statements can reduce the ambiguity in KBQA questions and improve the relevance of answers involving negative queries.
[0073] Although related technologies can mine some negative statements with practical significance, there are the following problems when applied to vertical domain knowledge graphs (such as vertical medical knowledge graphs):
[0074] (1) The overly strong assumption of a locally closed world (CWA, Closed World Assumption). It assumes that clusters of similar entities satisfy the CWA assumption. Since the construction of a vertical domain medical knowledge graph requires professional structured knowledge descriptions and is also smaller in scale compared to general knowledge graphs, it is difficult to meet the CWA assumption, resulting in the generated negative statements not having good practical applications.
[0075] (2) When retrieving similar (peer) entities, relying on a single means cannot fully utilize the complementarity between entity structures and embedding representations. For example, methods based on entity structures can adaptively select appropriate relationships or attributes as retrieval anchors according to the characteristics of the target entity, but they heavily rely on the completeness of the structure. While methods based on embedding representations can model the high-level semantic features of entities and represent the types of entities, it is difficult to model the structured information of entities.
[0076] (3) The uniqueness of relationships is not considered in the inference stage, resulting in the easy generation of some negative statements that are correct but uninformative. For example, for an affirmative statement with unique directivity such as "The alias of azithromycin is Zithromax", the corresponding negative statements generated are "The alias of azithromycin is not ibuprofen", "The alias of azithromycin is not Yixianshu", etc. These negative statements are rather redundant and do not have good discriminative properties.
[0077] To solve the above problems, the embodiments of the present application provide an artificial intelligence-based knowledge generation method, apparatus, electronic device, computer-readable storage medium, and computer program product, which can automatically and accurately generate negative statement knowledge.
[0078] The artificial intelligence-based knowledge generation method provided by the embodiments of the present application can be implemented independently by a terminal; or it can be implemented in cooperation between a terminal and a server. For example, the terminal alone undertakes the artificial intelligence-based knowledge generation method described below, or the terminal sends a knowledge graph expansion request to the server. The server generates various negative statement knowledge according to the received knowledge graph expansion request and supplements the negative statement knowledge into the knowledge graph to enhance the scale and quality of the knowledge graph, so as to smoothly carry out other knowledge graph-based applications, such as information retrieval, intelligent question answering, etc.
[0079] The electronic device for knowledge generation provided by the embodiments of the present application can be various types of terminals or servers. Among them, the server can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, Content Delivery Network (CDN), and big data and artificial intelligence platforms. The terminal can be a smart phone, a tablet computer, a notebook computer, a desktop computer, a smart speaker, a smart watch, a smart TV, a vehicle-mounted device, etc., but is not limited thereto. The terminal and the server can be directly or indirectly connected through wired or wireless communication methods, and the present application does not make any restrictions here.
[0080] Taking the server as an example, it can be, for example, a server cluster deployed in the cloud, which opens artificial intelligence cloud services (AI as a Service, AIaaS) to users. The AIaaS platform will split several common AI services and provide independent or packaged services in the cloud. This service model is similar to an AI-themed mall, and all users can access and use one or more artificial intelligence services provided by the AIaaS platform through the application programming interface.
[0081] For example, one of the artificial intelligence cloud services can be a knowledge generation service, that is, the server in the cloud encapsulates the knowledge generation program provided by the embodiments of the present application. The user calls the knowledge generation service in the cloud service through the terminal (running a client, such as a question-and-answer client or a retrieval client), so that the server deployed in the cloud calls the encapsulated knowledge generation program to perform a fusion process on the first knowledge graph and the second knowledge graph, obtain a third knowledge graph including the first entity and the second entity, and obtain multiple similar entities corresponding to the first entity and the second entity from the third knowledge graph. Based on the statement relationship of the multiple similar entities in the third knowledge graph, negative statement knowledge of the first entity is generated, so as to improve the scale and quality of the knowledge graph (such as the first knowledge graph and the second knowledge graph) based on the generated negative statement knowledge, and thus smoothly perform other knowledge graph-based applications, such as information retrieval and intelligent question and answer.
[0082] See Figure 1 , Figure 1 is a schematic diagram of the application scenario of the knowledge generation system 10 provided by the embodiments of the present application. The terminal 200 is connected to the server 100 through the network 300. The network 300 can be a wide area network or a local area network, or a combination of the two.
[0083] A terminal (running a client, such as a Q&A client or a retrieval client) can be used to obtain a first knowledge graph. For example, the user inputs the first knowledge graph and the second knowledge graph through the terminal, and the terminal automatically obtains a knowledge graph expansion request (including the first knowledge graph and the second knowledge graph).
[0084] In some embodiments, a knowledge generation plugin can be implanted in the client running in the terminal 200 to implement an artificial intelligence-based knowledge generation method locally on the client. For example, the terminal 200 invokes the knowledge generation plugin to implement an artificial intelligence-based knowledge generation method, perform a fusion process on the first knowledge graph and the second knowledge graph to obtain a third knowledge graph including a first entity and a second entity, and obtain a plurality of similar entities corresponding to the first entity and the second entity from the third knowledge graph. Based on the statement relationships of the plurality of similar entities in the third knowledge graph, negative statement knowledge of the first entity is generated, so as to improve the scale and quality of the knowledge graph (such as the first knowledge graph, the second knowledge graph) based on the generated negative statement knowledge, and thus smoothly perform other knowledge graph-based applications, such as information retrieval, intelligent Q&A, etc.
[0085] In some embodiments, after the terminal 200 obtains a knowledge graph expansion request, it invokes the knowledge generation interface of the server 100 (which can be provided in the form of a cloud service, i.e., a knowledge generation service). The server 100 performs a fusion process on the first knowledge graph and the second knowledge graph based on the knowledge graph expansion request to obtain a third knowledge graph including a first entity and a second entity, and obtains a plurality of similar entities corresponding to the first entity and the second entity from the third knowledge graph. Based on the statement relationships of the plurality of similar entities in the third knowledge graph, negative statement knowledge of the first entity is generated, and the generated negative statement knowledge is sent to the terminal 200. The terminal 200 expands the knowledge graph (such as the first knowledge graph, the second knowledge graph) based on the generated negative statement knowledge, so as to improve the scale and quality of the knowledge graph to smoothly perform other knowledge graph-based applications, such as information retrieval, intelligent Q&A, etc.
[0086] In some embodiments, the terminal or the server can implement the artificial intelligence-based knowledge generation method provided in the embodiments of the present application by running a computer program, and the computer program is as Figure 1 shown in the client running in the terminal 200. For example, the computer program can be a native program or software module in the operating system; it can be a local (Native) application (APP, Application), that is, a program that needs to be installed in the operating system to run; it can also be a small program, that is, a program that only needs to be downloaded to the browser environment to run; it can also be a small program that can be embedded in any APP. In short, the above computer program can be any form of application program, module or plugin.
[0087] In some embodiments, multiple servers can be grouped into a blockchain, and server 100 is a node on the blockchain. There can be information connections between each node in the blockchain, and information can be transmitted between nodes through the above-mentioned information connections. Among them, the data related to the knowledge generation method based on artificial intelligence provided in the embodiments of the present application (such as the logic of knowledge generation, negative statement knowledge) can be stored on the blockchain.
[0088] The following describes the structure of the electronic device for knowledge generation provided in the embodiments of the present application. Refer to Figure 2 , Figure 2 FIG. is a schematic structural diagram of the electronic device 500 for knowledge generation provided in the embodiments of the present application. Taking the electronic device 500 as a terminal as an example for illustration, Figure 2 The electronic device 500 for knowledge generation shown in FIG. includes: at least one processor 510, a memory 550, at least one network interface 520, and a user interface 530. Each component in the electronic device 500 is coupled together through a bus system 540. It can be understood that the bus system 540 is used to realize the connection and communication between these components. In addition to including a data bus, the bus system 540 also includes a power bus, a control bus, and a status signal bus. However, for the sake of clear illustration, in Figure 2 all kinds of buses are labeled as the bus system 540.
[0089] The processor 510 can be an integrated circuit chip with signal processing capabilities, such as a general-purpose processor, a digital signal processor (DSP, Digital Signal Processor), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Among them, the general-purpose processor can be a microprocessor or any conventional processor, etc.
[0090] The memory 550 includes volatile memory or non-volatile memory, and can also include both volatile and non-volatile memory. Among them, the non-volatile memory can be a read-only memory (ROM, Read Only Memory), and the volatile memory can be a random access memory (RAM, Random Access Memory). The memory 550 described in the embodiments of the present application is intended to include any suitable type of memory. Optionally, the memory 550 includes one or more storage devices that are physically remote from the processor 510.
[0091] In some embodiments, the memory 550 is capable of storing data to support various operations. Examples of these data include programs, modules, and data structures, or subsets or supersets thereof, which are described below by way of example.
[0092] The operating system 551 includes system programs for processing various basic system services and performing hardware-related tasks, such as the framework layer, the core library layer, the driver layer, etc., for implementing various basic services and processing hardware-based tasks.
[0093] The network communication module 552 is used to reach other computing devices via one or more (wired or wireless) network interfaces 520. Exemplary network interfaces 520 include: Bluetooth, Wi-Fi (Wireless Fidelity), and USB (Universal Serial Bus), etc.
[0094] In some embodiments, the artificial intelligence-based knowledge generation device provided by the embodiments of the present application can be implemented in software. The artificial intelligence-based knowledge generation device provided by the embodiments of the present application can be provided in various software embodiments, including various forms such as application programs, software, software modules, scripts, or code.
[0095] Figure 2 Shown in the memory 550 is the artificial intelligence-based knowledge generation device 555, which can be software in the form of programs and plugins, etc., and includes a series of modules, including the entity linking module 5551, the fusion module 5552, the screening module 5553, and the generation module 5554. These modules are logical, so they can be combined arbitrarily or further split according to the functions to be implemented. The functions of each module will be described below.
[0096] As mentioned above, the artificial intelligence-based knowledge generation method provided by the embodiments of the present application can be implemented by various types of electronic devices. Refer to Figure 3 , Figure 3 is a flowchart of the artificial intelligence-based knowledge generation method provided by the embodiments of the present application, which will be described in combination with the steps shown in Figure 3 shown below.
[0097] In the following steps, the amount of knowledge in the first knowledge graph is different from that in the second knowledge graph. When the amount of knowledge in the first knowledge graph is less than that in the second knowledge graph, for example, the first knowledge graph can be a vertical domain knowledge graph (i.e., a small graph, such as a medication assistant knowledge graph), and the second knowledge graph is a general knowledge graph (i.e., a large graph, such as a large-scale graph constructed from online resources like Baidu Encyclopedia). By linking the first entity in the first knowledge graph to the second knowledge graph, on the basis of the first knowledge graph, combined with the characteristics of the second knowledge graph such as diversified knowledge structure sources, large scale, and high coverage rate, it is more complete to a certain extent compared to the first knowledge graph. When the amount of knowledge in the first knowledge graph is greater than that in the second knowledge graph, for example, the first knowledge graph can be a general knowledge graph, and the second knowledge graph is a vertical domain knowledge graph. By linking the first entity in the first knowledge graph to the second knowledge graph, on the basis of the first knowledge graph, combined with the characteristics of the second knowledge graph such as high accuracy, it is more accurate to a certain extent compared to the first knowledge graph.
[0098] In step 101, entity linking processing is performed on the second knowledge graph based on the first entity in the first knowledge graph to obtain a second entity in the second knowledge graph that is associated with the first entity.
[0099] Taking the example that the first knowledge graph is a vertical domain knowledge graph (i.e., a small graph, such as a medication assistant knowledge graph) and the second knowledge graph is a general knowledge graph (i.e., a large graph, such as a large-scale graph constructed from online resources like Baidu Encyclopedia), the entities in the small graph are linked to the large graph, so as to screen out the second entity (i.e., the linking object) associated with the first entity from the large graph. Subsequently, based on the first entity and the second entity, the first knowledge graph and the second knowledge graph are fused, thereby realizing the fusion between the graphs and expanding the scale and expressive ability of the vertical domain knowledge graph.
[0100] In some embodiments, performing entity linking processing on the second knowledge graph based on the first entity in the first knowledge graph to obtain a second entity in the second knowledge graph that is associated with the first entity includes: performing clustering processing on multiple second candidate entities included in the second knowledge graph to obtain multiple candidate entity sets; performing matching processing on the multiple candidate entity sets based on the first entity in the first knowledge graph to obtain a target entity set that matches the first entity; and performing screening processing on the second candidate entities included in the target entity set based on the first entity to obtain a second entity in the second knowledge graph that is associated with the first entity.
[0101] For example, since the number of entities in the second knowledge graph is large, if the similarity between the first entity (i.e., entity e) and each entity in the second knowledge graph is calculated, and then the linking object is selected from the second knowledge graph, when the scale of the second knowledge graph is large, this method will consume a large amount of computing resources. Therefore, in the embodiments of the present application, rules or models are used to determine a candidate entity set that is as small as possible and contains the linking object as much as possible, so as to complete entity linking at a relatively small cost. By clustering a plurality of second candidate entities included in the second knowledge graph and determining a target entity set that matches the first entity from a plurality of candidate entity sets (including at least one second candidate entity), it is only necessary to screen out the second entities associated with the first entity in the second knowledge graph from the target entity set, so as to reduce the consumption of computing resources and improve the efficiency of entity linking.
[0102] In some embodiments, the method for clustering processing includes at least one of the following operations: performing type-based classification processing on a plurality of second candidate entities based on the types of the second candidate entities included in the second knowledge graph; performing synonym classification processing on a plurality of second candidate entities based on the synonym relationships included in the synonym table; performing name-based classification processing on a plurality of second candidate entities based on the names of the second candidate entities included in the second knowledge graph.
[0103] For example, when recalling candidate entities that may be related to the first entity in the second knowledge graph through type constraints to form a candidate entity set, for example, the types of the first entity are "drug" and "health care", then the types of the second candidate entities in the second knowledge graph are used to divide the second candidate entities into candidate entity sets of "drug" and "health care", and then the second entities associated with the first entity are screened out from the candidate entity sets of "drug" and "health care".
[0104] For example, when recalling candidate entities that may be related to the first entity in the second knowledge graph through the synonym table constraint to form a candidate entity set, for example, from the second knowledge graph, synonyms of the first entity are queried based on the synonym table, and then the queried synonyms of the first entity are divided into the candidate entity set of synonyms, and then the second entities associated with the first entity are screened out from the candidate entity set of synonyms.
[0105] For example, when using an inverted index with n-gram as the key to recall candidate entities that may be related to the first entity to form a set of candidate entities. For example, store the names of the second candidate entities in the second knowledge graph as keywords with 2-gram into the inverted index, query and retrieve relevant content based on entity e to recall candidate entities that may be related to the first entity into the 2-gram candidate entity set, and then screen out the second entity associated with the first entity from the 2-gram candidate entity set.
[0106] In some embodiments, screening the second candidate entities included in the target entity set to obtain the second entity associated with the first entity in the second knowledge graph includes: determining the first similarity between the first entity and the second candidate entities included in the target entity set; taking the second candidate entity corresponding to the maximum first similarity as the second entity associated with the first entity in the second knowledge graph.
[0107] For example, use a metric method to calculate the matching degree (i.e., the first similarity) between the first entity and each second candidate entity in the target entity set, and select the second candidate entity with the highest matching degree as the chained object pointed to by the first entity, thereby reducing the consumption of computing resources and improving the efficiency of entity chaining.
[0108] As an example, take the second candidate entity with the highest matching degree and exceeding a certain threshold in the second knowledge graph as the chained object of the first entity. If the highest matching degree does not exceed the threshold, no chaining process is performed on the first entity, and negative statement knowledge is generated in the first knowledge graph, that is, based on the first entity, screen the multiple first candidate entities included in the first knowledge graph to obtain multiple similar entities corresponding to the first entity, and based on the statement relationships of the multiple similar entities in the first knowledge graph, perform prediction processing on the first entity based on negative relationships to obtain the negative statement knowledge of the first entity.
[0109] In some embodiments, determining the first similarity between the first entity and the second candidate entities included in the target entity set includes: determining the name similarity between the first entity and the second candidate entities included in the target entity set; determining the semantic similarity between the first entity and the second candidate entity; performing a weighted summation process on the name similarity and the semantic similarity to obtain the first similarity between the first entity and the second candidate entity.
[0110] For example, the embodiments of the present application comprehensively consider the matching degrees of entities in terms of nouns (i.e., literals) and semantics, and adopt two measurement strategies: literal matching and semantic matching. For literal matching, the edit distance is used to measure the name similarity between the first entity and the second candidate entity. However, literal matching cannot consider the situation where two entities are not similar literally but similar semantically, such as "formaldehyde solution" and "formalin", which, although not similar literally, express the same drug. This situation can be compensated for by semantic matching. The embodiments of the present application adopt a pre-trained relevant model for generating word vectors (such as word2vec (word to vector)) to generate the feature vector representation of the entity. Since word2vec learns general language knowledge from a large-scale text corpus, the closer the distance between words with more similar semantics in the feature space, the feature extraction process is performed on the first entity to obtain the semantic feature of the first entity, the feature extraction process is performed on the second candidate entity to obtain the semantic feature of the second candidate entity, and the similarity process is performed on the semantic feature of the first entity and the semantic feature of the second candidate entity to obtain the semantic similarity between the first entity and the second candidate entity. Finally, the matching degree between the first entity and the second candidate entity in terms of name and semantics is obtained by weighted summation, and the second candidate entity with the highest similarity in the second knowledge graph is used as the second entity associated with the first entity.
[0111] In step 102, the first knowledge graph and the second knowledge graph are fused to obtain a third knowledge graph including the first entity and the second entity.
[0112] For example, after the second entity associated with the first entity is chained from the second knowledge graph, based on the first entity and the second entity, the first knowledge graph and the second knowledge graph are fused to obtain a third knowledge graph including the first entity and the second entity. This third knowledge graph combines the characteristics of the second knowledge graph, such as diversified knowledge structure sources, large scale, high coverage, etc., and the high accuracy of the second knowledge graph.
[0113] As Figure 6 shown, the first entity is Haidewei, the second entity is paracetamol, pseudoephedrine and dextromethorphan tablets, and Haidewei and paracetamol, pseudoephedrine and dextromethorphan tablets are connected by a connection line 601, thereby fusing the first knowledge graph and the second knowledge graph.
[0114] In step 103, based on the first entity and the second entity, screening processing is performed on multiple first candidate entities included in the third knowledge graph to obtain multiple similar entities corresponding to the first entity and the second entity.
[0115] For example, after fusing the first knowledge graph and the second knowledge graph, the first entity and the second entity can be regarded as a target entity in the third knowledge graph. That is, based on the first entity and the second entity, screening processing is performed on multiple first candidate entities included in the third knowledge graph, and multiple similar entities corresponding to the first entity and the second entity are obtained, that is, multiple similar entities corresponding to the first entity, or multiple similar entities corresponding to the second entity.
[0116] See Figure 4 , Figure 4 which is a schematic flowchart of a knowledge generation method based on artificial intelligence provided by an embodiment of the present application. Figure 4 shows Figure 3 Step 103 in Figure 4 can be implemented by the steps 1031 - 1032 shown: In step 1031, determine the second similarity between the first entity and the first candidate entities included in the third knowledge graph; in step 1032, when the second similarity is greater than the similarity threshold, use the first candidate entity as the similar entity corresponding to the first entity and the second entity.
[0117] For example, determine the second similarity between the first entity and the first candidate entities included in the third knowledge graph through a metric strategy. When the second similarity is greater than the similarity threshold, use the first candidate entity as the similar entity corresponding to the first entity and the second entity for subsequent generation of negative statement knowledge.
[0118] In some embodiments, determining the second similarity between the first entity and the first candidate entities included in the third knowledge graph includes: determining the name similarity between the first entity and the first candidate entities included in the third knowledge graph; determining the semantic similarity between the first entity and the first candidate entity; determining the structural similarity between the first entity and the first candidate entity; performing weighted summation processing on the structural similarity, name similarity, and semantic similarity to obtain the second similarity between the first entity and the first candidate entities included in the third knowledge graph.
[0119] For example, in order to be able to mine similar entities of the target entity, the embodiments of the present application introduce a multi - perspective graph modeling technology to mine high - quality similar entities from different levels, including the structural level, name level, and semantic level, that is, mine high - quality similar entities from the structural similarity, name similarity, and semantic similarity.
[0120] In some embodiments, determining the structural similarity between a first entity and a first candidate entity includes: determining a first statement relationship of the first entity in a third knowledge graph and determining a second statement relationship of the first candidate entity in the third knowledge graph; performing an intersection logic process on the first statement relationship and the second statement relationship to obtain an intersection eigenvalue; performing a union logic process on the first statement relationship and the second statement relationship to obtain a union eigenvalue; and taking the ratio of the union eigenvalue to the intersection eigenvalue as the structural similarity between the first entity and the first candidate entity.
[0121] For example, assume that the triples corresponding to the target entity (i.e., the first entity or the second entity) and the (predicate, object) relationships (i.e., statement relationships) they contain are represented as . At the structural level, the structural similarity between two entities is measured by the ratio of the intersection and union of of the two entities, and the calculation formula is , where represents the target entity, and represents any entity in the knowledge graph G (i.e., the third knowledge graph).
[0122] At the name level, the name similarity between the target entity and the first candidate entity is measured by the edit distance between their names.
[0123] At the semantic level, feature extraction processing is performed on the first entity to obtain the semantic features of the first entity, feature extraction processing is performed on the first candidate entity to obtain the semantic features of the first candidate entity, and similarity processing is performed on the semantic features of the first entity and the semantic features of the first candidate entity to obtain the semantic similarity between the first entity and the first candidate entity. The cosine distance represented by entity vectors can be used to determine the semantic similarity between two entities.
[0124] In step 104, based on the statement relationships of multiple similar entities in the third knowledge graph, prediction processing based on negative relationships is performed on the first entity to obtain the negative statement knowledge of the first entity.
[0125] For example, after obtaining multiple similar entities corresponding to the first entity and the second entity, based on the statement relationships of the similar entities in the third knowledge graph, an inference process of negative statement knowledge is performed to generate the negative statement knowledge of the first entity, and the knowledge graph (such as the first knowledge graph, the second knowledge graph, the third knowledge graph) is expanded through the generated negative statement knowledge.
[0126] See Figure 5 , Figure 5 which is a schematic flowchart of a knowledge generation method based on artificial intelligence provided by an embodiment of the present application.Figure 5 shown Figure 3 Step 104 in Figure 5 can be implemented by the steps 1041 - 1022 shown: In step 1041, for any statement relationship of multiple similar entities in the third knowledge graph, the following processing is performed: statistical processing is performed on the statement relationships of the multiple similar entities to obtain the expected value of the first entity for the statement relationship; in step 1042, when the expected value is greater than the expected value threshold, based on the negative relationship of the statement relationship, the negative statement knowledge of the first entity is determined.
[0127] For example, similar entities can be used to evaluate the expected value of relevant statements of the first entity. Based on probability statistics, calculate the relative frequency of the (predicate, object) statement relationship in the triples of all similar entities , that is, the expected value of the first entity for the statement relationship, and the (predicate, object) statement relationship does not exist in the triples of the target entity.
[0128] Among them, the calculation scheme of the expected value of the first entity for the statement relationship is as follows: determine the number of similar entities containing the statement relationship among the multiple similar entities, and determine the total number of the multiple similar entities; use the ratio of the number to the total number as the expected value of the first entity for the statement relationship , and the calculation formula is , represents the total number of similar entities, represents the number of similar entities existing in the knowledge graph G with relationship. Among them, in the embodiments of the present application, the expected value The calculation formula of is not limited to , and can also be other deformed formulas.
[0129] For example, the similar entities of "vitamin C tablets" include "vitamin K1 injection", "calcium ascorbate capsules", "calcium folinate for injection", and "vitamin C injection", among which "vitamin K1 injection", "calcium ascorbate capsules", and "calcium folinate for injection" all contain the (use with caution, pregnant women) statement relationship, then the corresponding , which means that the probability that the generated negative statement knowledge (that is, pregnant women can use vitamin C tablets) holds is 0.75.
[0130] In some embodiments, before using the ratio of the quantity to the total quantity as the expected value of the first entity for the statement relationship, a functional processing of the relationship is performed on the first entity to obtain first pointing information of the first entity as the head entity; an inverse functional processing of the relationship is performed on the first entity to obtain second pointing information of the first entity as the tail entity; based on the first pointing information and the ratio, the expected value of the first entity as the head entity for the statement relationship is determined, where the expected value of the first entity as the head entity for the statement relationship is positively correlated with the ratio and negatively correlated with the first pointing information; based on the second pointing information and the ratio, the expected value of the first entity as the tail entity for the statement relationship is determined, where the expected value of the first entity as the tail entity for the statement relationship is positively correlated with the ratio and negatively correlated with the second pointing information.
[0131] For example, if the unique directivity of the relationship is not considered, it is easy to cause the generated negative statement knowledge to be redundant and have no practical application value. To avoid generating redundant negative statement knowledge, the embodiments of the present application utilize the functionality and inverse functionality of the relationship to evaluate the unique directivity of the relationship. Among them, the functionality of relationship p , that is, the first pointing information of the first entity as the head entity, and the inverse functionality , that is, the second pointing information of the first entity as the tail entity, where represents the number of all e that satisfy under the condition that the p relationship is fixed, represents the number of all combinations that satisfy under the condition that the p relationship is fixed, represents the number of all o that satisfy under the condition that the p relationship is fixed.
[0132] Finally, the probability value of the corresponding negative statement is determined according to the relevant frequency, the functionality of the relationship, and the inverse functionality. Among them, when the first entity is used as the head entity, the expected value is ; when the first entity is used as the tail entity, the corresponding expected value is . When the expected value of the generated candidate negative statement knowledge is greater than the expected value threshold, it is determined that the corresponding negative statement knowledge is generated. Among them, the expected value in the embodiments of the present application is not limited to , , and can also be other deformation formulas.
[0133] In summary, the knowledge generation method based on artificial intelligence provided by the embodiments of the present application has the following beneficial effects: By fusing the first knowledge graph and the second knowledge graph, the expression ability of the third knowledge graph is expanded, and based on the statement relationship of similar entities in the third knowledge graph, negative statement knowledge of the first entity is generated, so as to automatically and accurately generate negative statement knowledge, reduce the pressure caused by the lack of negative statement knowledge, and improve the scale and quality of the knowledge graph based on the generated negative statement knowledge.
[0134] Next, an exemplary application of the embodiments of the present application in a practical application scenario will be described.
[0135] The embodiments of the present application can be applied to downstream applications of knowledge graphs such as information retrieval and intelligent question answering. For example, for the information retrieval application, after expanding the knowledge graph based on negative statement knowledge, in response to an information retrieval request, the expanded knowledge graph is queried for the retrieved information to obtain corresponding query results, so as to achieve accurate information retrieval; for the intelligent question answering application, after expanding the knowledge graph based on negative statement knowledge, in response to a request for an answer to a question, the expanded knowledge graph is queried for the question to obtain corresponding answers, so as to achieve automatic and accurate question answering. Next, the knowledge generation method (i.e., the negative statement generation method) provided by the embodiments of the present application will be further described.
[0136] The embodiments of the present application propose a negative statement generation method, which makes full use of probability statistics technology and knowledge graph modeling technology, and flexibly uses the knowledge graph (i.e., the large graph) and the vertical domain knowledge graph (i.e., the small graph), so that the generated negative statements are more meaningful in reality.
[0137] Taking the vertical domain knowledge graph as the medical knowledge graph as an example, more and more meaningful negative statements are introduced into the medical knowledge graph to enhance the knowledge expression ability of the knowledge graph and the performance of downstream AI algorithms based on the knowledge graph.
[0138] The negative statement generation method proposed by the embodiments of the present application can help the vertical medical knowledge graph (such as the medication assistant knowledge graph) expand more and more meaningful negative statements, and can achieve better results in downstream algorithms (such as the knowledge-based question answering KBQA model), and expanding negative statements also broadens the knowledge expression ability of the knowledge graph for complex medical knowledge to a certain extent, making the knowledge graph significantly improved in both scale and quality.
[0139] Next, the negative statement generation method provided by the embodiments of the present application will be specifically described:
[0140] Given a large graph (knowledge can be sourced from Baidu Encyclopedia, neo4j graph, etc.) and a small graph (Medical Knowledge Graph), link the entities in the small graph to the large graph , and then complete the reasoning process of negative statements. The reason for doing this is that although the knowledge system of the small graph is highly accurate but relatively single, it does not meet the CWA assumption (that is, the graph is complete), which easily makes the generated negative statements have a certain bias and tend to focus on several high-frequency relationships, lacking diversity. The knowledge structure in the large graph comes from multiple sources, is large in scale, and has a high coverage rate, and can support the query of entities and relationships of hundreds of thousands of types such as diseases, drugs, symptoms, and acupoints. Compared with the small graph, it is more complete to a certain extent. At the same time, when linking to the large graph, not only can the reasoning of negative statements be completed, but also the fusion between graphs can be realized, expanding the scale and expression ability of the vertical domain knowledge graph, and also helping to improve the reasoning ability of downstream models such as KBQA models. Among them, as Figure 7 shown, the specific implementation technology of this application embodiment mainly includes three modules: 1) Entity Linking Module (i.e., Linking Module); 2) Similar Entity Recall Module Based on Multi-Perspective Matching Technology (i.e., Screening Module); 3) Negative Statement Generation Module (i.e., Generation Module). The following will introduce the specific details and main functions of each module.
[0141] 1) Entity Linking Module
[0142] It should be noted that entity linking refers to associating an entity mention with the corresponding entity in a given knowledge graph. Given an entity e (i.e., entity mention) in the small graph , through the linking technology, it is mapped to the large graph to obtain richer knowledge structure information. As Figure 8 shown, the entity linking module includes two parts:
[0143] (1) Candidate entity generation. Since the number of entities in the large graph is large, if the similarity between entity e and each entity in the large graph is calculated and then the linking object is selected from the large graph, when the scale of the large graph is relatively large, the computational consumption caused by this strategy is very large. The main role of candidate entity generation in this application embodiment is to use rules or models to determine a candidate entity set that is as small as possible and contains the linking object as much as possible, and complete entity linking at a relatively small cost.
[0144] For example, recall possible relevant candidate entities through type constraints, thesaurus, or an inverted index with words or n-grams as keys. Taking the Medication Assistant Knowledge Graph as an example, the entities in this graph are mainly of the drug type. Therefore, when generating candidate entities, the type of entities in the large graph can be restricted to "drugs". To further improve the recall ability for the chained reference objects, the entity names in the large graph are stored as keywords in the inverted index with 2-grams, and relevant content is retrieved based on entity e.
[0145] (2) Entity matching. Use a metric method to calculate the matching degree between the entity e in the small graph and each candidate entity, and select the candidate entity with the highest matching degree as the chained reference object pointed to by entity e.
[0146] The embodiments of this application comprehensively consider the literal and semantic matching degrees of the text, and adopt two metric strategies: literal matching and semantic matching. For literal matching, the edit distance is used to measure the literal similarity between the entity e in the small graph and the candidate entity. However, literal matching cannot consider the situation where two texts are not literally similar but semantically similar, such as "formaldehyde solution" and "formalin", although they are not literally similar but express the same drug. This situation can be compensated by semantic matching. The embodiments of this application adopt a pre-trained relevant model for generating word vectors (such as word2vec (word to vector)) to generate the feature vector representation of the entity. Since word2vec learns general language knowledge from a large-scale text corpus, the closer the distance between semantically more similar words in the feature space, the similarity between the representation of entity e in the small graph and the representation of the candidate entity is calculated through cosine similarity. Finally, the matching degree of entity e and the candidate entity at the literal and semantic levels is obtained through weighted summation. The candidate entity in the large graph with the highest matching degree and exceeding a certain threshold is used as the chained reference object of entity e. If the threshold is not exceeded, entity e is not chained to the large graph, but a negative statement is generated in the small graph.
[0147] 2) Similar entity recall module based on multi-perspective matching technology
[0148] After chaining the entities in the small graph to the large graph, effective and valuable knowledge information can be mined from the large graph, and this process can use the peer entities of the target entities (including entity e and the chained reference object) as references. Peer entities are entities similar to or highly relevant to the target entity. Peer entities can provide clues to the validity of a given entity e for relevant statements to a certain extent. For example, for "Vitamin K1 Injection", "Calcium Ascorbate Capsule", "Calcium Folinate for Injection", and "Ascorbic Acid Tablets", which all belong to the vitamin category, among them, "Vitamin K1 Injection", "Calcium Ascorbate Capsule", and "Calcium Folinate for Injection" in the Knowledge Graph G (i.e., the integrated large graph and small figures In the atlas after that, it is marked that pregnant women need to use it with caution, but it is not marked that "vitamin C tablets" need to be used with caution for pregnant women. Therefore, it can be reasonably inferred that the statement "pregnant women can use vitamin C tablets" is probably true.
[0149] Such as Figure 9 As shown, in order to be able to mine the peer entities of the target entity, the embodiment of the present application introduces a multi-perspective atlas modeling technology to mine high-quality related entities from different levels, including the structural level, the name level, and the semantic level. Assume the target entity The (predicate, object) relationship included in the corresponding triple is expressed as . For the structural level, the ratio of the intersection and union of the of two entities is used to measure the similarity of the network structures of the two entities , and the calculation process is as shown in formula (1):
[0150] (1)
[0151] Among them, represents the target entity, represents any entity in the knowledge graph G.
[0152] For the name level, the similarity between the two entities is measured by the edit distance between the names of the two entities, where the edit distance between and is .
[0153] For the semantic level, the entity is represented as a low-dimensional dense real-valued vector through a representation learning model (TransE, Translating Embedding). The goal of the TransE model is to make the sum of the vector representations of the head entity and the relation vector representation as close as possible to the vector representation of the tail entity. During training, false triples are generated by sampling methods to make the distance between the correct triples and the false triples as far as possible. After training, the cosine distance of the entity vector representations can be used to judge the semantic similarity between two entities, where the semantic similarity between the two entities is represented as . The final similarity of the two entities is obtained by weighting the similarity degrees of the structural level, the literal level, and the semantic level , and the calculation process is as shown in formula (2):
[0154]
[0155] (2)
[0156] Among them, , , represent the weights at the structural level, name level, and semantic level respectively. The sum of the three is equal to 1. Sort the final similarity of the two entities from largest to smallest, and select entities greater than a certain threshold from the knowledge graph G as the peer entities of the target entity for the subsequent negative statement generation module.
[0157] 3) Negative statement generation module
[0158] Peer entities can be used to evaluate the expected value of statements related to entity e. Calculate the relative frequency of the (predicate, object) relationship in all peer entity triples based on probability statistics , and there is no such (predicate, object) relationship in the triple of the target entity. The calculation process is shown in formula (3):
[0159] (3)
[0160] where represents the total number of peer entities, represents the number of peer entities that exist in the knowledge graph G with the relationship.
[0161] It should be noted that if the value is larger, the probability that the negative statement corresponding to entity e holds is also larger. For example, the peer entities of "vitamin C tablets" include "vitamin K1 injection", "vitamin C calcium capsules", "calcium folinate for injection", and "vitamin C injection". Among them, "vitamin K1 injection", "vitamin C calcium capsules", and "calcium folinate for injection" all contain the (use with caution, pregnant women) relationship, then the corresponding , which means the probability that the generated negative statement (i.e., pregnant women can use vitamin C tablets) holds is 0.75.
[0162] However, this method does not consider the unique directivity of the relationship, which easily leads to redundant generated negative statements and has no practical application value. For example, "the alias of formaldehyde solution is formalin". Since an alias is usually unique, it can be known that the aliases of other drugs are not formalin. To avoid generating redundant negative statements, the embodiments of the present application utilize the functionality and inverse functionality of the relationship to evaluate the unique directivity of the relationship. Among them, the functionality and inverse functionality of relationship p are calculated as follows. The calculation process is shown in formulas (4) and (5):
[0163] (4)
[0164] (5)
[0165] Among them, represents the number of all e that satisfy when the p relationship is fixed, represents the number of all combinations that satisfy when the p relationship is fixed, represents the number of all o that satisfy when the p relationship is fixed.
[0166] Therefore, the functionality of relationship p defines the unique directivity of the head entity, while the inverse functionality defines the unique directivity of the tail entity. For example , it means that the department to which a doctor entity belongs is uniquely determined.
[0167] Finally, the probability value of the corresponding negative statement is determined according to the relevant frequency, the functionality of the relationship, and the inverse functionality. When the target entity e is the head entity, the probability value is as shown in formula (6):
[0168] (6)
[0169] When the target entity e is the tail entity, the corresponding probability value is as shown in formula (7):
[0170] (7)
[0171] Sort the probability values of all generated candidate negative statements from largest to smallest, and use a threshold to screen negative statements within a certain range as the generated result.
[0172] Apply the above technical solution of the embodiment of the present application to the Medication Assistant Knowledge Graph (i.e., the small graph), map the entities of the Medication Knowledge Graph to the crawled large-scale medical knowledge graph (i.e., the large graph), and then generate negative statements. As shown in Table 1, the negative statements generated by the embodiment of the present application are meaningful. For example, for the question "Can patients with hypertension take vitamin C tablets?", since only positive statements are stored in the small graph and there is no relevant triple indicating that patients with hypertension can take vitamin C tablets, the result of the KBQA task may be "No" or unable to answer. According to the reasoning result of the embodiment of the present application, it shows that " (vitamin c tablets, contraindications, hypertension)", that is, patients with hypertension can take vitamin C tablets.
[0173] Table 1 Generated negative statements
[0174]
[0175] Therefore, the negative statement generation method proposed in the embodiments of the present application can effectively generate some reasonable and significant knowledge, which can not only expand the scale and expression ability of the original knowledge graph, but also help to enhance the reasoning ability and generalization ability of downstream tasks (such as KBQA), mine potential valuable knowledge information, reduce the amount of manual annotation cost, and improve the efficiency of large-scale knowledge graph construction and development.
[0176] In summary, the embodiments of the present application have the following beneficial effects:
[0177] (1) By using entity linking technology, the general knowledge graph (such as a large-scale graph constructed from online resources such as Baidu Encyclopedia) and the vertical domain knowledge graph (such as the medication assistant knowledge graph) are combined to make up for the problem that it is difficult to evaluate the rationality and application value of the generated negative statements due to the incompleteness of knowledge in small graphs.
[0178] (2) When mining peer entities, a variety of perspective graph modeling techniques are integrated, considering information at different levels such as structure, semantics, and literal meaning, modeling the knowledge graph, fully extracting multi-dimensional matching features between entities, and mining highly relevant candidate peer entities for subsequent negative statement generation.
[0179] (3) When generating negative statements, the unique directivity of the relationship is measured by using the functionality and inverse functionality of the relationship, and practical negative statements are generated in combination with probability statistics, avoiding redundancy and enhancing the expression ability of the knowledge graph.
[0180] So far, the knowledge generation method based on artificial intelligence provided in the embodiments of the present application has been described in combination with the exemplary applications and implementations of the electronic devices provided in the embodiments of the present application. The embodiments of the present application also provide a knowledge generation device based on artificial intelligence. In practical applications, each functional module in the knowledge generation device based on artificial intelligence can be realized in cooperation with hardware resources of an electronic device (such as a terminal, a server, or a server cluster), such as computing resources such as a processor, communication resources (such as those used to support various communication methods such as optical cables and cellular networks), and a memory. Figure 2 The knowledge generation device 555 based on artificial intelligence stored in the memory 550 is shown, which can be software in the form of programs and plugins, for example, software modules designed in programming languages such as C / C++, Java, application software designed in programming languages such as C / C++, Java, or dedicated software modules, application programming interfaces, plugins, cloud services, etc. in large software systems. Examples of different implementation methods are described below.
[0181] Among them, the artificial intelligence-based knowledge generation device 555 includes a series of modules, including an entity linking module 5551, a fusion module 5552, a screening module 5553, and a generation module 5554. Next, the cooperation of each module in the artificial intelligence-based knowledge generation device 555 provided by the embodiments of the present application to implement the knowledge generation solution will be further described.
[0182] The entity linking module 5551 is used to perform entity linking processing on the second knowledge graph based on the first entity in the first knowledge graph to obtain a second entity associated with the first entity in the second knowledge graph; the fusion module 5552 is used to perform fusion processing on the first knowledge graph and the second knowledge graph to obtain a third knowledge graph including the first entity and the second entity; the screening module 5553 is used to perform screening processing on a plurality of first candidate entities included in the third knowledge graph based on the first entity and the second entity to obtain a plurality of similar entities corresponding to the first entity and the second entity; the generation module 5554 is used to perform prediction processing on the first entity based on the negative relationship based on the statement relationship of the plurality of similar entities in the third knowledge graph to obtain the negative statement knowledge of the first entity.
[0183] In some embodiments, the entity linking module 5551 is further used to perform clustering processing on a plurality of second candidate entities included in the second knowledge graph to obtain a plurality of candidate entity sets; perform matching processing on the plurality of candidate entity sets based on the first entity in the first knowledge graph to obtain a target entity set matching the first entity; perform screening processing on the second candidate entities included in the target entity set based on the first entity to obtain a second entity associated with the first entity in the second knowledge graph.
[0184] In some embodiments, the entity linking module 5551 is further used to determine a first similarity between the first entity and the second candidate entities included in the target entity set; use the second candidate entity corresponding to the maximum first similarity as the second entity associated with the first entity in the second knowledge graph.
[0185] In some embodiments, the entity linking module 5551 is further used to determine a name similarity between the first entity and the second candidate entities included in the target entity set; determine a semantic similarity between the first entity and the second candidate entity; perform weighted summation processing on the name similarity and the semantic similarity to obtain a first similarity between the first entity and the second candidate entity.
[0186] In some embodiments, the entity chain finger module 5551 is further configured to perform feature extraction processing on the first entity to obtain the semantic features of the first entity; perform feature extraction processing on the second candidate entity to obtain the semantic features of the second candidate entity; and perform similarity processing on the semantic features of the first entity and the semantic features of the second candidate entity to obtain the semantic similarity between the first entity and the second candidate entity.
[0187] In some embodiments, the screening module 5553 is further configured to determine a second similarity between the first entity and a first candidate entity included in the third knowledge graph; and when the second similarity is greater than a similarity threshold, use the first candidate entity as the similar entity corresponding to the first entity and the second entity.
[0188] In some embodiments, the screening module 5553 is further configured to determine a name similarity between the first entity and a first candidate entity included in the third knowledge graph; determine a semantic similarity between the first entity and the first candidate entity; determine a structural similarity between the first entity and the first candidate entity; and perform weighted summation processing on the structural similarity, the name similarity, and the semantic similarity to obtain a second similarity between the first entity and the first candidate entity included in the third knowledge graph.
[0189] In some embodiments, the screening module 5553 is further configured to determine a first statement relationship of the first entity in the third knowledge graph and determine a second statement relationship of the first candidate entity in the third knowledge graph; perform intersection logic processing on the first statement relationship and the second statement relationship to obtain an intersection feature value; perform union logic processing on the first statement relationship and the second statement relationship to obtain a union feature value; and use the ratio of the union feature value to the intersection feature value as the structural similarity between the first entity and the first candidate entity.
[0190] In some embodiments, the generating module 5554 is further configured to perform the following processing on any statement relationship of the multiple similar entities in the third knowledge graph: perform statistical processing on the statement relationships of the multiple similar entities to obtain an expected value of the first entity for the statement relationship; and when the expected value is greater than an expected value threshold, determine the negative statement knowledge of the first entity based on the negative relationship of the statement relationship.
[0191] In some embodiments, the generating module 5554 is further configured to determine the number of similar entities among the multiple similar entities that contain the statement relationship, and determine the total number of the multiple similar entities; and use the ratio of the number to the total number as the expected value of the first entity for the statement relationship.
[0192] In some embodiments, before using the ratio of the number to the total number as the expected value of the first entity for the statement relationship, the generating module 5554 is further configured to perform a functional processing of the relationship on the first entity to obtain first pointing information of the first entity as the head entity; perform an inverse functional processing of the relationship on the first entity to obtain second pointing information of the first entity as the tail entity; determine the expected value of the first entity as the head entity for the statement relationship based on the first pointing information and the ratio, wherein the expected value of the first entity as the head entity for the statement relationship is positively correlated with the ratio and negatively correlated with the first pointing information; and determine the expected value of the first entity as the tail entity for the statement relationship based on the second pointing information and the ratio, wherein the expected value of the first entity as the tail entity for the statement relationship is positively correlated with the ratio and negatively correlated with the second pointing information.
[0193] An embodiment of the present application provides a computer program product or a computer program, which includes computer instructions stored in a computer-readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the above-mentioned knowledge generation method based on artificial intelligence in the embodiments of the present application.
[0194] An embodiment of the present application provides a computer-readable storage medium storing executable instructions, where the executable instructions, when executed by a processor, will cause the processor to execute the knowledge generation method based on artificial intelligence provided in the embodiments of the present application. For example, Figures 3 - 5 the knowledge generation method based on artificial intelligence shown.
[0195] In some embodiments, the computer-readable storage medium may be a memory such as FRAM, ROM, PROM, EPROM, EEPROM, flash memory, magnetic surface memory, optical disc, or CD-ROM; or may be various devices including one or any combination of the above memories.
[0196] In some embodiments, the executable instructions may be in the form of a program, software, a software module, a script, or code, written in any form of programming language (including compiled or interpreted languages, or declarative or procedural languages), and may be deployed in any form, including being deployed as a stand-alone program or being deployed as a module, a component, a subroutine, or other unit suitable for use in a computing environment.
[0197] As an example, the executable instructions may or may not correspond to a file in a file system, may be stored as part of a file that holds other programs or data, for example, in one or more scripts in a Hyper Text Markup Language (HTML) document, stored in a single file dedicated to the program being discussed, or, stored in multiple cooperating files (such as files that store one or more modules, subroutines, or portions of code).
[0198] As an example, the executable instructions may be deployed to execute on one computing device, or on multiple computing devices located at one site, or, on multiple computing devices distributed across multiple sites and interconnected by a communication network.
[0199] As described above, the above are only embodiments of the present application and are not intended to limit the protection scope of the present application. Any modifications, equivalent replacements, and improvements made within the spirit and scope of the present application are all included in the protection scope of the present application.
Claims
1. A knowledge generation method based on artificial intelligence, characterized in that The method includes: Based on the first entity in the first knowledge graph, entity linking processing is performed on the second knowledge graph to obtain a second entity associated with the first entity in the second knowledge graph, where the first knowledge graph is a medical knowledge graph, and the entity types of the first entity and the second entity include any one of the following: disease, drug, symptom; Fusion processing is performed on the first knowledge graph and the second knowledge graph to obtain a third knowledge graph including the first entity and the second entity; Based on the first entity and the second entity, screening processing is performed on a plurality of first candidate entities included in the third knowledge graph to obtain a plurality of similar entities corresponding to the first entity and the second entity; Based on the statement relationships of the plurality of similar entities in the third knowledge graph, prediction processing based on negative relationships is performed on the first entity to obtain negative statement knowledge of the first entity.
2. The method according to claim 1, wherein The entity linking processing based on the first entity in the first knowledge graph to obtain a second entity associated with the first entity in the second knowledge graph includes: Clustering processing is performed on a plurality of second candidate entities included in the second knowledge graph to obtain a plurality of candidate entity sets; Based on the first entity in the first knowledge graph, matching processing is performed on the plurality of candidate entity sets to obtain a target entity set matching the first entity; Based on the first entity, screening processing is performed on the second candidate entities included in the target entity set to obtain a second entity associated with the first entity in the second knowledge graph.
3. The method according to claim 2, wherein The screening processing of the second candidate entities included in the target entity set to obtain a second entity associated with the first entity in the second knowledge graph includes: Determining a first similarity between the first entity and the second candidate entities included in the target entity set; Taking the second candidate entity corresponding to the maximum first similarity as the second entity associated with the first entity in the second knowledge graph.
4. The method according to claim 3, wherein The determining of the first similarity between the first entity and the second candidate entities included in the target entity set includes: Determining a name similarity between the first entity and the second candidate entities included in the target entity set; Determining a semantic similarity between the first entity and the second candidate entity; Performing weighted summation processing on the name similarity and the semantic similarity to obtain the first similarity between the first entity and the second candidate entity.
5. The method according to claim 4, characterized in that The determining of the semantic similarity between the first entity and the second candidate entity includes: Performing feature extraction processing on the first entity to obtain semantic features of the first entity; Performing feature extraction processing on the second candidate entity to obtain semantic features of the second candidate entity; Performing similarity processing on the semantic features of the first entity and the semantic features of the second candidate entity to obtain the semantic similarity between the first entity and the second candidate entity.
6. The method according to claim 1, wherein Performing a screening process on multiple first candidate entities included in the third knowledge graph based on the first entity and the second entity to obtain multiple similar entities corresponding to the first entity and the second entity, including: Determining a second similarity between the first entity and a first candidate entity included in the third knowledge graph; When the second similarity is greater than a similarity threshold, taking the first candidate entity as a similar entity corresponding to the first entity and the second entity.
7. The method according to claim 6, wherein The determining the second similarity between the first entity and a first candidate entity included in the third knowledge graph includes: Determining a name similarity between the first entity and a first candidate entity included in the third knowledge graph; Determining a semantic similarity between the first entity and the first candidate entity; Determining a structural similarity between the first entity and the first candidate entity; Performing a weighted summation process on the structural similarity, the name similarity, and the semantic similarity to obtain the second similarity between the first entity and a first candidate entity included in the third knowledge graph.
8. The method according to claim 7, characterized in that, The determining the structural similarity between the first entity and the first candidate entity includes: Determining a first statement relationship of the first entity in the third knowledge graph and determining a second statement relationship of the first candidate entity in the third knowledge graph; Performing an intersection logic process on the first statement relationship and the second statement relationship to obtain an intersection eigenvalue; Performing a union logic process on the first statement relationship and the second statement relationship to obtain a union eigenvalue; Taking the ratio of the union eigenvalue to the intersection eigenvalue as the structural similarity between the first entity and the first candidate entity.
9. The method according to claim 1, wherein Performing a prediction process on the first entity based on a negative relationship based on the statement relationships of the multiple similar entities in the third knowledge graph to obtain negative statement knowledge of the first entity, including: Performing the following process for any statement relationship of the multiple similar entities in the third knowledge graph: Performing a statistical process on the statement relationships of the multiple similar entities to obtain an expected value of the first entity for the statement relationship; When the expected value is greater than an expected value threshold, determining the negative statement knowledge of the first entity based on the negative relationship of the statement relationship.
10. The method according to claim 9, wherein The performing a statistical process on the statement relationships of the multiple similar entities to obtain an expected value of the first entity for the statement relationship includes: Determining the number of similar entities among the multiple similar entities that include the statement relationship and determining the total number of the multiple similar entities; Taking the ratio of the number to the total number as the expected value of the first entity for the statement relationship.
11. According to the method of claim 10, wherein Before taking the ratio of the number to the total number as the expected value of the first entity for the statement relationship, the method further includes: Performing a functionality process on the relationship of the first entity to obtain first pointing information of the first entity as a head entity; Perform inverse functional processing on the relationships of the first entity to obtain second pointing information with the first entity as the tail entity; Regarding the ratio of the quantity to the total quantity as the expected value of the first entity for the statement relationship includes: Based on the first pointing information and the ratio, determine the expected value of the first entity for the statement relationship when the first entity is the head entity, where the expected value of the first entity for the statement relationship when the first entity is the head entity is positively correlated with the ratio and negatively correlated with the first pointing information; Based on the second pointing information and the ratio, determine the expected value of the first entity for the statement relationship when the first entity is the tail entity, where the expected value of the first entity for the statement relationship when the first entity is the tail entity is positively correlated with the ratio and negatively correlated with the second pointing information.
12. An artificial intelligence-based knowledge generation device, characterized in that, The device includes: An entity linking module, configured to perform entity linking processing on a second knowledge graph based on a first entity in a first knowledge graph to obtain a second entity associated with the first entity in the second knowledge graph, where the first knowledge graph is a medical knowledge graph, and the entity types of the first entity and the second entity include any one of the following: disease, drug, symptom; A fusion module, configured to perform fusion processing on the first knowledge graph and the second knowledge graph to obtain a third knowledge graph including the first entity and the second entity; A screening module, configured to perform screening processing on a plurality of first candidate entities included in the third knowledge graph based on the first entity and the second entity to obtain a plurality of similar entities corresponding to the first entity and the second entity; A generation module, configured to perform prediction processing on the first entity based on a negative relationship based on the statement relationships of the plurality of similar entities in the third knowledge graph to obtain negative statement knowledge of the first entity.
13. An electronic device, characterized in that, The electronic device includes: A memory, configured to store executable instructions; A processor, configured to implement the artificial intelligence-based knowledge generation method according to any one of claims 1 to 11 when executing the executable instructions stored in the memory.
14. A computer-readable storage medium, characterized in that, Stored with executable instructions, configured to implement the artificial intelligence-based knowledge generation method according to any one of claims 1 to 11 when being executed by a processor.
15. A computer program product, comprising a computer program or instructions, characterized in that, When the computer program or instructions are executed by a processor, the artificial intelligence-based knowledge generation method according to any one of claims 1 to 11 is implemented.
Citation Information
Patent Citations
Data processing method, device and equipment and storage medium
CN112149400A
Knowledge graph entity alignment method based on improved auto-encoder and related equipment
CN112765362A