Multi-source knowledge fusion method, device and equipment based on semantic calculation
By employing a multi-source knowledge fusion method based on semantic computing, and utilizing target word vector models and confidence evaluation models, structured data in a unified format is generated, a semantic vector space is constructed, and comprehensive similarity and confidence evaluation values are determined. This solves the problem of inaccurate semantic understanding in multi-source knowledge fusion and achieves efficient and accurate knowledge fusion.
Patent Information
- Application Number
- CN202510876781.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-27
- Publication Date
- 2025-11-21
- Estimated Expiration
- 2045-06-27
AI Technical Summary
Existing technologies cannot effectively process the complex semantic information of multi-source knowledge, resulting in significant differences in knowledge format, granularity, and accuracy, and inaccurate semantic understanding and processing.
A multi-source knowledge fusion method based on semantic computing is adopted. Structured data in a unified format is generated through preprocessing, a semantic vector space is constructed using a target word vector model, and a confidence evaluation model is combined to determine the comprehensive similarity and confidence evaluation values, thereby generating a fused knowledge base.
It improves the accuracy and consistency of multi-source knowledge fusion, solves the problems of lack of semantic understanding and inaccurate processing in existing technologies, and enhances the decision support and intelligent analysis capabilities of knowledge.
Smart Images

Figure CN120372022B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of data processing technology, and in particular to a method, apparatus, and device for multi-source knowledge fusion based on semantic computing. Background Technology
[0002] With the development of the internet, artificial intelligence, and big data technologies, more and more knowledge is being acquired through various channels. This knowledge includes structured data knowledge from different sources, as well as structured knowledge extracted from multi-source unstructured data. Multi-source knowledge may have synonymous, near-synonymous, or polysemous expressions, facing potential data redundancy or conflicts. This results in significant differences in knowledge format, granularity, and precision, necessitating fusion processing to achieve a unified expression.
[0003] Multi-source knowledge fusion technology uses appropriate rules and algorithms to determine whether two or more pieces of knowledge represent the same meaning, and merges descriptive information about an entity, concept, relationship, or event from different sources to improve the richness and accuracy of knowledge. Common knowledge fusion work involves performing conflict detection, name unification, entity disambiguation, and entity alignment on multi-source knowledge, merging identical information and unifying similar information.
[0004] Previous knowledge fusion methods mainly relied on traditional rule matching and data mining algorithms, which are usually unable to effectively handle complex semantic information and have low accuracy. Summary of the Invention
[0005] To address the aforementioned shortcomings in existing technologies, this invention provides a multi-source knowledge fusion method, apparatus, and device based on semantic computing. This method effectively integrates knowledge from different sources and ensures the accuracy of data fusion through confidence assessment values and comprehensive similarity calculations, thereby solving the problems of lack of semantic understanding and inaccurate processing in existing technologies.
[0006] In a first aspect, the present invention provides a multi-source knowledge fusion method based on semantic computing, which includes the following steps:
[0007] Multi-source data is preprocessed to generate multiple structured data in a unified format, and knowledge units corresponding to each structured data in a unified format are extracted from each structured data in a unified format.
[0008] Each of the knowledge units is input into the target word vector model to obtain the target semantic vector corresponding to each knowledge unit;
[0009] Determine the comprehensive similarity between the target semantic vectors corresponding to each knowledge unit; the comprehensive similarity is determined based on the normalized weighted value of cosine similarity and Euclidean distance;
[0010] Based on the confidence assessment model, the confidence assessment value of each knowledge unit is determined; the confidence assessment value of each knowledge unit is used to characterize the reliability of each knowledge unit.
[0011] A fused knowledge base is generated based on the comprehensive similarity between the target semantic vectors corresponding to each knowledge unit and the confidence evaluation value of each knowledge unit.
[0012] According to the present invention, a multi-source knowledge fusion method based on semantic computing is provided, wherein the target word vector model includes an embedding layer, a self-attention mechanism module and a pooling layer, and the embedding layer is a lightweight bidirectional encoder representation ALBERT model.
[0013] The step of inputting each of the knowledge units into the target word vector model to obtain the target semantic vector corresponding to each of the knowledge units includes:
[0014] Perform vector transformation on each of the knowledge units to obtain the multi-dimensional word vectors corresponding to each knowledge unit;
[0015] The multi-dimensional word vectors corresponding to each knowledge unit are input into the ALBERT model to obtain the embedding vectors corresponding to each knowledge unit.
[0016] The embedding vector corresponding to each knowledge unit is input into the encoder of the ALBERT model to obtain the first semantic vector corresponding to each knowledge unit;
[0017] Each of the first semantic vectors is input into the self-attention mechanism module to obtain the second semantic vector corresponding to each of the first semantic vectors output by the self-attention mechanism module;
[0018] Each of the second semantic vectors is input into the pooling layer for mean pooling to obtain the target semantic vector corresponding to each knowledge unit; the target semantic vector is a global semantic vector representation.
[0019] According to the multi-source knowledge fusion method based on semantic computation provided by the present invention, the step of inputting each first semantic vector into the self-attention mechanism module to obtain a second semantic vector corresponding to each first semantic vector output by the self-attention mechanism module includes:
[0020] Each of the first semantic vectors is multiplied by the query matrix, the key matrix, and the value matrix respectively to generate the query vector, key vector, and value vector corresponding to each of the first semantic vectors;
[0021] The attention score of each first semantic vector is determined by the inner product of the query vector and the key vector corresponding to each first semantic vector.
[0022] The attention scores of each first semantic vector are normalized using the soft-max function to obtain the attention weights of each first semantic vector.
[0023] The attention weights of each first semantic vector are weighted and summed with the value vectors to obtain each second semantic vector.
[0024] According to a multi-source knowledge fusion method based on semantic computation provided by the present invention, determining the comprehensive similarity between the target semantic vectors corresponding to each knowledge unit includes:
[0025] Determine the cosine similarity and the Euclidean distance between each of the target semantic vectors; the cosine similarity represents the direction between two vectors, and the Euclidean distance represents the distance between two vectors;
[0026] The cosine similarity and Euclidean distance between the target semantic vectors are weighted and normalized using a first preset weight coefficient and a second preset weight coefficient to obtain the comprehensive similarity between the target semantic vectors corresponding to each knowledge unit; the sum of the first preset weight coefficient and the second preset weight coefficient is 1.
[0027] According to the multi-source knowledge fusion method based on semantic computing provided by the present invention, the step of determining the confidence evaluation value of each knowledge unit based on a confidence evaluation model includes:
[0028] Construct a multi-dimensional feature matrix that includes source information, evidence, literature records, logic, expert opinions, public evaluation, time factors, spatial factors, and related information;
[0029] An indicator parameter weight matrix is generated by comparing each pair of indicators. The indicator parameter weight matrix is then normalized to obtain the weight value of each indicator parameter.
[0030] Based on the weight values of each indicator parameter and the multidimensional feature matrix, the multidimensional features are weighted and summed to generate a confidence evaluation value for each knowledge unit.
[0031] According to a multi-source knowledge fusion method based on semantic computing provided by the present invention, the step of generating a fused knowledge base based on the comprehensive similarity between the target semantic vectors corresponding to each knowledge unit and the confidence evaluation value of each knowledge unit includes:
[0032] Based on the comprehensive similarity between the target semantic vectors corresponding to each knowledge unit, redundant knowledge pairs and contradictory knowledge pairs in each knowledge unit are determined.
[0033] The fused knowledge base is generated based on the confidence evaluation values of the redundant knowledge pairs and the contradictory knowledge pairs.
[0034] According to the multi-source knowledge fusion method based on semantic computing provided by the present invention, the step of determining redundant knowledge pairs and contradictory knowledge pairs in each knowledge unit based on the comprehensive similarity between the target semantic vectors corresponding to each knowledge unit includes:
[0035] If the comprehensive similarity between the target semantic vectors corresponding to any two knowledge units in each knowledge unit is greater than or equal to a preset redundancy threshold, then any two knowledge units are marked as the redundant knowledge pair.
[0036] If any two knowledge units are contradictory and the overall similarity between the target semantic vectors corresponding to any two knowledge units is lower than the preset redundancy threshold, then any two knowledge units are marked as the contradictory knowledge pair.
[0037] The process of generating the fused knowledge base based on the confidence evaluation values of the redundant knowledge pairs and the contradictory knowledge pairs includes:
[0038] The knowledge units with higher confidence scores among the redundant knowledge pairs are retained, and the knowledge units of the contradictory knowledge pairs are weighted and fused according to their confidence scores to generate new knowledge units.
[0039] The fused knowledge base is determined based on the knowledge units with larger confidence scores and the new knowledge units.
[0040] According to the multi-source knowledge fusion method based on semantic computing provided by the present invention, the method further includes:
[0041] The performance of the fusion results is quantified by accuracy, recall, and F1 score;
[0042] Wherein, the accuracy rate is the proportion of correctly fused knowledge pairs to the total number of fused knowledge pairs, the recall rate is the proportion of correctly fused knowledge pairs to the total number of fused knowledge pairs, and the F1 value is the harmonic mean of the accuracy rate and the recall rate.
[0043] Secondly, the present invention also provides a multi-source knowledge fusion device based on semantic computing, the device comprising the following modules:
[0044] The preprocessing module is used to preprocess multi-source data, generate multiple structured data in a unified format, and extract knowledge units corresponding to each structured data in a unified format from each structured data in a unified format.
[0045] The fusion module is used to input each of the knowledge units into the target word vector model to obtain the target semantic vector corresponding to each of the knowledge units;
[0046] Determine the comprehensive similarity between the target semantic vectors corresponding to each knowledge unit; the comprehensive similarity is determined based on the normalized weighted value of cosine similarity and Euclidean distance;
[0047] Based on the confidence assessment model, the confidence assessment value of each knowledge unit is determined; the confidence assessment value of each knowledge unit is used to characterize the reliability of each knowledge unit.
[0048] A fused knowledge base is generated based on the comprehensive similarity between the target semantic vectors corresponding to each knowledge unit and the confidence evaluation value of each knowledge unit.
[0049] Thirdly, the present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the multi-source knowledge fusion method based on semantic computing as described above.
[0050] Fourthly, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the multi-source knowledge fusion method based on semantic computing as described above.
[0051] Fifthly, the present invention also provides a computer program product, including a computer program that, when executed by a processor, implements the multi-source knowledge fusion method based on semantic computing as described above.
[0052] The multi-source knowledge fusion method, apparatus, and device based on semantic computing provided by this invention first preprocesses the multi-source data to generate multiple structured data in a unified format, and extracts the knowledge units corresponding to each unified format structured data from each structured data. Then, each knowledge unit is input into a target word vector model to obtain the target semantic vector corresponding to each knowledge unit, and a semantic vector space is constructed based on the target semantic vector corresponding to each knowledge unit. Further, the comprehensive similarity between the target semantic vectors corresponding to each knowledge unit is determined, and the comprehensive similarity is determined by a normalized weighted value based on cosine similarity and Euclidean distance. Based on a confidence evaluation model, the confidence evaluation value of each knowledge unit is determined. The confidence evaluation value of each knowledge unit is used to characterize the reliability of each knowledge unit. Finally, based on the comprehensive similarity between the target semantic vectors corresponding to each knowledge unit and the confidence evaluation value of each knowledge unit, a fused knowledge base is generated.
[0053] This invention first preprocesses multi-source data, using a target word vector model to generate target semantic vectors corresponding to each knowledge unit. Then, based on the comprehensive similarity of each target semantic vector and the confidence evaluation value of each knowledge unit, the knowledge units are fused to obtain a fused knowledge base. This effectively integrates knowledge from different sources, and the accuracy of data fusion is ensured through confidence evaluation values and comprehensive similarity calculations, thereby solving the problems of lack of semantic understanding and inaccurate processing in existing technologies. Attached Figure Description
[0054] To more clearly illustrate the technical solutions in this invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0055] Figure 1 This is one of the flowcharts of the multi-source knowledge fusion method based on semantic computing provided by the present invention.
[0056] Figure 2 This is a schematic diagram illustrating the effect of the multi-source knowledge fusion method based on semantic computing provided by the present invention.
[0057] Figure 3 This is the second flowchart of the multi-source knowledge fusion method based on semantic computing provided by the present invention.
[0058] Figure 4 This is a schematic diagram of the structure of the multi-source knowledge fusion device based on semantic computing provided by the present invention.
[0059] Figure 5 This is a schematic diagram of the structure of the electronic device provided by the present invention. Detailed Implementation
[0060] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.
[0061] To more clearly understand the various embodiments provided by the present invention, the technical content involved in the present invention will first be described as follows:
[0062] With the rapid development of big data and artificial intelligence technologies, multi-source knowledge fusion has become a key means of acquiring accurate and comprehensive knowledge, and an important research direction in the field of artificial intelligence. However, knowledge from different sources often presents different formats, structures, and semantic expressions. In multi-source knowledge fusion, there are often gaps between the accuracy, efficiency, knowledge representation, and fusion effect and the needs of practical applications. This makes it crucial to study more effective fusion methods and achieve more efficient fusion results.
[0063] Traditional knowledge fusion methods often fail to effectively handle complex semantic information, lacking flexibility and accuracy, and are inefficient. Furthermore, simple similarity calculations cannot handle synonyms, near-synonyms, or polysemy in different contexts, and their capabilities in automatic reasoning and intelligent recognition of contextual information are limited. For example, "apple" can refer to both a type of fruit and a mobile phone brand; similarly, different place names may share the same meaning.
[0064] Therefore, there is an urgent need for a multi-source knowledge fusion method based on semantic computing, which can automatically and accurately fuse data and knowledge from different sources to improve the ability of knowledge to support decision-making, automatic reasoning, and intelligent analysis.
[0065] Based on the above-mentioned shortcomings in the existing technology, the present invention provides a multi-source knowledge fusion method based on semantic computing, which can effectively fuse knowledge from different sources and ensure the accuracy and consistency of information through knowledge confidence assessment, thereby solving the problems of lack of semantic understanding and inaccurate processing in the existing technology.
[0066] The following is combined Figures 1-5 This invention describes a multi-source knowledge fusion method, apparatus, and device based on semantic computing.
[0067] Figure 1 This is one of the flowcharts illustrating the multi-source knowledge fusion method based on semantic computing provided by this invention, such as... Figure 1 As shown, the method includes the following:
[0068] Step 101: Preprocess the multi-source data to generate multiple structured data in a unified format, and extract the knowledge units corresponding to the structured data in each unified format from the structured data in each unified format.
[0069] It should be noted that the subject of this invention is an electronic device used to realize multi-source knowledge fusion based on semantic computing. By constructing a unified knowledge semantic vector space, calculating normalized similarity, and combining it with a confidence evaluation algorithm, it achieves efficient fusion of multi-source knowledge, effectively solving the accuracy and efficiency problems in multi-source knowledge fusion, and providing strong support for the development of big data and artificial intelligence.
[0070] The method provided in this embodiment includes the following:
[0071] First, the multi-source data is preprocessed to obtain multiple structured data in a unified format.
[0072] By acquiring structured, semi-structured, and unstructured data from various sources, and using Python's built-in modules or database operation statements, preprocessing operations such as cleaning, deduplication, and format conversion are performed to obtain multiple pieces of structured data in a unified format. Python is a high-level scripting language that combines interpretation, compilation, interactivity, and object-oriented features.
[0073] Furthermore, knowledge units corresponding to the structured data in each unified format are extracted from the structured data in each unified format.
[0074] For example, based on dataset mapping and trained extraction model tools, knowledge such as entity names, attributes, relationships, and events can be extracted from multi-source data to obtain knowledge units corresponding to structured data in a unified format.
[0075] The expression of this knowledge may contain repetitions, polysemy, synonyms, ambiguity, etc. For example, in the domain of entity targets such as airports, ports, aircraft, ships, and vehicles, different expressions may refer to the same entity name.
[0076] Step 102: Input each knowledge unit into the target word vector model to obtain the target semantic vector corresponding to each knowledge unit;
[0077] After extracting the knowledge units corresponding to the multi-source data, the improved word vector model (target word vector model) can be used to represent each knowledge unit as a vector to obtain the target semantic vector corresponding to each knowledge unit, and then construct the semantic vector space.
[0078] Then, similarity calculation and confidence evaluation can be performed based on the semantic vectors of each target, which facilitates the effective fusion of multi-source knowledge.
[0079] The target word vector model of this invention includes an embedding layer, a pooling layer, and a self-attention mechanism module. The embedding layer is a lightweight bidirectional encoder representation from transformers (ALBERT) model, and a self-attention mechanism is introduced between the embedding layer and the pooling layer, so that the generated word vectors can pay more attention to the keywords and important contextual information in the text and can handle polysemous words.
[0080] Each knowledge unit is sequentially input into the embedding layer, the self-attention mechanism, and the pooling layer to obtain the output target semantic vectors.
[0081] Step 103: Determine the comprehensive similarity between the target semantic vectors corresponding to each knowledge unit; the comprehensive similarity is determined based on the normalized weighted value of cosine similarity and Euclidean distance;
[0082] Specifically, for each knowledge unit in the multi-source knowledge, its similarity with other knowledge units is calculated to form a similarity matrix, which facilitates the subsequent determination of the fusion strategy based on the comprehensive similarity.
[0083] The comprehensive similarity in this invention is determined by a normalized weighted average of cosine similarity and Euclidean distance. The comprehensive similarity calculation based on semantic vector space incorporates normalized formulas for angle and spatial distance, resulting in a more comprehensive similarity calculation.
[0084] Step 104: Based on the confidence assessment model, determine the confidence assessment value of each knowledge unit; the confidence assessment value of each knowledge unit is used to characterize the reliability of each knowledge unit.
[0085] It should be noted that for some knowledge from multiple sources, due to the influence of various factors such as the authority of the data source, changes in time and space, collection methods, and processing methods, it is sometimes impossible to ensure the authenticity and accuracy of the knowledge obtained, and there may be contradictions, conflicts, or situations where it is "difficult to distinguish between true and false".
[0086] Therefore, this invention uses a confidence assessment model to calculate the confidence assessment value of each knowledge unit, thereby enabling confidence ranking of knowledge units from multiple sources that have contradictions and conflicts. The knowledge units ranked first are then fused and stored in the knowledge base based on a similarity threshold, while the rest are discarded.
[0087] The confidence score of each knowledge unit is used to characterize the reliability of each knowledge unit. The higher the confidence score of a knowledge unit, the higher its reliability. Conversely, the lower the confidence score of a knowledge unit, the lower its reliability.
[0088] Step 105: Generate the fused knowledge base based on the comprehensive similarity between the target semantic vectors corresponding to each knowledge unit and the confidence evaluation value of each knowledge unit.
[0089] Specifically, the knowledge fusion algorithm is optimized based on the comprehensive similarity between the target semantic vectors corresponding to each knowledge unit and the confidence evaluation value of each knowledge unit. Thus, a fused knowledge base is generated based on the knowledge fusion algorithm.
[0090] The method provided in this embodiment first preprocesses multi-source data to generate multiple structured data in a unified format, and extracts knowledge units corresponding to each unified format structured data from each structured data. Then, it inputs each knowledge unit into a target word vector model to obtain the target semantic vector corresponding to each knowledge unit, and constructs a semantic vector space based on the target semantic vector corresponding to each knowledge unit. Further, it determines the comprehensive similarity between the target semantic vectors corresponding to each knowledge unit, which is determined by a normalized weighted value based on cosine similarity and Euclidean distance. Based on a confidence evaluation model, it determines the confidence evaluation value of each knowledge unit. The confidence evaluation value of each knowledge unit is used to characterize the reliability of each knowledge unit. Finally, based on the comprehensive similarity between the target semantic vectors corresponding to each knowledge unit and the confidence evaluation value of each knowledge unit, it generates a fused knowledge base.
[0091] This invention first preprocesses multi-source data, using a target word vector model to generate target semantic vectors corresponding to each knowledge unit. Then, based on the comprehensive similarity of each target semantic vector and the confidence evaluation value of each knowledge unit, the knowledge units are fused to obtain a fused knowledge base. This effectively integrates knowledge from different sources, and the accuracy of data fusion is ensured through confidence evaluation values and comprehensive similarity calculations, thereby solving the problems of lack of semantic understanding and inaccurate processing in existing technologies.
[0092] Specifically,
[0093] The method provided in this embodiment,
[0094] It should be noted that each implementation method of this application can be freely combined, rearranged, or executed individually, and does not need to rely on or depend on a fixed execution order.
[0095] According to the present invention, a multi-source knowledge fusion method based on semantic computing is provided. The target word vector model includes an embedding layer, a self-attention mechanism module and a pooling layer. The embedding layer is a lightweight bidirectional encoder representation ALBERT model.
[0096] Each knowledge unit is input into the target word vector model to obtain the target semantic vector corresponding to each knowledge unit, including:
[0097] Vector transformation is performed on each knowledge unit to obtain the multidimensional word vector corresponding to each knowledge unit;
[0098] Input the multi-dimensional word vectors corresponding to each knowledge unit into the ALBERT model to obtain the embedding vectors corresponding to each knowledge unit.
[0099] The embedding vectors corresponding to each knowledge unit are input into the encoder of the ALBERT model to obtain the first semantic vector corresponding to each knowledge unit.
[0100] Each first semantic vector is input into the self-attention mechanism module to obtain the second semantic vector corresponding to each first semantic vector output by the self-attention mechanism module;
[0101] Each second semantic vector is input into the pooling layer and subjected to mean pooling to obtain the target semantic vector corresponding to each knowledge unit; the target semantic vector is a global semantic vector representation.
[0102] Specifically, in some embodiments, the target word vector model includes an embedding layer, a self-attention mechanism module, and a pooling layer, with the embedding layer being an ALBERT model.
[0103] This invention uses an improved word vector model to represent multi-source knowledge into vectors, constructing a semantic vector space V. The improved word vector model (target word vector model) uses the ALBERT model for its embedding layer and introduces a self-attention mechanism between the embedding layer and the pooling layer, enabling the generated word vectors to pay more attention to keywords and important contextual information in the text, and to handle polysemous words.
[0104] Step 102 is achieved through the following steps:
[0105] Step 2-1: Train each knowledge unit to obtain the multi-dimensional word vector corresponding to each knowledge unit.
[0106] For example, two preprocessed multi-source knowledge S A S B Training is performed to generate multi-dimensional word vectors (matrices), resulting in matrix A = (a1, a2, a3, ..., a...). m ) T , B = (b1, b2, b3, ..., b m ) T Among them, a i =(a i1 ,a i2 ,a i3 ,…,a id ) is the row vector of the i-th row of matrix A, b j =(b j1 ,b j2 ,b j3 ,…,b jd Let A be the row vector of the j-th row of matrix B, where A ∈ R. m×d , B∈R m×d a i b i These represent two multi-source knowledge S. A S B The word vector of the i-th word in the text, where d represents the dimension of the word vector (i=1,2,3,…,m;j=1,2,3,…,m).
[0107] Step 2-2: Input the multi-dimensional word vectors corresponding to each knowledge unit into the ALBERT model to obtain the embedding vectors corresponding to each knowledge unit.
[0108] For example, in the embedding layer, an embedding vector is generated for each word in each piece of multi-source knowledge. Input is the input, and Position Embeddings, Segment Embeddings, and Token Embeddings are the position encoding, segment encoding, and character encoding of each word in the multi-source knowledge, respectively. The synthesized input vector (embedding vector) is shown in the following formula:
[0109]
[0110] in, Encoding the position of word vectors For the contextual information of word vectors, Character embedding for word vectors, Represents word vectors, synthesized vectors .
[0111] Steps 2-3: Input the embedding vector corresponding to each knowledge unit into the encoder of the ALBERT model to obtain the first semantic vector corresponding to each knowledge unit.
[0112] For example, the synthesized vector The data is further fed into the bidirectional encoder of the ALBERT model to obtain the first semantic vector corresponding to each knowledge unit. .
[0113] Steps 2-4: Input each first semantic vector into the self-attention mechanism module to obtain the second semantic vector corresponding to each first semantic vector output by the self-attention mechanism module.
[0114] For example, the first semantic vector The input to the self-attention mechanism module yields a second semantic vector, Output. The output represents a weighted combination of the inputs, where the weight of each input is determined by the content of the other inputs. This allows the model to focus on different parts of the input and capture long-distance dependencies.
[0115] Steps 2-5: Perform mean pooling on each second semantic vector to obtain the target semantic vector corresponding to each knowledge unit; the target semantic vector is the global semantic vector representation.
[0116] For example, by performing mean pooling on the output of the self-attention layer, each piece of knowledge is transformed into a fixed-length vector. This vector can be viewed as the overall representation of the input knowledge. The output of the self-attention layer is an n×d matrix, where n is the number of characters in the sentence and d is the dimension of each character vector. For each feature dimension, the average value (Average) of all character vectors is calculated, as shown in the formula below:
[0117]
[0118] Among them, Output i The i-th row of the output from the self-attention layer yields an average vector containing d words, representing the vector representation of that knowledge.
[0119] The method provided in this embodiment represents multi-source knowledge into vectors through a target word vector model, constructs a semantic vector space, uses the ALBERT model as the embedding layer of the target word vector model, and introduces a self-attention mechanism between the embedding layer and the pooling layer, so that the generated word vectors can pay more attention to the keywords and important contextual information in the text, and can handle polysemous words, thereby improving the accuracy of data fusion.
[0120] According to the multi-source knowledge fusion method based on semantic computation provided by the present invention, each first semantic vector is input into a self-attention mechanism module to obtain a second semantic vector corresponding to each first semantic vector output by the self-attention mechanism module, including:
[0121] Each first semantic vector is multiplied by the query matrix, key matrix, and value matrix respectively to generate the query vector, key vector, and value vector corresponding to each first semantic vector;
[0122] The attention score of each first semantic vector is determined by the inner product of the query vector and the key vector corresponding to each first semantic vector.
[0123] The attention scores of each first semantic vector are normalized using the soft-max function to obtain the attention weights of each first semantic vector.
[0124] The attention weights and value vectors of each first semantic vector are weighted and summed to obtain each second semantic vector.
[0125] Specifically, in some embodiments, the specific implementation process of steps 2-4 includes the following steps:
[0126] (1) Multiply each first semantic vector by the query matrix, key matrix and value matrix respectively to generate the query vector, key vector and value vector corresponding to each first semantic vector.
[0127] Self-attention is a variant of attention-based mechanisms. Its main purpose is to enable models to automatically focus on different parts of the input sequence, thereby capturing the relationships between different words in the knowledge. The core idea of self-attention is to assign a weight to each word in the input sequence, and these weights are proportional to the relevance of other words.
[0128] Here, the word vector matrix (first semantic vector) of the input text is multiplied by three weight matrices respectively. 、 and This yields a vector sequence of query, key, and value, while QK T This involves taking the inner product of each pair of query and key vectors, then normalizing the result using the softmax function. The normalized attention matrix represents the degree of correlation between each element in the query and key. Multiplying the attention matrix by the value vector sequence yields the final output vector sequence.
[0129] Currently, the most widely used attention mechanism is self-attention. 、 、 Both are linear transformations derived from the same input sequence, which reduce reliance on external information and are better at capturing the internal correlations of data or features.
[0130] Using a self-attention mechanism, the model calculates the degree of association between each word in the input sequence and all other words, and then performs a weighted average based on these associations to generate new word vectors. A query, key, and value need to be constructed for each input vector. This is achieved by multiplying the input vector by three sets of weight matrices, as shown in the following equation:
[0131]
[0132] in, This represents the query vector corresponding to the first semantic vector. Represents the first semantic vector. The query matrix to be learned;
[0133]
[0134] in, This represents the key vector corresponding to the first semantic vector. Represents the first semantic vector. The key matrix to be learned;
[0135]
[0136] in, This represents the value vector corresponding to the first semantic vector. Represents the first semantic vector. This is the value matrix to be learned.
[0137] (2) The attention score of each first semantic vector is determined by the inner product of the query vector and the key vector corresponding to each first semantic vector.
[0138] For example, using queries and keys to calculate attention scores, as shown in the formula below:
[0139]
[0140] in, This represents the attention score of the first semantic vector. This represents the query vector corresponding to the first semantic vector. This represents the key vector corresponding to the first semantic vector. The dimension of the key.
[0141] (3) Using the Soft-max function, the attention scores of each first semantic vector are normalized to obtain the attention weights of each first semantic vector.
[0142] For example, the softmax function is applied to the attention score to obtain the attention weights of each input to other inputs. Essentially, the softmax function maps the original output to (0,1) values, as shown in the following equation:
[0143] AttentionWeights=soft-max(AttentionScore)
[0144] Where AttentionWeights represents the attention weights of the first semantic vector, and AttentionScore represents the attention score of the first semantic vector.
[0145] (4) The attention weights and value vectors of each first semantic vector are weighted and summed to obtain each second semantic vector.
[0146] For example, the output can be calculated using attention weights and values, as shown in the following formula:
[0147] Output = AttentionWeights × V
[0148] =soft-max(AttentionScore)×V
[0149] =soft-max ×V
[0150] Where Output represents the second semantic vector, and AttentionWeights represents the attention weights of the first semantic vector. This represents the value vector corresponding to the first semantic vector. This represents the query vector corresponding to the first semantic vector. This represents the key vector corresponding to the first semantic vector. The dimension of the key.
[0151] In the method provided in this embodiment, the resulting second semantic vector represents a weighted combination of inputs, where the weight of each input is determined by the content of the other inputs. This allows the model to focus on different parts of the input and capture long-distance dependencies. The target word vector model of this invention introduces a self-attention mechanism between the embedding layer and the pooling layer, enabling the generated word vectors to pay more attention to keywords and contextual information in the text, and to handle polysemous words.
[0152] According to the multi-source knowledge fusion method based on semantic computation provided by the present invention, the comprehensive similarity between the target semantic vectors corresponding to each knowledge unit is determined, including:
[0153] Determine the cosine similarity and Euclidean distance between each target semantic vector; cosine similarity represents the direction between two vectors, and Euclidean distance represents the distance between two vectors;
[0154] By using the first and second preset weight coefficients, the cosine similarity and Euclidean distance between each target semantic vector are weighted and normalized to obtain the comprehensive similarity between the target semantic vectors corresponding to each knowledge unit; the sum of the first and second preset weight coefficients is 1.
[0155] Specifically, in some embodiments, step 103 can be implemented by the following steps: determining the comprehensive similarity between the target semantic vectors corresponding to each knowledge unit, including:
[0156] First, determine the cosine similarity between each target semantic vector and the Euclidean distance between each target semantic vector.
[0157] In the knowledge semantic space, similarity between different knowledge items is calculated using metrics such as cosine similarity and Euclidean distance. For each knowledge unit in multi-source knowledge, its similarity with other knowledge units is calculated, forming a similarity matrix.
[0158] Cosine similarity represents the direction between two vectors, while Euclidean distance represents the distance between two vectors. Combining the two improves the calculation effect of similarity and can more comprehensively evaluate the similarity between two vectors.
[0159] The cosine similarity between vectors of two knowledge units extended to n-dimensional space is calculated using the following formula:
[0160]
[0161] in, For vectors sum vector Cosine similarity between them Indicates the output vector. Represents another output vector, and They represent vectors respectively and The components, of which, Representing vectors sum vector dot product, and Representing vectors respectively and The Euclidean norm (i.e., the length of the vector).
[0162] Euclidean distance (also known as Euclidean metric) is a commonly used definition of distance, referring to the actual distance between two points in n-dimensional space. In two-dimensional and three-dimensional space, the Euclidean distance is simply the actual distance between two points. The formula for distance in n-dimensional space is:
[0163]
[0164] in, Representing vectors sum vector The Euclidean distance between them Indicates the output vector. Represents another output vector, Representing vectors The i-th component, Representing vectors The i-th component.
[0165] By using the first preset weight coefficient k1 and the second preset weight coefficient k2, the cosine similarity and Euclidean distance between each target semantic vector are weighted and normalized to obtain the comprehensive similarity between the target semantic vectors corresponding to each knowledge unit.
[0166] The sum of the first preset weight coefficient k1 and the second preset weight coefficient k2 is 1. The preset weight coefficients k1 and k2 are determined by calculating the vector results of different knowledge sets to determine whether fusion is possible, thereby obtaining appropriate k1 and k2 values. A threshold is then calculated, and a fusion strategy is selected based on the threshold.
[0167] For example, the normalized formula combining cosine similarity and Euclidean distance is as follows:
[0168]
[0169] (0≦k1, k2≦1, and k1+k2=1)
[0170] Where s is the normalized similarity value. The smaller the angle θ between two vectors, the larger cosθ, and the smaller (1-cosθ). The value of is between 0 and 1; the closer the two vectors are, the better. d The smaller, The smaller the value of , the lower its value is between 0 and 1. Therefore, the value of s is between 0 and 1. When θ is 0 and d is also 0, s is 0; when θ is 180° and d is infinite, s is 1. By reasonably choosing the values of k1 and k2, and based on the value of s, the similarity between two vectors can be comprehensively evaluated.
[0171] The method provided in this embodiment uses cosine similarity and Euclidean distance formulas to calculate the comprehensive similarity between the output vectors of different knowledge units. Then, based on the similarity calculation results, multi-source knowledge can be fused to obtain a more accurate and comprehensive knowledge representation, thereby improving the accuracy of knowledge fusion.
[0172] According to the multi-source knowledge fusion method based on semantic computing provided by the present invention, the confidence evaluation value of each knowledge unit is determined based on a confidence evaluation model, including:
[0173] Construct a multi-dimensional feature matrix that includes source information, evidence, literature records, logic, expert opinions, public evaluation, time factors, spatial factors, and related information;
[0174] By comparing each pair of indicators, an indicator parameter weight matrix is generated. The indicator parameter weight matrix is then normalized to obtain the weight value of each indicator parameter.
[0175] Based on the weight values of each indicator parameter and the multidimensional feature matrix, the multidimensional features are weighted and summed to generate the confidence evaluation value of each knowledge unit.
[0176] Specifically, in some embodiments, step 104 can be implemented through the following steps:
[0177] First, a multi-dimensional feature matrix is constructed, which includes source information, evidence, literature records, logic, expert opinions, public evaluation, time factors, spatial factors, and related information.
[0178] The dataset U consists of m pieces of knowledge that will be used for confidence evaluation. E ={e1,e2,..., e i ,...,e m} T (i=1,2,...,m), n features for each piece of knowledge, including source information, evidence, documentary records, logical consistency, expert opinions, public evaluation, time factors, spatial factors, and related information, are used as confidence indicators. The indicator parameter set is F={f1,f2,...,f j ,...,f n} (j=1,2,...,n), the set of index parameter weights is U W ={w1,w2,...,w j ,...,w n (j=1,2,...,n).
[0179] The indicator parameters are generally text data. Confidence indicators can be quantified and assigned values using the ranking method. Each piece of knowledge yields m indicator values, i.e., e. i ={e i1 ,e i2 ,...,e ij ,...,e in}, (j=1,2,...,n), thus obtaining the knowledge confidence index matrix E=(e ij We obtain m×n (i=1,2,...,m; j=1,2,...,n), which means we get m multidimensional feature matrices of knowledge. The multidimensional feature matrices are shown in Table 1.
[0180] Table 1:
[0181]
[0182] Furthermore, an indicator parameter weight matrix is generated by comparing each pair of indicators, and the indicator parameter weight matrix is normalized to obtain the weight value of each indicator parameter.
[0183] For example, first calculate the weight values of the indicator parameters, then use pairwise comparisons to determine the importance of the indicators, assigning values according to their importance (e.g., very important, important, equally important, unimportant), such as 4, 3, 2, 1. Construct the indicator parameter weight matrix W = (w ij ) n×n (i=1,2,...,n; j=1,2,...,n). The weight matrix of the index parameters is shown in Table 2:
[0184] Table 2:
[0185]
[0186] (1) Normalize the index parameter weight matrix to obtain the normalized index parameter weight matrix W'=(w ij ') n×n .
[0187]
[0188]
[0189] in, To determine the relative importance of the normalized i-th indicator compared to the j-th indicator, This represents the relative importance of the i-th indicator compared to the j-th indicator.
[0190] (2) Calculate the indicator parameter weight value of the j-th indicator. :
[0191]
[0192]
[0193] in, This represents the weight value of the indicator parameter for the j-th indicator. This represents the relative importance of the i-th indicator compared to the j-th indicator in the normalization process.
[0194] Furthermore, after obtaining the weight values of each indicator parameter and the multidimensional feature matrix, the multidimensional features are weighted and summed based on the weight values of each indicator parameter and the multidimensional feature matrix to generate the confidence evaluation value of each knowledge unit.
[0195] For example, the confidence assessment value of the i-th knowledge unit is the weighted sum of the quantified values of each indicator:
[0196]
[0197]
[0198] in, This represents the confidence score of the i-th knowledge unit. This represents the feature value of the j-th indicator in the i-th knowledge unit. This represents the weight value of the indicator parameter for the j-th indicator.
[0199] Therefore, n knowledge units can be sorted from high to low according to their confidence evaluation values, which can be used as the criterion for knowledge fusion. For example, the knowledge units ranked higher can be fused and stored in the knowledge base based on a similarity threshold, while the rest can be discarded.
[0200] The method provided in this embodiment calculates the confidence assessment value of each knowledge unit based on the confidence assessment model, which facilitates the subsequent fusion of each knowledge unit based on the confidence assessment value and the comprehensive similarity, thereby improving the accuracy of multi-source data fusion.
[0201] According to the multi-source knowledge fusion method based on semantic computing provided by the present invention, a fused knowledge base is generated based on the comprehensive similarity between the target semantic vectors corresponding to each knowledge unit and the confidence evaluation value of each knowledge unit, including:
[0202] Based on the comprehensive similarity between the target semantic vectors corresponding to each knowledge unit, redundant and contradictory knowledge pairs in each knowledge unit are determined.
[0203] Based on the confidence assessment values of redundant and contradictory knowledge pairs, a fused knowledge base is generated.
[0204] Specifically, in some embodiments, step 105 can be implemented through the following steps:
[0205] First, redundant and contradictory knowledge pairs in each knowledge unit are determined based on the comprehensive similarity between the target semantic vectors corresponding to each knowledge unit.
[0206] It's important to note that two scenarios need to be addressed during the fusion process: redundant knowledge and contradictory knowledge. Redundant knowledge can negatively impact the refinement of the knowledge base, leading to an overabundance of data and a lack of actual knowledge. Contradictory knowledge can affect the accuracy of the knowledge base, causing ambiguity or even making the knowledge base unreliable. This embodiment determines redundant and contradictory knowledge pairs based on the semantic similarity calculation results.
[0207] Furthermore, based on the confidence assessment values of redundant and contradictory knowledge pairs, a fused knowledge base is generated.
[0208] Specifically, after obtaining redundant and contradictory knowledge pairs, multi-source knowledge can be fused based on the semantic similarity calculation results and confidence assessment values. For example, knowledge pairs exceeding a preset redundancy threshold (similarity threshold) are fused as redundant knowledge. Knowledge pairs below the preset redundancy threshold (similarity threshold) and containing contradictions are fused as contradictory knowledge based on confidence assessment values. Ultimately, a fused knowledge base can be obtained.
[0209] The method provided in this embodiment generates a fused knowledge base based on the comprehensive similarity between the target semantic vectors corresponding to each knowledge unit and the confidence evaluation value of each knowledge unit. The comprehensive similarity result is more comprehensive. Based on the comprehensive similarity and confidence results, the knowledge fusion algorithm is optimized, realizing the accurate and efficient fusion of multi-source knowledge.
[0210] According to the multi-source knowledge fusion method based on semantic computing provided by the present invention, redundant knowledge pairs and contradictory knowledge pairs in each knowledge unit are determined according to the comprehensive similarity between the target semantic vectors corresponding to each knowledge unit, including:
[0211] If the overall similarity between the target semantic vectors of any two knowledge units in each knowledge unit is greater than or equal to the preset redundancy threshold, then any two knowledge units will be marked as a redundant knowledge pair.
[0212] If any two knowledge units are contradictory and the overall similarity between the target semantic vectors corresponding to any two knowledge units is lower than a preset redundancy threshold, then any two knowledge units will be marked as contradictory knowledge pairs.
[0213] Based on the confidence assessment values of redundant and contradictory knowledge pairs, a fused knowledge base is generated, including:
[0214] The knowledge units with higher confidence scores among redundant knowledge pairs are retained, and new knowledge units are generated by weighted fusion based on the confidence scores of contradictory knowledge pairs.
[0215] Based on the knowledge units with higher confidence scores and the new knowledge units, the fused knowledge base is determined.
[0216] Specifically, in some embodiments, the process of determining redundant and contradictory knowledge pairs in each knowledge unit is exemplified as follows:
[0217] If the overall similarity between the target semantic vectors of any two knowledge units is greater than or equal to a preset redundancy threshold, then these two knowledge units are marked as a redundant knowledge pair. If any two knowledge units are contradictory and the overall similarity between the target semantic vectors of these two knowledge units is less than a preset redundancy threshold, then these two knowledge units are marked as a contradictory knowledge pair.
[0218] For example, the preset redundancy threshold is 0.8. When the comprehensive similarity s ≥ 0.8, it means that any two knowledge units are marked as redundant knowledge pairs. When s < 0.8, it means that any two knowledge units are contradictory and are marked as contradictory knowledge pairs.
[0219] Furthermore, based on the confidence evaluation values of redundant and contradictory knowledge pairs, the specific implementation process for generating the fused knowledge base includes the following steps:
[0220] First, for redundant knowledge pairs, the knowledge units with higher confidence assessment values are retained; for contradictory knowledge pairs, a weighted fusion is performed based on the confidence assessment values of the contradictory knowledge pairs to generate new knowledge units.
[0221] Then, based on the knowledge units with higher confidence scores and the new knowledge units, the fused knowledge base is determined.
[0222] That is, based on the knowledge confidence score, the multi-source knowledge is weighted and fused to obtain the fused knowledge representation, which is then stored in the knowledge base.
[0223] For example, a multi-source knowledge fusion algorithm is as follows:
[0224] Input: New knowledge set K, original knowledge base KB1
[0225] Output: Merged knowledge base KB2
[0226] process:
[0227] 1. If KB1 does not exist, create KB1;
[0228] 2. Read one piece of knowledge k (k∈K);
[0229] 3. If there is redundancy between k1 (k1∈K) and k, discard k according to the threshold or rule, add k1 to KB2, and proceed to step 2;
[0230] 4. If there is a contradiction between k2 (k2∈K) and k, call the confidence evaluation algorithm to calculate the confidence scores of k2 and k. If the confidence score of k2 is high, add k2 to KB2 and delete k. Otherwise, discard k2 and go to step two.
[0231] 5. Output the merged knowledge base KB2.
[0232] The method provided in this embodiment fuses multi-source knowledge based on semantic similarity calculation results and confidence assessment values. Knowledge with high similarity is fused, while knowledge with low similarity or contradictions is fused using a weighted approach based on knowledge confidence assessment values to obtain a fused knowledge representation and generate a fused knowledge base. This method optimizes the knowledge fusion algorithm based on comprehensive similarity and confidence assessment results, achieving accurate and efficient fusion of multi-source knowledge.
[0233] According to the multi-source knowledge fusion method based on semantic computation provided by the present invention, the method further includes:
[0234] The performance of the fusion results is quantified by accuracy, recall, and F1 score;
[0235] Among them, precision is the proportion of correctly fused knowledge pairs to the total number of fused knowledge pairs, recall is the proportion of correctly fused knowledge pairs to the total number of fused knowledge pairs, and F1 value is the harmonic mean of precision and recall.
[0236] Specifically, in some embodiments, the method further includes:
[0237] The performance of the fusion result is quantified using precision, recall, and F1 score. For example, the fused knowledge base is examined and evaluated to determine whether it is accurate, complete, and reasonable.
[0238] Performance is evaluated by constructing an assessment index system, which includes accuracy (whether the fused knowledge conforms to the facts), completeness (whether it contains important content that should be retained from multiple sources), and consistency (whether the fused knowledge is internally contradictory). These indicators are scored, and the final comprehensive evaluation assesses the effectiveness of the fusion.
[0239] Accuracy is the proportion of correctly fused knowledge pairs to the total number of fused pairs. In other words, accuracy refers to the ratio of correctly fused knowledge pairs (TP) to the total number of fused pairs (TP+FP), used to measure the proportion of correctly merged pairs in the fusion result and avoid incorrect matches. The relevant formula for calculating accuracy is as follows:
[0240]
[0241] In the formula, For accuracy, This represents the number of correctly integrated knowledge pairs (knowledge pairs that should be integrated). This represents the number of incorrectly merged knowledge pairs (knowledge pairs that should not have been merged but were merged).
[0242] Recall is the proportion of correctly fused knowledge pairs to the total number of pairs that should be fused. In other words, recall refers to the ratio of correctly fused knowledge pairs (TP) to the total number of pairs that should be fused (TP+FN). It measures the system's ability to discover true associations and avoid missed matches. The relevant formula for calculating recall is as follows:
[0243]
[0244] in, For recall rate, This represents the quantity of correctly integrated knowledge pairs. This indicates the number of knowledge pairs that were not merged (knowledge pairs that should have been merged but were not).
[0245] The F1 score is the harmonic mean of precision and recall, used to comprehensively measure the performance of knowledge fusion. The formula for calculating the F1 score is as follows:
[0246]
[0247] In the formula, For accuracy, is the recall rate, and F1 value is the harmonic mean of precision and recall.
[0248] For example, Figure 2 This is a schematic diagram illustrating the effect of the multi-source knowledge fusion method based on semantic computing provided by the present invention, such as... Figure 2 As shown in the attached figure, the horizontal axis represents the amount of data (data points), and the vertical axis represents the accuracy (%). The three curves from top to bottom are the accuracy curves of this method, the Bert-based method, and the Word2Vec-based method, respectively. It can be seen from the figure that the accuracy of data fusion of this method is better than the other two methods in different amounts of data.
[0249] For example, Table 3 compares the experimental fusion effects of the three methods:
[0250] Table 3:
[0251]
[0252] Compared with existing technologies, the key to this invention lies in employing an optimized semantic computation normalization algorithm combining cosine similarity and Euclidean distance, along with a confidence evaluation algorithm, to achieve effective fusion of multi-source knowledge. By constructing a knowledge semantic vector space, words in the knowledge data are converted into vector representations, and then the similarity between different words is calculated using cosine similarity and Euclidean distance formulas. Based on the similarity calculation results, multi-source knowledge can be fused to obtain a more accurate and comprehensive knowledge representation.
[0253] The key technologies and algorithms involved in this invention have been verified in practical applications and have achieved significant results. The implementation of this invention can effectively solve the accuracy and efficiency problems in multi-source knowledge fusion, providing strong support for the development of big data and artificial intelligence.
[0254] The method provided in this embodiment can determine whether the fused knowledge is accurate, complete, and reasonable by checking and evaluating the fused knowledge.
[0255] Figure 3 This is the second flowchart of the multi-source knowledge fusion method based on semantic computing provided by this invention, as shown below. Figure 3 As shown, the method includes:
[0256] Step 301: Obtain multi-source knowledge data;
[0257] Step 302, Multi-source data preprocessing: including cleaning, deduplication, format unification, and knowledge unit extraction;
[0258] Step 303: Construct a unified knowledge semantic vector space based on multiple knowledge units;
[0259] Step 304: Calculate the comprehensive similarity between multiple knowledge units. The comprehensive similarity is the normalized value of cosine similarity and Euclidean distance;
[0260] Step 305: Use the subjective and objective weighting method to evaluate the confidence level of multiple knowledge units and sort them according to the confidence level.
[0261] Step 306: Perform multi-source knowledge fusion based on the comprehensive similarity between multiple knowledge units and the confidence of multiple knowledge units;
[0262] Step 307: Output the merged knowledge in a unified format.
[0263] The method provided in this embodiment preprocesses multi-source knowledge into a unified format, constructs a unified knowledge semantic vector space using a lightweight ALBERT model, performs semantic calculations using a normalization algorithm that combines optimized cosine similarity and Euclidean distance, and combines a knowledge confidence evaluation algorithm to achieve effective fusion of multi-source knowledge.
[0264] The following describes the multi-source knowledge fusion device based on semantic computing provided by the present invention. The multi-source knowledge fusion device based on semantic computing described below and the multi-source knowledge fusion method based on semantic computing described above can be referred to and correspond to each other.
[0265] Figure 4 This is a schematic diagram of the structure of the multi-source knowledge fusion device based on semantic computing provided by the present invention, as shown below. Figure 4 As shown, the multi-source knowledge fusion device 400 based on semantic computing includes the following modules:
[0266] The preprocessing module 410 is used to preprocess multi-source data to generate multiple structured data in a unified format, and extract knowledge units corresponding to each structured data in a unified format from each structured data in a unified format.
[0267] The fusion module 420 is used to input each of the knowledge units into the target word vector model to obtain the target semantic vector corresponding to each of the knowledge units;
[0268] Determine the comprehensive similarity between the target semantic vectors corresponding to each knowledge unit; the comprehensive similarity is determined based on the normalized weighted value of cosine similarity and Euclidean distance;
[0269] Based on the confidence assessment model, the confidence assessment value of each knowledge unit is determined; the confidence assessment value of each knowledge unit is used to characterize the reliability of each knowledge unit.
[0270] A fused knowledge base is generated based on the comprehensive similarity between the target semantic vectors corresponding to each knowledge unit and the confidence evaluation value of each knowledge unit.
[0271] The apparatus provided by this invention first includes a preprocessing module 410, used to preprocess multi-source data to generate multiple structured data in a unified format, and extract knowledge units corresponding to each structured data in a unified format from each structured data. Then, a fusion module 420 is used to input each knowledge unit into a target word vector model to obtain the target semantic vector corresponding to each knowledge unit. Further, the comprehensive similarity between the target semantic vectors corresponding to each knowledge unit is determined, and the comprehensive similarity is determined based on a normalized weighted value of cosine similarity and Euclidean distance. Based on a confidence evaluation model, the confidence evaluation value of each knowledge unit is determined. The confidence evaluation value of each knowledge unit is used to characterize the reliability of each knowledge unit. Finally, based on the comprehensive similarity between the target semantic vectors corresponding to each knowledge unit and the confidence evaluation value of each knowledge unit, a fused knowledge base is generated.
[0272] This invention first preprocesses multi-source data, using a target word vector model to generate target semantic vectors corresponding to each knowledge unit. Then, based on the comprehensive similarity of each target semantic vector and the confidence evaluation value of each knowledge unit, the knowledge units are fused to obtain a fused knowledge base. This effectively integrates knowledge from different sources, and the accuracy of data fusion is ensured through confidence evaluation values and comprehensive similarity calculations, thereby solving the problems of lack of semantic understanding and inaccurate processing in existing technologies.
[0273] According to the present invention, a multi-source knowledge fusion device 400 based on semantic computing is provided, wherein the target word vector model includes an embedding layer, a self-attention mechanism module and a pooling layer, and the embedding layer is a lightweight bidirectional encoder representation ALBERT model.
[0274] The fusion module 420 is specifically used for:
[0275] Perform vector transformation on each of the knowledge units to obtain the multi-dimensional word vectors corresponding to each knowledge unit;
[0276] The multi-dimensional word vectors corresponding to each knowledge unit are input into the ALBERT model to obtain the embedding vectors corresponding to each knowledge unit.
[0277] The embedding vector corresponding to each knowledge unit is input into the encoder of the ALBERT model to obtain the first semantic vector corresponding to each knowledge unit;
[0278] Each of the first semantic vectors is input into the self-attention mechanism module to obtain the second semantic vector corresponding to each of the first semantic vectors output by the self-attention mechanism module;
[0279] Each of the second semantic vectors is input into the pooling layer for mean pooling to obtain the target semantic vector corresponding to each knowledge unit; the target semantic vector is a global semantic vector representation.
[0280] According to the multi-source knowledge fusion device 400 based on semantic computing provided by the present invention, the fusion module 420 is further used for:
[0281] Each of the first semantic vectors is multiplied by the query matrix, the key matrix, and the value matrix respectively to generate the query vector, key vector, and value vector corresponding to each of the first semantic vectors;
[0282] The attention score of each first semantic vector is determined by the inner product of the query vector and the key vector corresponding to each first semantic vector.
[0283] The attention scores of each first semantic vector are normalized using the soft-max function to obtain the attention weights of each first semantic vector.
[0284] The attention weights of each first semantic vector are weighted and summed with the value vectors to obtain each second semantic vector.
[0285] According to the multi-source knowledge fusion device 400 based on semantic computing provided by the present invention, the fusion module 420 is further used for:
[0286] Determine the cosine similarity and the Euclidean distance between each of the target semantic vectors; the cosine similarity represents the direction between two vectors, and the Euclidean distance represents the distance between two vectors;
[0287] The cosine similarity and Euclidean distance between the target semantic vectors are weighted and normalized using a first preset weight coefficient and a second preset weight coefficient to obtain the comprehensive similarity between the target semantic vectors corresponding to each knowledge unit; the sum of the first preset weight coefficient and the second preset weight coefficient is 1.
[0288] According to the multi-source knowledge fusion device 400 based on semantic computing provided by the present invention, the step of determining the confidence evaluation value of each knowledge unit based on a confidence evaluation model includes:
[0289] Construct a multi-dimensional feature matrix that includes source information, evidence, literature records, logic, expert opinions, public evaluation, time factors, spatial factors, and related information;
[0290] An indicator parameter weight matrix is generated by comparing each pair of indicators. The indicator parameter weight matrix is then normalized to obtain the weight value of each indicator parameter.
[0291] Based on the weight values of each indicator parameter and the multidimensional feature matrix, the multidimensional features are weighted and summed to generate a confidence evaluation value for each knowledge unit.
[0292] According to the multi-source knowledge fusion device 400 based on semantic computing provided by the present invention, the fusion module 420 is further used for:
[0293] Identify redundant and contradictory knowledge pairs in each of the knowledge units.
[0294] The fused knowledge base is generated based on the confidence evaluation values of the redundant knowledge pairs and the contradictory knowledge pairs.
[0295] According to the multi-source knowledge fusion device 400 based on semantic computing provided by the present invention, the fusion module 420 is further used for:
[0296] If the comprehensive similarity between the target semantic vectors corresponding to any two knowledge units in each knowledge unit is greater than or equal to a preset redundancy threshold, then any two knowledge units are marked as the redundant knowledge pair.
[0297] If any two knowledge units are contradictory and the overall similarity between the target semantic vectors corresponding to any two knowledge units is lower than the preset redundancy threshold, then any two knowledge units are marked as the contradictory knowledge pair.
[0298] The process of generating the fused knowledge base based on the confidence evaluation values of the redundant knowledge pairs and the contradictory knowledge pairs includes:
[0299] The knowledge units with higher confidence scores among the redundant knowledge pairs are retained, and the knowledge units of the contradictory knowledge pairs are weighted and fused according to their confidence scores to generate new knowledge units.
[0300] The fused knowledge base is determined based on the knowledge units with larger confidence scores and the new knowledge units.
[0301] According to the present invention, a multi-source knowledge fusion device 400 based on semantic computing is provided, the multi-source knowledge fusion device 400 based on semantic computing further includes: a fusion effect evaluation module;
[0302] The fusion effect evaluation module is used for:
[0303] The performance of the fusion results is quantified by accuracy, recall, and F1 score;
[0304] Wherein, the accuracy rate is the proportion of correctly fused knowledge pairs to the total number of fused knowledge pairs, the recall rate is the proportion of correctly fused knowledge pairs to the total number of fused knowledge pairs, and the F1 value is the harmonic mean of the accuracy rate and the recall rate.
[0305] Figure 5 An example is a schematic diagram of the physical structure of an electronic device, such as... Figure 5 As shown, the electronic device may include: a processor 510, a communications interface 520, a memory 530, and a communication bus 540, wherein the processor 510, the communications interface 520, and the memory 530 communicate with each other via the communication bus 540. The processor 510 can call logical instructions in the memory 530 to execute a multi-source knowledge fusion method based on semantic computing, which includes:
[0306] Multi-source data is preprocessed to generate multiple structured data in a unified format, and knowledge units corresponding to each structured data in a unified format are extracted from each structured data in a unified format.
[0307] Each of the knowledge units is input into the target word vector model to obtain the target semantic vector corresponding to each knowledge unit;
[0308] Determine the comprehensive similarity between the target semantic vectors corresponding to each knowledge unit; the comprehensive similarity is determined based on the normalized weighted value of cosine similarity and Euclidean distance;
[0309] Based on the confidence assessment model, the confidence assessment value of each knowledge unit is determined; the confidence assessment value of each knowledge unit is used to characterize the reliability of each knowledge unit.
[0310] A fused knowledge base is generated based on the comprehensive similarity between the target semantic vectors corresponding to each knowledge unit and the confidence evaluation value of each knowledge unit.
[0311] Furthermore, the logical instructions in the aforementioned memory 530 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0312] On the other hand, the present invention also provides a computer program product, the computer program product comprising a computer program that can be stored on a non-transitory computer-readable storage medium, wherein when the computer program is executed by a processor, the computer is able to execute the multi-source knowledge fusion method based on semantic computing provided by the above methods, the method comprising:
[0313] Multi-source data is preprocessed to generate multiple structured data in a unified format, and knowledge units corresponding to each structured data in a unified format are extracted from each structured data in a unified format.
[0314] Each of the knowledge units is input into the target word vector model to obtain the target semantic vector corresponding to each knowledge unit;
[0315] Determine the comprehensive similarity between the target semantic vectors corresponding to each knowledge unit; the comprehensive similarity is determined based on the normalized weighted value of cosine similarity and Euclidean distance;
[0316] Based on the confidence assessment model, the confidence assessment value of each knowledge unit is determined; the confidence assessment value of each knowledge unit is used to characterize the reliability of each knowledge unit.
[0317] A fused knowledge base is generated based on the comprehensive similarity between the target semantic vectors corresponding to each knowledge unit and the confidence evaluation value of each knowledge unit.
[0318] In another aspect, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the multi-source knowledge fusion method based on semantic computing provided by the methods described above, the method comprising:
[0319] Multi-source data is preprocessed to generate multiple structured data in a unified format, and knowledge units corresponding to each structured data in a unified format are extracted from each structured data in a unified format.
[0320] Each of the knowledge units is input into the target word vector model to obtain the target semantic vector corresponding to each knowledge unit;
[0321] Determine the comprehensive similarity between the target semantic vectors corresponding to each knowledge unit; the comprehensive similarity is determined based on the normalized weighted value of cosine similarity and Euclidean distance;
[0322] Based on the confidence assessment model, the confidence assessment value of each knowledge unit is determined; the confidence assessment value of each knowledge unit is used to characterize the reliability of each knowledge unit.
[0323] A fused knowledge base is generated based on the comprehensive similarity between the target semantic vectors corresponding to each knowledge unit and the confidence evaluation value of each knowledge unit.
[0324] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.
[0325] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.
[0326] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A multi-source knowledge fusion method based on semantic computing, characterized in that, include: Multi-source data is preprocessed to generate multiple structured data in a unified format, and knowledge units corresponding to each structured data in a unified format are extracted from each structured data in a unified format. Each of the knowledge units is input into the target word vector model to obtain the target semantic vector corresponding to each knowledge unit; Determine the comprehensive similarity between the target semantic vectors corresponding to each knowledge unit; the comprehensive similarity is determined based on the normalized weighted value of cosine similarity and Euclidean distance; Based on the confidence assessment model, the confidence assessment value of each knowledge unit is determined; the confidence assessment value of each knowledge unit is used to characterize the reliability of each knowledge unit. Based on the comprehensive similarity between the target semantic vectors corresponding to each knowledge unit and the confidence evaluation value of each knowledge unit, a fused knowledge base is generated. The target word vector model includes an embedding layer, a self-attention mechanism module, and a pooling layer. The embedding layer is a lightweight bidirectional encoder representation ALBERT model. The step of inputting each of the knowledge units into the target word vector model to obtain the target semantic vector corresponding to each of the knowledge units includes: Perform vector transformation on each of the knowledge units to obtain the multi-dimensional word vectors corresponding to each knowledge unit; The multi-dimensional word vectors corresponding to each knowledge unit are input into the ALBERT model to obtain the embedding vectors corresponding to each knowledge unit. The embedding vector corresponding to each knowledge unit is input into the encoder of the ALBERT model to obtain the first semantic vector corresponding to each knowledge unit; Each of the first semantic vectors is input into the self-attention mechanism module to obtain the second semantic vector corresponding to each of the first semantic vectors output by the self-attention mechanism module; Each second semantic vector is input into the pooling layer for mean pooling to obtain the target semantic vector corresponding to each knowledge unit; the target semantic vector is a global semantic vector representation. The step of inputting each of the first semantic vectors into the self-attention mechanism module to obtain the second semantic vector corresponding to each of the first semantic vectors output by the self-attention mechanism module includes: Each of the first semantic vectors is multiplied by the query matrix, the key matrix, and the value matrix respectively to generate the query vector, key vector, and value vector corresponding to each of the first semantic vectors; The attention score of each first semantic vector is determined by the inner product of the query vector and the key vector corresponding to each first semantic vector. The attention scores of each first semantic vector are normalized using the soft-max function to obtain the attention weights of each first semantic vector. The attention weights of each first semantic vector are weighted and summed with the value vectors to obtain each second semantic vector.
2. The multi-source knowledge fusion method based on semantic computing according to claim 1, characterized in that, Determining the comprehensive similarity between the target semantic vectors corresponding to each knowledge unit includes: Determine the cosine similarity and the Euclidean distance between each of the target semantic vectors; the cosine similarity represents the direction between two vectors, and the Euclidean distance represents the distance between two vectors; The cosine similarity and Euclidean distance between the target semantic vectors are weighted and normalized using a first preset weight coefficient and a second preset weight coefficient to obtain the comprehensive similarity between the target semantic vectors corresponding to each knowledge unit; the sum of the first preset weight coefficient and the second preset weight coefficient is 1.
3. The multi-source knowledge fusion method based on semantic computing according to claim 1, characterized in that, The determination of the confidence assessment value for each knowledge unit based on the confidence assessment model includes: Construct a multi-dimensional feature matrix that includes source information, evidence, literature records, logic, expert opinions, public evaluation, time factors, spatial factors, and related information; An indicator parameter weight matrix is generated by comparing each pair of indicators. The indicator parameter weight matrix is then normalized to obtain the weight value of each indicator parameter. Based on the weight values of each indicator parameter and the multidimensional feature matrix, the multidimensional features are weighted and summed to generate a confidence evaluation value for each knowledge unit.
4. The multi-source knowledge fusion method based on semantic computing according to claim 1, characterized in that, The step of generating a fused knowledge base based on the comprehensive similarity between the target semantic vectors corresponding to each knowledge unit and the confidence evaluation value of each knowledge unit includes: The redundant and contradictory knowledge pairs in each knowledge unit are determined based on the comprehensive similarity between the target semantic vectors corresponding to each knowledge unit. The fused knowledge base is generated based on the confidence evaluation values of the redundant knowledge pairs and the contradictory knowledge pairs.
5. The multi-source knowledge fusion method based on semantic computing according to claim 4, characterized in that, The step of determining redundant and contradictory knowledge pairs in each knowledge unit based on the comprehensive similarity between the target semantic vectors corresponding to each knowledge unit includes: If the comprehensive similarity between the target semantic vectors corresponding to any two knowledge units in each knowledge unit is greater than or equal to a preset redundancy threshold, then any two knowledge units are marked as the redundant knowledge pair. If any two knowledge units are contradictory and the overall similarity between the target semantic vectors corresponding to any two knowledge units is lower than the preset redundancy threshold, then any two knowledge units are marked as the contradictory knowledge pair. The process of generating the fused knowledge base based on the confidence evaluation values of the redundant knowledge pairs and the contradictory knowledge pairs includes: The knowledge units with higher confidence scores among the redundant knowledge pairs are retained, and the knowledge units of the contradictory knowledge pairs are weighted and fused according to their confidence scores to generate new knowledge units. The fused knowledge base is determined based on the knowledge units with larger confidence scores and the new knowledge units.
6. The multi-source knowledge fusion method based on semantic computation according to any one of claims 1-5, characterized in that, The method further includes: The performance of the fusion results is quantified by accuracy, recall, and F1 score; Wherein, the accuracy rate is the proportion of correctly fused knowledge pairs to the total number of fused knowledge pairs, the recall rate is the proportion of correctly fused knowledge pairs to the total number of fused knowledge pairs, and the F1 value is the harmonic mean of the accuracy rate and the recall rate.
7. A multi-source knowledge fusion device based on semantic computing, characterized in that, include: The preprocessing module is used to preprocess multi-source data, generate multiple structured data in a unified format, and extract knowledge units corresponding to each structured data in a unified format from each structured data in a unified format. A fusion module is used to input each of the knowledge units into a target word vector model to obtain a target semantic vector corresponding to each knowledge unit. The target word vector model includes an embedding layer, a self-attention mechanism module, and a pooling layer. The embedding layer is a lightweight bidirectional encoder representation ALBERT model. Specifically, the fusion module performs vector transformation on each of the knowledge units to obtain multi-dimensional word vectors corresponding to each knowledge unit; inputs the multi-dimensional word vectors corresponding to each knowledge unit into the ALBERT model to obtain embedding vectors corresponding to each knowledge unit; inputs the embedding vectors corresponding to each knowledge unit into the encoder of the ALBERT model to obtain a first semantic vector corresponding to each knowledge unit; inputs each of the first semantic vectors into the self-attention mechanism module to obtain a second semantic vector corresponding to each of the first semantic vectors output by the self-attention mechanism module; and inputs each of the second semantic vectors into the... The pooling layer performs mean pooling to obtain the target semantic vector corresponding to each knowledge unit; the target semantic vector is a global semantic vector representation; the step of inputting each first semantic vector into the self-attention mechanism module to obtain the second semantic vector corresponding to each first semantic vector output by the self-attention mechanism module includes: multiplying each first semantic vector by the query matrix, the key matrix, and the value matrix respectively to generate the query vector, key vector, and value vector corresponding to each first semantic vector; determining the attention score of each first semantic vector by the inner product of the query vector and the key vector corresponding to each first semantic vector; normalizing the attention score of each first semantic vector using the soft-max function to obtain the attention weight of each first semantic vector; and weighted summing the attention weight of each first semantic vector with the value vector to obtain each second semantic vector. Determine the comprehensive similarity between the target semantic vectors corresponding to each knowledge unit; the comprehensive similarity is determined based on the normalized weighted value of cosine similarity and Euclidean distance; Based on the confidence assessment model, the confidence assessment value of each knowledge unit is determined; the confidence assessment value of each knowledge unit is used to characterize the reliability of each knowledge unit. A fused knowledge base is generated based on the comprehensive similarity between the target semantic vectors corresponding to each knowledge unit and the confidence evaluation value of each knowledge unit.
8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the multi-source knowledge fusion method based on semantic computing as described in any one of claims 1 to 6.
Citation Information
Patent Citations
Clustering method and device based on comprehensive similarity
CN114118310A
Information data fusion method and device
CN114860822A