A large-scale noisy semantic graph entity type error detection method
By employing Semantic Web standard inference, node embedding anomaly detection, and triple linking methods, entity type errors in large semantic graphs are automatically detected and corrected, solving the accuracy problem of intelligent applications caused by entity type errors and improving the quality of semantic graphs.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SOUTHWEST UNIV
- Filing Date
- 2023-08-31
- Publication Date
- 2026-05-19
AI Technical Summary
Large semantic graphs contain numerous entity type errors, which reduces the accuracy and reliability of intelligent applications. Manual detection is impractical, and automated detection methods are needed.
We employ methods based on Semantic Web standards for reasoning improvement, node semantic embedding and anomaly detection, semantic graph type-attribute distribution statistics, and fact triple-based linking to automatically detect and correct entity type errors.
It enables efficient discovery and correction of entity type errors in semantic graphs without manual annotation, thereby improving the quality of semantic graphs and the accuracy of intelligent applications.
Smart Images

Figure CN117114100B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of computer technology and relates to a method for detecting entity type errors in large noisy semantic graphs. Background Technology
[0002] Large-scale encyclopedia and domain semantic graphs contain encyclopedic and domain knowledge and are the cornerstone of current intelligent applications in various fields, including question-answering systems, chat systems, intelligent diagnosis and treatment, and intelligent recommendation. Large-scale semantic graphs are enormous in size, with entity numbers generally in the millions and relationship scales in the tens of millions. They are constructed using a (semi-)automatic method, utilizing natural language processing algorithms to automatically extract entities from textual materials such as web pages and books and establish relationships between them. While natural language processing algorithms can quickly construct domain semantic graphs, their drawback is the presence of factual inconsistencies and errors. Such semantic graphs containing inconsistencies and errors are called "noisy semantic graphs." For example, according to literature statistics, 69%-99% of instances in large-scale encyclopedia semantic graphs like YAGO and DBpedia lack attributes, while in Freebase, 71% of people lack birthplace attributes. In DBpedia and Wikidata, 27% of entities have coarse classification errors, and 73% have fine classification errors. These errors severely impact the accuracy and reliability of intelligent applications that use semantic graphs as knowledge bases. Among these semantic graph noises, entity type errors are the most fundamental errors, because the correct determination of entity types is a basic requirement of any intelligent system and a fundamental knowledge upon which all intelligent applications rely.
[0003] Therefore, error detection in large semantic graphs to remove noise is crucial for improving semantic graph quality and the accuracy of related intelligent applications. However, due to the sheer size of large semantic graphs, relying on domain experts for manual error detection is impractical. This invention addresses the challenge of automatically detecting entity type errors in large semantic graphs by proposing an efficient automatic detection method that can effectively identify entity type errors in semantic graphs. Summary of the Invention
[0004] In view of this, the purpose of the present invention is to provide a method for detecting entity type errors in large noisy semantic graphs.
[0005] To achieve the above objectives, the present invention provides the following technical solution:
[0006] A method for detecting entity type errors in large noisy semantic graphs, comprising the following steps:
[0007] S1: Perform reasoning improvement on the noisy semantic graph based on the Semantic Web standard, complete the entity types that are not explicitly declared in the semantic graph through reasoning, and obtain the finest type of all entities;
[0008] S2: Entity type error detection based on node semantic embedding and anomaly detection. Its purpose is to take each finest type as the object, use the pre-trained real vectors of node semantic embedding to perform type anomaly detection for all the entity members contained in it, and discover the abnormal entities contained in the type.
[0009] S3: Distribution statistics of semantic graph type-attribute. Based on the anomalies found in S2, the semantic graph is initially cleaned, and the probability distribution of the entity type associated with each attribute is obtained.
[0010] S4: Entity type error detection based on fact triple links; for each entity and its corresponding finest type, based on the semantic graph type-attribute statistics in S3, calculate the trust level of the entity belonging to each finest type, and give a judgment according to the set threshold; according to the semantic graph ontology type hierarchy, label all parent types of the erroneous entity finest type, and finally obtain the semantic graph entity type error result.
[0011] Optionally, S1 specifically includes:
[0012] The semantic graph is composed of semantic data RDF triples, including ontology information and fact data. Based on the RDF and RDFS standards, the semantic graph uses `rdfs:subClassOf` to describe the hierarchical relationships between types, and `rdfs:domain` and `rdfs:range` to declare the domain and range of attributes. Before performing entity type error detection, implication reasoning is first performed based on the RDFS standard, including `rdfs:domain`, `rdfs:range`, and `rdfs:subClassOf`, to complete missing entity type declarations and triple data. The RDFS reasoning is implemented using the reasoning engine contained in the semantic database.
[0013] The semantic graph is defined as a six-tuple SG = <E,R,H,P,L R ,L E >, where E is the set of entities, R is the set of relations between entities, and H =<C,S> It represents a hierarchical relationship of types, where C is the set of all types, S is the set of relationships between types, P is the set of attributes (i.e., the set of relation types), and L... R R→P is a mapping from relation to relation type. It is a collection of entities to types, where Represents the power set of C;
[0014] For any entity e in SG; let C(e) denote the set of types to which e belongs and remove the top-level class: owl:Thing;
[0015] Definition 1: The finest type of an entity;
[0016] Given SG = <E,R,H,P,L R ,L E >, Let PathC(e) be the set of paths containing all types of entity e, then the finest type of e is:
[0017]
[0018] Where Level(c) represents the level in H where c is located;
[0019] According to definition 1, the finest type of an entity is the class that is deepest in the type hierarchy, and each entity can belong to a different finest type.
[0020] The process of refining entity types based on semantic graph reasoning includes the following steps:
[0021] S11: For any triplet (s,p,o)∈R, s,o∈E, p∈P in SG, use rdfs:domain and rdfs:range to infer and improve the types of s and o based on the domain and range declaration of attribute p;
[0022] S12: For any entity e∈E in SG, based on the type definition of e and rdfs:subClassOf, supplement the type set C(e) to which e belongs, that is, supplement the parent class reasoning of all e in H into C(e);
[0023] S13: For any entity e∈E in SG, extract the finest type C of e according to Definition 1. s (e) Obtain the finest set of types C for all entities. s =∪ e∈E C s (e).
[0024] Optionally, S2 specifically includes:
[0025] S21: Let C s It is the set containing the finest types of all entities; for any c∈C s To obtain all its entities, denoted as E(c), that is: E(c)={c|(e,rdf:type c),e∈E};
[0026] S22: For each entity e∈E(c), extract the pre-trained semantic embedding vector ee=[r1,r2,…,r n ], r i Let i be a real number, i = 1, ..., n, which is an n-dimensional real vector, where n can be 100, 150, 200 or 500;
[0027] The pre-trained semantic embedding vectors for semantic graphs include two options: RDF2Vec and Wikipedia2Vec.
[0028] S23: Let EE(c) be the set of all entity semantic embeddings in E(c). Perform attribute-based segmentation and distance-based anomaly detection on this set to identify anomalous entities in E(c).
[0029] S231: Attribute-based anomaly detection targets multi-attribute sample sets and identifies anomalous samples based on the differences between each attribute; it embeds the semantics of entities into an n-dimensional real vector ee = [r1, r2, ..., r n Each component of the entity semantic embedding EE(c) of type c is treated as an attribute value. Anomaly identification based on attribute segmentation is performed. Anomaly detection based on attribute segmentation is adopted: the Isolation Forest algorithm. The closer the outlier value is to 1, the higher the anomaly degree of the entity. An anomaly threshold δ is set. p The value should be no less than 0.7 to ensure that only anomalous entities are screened out; the anomalous entity vectors in EE(c) identified by the Isolation Forest algorithm are matched with the entity set E(c) and returned as anomalous entities, denoted as OL. p (c);
[0030] S232: By measuring the distance between the semantically embedded n-dimensional real vector ee and the cluster center, if the distance is greater than a set threshold, the semantically embedded vector deviating from the cluster center is determined to be an anomaly; a local outlier factor algorithm is used; outliers exceeding 1 are considered outliers, i.e., potential outliers; an anomaly threshold δ is set. d Not less than 3; the anomalous entity vectors in EE(c) identified by the local outlier factor algorithm are matched with the entity set E(c), and the anomalous entities are returned, denoted as OL. d (c);
[0031] S24: Perform a comprehensive evaluation on the anomalous entities obtained from S231 and S232; let the final set of anomalous entities be the intersection of attribute-based anomaly detection and distance-based anomaly detection: OL(c) = OL p (c)∩OL d (c); The set of all types of exception entities is denoted as OL. SG .
[0032] Optionally, S3 specifically includes:
[0033] S31: For the obtained abnormal entity OL SG Remove the entity from the corresponding type, that is: let e x If it is an exception entity of type c, then (e) xRemove rdf:type,c) from SG to obtain the initially cleaned semantic graph SG′, and update the finest type set C of entities. s ;
[0034] S32: For any attribute p∈P in the semantic graph, exclude semantic web custom attributes such as rdf:type and rdfs:label, and extract all fact triples related to p from the pre-cleaned semantic graph SG′, i.e.: T p ={(s,p,o)|s,o∈E′};
[0035] S33: T, the triples of all facts related to p extracted from S32. p Extract the finest type of the subject entity in each triple: C ss ={c|(s,rdf:type,c),(s,p,o)∈T p And c∈C s The finest type of the object entity, namely: C so ={c|(o,rdf:type,c),(s,p,o)∈T p And c∈C s}, where C s This is the finest set of types obtained after cleaning;
[0036] S34: For all C ss For type c, calculate the distribution:
[0037] Distri s (p,c)=|SE(c,p)| / |T p |
[0038] Where |SE(c,p)| represents T p The number of subject entities of type c in the middle;
[0039] Similarly, for all C so For type c, calculate the distribution:
[0040] Distri o (p,c)=|OE(c,p)| / |T p |
[0041] Where |OE(c,p)| represents T p The number of object entities whose object entity is of type c;
[0042] The two distributions above describe the probability that the subject entity s is of type c when a triple (s,p,o) exists, and the probability that the object entity o is of type c is Distri_s(p,c).
[0043] Optionally, S4 specifically includes:
[0044] S41: For any entity e∈E′ in the semantic graph SG′, extract the triples associated with e, let the number of triples be K, and calculate the attributes associated with e, i.e., the attributes pointing to e: P in (e)={p in |(s,p in ,e)∈SG′}, and the attribute pointed to by e: P out (e)={p out |(e,p out ,o)∈SG′};
[0045] S42: Extract all the finest categories of e, denoted as C. s (e), that is: C s (e) = {c|(e,rdf:type,c) and c∈C} s};
[0046] S43: Regarding C s For each type c in (e), calculate the probability that e is type c:
[0047]
[0048] Among them Distri o Distri is the probability that e is an object entity of type c. s It is the probability that e is the subject entity and its type is c;
[0049] S44: Based on the set threshold σ, where σ is 0.6, perform type error judgment: if Conf(c) < σ, then it is judged that it is wrong for entity e to be of type c.
[0050] The beneficial effects of this invention are as follows: The method proposed in this invention starts with the ontology information and factual relationship data of the semantic graph. First, it automatically infers and completes the entity types of the semantic graph based on the Semantic Web standards rdfs:domain, rdfs:range, and rdfs:subClassOf. Second, for the finest type of all entities, anomaly detection is performed based on the semantic embedding vector of the nodes to screen out abnormal entities contained in each type and to perform preliminary cleaning of the semantic graph. The third step is to perform type-attribute distribution statistics on the factual relationship data of the semantic graph after preliminary cleaning and calculate the association probability of type-attribute in factual relationships. Finally, using the results of the third step, the entity-type trust degree is calculated for all entities in the semantic graph based on triple links and type-attribute association probabilities, ultimately detecting entity type errors and returning the detection results.
[0051] The advantages of this invention are: (1) it eliminates the need for manual data annotation for entity type error detection in noisy semantic graphs; and (2) it fully utilizes the links and semantic information inherent in the semantic graph itself to improve the accuracy and efficiency of entity type error detection. This invention provides a solution for the automatic detection of entity type errors in large encyclopedic and domain-specific semantic graphs and lays the foundation for other error detection methods in semantic graphs.
[0052] Other advantages, objectives, and features of the invention will be set forth in part in the description which follows, and in part will be apparent to those skilled in the art from the following examination, or may be learned from practice of the invention. The objectives and other advantages of the invention can be realized and obtained through the following description. Attached Figure Description
[0053] To make the objectives, technical solutions, and advantages of the present invention clearer, the preferred embodiments of the present invention will be described in detail below with reference to the accompanying drawings, wherein:
[0054] Figure 1 The flowchart of the entity type error detection method for large noisy semantic graphs;
[0055] Figure 2 Application example of this invention: Smart Education;
[0056] Figure 3 Application Case 2 of this invention: Course Comparison and Recommendation;
[0057] Figure 4 An example of an educational semantic graph ontology type hierarchy;
[0058] Figure 5 To perform anomaly detection on entities in general education courses based on isolated forests;
[0059] Figure 6 To perform anomaly detection on entities in general education courses based on local outlier factors;
[0060] Figure 7 For the entity discrete mathematics course 2 and its associated fact triples. Detailed Implementation
[0061] The following specific examples illustrate the implementation of the present invention. Those skilled in the art can easily understand other advantages and effects of the present invention from the content disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and various details in this specification can be modified or changed based on different viewpoints and applications without departing from the spirit of the present invention. It should be noted that the illustrations provided in the following embodiments are only schematic representations of the basic concept of the present invention. Unless otherwise specified, the following embodiments and features can be combined with each other.
[0062] The accompanying drawings are for illustrative purposes only and are schematic diagrams, not actual pictures. They should not be construed as limiting the invention. To better illustrate the embodiments of the invention, some parts in the drawings may be omitted, enlarged, or reduced, and do not represent the actual product dimensions. It is understandable to those skilled in the art that some well-known structures and their descriptions may be omitted in the drawings.
[0063] In the accompanying drawings of the embodiments of the present invention, the same or similar reference numerals correspond to the same or similar components. In the description of the present invention, it should be understood that if terms such as "upper," "lower," "left," "right," "front," and "rear" indicate the orientation or positional relationship based on the orientation or positional relationship shown in the drawings, they are only for the convenience of describing the present invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, the terms used to describe positional relationships in the drawings are only for illustrative purposes and should not be construed as limiting the present invention. For those skilled in the art, the specific meaning of the above terms can be understood according to the specific circumstances.
[0064] 1. Overview of the method of this invention
[0065] To address the challenge of entity type error detection in large semantic graphs, this invention proposes an efficient entity type error detection method. Based on the ontology information (T-box) and factual relations (A-box) of the semantic graph, it diagnoses the type of entities and can detect entity type errors in noisy semantic graphs. Figure 1 These are the main steps included in the large-scale noisy semantic graph entity type error detection method proposed in this invention.
[0066] The method for addressing entity type errors in noisy semantic graphs proposed in this invention mainly comprises four steps. First, the noisy semantic graph is improved through inference based on the Semantic Web standard. The purpose is to complete the semantic graph by inference to fill in undeclared entity types and obtain the finest type of all entities. Second, entity type error detection is performed based on node semantic embedding and anomaly detection. This involves using the semantic embedding pre-trained real vectors of nodes to detect type anomalies in all entity members within each finest type, and to identify anomalous entities within that type. Third, semantic graph type-attribute distribution statistics are performed. This involves preliminary cleaning of the semantic graph based on the anomalies discovered in the second step and obtaining the probability distribution of entity types associated with each attribute. The final step is entity type error detection based on fact triple links. For each entity and its corresponding finest type, based on the type-attribute statistics from the third step, the trust level of the entity belonging to each finest type is calculated, and a judgment is given according to a set threshold. Finally, based on the semantic graph ontology type hierarchy, all parent types of the erroneous entity's finest type are labeled, ultimately yielding the semantic graph entity type error result.
[0067] 2. Overview of the Application of Large-Scale Noisy Semantic Graph Entity Type Error Detection in Smart Education Environments
[0068] Figure 2 This is an application case of the entity type error detection method for large noisy semantic graphs proposed in this invention in a smart education environment. Key components of a smart education environment include educational resource management and smart teaching applications. Large educational semantic graphs generated directly from public and private online educational resources contain noisy data and errors related to entities and relationships. As shown in the educational semantic graph, Discrete Mathematics Course 2 is a computer science course offered by Peking University, not an undergraduate general education course. However, because the educational semantic graph is automatically generated, the entity type of this course is incorrect, and the course is marked as both a computer science course and an undergraduate general education course, i.e.: (Discrete Mathematics Course 2, rdf:type, Computer Science Course, Discrete Mathematics Course 2, rdf:type, Undergraduate General Education Course).
[0069] Smart education applications, based on large-scale educational semantic graphs, can provide users with services including personalized educational resource recommendations, learning path optimization, and knowledge tracking. The accuracy of these intelligent applications depends on high-quality educational semantic graphs.
[0070] Figure 3This is a case study of personalized teaching resource recommendation based on educational semantic graphs: "Recommend undergraduate general education courses containing the content of 'Matrix Representation of Graph Theory'". If the recommendation is made on a noisy educational semantic graph, the recommendation results include Discrete Mathematics Course 1 and Discrete Mathematics Course 2; however, if the recommendation is made on a high-quality educational semantic graph after noise removal, it can be found that Discrete Mathematics Course 2 offered by Peking University does not meet the requirements, and the recommendation results are only Discrete Mathematics Course 1 offered by Southwest University.
[0071] Therefore, the entity type error detection method for large noisy semantic graphs proposed in this invention can be used to eliminate noise in large semantic graphs, generate high-quality semantic graphs, and provide reliable data support for intelligent applications in various fields.
[0072] 3. Refined entity type acquisition based on semantic graph reasoning
[0073] The purpose of semantic graph reasoning improvement based on the Semantic Web standard is to improve the entity types in the Semantic Web and extract the finest type to which the entity belongs, so as to provide a basis for subsequent type error prediction.
[0074] The semantic graph consists of semantic data RDF triples, including ontology information and fact data. Current semantics... Figure 1 Generally based on the RDF and RDFS standards (https: / / www.w3.org / 2000 / 01 / rdf-schema#), the hierarchical relationship between types can be described using `rdfs:subClassOf`, and the domain and range of attributes can be declared using `rdfs:domain` and `rdfs:range`. Before performing entity type error detection, this invention first performs implication reasoning based on the RDFS standard, including using `rdfs:domain`, `rdfs:range`, and `rdfs:subClassOf`, to complete missing entity type declarations and triple data. RDFS reasoning can be implemented using the reasoning engine included in semantic databases (such as AllegroGraph).
[0075] This invention defines a semantic graph as a six-tuple SG = <E,R,H,P,L R ,L E >, where E is the set of entities, R is the set of relations between entities, and H =<C,S> It represents a hierarchical relationship of types (where C is the set of all types, S is the set of relationships between types), P is the set of attributes, i.e., the set of relationship types, and L... R R→P is a mapping from relation to relation type. It is a collection of entities to types, where Let C be the power set.
[0076] For any entity e in SG, e can belong to multiple types. We use C(e) to denote the set of types to which e belongs, removing the top-level class: owl:Thing.
[0077] Definition 1 (Finest type of entity) Given SG = <E,R,H,P,L R ,L E >, Let PathC(e) be the set of paths containing all types of entity e, then the finest type of e is:
[0078]
[0079] Where Level(c) represents the level in H where c is located.
[0080] According to definition 1, the finest type of an entity is the deepest class in the type hierarchy, and each entity may belong to a different finest type. Figure 4 This is the example's educational semantic graph ontology type layer, where owl:Thing is the top-level class, and the type hierarchy only shows the relevant types. Let C(Discrete Mathematics Course 2) = {Course, Undergraduate Course, Engineering Course, Computer Science Course, General Education Course, Undergraduate General Education Course}, obtained from S1 and S2 above. Here, Path C(Discrete Mathematics Course) = {owl:Thing->Course->Undergraduate Course->Engineering Course->Computer Science Course, owl:Thing->Course->General Education Course->Undergraduate General Education Course}, containing two paths. Since Level(Course) = 1, Level(Undergraduate Course) = 2, Level(General Education Course) = 2, Level(Engineering Course) = 3, Level(Undergraduate General Education Course) = 3, and Level(Computer Science Course) = 4, the finest type in the path owl:Thing->Course->Undergraduate Course->Engineering Course->Computer Science Course is Computer Science Course; and the finest type in the path owl:Thing->Course->General Education Course is General Education Course. Therefore, the finest type of the Discrete Mathematics course 2 is C. s (Discrete Mathematics Course 2) = {Computer Science Course, Undergraduate General Education Course}.
[0081] The entity finest type acquisition method based on semantic graph reasoning proposed in this invention includes the following three steps:
[0082] S11: For any triple (s,p,o)∈R, s,o∈E, p∈P in SG, use rdfs:domain and rdfs:range to infer and improve the types of s and o based on the domain and range declaration of attribute p.
[0083] S12: For any entity e∈E in SG, according to the type definition of e and rdfs:subClassOf, supplement the type set C(e) to which e belongs, that is: supplement the parent class reasoning of all e in H into C(e).
[0084] S13: For any entity e∈E in SG, extract the finest type C of e according to Definition 1. s (e) Obtain the finest set of types C for all entities. s =∪ e∈E C s (e).
[0085] 4. Entity Type Error Detection Based on Node Semantic Embedding and Anomaly Detection
[0086] Entity type error detection based on node semantic embedding and anomaly detection mainly consists of four steps.
[0087] S21: Let C s It is the set containing the finest types of all entities. For any c∈C s We obtain all its entities, denoted as E(c), that is: E(c)={c|(e,rdf:type c),e∈E}.
[0088] S22: For each entity e∈E(c), extract the pre-trained semantic embedding vector ee=[r1,r2,…,r n ](r i Let i be a real number (i = 1, ..., n), which is an n-dimensional real vector. Generally, n can be 100, 150, 200 or 500.
[0089] There are two main choices for pre-trained semantic embedding vectors for semantic graphs:
[0090] (1)RDF2Vec(https: / / data.dws.informatik.uni-mannheim.de / rdf2vec / ) is based on graph walking, Weisfeiler-Lehman subtree RDF kernel, and skip-gram natural language model. It obtains semantic features of RDF dataset through deep learning.
[0091] (2) Wikipedia2Vec (https: / / wikipedia2vec.github.io / wikipedia2vec / ), which is based on skip-gram, anchor context and link graph model, and uses deep learning to obtain the semantic features of RDF datasets, especially the entities and words of Wikidata.
[0092] S23: Let EE(c) be the set of semantic embeddings of all entities in E(c). Perform attribute-based segmentation and distance-based anomaly detection on this set to identify anomalous entities in E(c).
[0093] S231: Attribute-based anomaly detection targets multi-attribute sample sets, identifying anomalous samples based on the differences between each attribute. This invention embeds the semantics of entities into an n-dimensional real vector ee = [r1, r2, ..., r...]. n Each component of the entity semantic embedding EE(c) of type c is treated as an attribute value, thus anomaly detection based on attribute segmentation can be performed on the entity semantic embedding EE(c) of type c. This invention employs the most efficient attribute segmentation-based anomaly detection algorithm currently available: the Isolation Forest algorithm. The closer the outlier value is to 1, the higher the anomaly degree of the entity. We set an anomaly threshold δ. p The accuracy should be no less than 0.7 to ensure that only anomalous entities are screened out without affecting correct entities; that is, to ensure high accuracy without considering recall. Anomalous entity vectors in EE(c) identified by the Isolation Forest algorithm are mapped to the entity set E(c), and the anomalous entities are returned, denoted as OL. p (c)
[0094] S232: Distance-based anomaly detection is a clustering method that uses the distance between a semantic embedding n-dimensional real vector *ee* and the cluster center. If the distance exceeds a set threshold, the semantic embedding vector deviating from the cluster center is considered an anomaly. This invention employs the most effective local outlier factor algorithm currently available for distance-based anomaly detection. An outlier value exceeding 1 is considered an outlier, i.e., a potential anomaly. To ensure high accuracy and efficiency in identifying genuine anomalous entities, we set an anomaly threshold δ. d Not less than 3. The anomalous entity vectors in EE(c) identified by the local outlier factor algorithm are mapped to the entity set E(c), and the anomalous entities are returned, denoted as OL. d (c)
[0095] S24: Perform a comprehensive evaluation of the anomalous entities obtained from S231 and S232. To ensure accuracy, but without requiring a high recall rate, let the final set of anomalous entities be the intersection of attribute-based anomaly detection and distance-based anomaly detection: OL(c) = OL p (c)∩OL d (c). The set of all types of exception entities is denoted as OL. SG .
[0096] Algorithm 1 implements the steps of entity type error detection based on node semantic embedding and anomaly detection.
[0097] Algorithm 1: Entity Type Error Detection Based on Node Semantic Embedding and Anomaly Detection
[0098] Enter Cs ,EE,δ d ,δ p ,α,τ
[0099] Output OL SG
[0100] 1)
[0101] 2) for c in C s :
[0102] 3) E(c) ← {c|(e,rdf:type c),e∈E} / / E(c) contains all entities of type c
[0103] 4) EE(c) ← {ee|e∈E(c) and ee is the semantic embedding vector of e} / / EE(c) contains the semantic embeddings of all entities of type c.
[0104] 5)OL p (c)←Property_OutlerDection(EE(c),δ p / / Attribute-based anomaly detection, δ p Threshold
[0105] 6)OL d (c)←Distance_OutlerDection(EE(c),δ d / / Distance-based anomaly detection, δ d Threshold
[0106] 7)OL(c)←OL p (c)∩OL d (c)
[0107] 8)OL SG (c)←OL(c)
[0108] 9)endfor
[0109] 10) Return to OL SG
[0110] Take the educational semantic graph as an example. Undergraduate general education courses are the finest set of types, C. s One element. For all undergraduate general education courses, entity E (undergraduate general education courses) is used to obtain the 100-dimensional semantic embedding vector of all entities via RDF2Vec. For example:
[0111] Introduction to Software Engineering = [0.1245 0.4200 0.2936 0.0924 -0.0669 0.0252 0.1407 -0.0729 0.0680 -0.2951 -0.2720 0.0785 0.0780 0.0248 0.0427 -0.1497 0.1013 -0.0257 0.0364 0.2647 0.0330 0.1047 0.0382 0.0138 -0.0162 -0.0733 0.0960 -0.2090 0.0561 0.1030 0.2898 -0.1914 -0.0927 0.1237] -0.0023 -0.4792 0.0523 -0.0819 0.3551 -0.2274 0.3301 0.0547 -0.1707 0.2304 -0.2599 -0.1389 -0.0106 0.1921 -0.3615 0.0077 -0.2439 0.1056 -0.0010 -0.2522 -0.2321 -0.1604 -0.2652 -0.0134 -0.3000 0.1215 0.0737 0.0215 -0.1647 0.2799 0.5886 -0.0189 -0.1250 -0.2438 -0.1621 -0.3960 -0.1078 0.2162 -0.1173 0.6267 -0.0788 0.0086 -0.1317 0.1440 -0.2035 -0.0742 -0.0536 -0.2773 0.1026 0.0356 0.3384 0.4606 -0.1893 0.0142 0.2269 0.1136 0.0962 0.1648 0.1065 0.0051 -0.1777 -0.0971 0.3434 0.2423 -0.1432 -0.1808).
[0112] Anomaly detection based on attribute segmentation (Isolation Forest) and distance-based anomaly detection (Local Outlier Factor) are performed on the semantic embedding vectors of all entities in E (undergraduate general education courses), as follows: Figure 5 and Figure 6 As shown, the abnormal entity set OL is obtained respectively. p (Undergraduate General Education Courses) = {Introduction to Software Engineering, Introduction to Programming} and OL d (Undergraduate General Education Courses) = {Introduction to Software Engineering, Introduction to Programming, Psychological Development and Education}. Combining the results of the two anomaly checks, we obtain OL (Undergraduate General Education Courses) = OL d(Undergraduate General Education Courses) ∩OL p (Undergraduate general education courses) = {Introduction to Software Engineering, Introduction to Programming}. Figure 5 Middle threshold δ p =0.7, Figure 6 Middle threshold δ d =3.
[0113] 5. Semantic Graph Attributes - Type Distribution Statistics
[0114] The purpose of semantic graph attribute-type information statistics is to provide semantic graph entity attribute-type distribution data for entity type error detection based on triple links. It mainly consists of the following four steps.
[0115] S31: First, for the abnormal entity OL obtained from Algorithm 1 SG Remove the entity from the corresponding type, that is: let e x If it is an exception entity of type c, then (e) x Remove rdf:type,c) from SG to obtain the initially cleaned semantic graph SG′, and update the finest type set C of entities. s .
[0116] S32: For any attribute p∈P in the semantic graph (excluding semantic web custom attributes such as rdf:type and rdfs:label), extract all fact triples related to p from the pre-cleaned semantic graph SG′, i.e.: T p ={(s,p,o)|s,o∈E′}.
[0117] S33: T, the triples of all facts related to p extracted from S32. p Extract the finest type of the subject entity in each triple: C ss ={c|(s,rdf:type,c),(s,p,o)∈T p And c∈C s The finest type of the object entity, namely: C so ={c|(o,rdf:type,c),(s,p,o)∈T p And c∈C s}, where C s This is the finest set of types obtained after cleaning.
[0118] S34: For all C ss For type c, calculate the distribution:
[0119] Distri s (p,c)=|SE(c,p)| / |T p |
[0120] Where |SE(c,p)| represents T p The number of subject entities in the middle is the number of subject entities of type c.
[0121] Similarly, for all C so For type c, calculate the distribution:
[0122] Distri o (p,c)=|OE(c,p)| / |T p |
[0123] Where |OE(c,p)| represents T p The number of object entities of type c.
[0124] The two distributions above describe the probability that the subject entity s is of type c when a triple (s,p,o) exists, and the probability that the object entity o is of type c, which is Distri_s(p,c).
[0125] Since clearly anomalous entities have been removed beforehand during the above statistical process, more accurate data can be provided for the next step of detecting entity types through triplet linking.
[0126] Algorithm 2 is a semantic graph type-attribute distribution statistical process.
[0127] Algorithm 2 Semantic Graph Type - Attribute Distribution Statistics
[0128] Enter SG,C s ,OL SG
[0129] Output Distri
[0130] 1) Initialize Distri
[0131] 2)SG′←cleanSemanticGraph(SG,OL SG / / Clear entities of type exception
[0132] 3) Update(SG′, C s )
[0133] 4) for p in P:
[0134] 5) T(p) ← {(s,p,o)|s,o∈E′} / / T(p) contains all triples with attribute p.
[0135] 6)C ss ←{c|(s,rdf:type,c),(s,p,o)∈T p And c∈C s / / C ss It is the finest set of subject entities in the triples of T(p).
[0136] 7)C so ←{c|(o,rdf:type,c),(s,p,o)∈T p And c∈C s / / C so It is the finest set of object entities in the triples of T(p).
[0137] 8) for c in C ss :
[0138] 9) SE(c,p)←{s|(s,rdf:type,c)and(s,p,o)∈T p} / / SE(c,p) is T p The subject entity is a set of subject entities of type c.
[0139] 10) Distri s (p,c)←|SE(c,p)| / |T p |
[0140] 11) Distri.append(Distri s (p,c))
[0141] 12)endfor
[0142] 13) for c in C so :
[0143] 14)OE(c,p)←{o|(o,rdf:type,c) and (s,p,o)∈T p / / OE(c,p) is T p The object entity is a set of object entities of type c.
[0144] 15) Distri o (p,c)←|OE(c,p)| / |T p |
[0145] 16) Distri.append(Distri o (p,c))
[0146] 17)endfor
[0147] 18)endfor
[0148] 19) Return to Distri
[0149] Taking the education semantic graph as an example. S31 removes the anomalous entities "Introduction to Software Engineering" and "Introduction to Programming" from the undergraduate general education course types discovered by Algorithm 1, that is, deletes the type descriptions of these two entities, rather than deleting the entities and their fact triples. According to S32, subject and object statistics are performed for each attribute of the semantic graph. Let the set of attributes of the education semantic graph be P = {offering institution, offering time, course content, major, course nature, prerequisite, follow-up, similarity}. Taking the attribute "follow-up" as an example, extract all fact triples related to "follow-up", that is: According to S33, for T 后续 We statistically analyze the finest types of objects and subjects in all triples, and let the finest subject type be C. ss = {Undergraduate major courses, undergraduate general education courses, graduate courses, computer science courses}, object entity finest type C so = {Undergraduate major courses, undergraduate general education courses, graduate courses, computer science courses}. According to the formula shown in S34, for T... 后续 The probability distribution of the finest type of the object and subject in all triples is calculated, resulting in the attribute follow-type distribution shown in Table 1. Note that the sum of the type distribution probability values of the subject and object is not 100%, because the finest type of each entity is not unique.
[0150] Given a fact triple (Discrete Mathematics Course 2, Follow-up, Data Structures), according to Table 1, the probability that Discrete Mathematics Course 2 is a Computer Science course is 0.801, while the probability that it is an undergraduate general education course is 0.005.
[0151] Table 1 shows the subsequent type distribution of attributes.
[0152] finest type subject(%) object(%) Undergraduate major courses 22.3 21.0 Undergraduate general education courses 0.005 0.0001 Postgraduate courses 23.5 35.3 Computer Science Course 80.1 63.0
[0153] 6. Entity Type Error Detection Based on Triple Linking
[0154] Entity type error detection based on triple links involves extracting triple information associated with a given entity and calculating the trust level of the entity to belong to a certain type based on the attribute-type distribution. It mainly includes the following four steps.
[0155] S41: For any entity e∈E′ in the semantic graph SG′, extract the triples associated with e, let the number of triples be K, and calculate the attributes associated with e, i.e., the attributes pointing to e: P in (e)={p in |(s,p in ,e)∈SG′}, and the attribute pointed to by e: P out (e)={p out |(e,p out ,o)∈SG′}.
[0156] S42: Extract all the finest categories of e, denoted as C. s (e), that is: C s (e) = {c|(e,rdf:type,c) and c∈C} s}
[0157] S43: Regarding C s For each type c in (e), calculate the probability that e is type c:
[0158]
[0159] Among them Distri o Distri is the probability that e is an object entity of type c. s It is the probability that e is the subject entity and its type is c.
[0160] S44: Perform type error judgment based on the set threshold σ (default is 0.6): If Conf(c) < σ, then it is judged that it is wrong for entity e to be of type c.
[0161] Algorithm 3 is an entity type error detection process based on triplet links.
[0162] Algorithm 3: Entity Type Error Detection Based on Triple Linking
[0163] Enter SG,Distri,OL SG C s ,σ
[0164] Output OL
[0165] 1) Initialize OL
[0166] 2) SG′←SG\OL SG / / SG′ is a semantic graph that removes anomalous entities and their triples discovered based on node semantic embedding and anomaly detection.
[0167] 3) for e in SG′:
[0168] 4)C s (e)←{c|(e,rdf:type,c)andc∈C} s / / Extract all finest categories of e
[0169] 5)P in (e)←{p in |(s,p in ,e)∈SG′} / / Extract the attribute pointing to e
[0170] 6)P out (e)←{p out |(e,pout ,o)∈SG′} / / Extract the attribute indicated by e
[0171] 7) T(e) ← {(e, p, o) | o ∈ E′ and p ∈ P} out (e)}∪{(s,p,e)|s∈E′andp∈P in (e)} / / T(e) contains all triples associated with e.
[0172] 8) for c in C s (e):
[0173] 9)Conf in ←0; Conf out ←0
[0174] 10) for p in P in (e):
[0175] 11)Conf in +=Distri o (p,c)
[0176] 12)endfor
[0177] 13) for p in P out (e):
[0178] 14)Conf out +=Distri s (p,c)
[0179] 15)endfor
[0180] 16)Conf(c)=(Conf in +Conf out ) / |T(e)|
[0181] 17) if Conf(c) < σ:
[0182] 18) OL.append(c,e,Cnf(c)) / / If the trust level is less than the given threshold, it is incorrect to determine that e is of type c.
[0183] 19)endfor
[0184] 20)endfor
[0185] 21) Return to OL
[0186] Taking educational semantic graphs as an example, consider the following: Figure 7 The entity shown is Discrete Mathematics Course 2 and its associated fact triples. The course content links are simplified here, showing only one course content triple. Pin (Discrete Mathematics Course 2) = {Similarity}, and the property indicated by e: P out (Discrete Mathematics Course 2) = {Subsequent events, course content, offering institution}. The finest type of Discrete Mathematics Course 2 is known to be C. s (Discrete Mathematics Course 2) = {Computer Science Courses, Undergraduate General Education Courses}.
[0187] Suppose that the relevant attribute-type distributions have been obtained according to Algorithm 2, as shown in Tables 2 and 3:
[0188] Table 2 shows the type probabilities of object entities in Discrete Mathematics Course 2.
[0189]
[0190] Table 3. Type probabilities of the subject entity in Discrete Mathematics Course 2
[0191]
[0192] Let the threshold σ = 0.6.
[0193] From the formula shown in S43, we can obtain:
[0194] Conf (Computer Science Course) = (0.671 + 0.801 + 0.630 + 0.411) / 4 = 0.628 > σ
[0195] Conf (Undergraduate General Education Courses) = (0.592 + 0.005 + 0.230 + 0.363) / 4 = 0.298 < σ
[0196] It is incorrect to classify Discrete Mathematics Course 2 as an undergraduate general education course.
[0197] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the present invention, and all such modifications or substitutions should be covered within the scope of the claims of the present invention.
Claims
1. A method for detecting entity type errors in large noisy semantic graphs, characterized in that: The method includes the following steps: S1: Perform reasoning improvement on the noisy semantic graph based on the Semantic Web standard, complete the entity types that are not explicitly declared in the semantic graph through reasoning, and obtain the finest type of all entities; S2: Entity type error detection based on node semantic embedding and anomaly detection. Its purpose is to take each finest type as the object, use the pre-trained real vectors of node semantic embedding to perform type anomaly detection for all the entity members contained in it, and discover the abnormal entities contained in the type. S3: Distribution statistics of semantic graph type-attribute. Based on the anomalies found in S2, the semantic graph is initially cleaned, and the probability distribution of the entity type associated with each attribute is obtained. S4: Entity type error detection based on fact triple links; for each entity and its corresponding finest type, based on the semantic graph type-attribute statistics in S3, calculate the trust level of the entity belonging to each finest type, and give a judgment according to the set threshold; according to the semantic graph ontology type hierarchy, label all parent types of the incorrect entity's finest type, and finally obtain the semantic graph entity type error result. Specifically, S1 is: Semantic graphs are composed of semantic data RDF triples, including ontology information and fact data; semantic graphs are based on the RDF and RDFS standards and use... rdfs:subClassOf Describe the hierarchical relationship between types, and use the domain and range of attributes. rdfs:domai n and rdfs:range A declaration is made; before performing entity type error detection, it is first based on the RDFS standard, including those based on... rdfs:domain , rdfs:range and rdfs:subClassOf Entailment reasoning is performed to complete missing entity type declarations and triple data; RDFS reasoning is implemented based on the reasoning engine contained in the semantic database. Define semantic graphs as six-tuples SG =< E , R , H , P , L R , L E >, among which E It is a collection of entities. R It is a set of relationships between entities. H =< C , S > represents a hierarchical relationship in terms of types, where C It is a collection of all types. S It is a set of relationships between types. P It is a set of attributes, that is, a set of relation types. L R : R P It is a mapping from relation to relation type. L E : R ( C ) is a collection of entities to types, where ( C )express C The power set; For any SG Entities in e ;use C ( e )express e The set of types to which it belongs, excluding the top-level class: owl:Thing; Definition 1: The finest type of an entity; Given SG =< E , R , H , P , L R , L E >, e E ,set up PathC ( e ) is an entity e The set of paths containing all types, then e The finest type is: in Level ( c )express c Location H The hierarchy within; According to definition 1, the finest type of an entity is the class that is deepest in the type hierarchy, and each entity can belong to a different finest type. The process of refining entity types based on semantic graph reasoning includes the following steps: S11: Yes SG Any triplet in the middle ( s , p , o ) R , s , o E , p P According to attributes p Domain and range declarations, using rdfs:domain and rdfs:range s and o The types are used to refine the reasoning; S12: Yes SG any entity e E ,according to e Type definitions and rdfs:subClassOf, for e The type set C ( e To supplement, that is, all H In e The parent class reasoning is supplemented to C ( e )middle; S13: Yes SG any entity e E Extract according to definition 1 e The finest type C s ( e This yields the finest set of types for all entities. C s = .
2. The method for detecting entity type errors in large noisy semantic graphs according to claim 1, characterized in that: Specifically, S2 is: S21: Let C s It is the set containing the finest types of all entities; for any c C s To retrieve all its entities, represented as E ( c ),Right now: E ( c )={ c | ( e , rdf:typec ), e E }; S22: Yes e E ( c For each entity in the semantic graph, extract the pre-trained semantic embedding vector. ee =[ r 1, r 2, …, r n ], r i For real numbers, i =1,…, n It is n 3D real vector, n Choose 100, 150, 200, or 500; The pre-trained semantic embedding vectors for semantic graphs include two options: RDF2Vec and Wikipedia2Vec. S23: Let EE ( c )for E ( c The set consisting of the semantic embeddings of all entities is used to perform attribute-based segmentation and distance-based anomaly detection on the set. E ( c Identify abnormal entities in the data; S231: Attribute-based anomaly detection targets multi-attribute sample sets and identifies anomalous samples based on the differences between each attribute; it embeds the semantics of entities. n 3D real vector ee =[ r 1, r 2, …, r n Each component is treated as an attribute value, depending on the type. c Entity semantic embedding EE ( c Anomaly identification based on attribute segmentation is performed; anomaly detection based on attribute segmentation is employed: the Isolation Forest algorithm; The closer an outlier is to 1, the higher the anomaly level of the entity; set an anomaly threshold. δ p A score of at least 0.7 is required to ensure that only anomalous entities are detected; entities identified using the Isolation Forest algorithm... EE ( c The abnormal entity vector in ) and its association with the entity set E ( c The corresponding exception entity is returned, denoted as ) OL p ( c ); S232: Through semantic embedding n 3D real vector ee The distance from the cluster center is used to determine if the semantic embedding vector deviating from the cluster center is an outlier if the distance is greater than a set threshold. A local outlier factor algorithm is employed. Outliers exceeding 1 are considered outliers, i.e., potential outliers. An outlier threshold is set. δ d Not less than 3; identified through the local outlier factor algorithm EE ( c The abnormal entity vector in ) and its association with the entity set E ( c The corresponding exception entity is returned, denoted as ) OL d ( c ); S24: Perform a comprehensive evaluation of the anomalous entities obtained from S231 and S232; let the final set of anomalous entities be the intersection of attribute-based anomaly detection and distance-based anomaly detection: OL ( c )= OL p ( c ) OL d ( c The set of all types of exception entities is denoted as . OL SG .
3. The method for detecting entity type errors in large noisy semantic graphs according to claim 2, characterized in that: Specifically, S3 is: S31: For the obtained abnormal entities OL SG To remove the entity from the corresponding type, that is: Let e x For type c The abnormal entity will ( e x , rdf:type , c )from SG After removing the semantic graph, we obtain a preliminarily cleaned semantic graph. SG And update the finest set of entity types. C s ; S32: For any attribute of the semantic graph p P ,exclude rdf:type and rdfs:label Semantic Web custom attributes, from the semantic graph after initial cleaning SG Extraction and p All relevant fact triples, namely: T p ={( s , p , o )| s , o E }; S33: Extracted from S32 and p All relevant fact triples T p Extract the finest type of the subject entity of each triple: C ss ={ c |( s , rdf:type , c ), ( s , p , o ) T p and c C s The finest type of object entity, namely: C so ={ c |( o , rdf:type , c ), ( s , p , o ) T p and c C s },in C s This is the finest set of types obtained after cleaning; S34: For all C ss Types in c Calculate the distribution: Distri s ( p , c )= |SE ( c , p )| / | T p | Among them | SE ( c , p )| indicates T p The subject entity is a type c The number of subject entities; Similarly, for all C so Types in c Calculate the distribution: Distri o ( p , c )= |OE ( c , p )| / | T p | Among them |O E ( c , p )| indicates T p The object entity is a type c The number of object entities; The two calculation distributions above describe when a triple ( s , p , o When it exists, its subject entity s For type c The possibility is Distri_s ( p , c ), its object entity o For type c The possibility is Distri_o ( p , c ) .
4. The method for detecting entity type errors in large noisy semantic graphs according to claim 3, characterized in that: Specifically, S4 is: S41: For semantic graphs SG any entity e E Extraction and e The number of related triples is given by... K and calculate with e Related attributes, i.e., pointing to e Attributes: P in ( e )={ p in |( s , p in , e ) SG }, and from e The specified attributes: P out ( e )={ p out |( e , p out , o ) SG }; S42: Extract e All the finest categories are denoted as C s ( e ),Right now: C s ( e )={ c |( e , rdf:type , c )and c C s }; S43: Yes C s ( e Each type in ) c ,calculate e For type c The probability of: in Distri o yes e As an object entity and of type c The probability, Distri s yes e As the subject entity and of type c The probability of; S44: Based on the set threshold σ , σ Take 0.6 and perform a type error check: If Conf ( c )< σ Then determine the entity e For type c That is incorrect.