A multi-source heterogeneous corpus fusion method and system based on government service data
By using cross-modal semantic alignment and multimodal coding techniques, standardized data blocks are generated and a fusion weight matrix is constructed, which solves the problems of semantic differences and missing correlations in multi-source heterogeneous government data, and improves the data collaboration efficiency and semantic retrieval accuracy of government services.
Patent Information
- Application Number
- CN202510578949.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-07
- Publication Date
- 2025-11-07
- Estimated Expiration
- 2045-05-07
AI Technical Summary
Existing technologies cannot effectively solve the problems of semantic granularity differences and missing correlations among multi-source heterogeneous government data, resulting in low efficiency of cross-departmental data collaboration.
Normalized data blocks are generated through cross-modal semantic alignment, multimodal semantic encoding and global topological structure encoding are performed, a fusion weight matrix is generated, cross-modal feature fusion is achieved, and a standardized corpus is constructed.
It improves the accuracy of semantic retrieval and the comprehensiveness of decision analysis in government service scenarios, enhances the robustness of semantic representation, and improves the efficiency of government data governance and cross-departmental collaboration capabilities.
Smart Images

Figure CN120493159B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of text processing, and in particular, to a multi-source heterogeneous corpus fusion method and system based on government service data. BACKGROUND
[0002] With the deepening of the digital transformation of government services, multi-source heterogeneous corpus fusion technology has become a core link of government data governance, which aims to build a standardized semantic knowledge base by integrating multi-modal data to support efficient decision-making. The existing technology usually cannot overcome the semantic granularity difference and the lack of correlation between multi-source data, which is specifically manifested in the attribute mapping conflict caused by the non-uniformity of cross-modal semantic label system, the inability of static fusion strategy to adapt to the change of modal importance in dynamic business scenarios, and the semantic retrieval deviation caused by the fragmentation of local feature coding and global topology correlation. Based on this, the cross-department data collaboration efficiency in the government service scenario is restricted. SUMMARY
[0003] The present application provides a multi-source heterogeneous corpus fusion method and system based on government service data.
[0004] In a first aspect, the present application embodiment provides a multi-source heterogeneous corpus fusion method based on government service data, which comprises: acquiring a set of original corpora of multiple data sources in government services, wherein the set of original corpora contains corpora units of different data types; performing cross-modal semantic alignment processing on each corpora unit in the set of original corpora to generate a standardized data block corresponding to each corpora unit, the standardized data block containing a set of unified semantic labels and associated attributes; respectively performing multi-modal semantic coding on the standardized data blocks to obtain semantic feature vectors of each corpora unit, and performing topology structure coding on the set of associated attributes between the standardized data blocks to generate a global structure relationship graph; based on the node connection weight in the global structure relationship graph, performing dynamic weight distribution on the semantic feature vectors to generate a fusion weight matrix, and performing cross-modal feature fusion on the semantic feature vectors through the fusion weight matrix to obtain a target semantic embedding representation; and generating a standardized corpus library associated with government services according to the target semantic embedding representation.
[0005] In a second aspect, the present application embodiment provides a computer system, comprising: a memory having a computer program stored therein; a processor for loading the computer program to realize the multi-source heterogeneous corpus fusion method based on government service data as described above.
[0006] This invention provides a multi-source heterogeneous corpus fusion method based on government service data. Through cross-modal semantic alignment processing, it uniformly maps corpus units of different data types to standardized data blocks, eliminating semantic gaps and format differences between multi-source data. Furthermore, based on the synergistic effect of multi-modal semantic encoding and global topological structure encoding, it generates a fusion weight matrix, achieving cross-modal feature fusion under dynamic weight allocation. This enables the target semantic embedding representation to accurately express the semantic details of a single modality while capturing the global correlation patterns of cross-modal data, thereby significantly improving the accuracy of semantic retrieval and the comprehensiveness of decision analysis in government service scenarios. The method achieves end-to-end model training and application consistency. The design ensures dynamic adaptation of semantic features and topological structure during the generation of the standardized corpus, avoiding feature drift caused by the logical separation between training and application stages in traditional methods, and effectively enhancing the robustness of semantic representation of complex government service items. It adopts unsupervised semantic density clustering and multi-level mapping mechanism to automatically build a standardized corpus that supports multi-condition combined queries in scenarios without manual annotation. This overcomes the problems of high cost and strong subjectivity of manual annotation, and solves the semantic aggregation problem of non-uniformly distributed corpus units through dynamic cluster radius adjustment and variance-driven sub-cluster splitting strategy, which greatly improves the efficiency of government data governance and cross-departmental collaboration capabilities. Attached Figure Description
[0007] Figure 1 This is a flowchart of a multi-source heterogeneous corpus fusion method based on government service data provided in an embodiment of the present invention.
[0008] Figure 2 This is a schematic diagram of the composition of a computer system provided in an embodiment of the present invention. Detailed Implementation
[0009] Please see Figure 1 , Figure 1 A flowchart illustrating a method for fusing multi-source heterogeneous corpora based on government service data, provided in this embodiment of the invention, is shown. This method can be executed by a computer system and specifically includes the following steps:
[0010] Step S100: Obtain the original corpus set from multiple data sources in government services, wherein the original corpus set contains corpus units of different data types.
[0011] In government service, multiple different data sources are involved, each of which generates and stores data related to government service. The original corpus set is a collection of all relevant data collected from these multiple data sources. The corpus unit is the basic component in the original corpus set and has different data types. For example, in government service, the business systems, databases, log records, etc. of different departments can all be used as data sources. The data obtained from these data sources can include structured table data, such as a personnel information table of a department, containing fields such as name, position, contact information, etc. arranged neatly in a table; unstructured text data, such as policy documents, guide documents, etc. without fixed format and structure; semi-structured log data, such as system operation logs, containing timestamp, operation type, operation parameter, etc. but not as strictly uniform as structured table. Through data collection and integration of these different data sources, an original corpus set containing corpus units of different data types can be obtained. In actual operation, data interfaces, data extraction tools, etc. can be used to extract data from each data source and aggregate it into a unified storage location to form the original corpus set.
[0012] Step S200: Perform cross-modal semantic alignment processing on each corpus unit in the original corpus set to generate a standardized data block corresponding to each corpus unit, the standardized data block containing a unified semantic label and a set of associated attributes.
[0013] Cross-modal semantic alignment processing is to unify and align corpus units of different data types at the semantic level, so that data of different modalities can be understood and processed under the same semantic framework. The unified semantic label is a label that can accurately express the semantic meaning of the corpus unit, and the set of associated attributes is a series of attribute information related to the corpus unit. Through cross-modal semantic alignment processing, the semantic differences between different data types can be eliminated, providing a more accurate and consistent data basis for subsequent data analysis and processing. For example, for a structured table data about enterprise registration and an unstructured text data about enterprise registration process, through cross-modal semantic alignment processing, they can both be given a unified semantic label of "enterprise registration" and associated with attributes such as enterprise name, registration time, registration address, etc.
[0014] As mentioned earlier, the data types of corpus units can include structured table data, unstructured text data and semi-structured log data. Based on this, step S200, which performs cross-modal semantic alignment processing on each corpus unit in the original corpus set to generate a standardized data block corresponding to each corpus unit, can specifically include the following steps S210-S240:
[0015] Step S210: For the corpus unit of the structured table data type, extract the table header field and the row-column relationship, map the table header field to the candidate label in the preset semantic label set, and determine the final semantic label of the table header field according to the semantic similarity between the field content and the candidate label.
[0016] The structured table data has a clear table header field and row-column relationship, and the table header field is used to identify the meaning of each column of data. The preset semantic label set is a series of semantic labels defined in advance, which is used to map the table header field. The candidate label is a label that may match the table header field selected from the preset semantic label set. The semantic similarity is an index for measuring the semantic closeness between the field content and the candidate label. By extracting the table header field and the row-column relationship, the structure and meaning of the table data can be better understood. Then the table header field is mapped to the preset semantic label set to find the possible matching candidate label. Finally, according to the semantic similarity between the field content and the candidate label, the final semantic label that best matches is determined. For example, for an enterprise employee information table, the table header field "employee name", there may be candidate labels such as "personnel name" and "worker name" in the preset semantic label set. By calculating the semantic similarity between "employee name" and these candidate labels, "personnel name" is finally determined as the final semantic label. In actual operation, natural language processing techniques such as word vector models can be used to convert the table header field and the candidate label into vector representations, and then the semantic similarity can be determined by calculating the similarity between the vectors.
[0017] As an implementation, step S210, for the corpus unit of the structured table data type, extracts the table header field and the row-column relationship, maps the table header field to the candidate label in the preset semantic label set, and determines the final semantic label of the table header field according to the semantic similarity between the field content and the candidate label. Specifically, it can include the following steps S211-S216:
[0018] Step S211: Analyze the table structure in the corpus unit of the structured table data type, identify the nested level of the table and the merged cell information across rows and columns, generate a hierarchical relationship tree of the table header field, and the hierarchical relationship tree contains the parent-child relationship of the parent table header field and the child table header field.
[0019] The structured table data can have nested levels and merged cells. Parsing the table structure is to identify these complex structural information. Nested levels are the multi-level table header structures existing in the table. For example, a company financial statement can have a total header "financial information", and then be divided into "income information", "expense information" and other sub-headers. Merged cells across rows and columns are some cells in the table that span multiple rows or columns. The hierarchical relationship tree is a tree structure used to represent the subordinate relationship between table header fields. The parent table header field is the upper table header field, and the child table header field is the lower table header field. By parsing the table structure, identifying the nested levels and merged cell information, the hierarchical relationship tree of the table header field can be accurately generated. For example, for a table containing department information and employee information, "department information" can be a parent table header field, and "department name" and "department number" are child table header fields. In actual operation, a table parsing algorithm such as a rule-based parsing algorithm or a machine learning algorithm can be used to parse the table, extract the structural information of the table, and generate the hierarchical relationship tree.
[0020] Step S212: Based on the text description of each table header field in the hierarchical relationship tree, candidate labels containing the same core vocabulary as the text description are selected from the preset semantic label set to generate an initial candidate label list.
[0021] The text description of the table header field is the specific literal content expressed by the table header field, and the core vocabulary is the vocabulary with key semantics in the text description. The preset semantic label set is a series of semantic labels defined in advance. By comparing the text description of the table header field and the preset semantic label set, candidate labels containing the same core vocabulary are selected to form an initial candidate label list. For example, for the table header field "employee age", the preset semantic label set contains labels such as "personnel age" and "employee age". Since these labels all contain the core vocabulary "age", they can be selected to generate an initial candidate label list. In actual operation, a string matching algorithm such as regular expression matching or fuzzy matching algorithm can be used to select candidate labels containing the same core vocabulary.
[0022] Step S213: Traverse the initial candidate label list, and extract the semantic context template associated with each candidate label. The semantic context template includes label definition, synonym set and typical application scenario description.
[0023] The semantic context template is a template for describing the semantic information of the candidate label, including label definition, synonym set and typical application scenario description. The label definition is an explanation of the specific meaning of the candidate label, the synonym set is a set of words similar in meaning to the candidate label, and the typical application scenario description is a specific scenario of the candidate label in actual application. By traversing the initial candidate label list, the semantic context template associated with each candidate label is extracted, and the semantic information of the candidate label can be more comprehensively understood. For example, for the candidate label "person age", the label definition can be "to represent the age of a person", the synonym set can include "age" and "age", and the typical application scenario description can be "used in personnel information management, statistical analysis and other scenarios". In actual operation, natural language processing techniques such as text mining and information extraction techniques can be used to extract the semantic context template of the candidate label from related knowledge bases or documents.
[0024] Step S214: input the text description of the table header field and the semantic context template into the semantic matching model, calculate the context matching degree of the text description and each candidate label, and weight and correct the matching degree of the child table header field based on the matching result of the parent table header field in the hierarchical relationship tree.
[0025] The semantic matching model is a model for calculating the semantic matching degree between texts, which can use a deep learning model such as the BERT model. The context matching degree is an index for measuring the matching degree between the text description of the table header field and the semantic context template of the candidate label. By inputting the text description of the table header field and the semantic context template into the semantic matching model, the context matching degree of the text description and each candidate label can be calculated. At the same time, since there is a subordinate relationship between the parent table header field and the child table header field in the hierarchical relationship tree, the matching result of the parent table header field will affect the matching degree of the child table header field. Therefore, based on the matching result of the parent table header field in the hierarchical relationship tree, the matching degree of the child table header field is weighted and corrected, which can more accurately determine the matching degree of the child table header field. For example, for a table containing "department information" and "employee information", the matching result of the "department information" parent table header field is better, so when calculating the matching degree of the "employee information" child table header field, a higher weight can be given. In actual operation, the text description of the table header field and the semantic context template can be converted into vector representation and input into the BERT model for calculation to obtain the context matching degree. Then, according to the matching result of the parent table header field in the hierarchical relationship tree, the matching degree weight of the child table header field is adjusted.
[0026] Step S215: Sort the initial candidate label list according to the revised context matching degree, select the top K candidate labels with the highest matching degree to generate an optimized candidate label set, and calculate the compatibility score of each optimized candidate label and the cell content type based on the distribution characteristics of the cell content under the table header field, K > 1.
[0027] The revised context matching degree is the context matching degree revised by weighting the parent table header field matching result. By sorting the initial candidate label list according to the revised context matching degree, candidate labels with higher matching degrees can be found. Selecting the top K candidate labels with the highest matching degree to generate an optimized candidate label set narrows down the range of candidate labels and improves the efficiency of subsequent processing. The distribution characteristics of the cell content are the type, value range, frequency, etc. of the cell content under the table header field. The compatibility score is an index to measure the matching degree of the optimized candidate label and the cell content type. By calculating the compatibility score of each optimized candidate label and the cell content type, the candidate label that best matches the cell content type can be further selected. For example, for the table header field "employee gender", the cell content below is "male" and "female", and the optimized candidate label set may include labels such as "personnel gender" and "employee gender". By calculating the compatibility score of these labels and the cell content type, the best matching label can be determined. In actual operation, statistical analysis methods such as calculating the frequency distribution and value range of the cell content can be used to determine the distribution characteristics of the cell content. Then, according to the compatibility score rules, such as the consistency of the label and the cell content type, the coverage of the label to the cell content, etc., the compatibility score is calculated.
[0028] Step S216: Fuse the context matching degree and the compatibility score to generate a comprehensive weight, determine the candidate label with the largest comprehensive weight as the final semantic label of the table header field, and perform logical consistency check on the final semantic label and the semantic labels of adjacent table header fields in the hierarchical relationship tree, and output the complete mapping result after modifying the conflict label.
[0029] The comprehensive weight is a weight value obtained by fusing the context matching degree and the compatibility score, and is used to comprehensively measure the matching degree of the candidate label and the table header field. By determining the candidate label with the maximum comprehensive weight as the final semantic label of the table header field, the label that best matches the semantics of the table header field can be obtained. The logical consistency check is to check whether the final semantic label and the semantic label of the adjacent table header field in the hierarchical relationship tree are logically consistent. If there is a conflict label, it needs to be corrected to ensure the semantic consistency of the entire table. For example, for a table containing "employee information" and "department information", the final semantic label of "employee name" is determined as "person name", and the final semantic label of "department name" is determined as "organization name", which needs to be checked whether the two labels are logically reasonable. In actual operation, the context matching degree and the compatibility score can be fused to generate the comprehensive weight using the weighted average method. Then, the logical consistency check is performed on the final semantic label and the semantic label of the adjacent table header field using logical rules or a knowledge base, and the conflict label is corrected.
[0030] Step S220: For the corpus unit of unstructured text data type, the government service entity in the text is extracted by the entity recognition model, and the government service entity is matched with the preset entity library to generate attribute key-value pairs containing entity types and entity relationships.
[0031] Unstructured text data is text content without fixed format and structure, such as policy documents and service guidelines. The entity recognition model is a model used to identify entities in text, which can use deep learning models such as BiLSTM-CRF model. Government service entities are entities with meaning in the government service field, such as enterprises, individuals, and policies. The preset entity library is a collection of a series of government service entities and their related information defined in advance. The attribute key-value pair is a data structure used to represent entity types and entity relationships, with the key representing the entity type and the value representing the entity relationship. By extracting government service entities in the text through the entity recognition model, and then matching these entities with the preset entity library, the types and relationships of the entities can be determined to generate attribute key-value pairs containing entity types and entity relationships. For example, for an unstructured text about enterprise tax policy, through the entity recognition model, entities such as "enterprise" and "tax policy" can be identified, and by matching these entities with the preset entity library, it can be determined that "enterprise" is the main entity and "tax policy" is the related policy entity, generating attribute key-value pairs such as "main entity: enterprise, related policy entity: tax policy". In actual operation, the unstructured text is input into the BiLSTM-CRF model for entity recognition. Then, using a similarity matching algorithm, the identified entities are matched with the entities in the preset entity library to generate attribute key-value pairs.
[0032] Step S230: For the corpus unit of semi-structured log data type, parse the timestamp, operation type and parameter list in its log template, map the operation type to a unified operation code, and convert the parameter list to a property set in the form of key-value pair.
[0033] Semi-structured log data is structured but not completely standardized data, such as system operation logs. Log template is the basic format of log data, such as containing timestamp, operation type and parameter list. Timestamp is used to record the time of operation, operation type represents the specific type of operation, and parameter list is the relevant parameters involved in the operation. Unified operation code is to unify different operation types into a preset code for subsequent processing and analysis. Property set is to convert parameter list into a data set in the form of key-value pair, key represents parameter name, and value represents parameter value. By parsing the timestamp, operation type and parameter list in the log template, key information can be extracted. Then map the operation type to a unified operation code and convert the parameter list to a property set in the form of key-value pair, so that the semi-structured log data is more standardized. For example, for a system operation log, the log template is "timestamp: 2024-01-01 10:00:00, operation type: user login, parameter list: username=Zhang San, password=123456", map the "user login" operation type to a unified operation code "001", and convert the parameter list to a property set "username: Zhang San, password: 123456". In actual operation, regular expressions or log parsing tools can be used to parse the information in the log template. Then use the operation type mapping table to map the operation type to a unified operation code. Finally, convert the parameter list in the form of key-value pair to generate a property set.
[0034] Step S240: Associate the final semantic label, attribute key-value pair and attribute set for relevance verification, delete redundant attributes with semantic conflicts, and fill in missing attribute values to generate a standardized data block containing complete semantic labels and associated attribute sets.
[0035] The relevance check is to check whether the final semantic label, attribute key-value pair and attribute set are semantically relevant and consistent. Redundant attributes with semantic conflicts are attributes that conflict or repeat with the final semantic label or other attributes in semantics. Missing attribute values are some attributes in the attribute set without corresponding values. By performing relevance check, the semantic consistency and completeness of the information in the normalized data block can be ensured. Deleting redundant attributes with semantic conflicts can reduce data redundancy and improve data quality. Filling missing attribute values can ensure data completeness. For example, for a normalized data block about enterprise registration, the final semantic label is "enterprise registration", the attribute key-value pair contains "subject entity: enterprise", and the attribute set contains "enterprise name: XX company", "registration address: XX Road XX" and other information. If it is found that there are attributes in the attribute set that are irrelevant to the "enterprise registration" semantics, such as "employee hobby", it will be deleted. If the "registration time" attribute value is missing, it will be filled by querying related records or using default values. In actual operation, semantic reasoning rules or knowledge base can be used to perform relevance check on the final semantic label, attribute key-value pair and attribute set. Use data cleaning algorithms to delete redundant attributes with semantic conflicts. Use data filling algorithms such as mean filling, median filling, etc. to fill missing attribute values.
[0036] Step S300: Perform multi-modal semantic encoding on the normalized data blocks respectively to obtain semantic feature vectors of each corpus unit, and perform topological structure encoding on the associated attribute sets between the normalized data blocks to generate a global structure relationship graph.
[0037] Multi-modal semantic encoding is to convert normalized data blocks of different modalities into vector representations for processing and analysis in a unified vector space. Semantic feature vectors are vectors used to represent the semantic information of corpus units. Topological structure encoding is to convert the associated attribute sets between normalized data blocks into graph structures to represent the relationships between data. The global structure relationship graph is a graph structure used to represent the semantic and attribute association relationships between all normalized data blocks. By performing multi-modal semantic encoding on the normalized data blocks, data of different modalities can be converted into comparable and analyzable vector forms. By performing topological structure encoding on the associated attribute sets between the normalized data blocks, a relationship network between the data can be constructed to provide a basis for subsequent data analysis and mining. For example, for a set of normalized data blocks containing structured table data, unstructured text data and semi-structured log data, semantic feature vectors of each corpus unit can be obtained through multi-modal semantic encoding, and a global structure relationship graph representing the relationships between these data blocks can be generated through topological structure encoding.
[0038] As an implementation, in step S300, the multi-modal semantic encoding is performed on the normalized data blocks respectively to obtain semantic feature vectors of each corpus unit, which can include the following steps:
[0039] In step S310, the context semantic features of the text content of the normalized data block of the unstructured text data type are extracted by using a pre-trained language model, and a long-distance dependency relationship is modeled by using a multi-head attention mechanism to generate a first semantic feature vector.
[0040] The pre-trained language model is a model pre-trained on large-scale text data, such as the BERT model. The context semantic features are semantic information of the text in the context, which can better reflect the true meaning of the text. The multi-head attention mechanism is a mechanism for processing sequence data, which can capture the dependency relationship between different positions in the sequence, especially the long-distance dependency relationship. The first semantic feature vector is a semantic feature vector obtained after encoding the normalized data block of the unstructured text data type. By using a pre-trained language model to extract the context semantic features of the text content, the language knowledge learned by the pre-trained model on large-scale data can be fully utilized. By using a multi-head attention mechanism to model the long-distance dependency relationship, the relationship between different parts of the text can be better understood, and a more accurate semantic feature vector can be generated. For example, for an unstructured text about government policy, the text is input into the BERT model to extract the context semantic features of the text. Then, the multi-head attention mechanism is used to model the dependency relationship between different sentences and paragraphs in the text to generate the first semantic feature vector. In actual operation, the unstructured text data is processed by word segmentation, and then input into the BERT model to obtain the feature representation of the text. Then, the feature representation is input into the multi-head attention mechanism for further processing to generate the first semantic feature vector.
[0041] In step S320, for the normalized data block of the structured table data type, a relationship graph network between fields is constructed based on the semantic labels of the table header fields and the distribution rules of the cell contents, and a graph neural network is used to aggregate the feature representations of adjacent fields to generate a second semantic feature vector.
[0042] The inter-field relation graph network is a graph structure used to represent the relations between fields in structured table data. The semantic labels of table header fields represent the semantic meaning of each field, and the distribution of cell contents reflects the data correlation between fields. The graph neural network is a neural network used to process graph-structured data, which can aggregate the feature representations of nodes in the graph. The second semantic feature vector is a semantic feature vector obtained by encoding the normalized data block of the structured table data type. By constructing the inter-field relation graph network based on the semantic labels of table header fields and the distribution of cell contents, the structured table data can be converted into a graph structure, which is convenient for processing using a graph neural network. By aggregating the feature representations of adjacent fields using a graph neural network, the relations between fields can be considered comprehensively to generate a more comprehensive semantic feature vector. For example, for an enterprise employee information table, the inter-field relation graph network is constructed according to the semantic labels of table header fields such as "employee name", "employee age", "department name", etc., and the distribution of cell contents. Then, a graph neural network such as GCN (graph convolutional network) is used to aggregate the feature representations of adjacent fields to generate a second semantic feature vector. In actual operation, first, the connection relations between fields are determined according to the semantic labels of table header fields and the distribution of cell contents, and the relation graph network is constructed. Then, the feature representation of each field is taken as the node feature in the graph, which is input into the GCN for processing to generate the second semantic feature vector.
[0043] Step S330: For the normalized data block of the semi-structured log data type, the time distribution pattern of the operation encoding sequence and the parameter set is parsed, the time convolution network is used to extract the time sequence features of the operation sequence, and the embedding layer is used to map the parameter set to a dense vector to generate a third semantic feature vector.
[0044] The operation encoding sequence is a sequence composed of uniform operation encodings corresponding to operation types in the semi-structured log data, and reflects the order of operations. The time distribution pattern of the parameter set is the distribution of the parameter set at different time points. The time convolution network is a convolution network for processing sequence data, which can extract time sequence features in the sequence. The embedding layer is a layer that converts discrete data into continuous vector representation. The third semantic feature vector is a semantic feature vector obtained by encoding the normalized data block of the semi-structured log data type. By analyzing the operation encoding sequence and the time distribution pattern of the parameter set, the time sequence characteristics of the semi-structured log data can be understood. The time convolution network is used to extract the time sequence features of the operation sequence, which can capture the time dependence between operations. The parameter set is mapped to a dense vector through the embedding layer, which can convert discrete parameter data into continuous vector representation for subsequent processing. For example, for a system operation log, the operation encoding sequence "001, 002, 003" and the time distribution pattern of the parameter set are analyzed. The time convolution network, such as TCN (Time Convolution Network), is used to extract the time sequence features of the operation sequence. The parameters "username", "password", etc. in the parameter set are mapped to dense vectors through the embedding layer to generate the third semantic feature vector. In actual operation, first, the operation encoding sequence and the parameter set are preprocessed, then the operation encoding sequence is input into the TCN to extract the time sequence features. The parameter set is input into the embedding layer to obtain the dense vector representation. Finally, the time sequence features and the dense vector are spliced to generate the third semantic feature vector.
[0045] Step S340: The first semantic feature vector, the second semantic feature vector, and the third semantic feature vector are normalized to unify the vector dimensions of each semantic feature vector and retain the modal identifiers of each semantic feature vector.
[0046] The normalization processing is to map the value range of the vector to a preset interval, such as [0, 1] or [-1, 1], so as to eliminate the scale difference between different vectors. The vector dimension unification is to adjust the dimensions of different semantic feature vectors to the same dimension, so as to facilitate subsequent comparison and calculation. The modal identifier is identification information for identifying the modal to which the semantic feature vector belongs, such as text modal, table modal, log modal, etc. By normalizing the first semantic feature vector, the second semantic feature vector and the third semantic feature vector, the vectors can be compared and analyzed at the same scale. By unifying the dimensions of the semantic feature vectors, subsequent vector operations can be facilitated. By retaining the modal identifiers of the semantic feature vectors, the data of different modes can be distinguished in subsequent processing. For example, the dimension of the first semantic feature vector is 100, the dimension of the second semantic feature vector is 120, and the dimension of the third semantic feature vector is 80. Through dimension unification processing, the dimensions of them are all adjusted to 150. At the same time, the modal identifiers "text", "table" and "log" are added to each semantic feature vector. In actual operation, normalization algorithms such as Min-Max normalization or Z-Score normalization can be used to normalize the semantic feature vectors. The dimensions of the vectors are unified by using zero padding or truncation, etc. The modal identifiers are added to each semantic feature vector.
[0047] As an implementation, in step S300, the association attribute set between the normalized data blocks is topologically encoded to generate a global structure relationship graph, which can specifically include the following steps:
[0048] Step S350: Extract common attribute keys from the association attribute set of each normalized data block, the common attribute keys including government service matter code, user identifier and time interval.
[0049] The association attribute set is a set of attributes associated with other data blocks in the normalized data block. The common attribute key is an attribute key that exists in the association attribute set of multiple normalized data blocks. The government service matter code is a code for uniquely identifying a government service matter, the user identifier is identification information for uniquely identifying a user, and the time interval is a time range of an operation or event. By extracting common attribute keys from the association attribute set of each normalized data block, the association clues between different data blocks can be found. For example, for multiple normalized data blocks related to government service matters, they may all contain common attribute keys such as government service matter code, user identifier and time interval. In actual operation, the association attribute set of each normalized data block can be traversed, and an attribute key matching algorithm can be used to extract common attribute keys.
[0050] Step S360: taking each normalized data block as a node, constructing an initial node connection edge based on the matching relationship of the common attribute key, and calculating the attribute overlap degree and semantic correlation between nodes.
[0051] The node is the basic element in the graph structure, and each normalized data block is used as the node here. The initial node connection edge is established between the nodes according to the matching relationship of the common attribute key. The attribute overlap degree is the proportion of the same attribute key in the associated attribute set of two nodes, which reflects the similarity of the attributes between the nodes. The semantic correlation is the correlation degree between the semantic feature vectors of two nodes, which reflects the similarity of the semantics between the nodes. By taking each normalized data block as a node and constructing an initial node connection edge based on the matching relationship of the common attribute key, a preliminary relationship network between the data blocks can be constructed. By calculating the attribute overlap degree and semantic correlation between the nodes, the relationship between the nodes can be further quantified. For example, for two normalized data blocks, their associated attribute sets both contain the government service item code "001", so an initial node connection edge is established between the two nodes. Then the attribute overlap degree and semantic correlation are calculated. In actual operation, according to the matching of the common attribute key, an initial node connection edge is established for the matched node pair. The set operation method is used to calculate the attribute overlap degree. The cosine similarity method is used to calculate the semantic correlation.
[0052] As an implementation, step S360, taking each normalized data block as a node, constructing an initial node connection edge based on the matching relationship of the common attribute key, and calculating the attribute overlap degree and semantic correlation between nodes, can specifically include the following steps S361-S364:
[0053] Step S361: traverse all pairs of normalized data block nodes, detect whether there is at least one same common attribute key in the associated attribute sets of the two nodes, if there is, mark the two nodes as a candidate connection node pair, and record the matching number and specific key value of the common attribute key.
[0054] By traversing all pairs of normalized data block nodes, the associated attribute sets between the nodes can be comprehensively checked. By detecting whether there is at least one same common attribute key in the associated attribute sets of the two nodes, it can be determined whether there is an associated clue between the nodes. The two nodes with the same common attribute key are marked as a candidate connection node pair, and the matching number and specific key value of the common attribute key are recorded, which provides a basis for subsequent processing. For example, for node A and node B, their associated attribute sets both contain the government service item code "001", so node A and node B are marked as a candidate connection node pair, and the matching number is recorded as 1 and the specific key value is "government service item code: 001". In actual operation, all node pairs are traversed using double loops, and the associated attribute sets of each node pair are compared to find the same common attribute key.
[0055] Step S362: For each candidate connection node pair, extract the union and intersection of all attribute keys in its associated attribute sets, calculate the proportion of the number of attribute keys contained in the intersection to the number of attribute keys contained in the union, and generate the attribute overlap degree.
[0056] The union of attribute keys is the set of all different attribute keys in the associated attribute sets of the two nodes, and the intersection of attribute keys is the set of the same attribute keys in the associated attribute sets of the two nodes. The attribute overlap degree is obtained by calculating the proportion of the number of attribute keys contained in the intersection to the number of attribute keys contained in the union, which reflects the similarity of attributes between the two nodes. For example, for the candidate connection node pair A and B, the associated attribute set of node A contains attribute keys "government service matter code" and "user identifier", and the associated attribute set of node B contains attribute keys "government service matter code" and "time interval", then the union of attribute keys is "government service matter code, user identifier, time interval", the intersection of attribute keys is "government service matter code", and the attribute overlap degree is 1 / 3. In actual operation, the union and intersection of attribute keys are calculated using set operation method. Then the number of attribute keys in the intersection and the union is calculated to obtain the attribute overlap degree.
[0057] Step S363: Extract a sub-vector related to the government service scenario from the semantic feature vector of the normalized data block, and the sub-vector contains matter classification, time sensitivity, and user group feature dimensions.
[0058] The semantic feature vector is the semantic representation of the normalized data block, which contains information related to the government service scenario. The sub-vector is a partial vector extracted from the semantic feature vector, which contains matter classification, time sensitivity, and user group feature dimensions. Matter classification is the category of government service matters, such as administrative approval, public service, etc. Time sensitivity is the sensitivity of government service matters to time, such as urgent matters and non-urgent matters. User group feature dimensions are features related to user groups, such as age, gender, occupation, etc. By extracting a sub-vector related to the government service scenario from the semantic feature vector of the normalized data block, the key information of the government service scenario can be focused on. For example, for a semantic feature vector of a normalized data block, a sub-vector related to matter classification "administrative approval", time sensitivity "urgent", and user group feature dimension "age between 30-40 years old" is extracted. In actual operation, according to the pre-defined indexes of matter classification, time sensitivity, and user group feature dimensions, the corresponding sub-vector is extracted from the semantic feature vector.
[0059] Step S364: Calculate the cosine similarity of the sub-vector of each candidate connection node pair to generate a semantic correlation coefficient reflecting the semantic association strength.
[0060] The cosine similarity is a method for calculating the similarity between two vectors, which measures the similarity between two vectors by calculating the cosine of the included angle between them. The semantic correlation coefficient is obtained by calculating the cosine similarity of the sub-vectors of the candidate connection node pair, which reflects the association strength between the two nodes.
[0061] Step S370: According to the attribute overlap degree and the semantic correlation, the initial node connection edge is weighted to generate a weighted edge set.
[0062] The attribute overlap degree and the semantic correlation reflect the association degree between nodes. By weighting the initial node connection edge according to the attribute overlap degree and the semantic correlation, a more accurate weight can be assigned to the edge to reflect the actual association strength between nodes. For example, for the nodes A and B connected by the initial node connection edge, the attribute overlap degree is 0.5 and the semantic correlation coefficient is 0.8. According to the preset weighting rule, such as linear weighting, a weight value can be assigned to the edge.
[0063] Step S380: Based on the node and the weighted edge set, a global structure relationship graph containing a node feature matrix and an adjacency matrix is constructed, wherein the node feature matrix is composed of semantic feature vectors of each node.
[0064] The node feature matrix is a matrix, where each row represents a semantic feature vector of a node, reflecting the semantic information of the node. The adjacency matrix is a matrix used to represent the connection relationship and connection weight between nodes. The global structure relationship graph is a graph structure that represents the semantic and attribute association relationship between nodes through the node feature matrix and the adjacency matrix. By constructing a global structure relationship graph containing a node feature matrix and an adjacency matrix based on the node and the weighted edge set, the relationship between the normalized data blocks can be comprehensively represented. For example, for a case with 3 nodes, the node feature matrix is a 3-row matrix, and each row is a semantic feature vector of a node. The adjacency matrix is a 3x3 matrix, and the elements in the matrix represent the connection weights between nodes. In actual operation, the semantic feature vectors of the nodes are arranged in order to form the node feature matrix. According to the weighted edge set, the weights of the edges are filled into the corresponding positions of the adjacency matrix to construct the global structure relationship graph.
[0065] As an implementation, step S380, based on the node and the weighted edge set, a global structure relationship graph containing a node feature matrix and an adjacency matrix is constructed, wherein the node feature matrix is composed of semantic feature vectors of each node, which can specifically include steps S381-S385:
[0066] Step S381: Traverse each edge in the weighted edge set, extract the two node identifiers connected by the edge and the corresponding weight value, map the node identifiers to the row index in the node feature matrix, and fill the weight value to the position corresponding to the row index in the adjacency matrix to generate an initial adjacency matrix.
[0067] The weighted edge set contains the connection relationship and connection weight between nodes. The node identifier is information used to uniquely identify the node. The row index is the row position of the corresponding node in the node feature matrix. By traversing each edge in the weighted edge set, extracting the two node identifiers connected by the edge and the corresponding weight value, the connection relationship and weight between nodes can be determined. Mapping the node identifier to the row index in the node feature matrix and filling the weight value to the position corresponding to the row index in the adjacency matrix can construct the initial adjacency matrix. For example, for an edge connecting node A and node B in the weighted edge set, the weight value is 0.5, and the identifiers of node A and node B are mapped to row indexes 1 and 2 in the node feature matrix, and 0.5 is filled into the positions of the first row and the second column and the second row and the first column in the adjacency matrix. In actual operation, the weighted edge set is traversed using a loop, and the weight value is filled into the adjacency matrix according to the mapping relationship between the node identifier and the row index.
[0068] Step S382: Detect whether there is a bidirectional connected edge in the weighted edge set, if there is, update the weight value at the corresponding position in the adjacency matrix to the sum of the bidirectional weights, and mark it as an undirected edge.
[0069] A bidirectional connected edge is an edge between two nodes with two opposite directions, and the weights of the edges may be different. By detecting whether there is a bidirectional connected edge in the weighted edge set, this special connection situation can be handled. Updating the weight value at the corresponding position in the adjacency matrix to the sum of the bidirectional weights and marking it as an undirected edge can accurately represent the connection relationship between nodes. For example, for an edge from node A to node B in the weighted edge set, the weight value is 0.3, and an edge from node B to node A, the weight value is 0.2, then the weight value at the corresponding position in the adjacency matrix is updated to 0.5, and marked as an undirected edge. In actual operation, the weighted edge set is traversed to check whether there is a bidirectional connected edge. If there is, update the weight value at the corresponding position in the adjacency matrix, and mark it as an undirected edge.
[0070] Step S383: According to the semantic feature vector of each row in the node feature matrix, calculate the distribution density of each node in the preset government service scenario dimension, and normalize the connection weight of the corresponding node in the adjacency matrix based on the distribution density to generate a symmetric normalized adjacency matrix.
[0071] The preset government service scenario dimension is a dimension related to the government service scenario, which is predefined, such as matter classification, time sensitivity, and the like. The distribution density is the distribution of nodes in the preset government service scenario dimension, reflecting the aggregation degree of the nodes in the dimension. By calculating the distribution density of each node in the preset government service scenario dimension according to the semantic feature vector of each row in the node feature matrix, the distribution characteristics of the nodes in the government service scenario can be understood. Based on the distribution density, the connection weight of the corresponding node in the adjacency matrix is normalized, so that the connection weight is more reasonable, and a symmetric normalized adjacency matrix is generated. For example, for the preset government service scenario dimension "matter classification", the distribution density of each node in the dimension is calculated. Then, according to the distribution density, the connection weight of the corresponding node in the adjacency matrix is normalized. In actual operation, the statistical analysis method is used to calculate the distribution density of each node in the preset government service scenario dimension. The normalization algorithm, such as the symmetric normalization algorithm, is used to normalize the connection weight of the corresponding node in the adjacency matrix.
[0072] Step S384: Group the semantic feature vectors in the node feature matrix according to the government service matter classification dimension, and smooth and enhance the connection weight of the nodes in the same classification group in the adjacency matrix to generate an optimized adjacency matrix.
[0073] The government service matter classification dimension is a dimension divided according to the category of government service matters, such as administrative approval, public service, and the like. By grouping the semantic feature vectors in the node feature matrix according to the government service matter classification dimension, nodes with the same matter classification can be grouped together. By smoothing and enhancing the connection weight of the nodes in the same classification group in the adjacency matrix, the association relationship between the nodes in the same classification group can be highlighted, and an optimized adjacency matrix can be generated. For example, for the government service matter classification dimension "administrative approval", the semantic feature vectors of the nodes belonging to this classification are grouped together. Then, the connection weight of the nodes in the group in the adjacency matrix is smoothed and enhanced, such as using a smoothing algorithm to increase the stability of the connection weight. In actual operation, the semantic feature vectors in the node feature matrix are grouped according to the government service matter classification dimension. The smoothing algorithm is used to smooth and enhance the connection weight of the nodes in the same classification group in the adjacency matrix.
[0074] Step S385: Combine the node feature matrix and the optimized adjacency matrix to generate a global structure relationship graph containing node semantic features and topological connection weights, wherein the non-zero element position of the adjacency matrix represents the existence of semantic or attribute association between nodes, and the element value represents the association strength.
[0075] By combining the node feature matrix with the optimized adjacency matrix, the semantic features of the nodes and the topological connection weights can be integrated into a graph structure to generate a global structure relationship graph containing node semantic features and topological connection weights. The non-zero element position of the adjacency matrix represents the existence of semantic or attribute association between nodes, and the element value represents the association strength. For example, the element value of the first row and the second column in the adjacency matrix is 0.8, indicating that there is a strong association between node 1 and node 2. In actual operation, the node feature matrix and the optimized adjacency matrix are spliced or combined to generate a global structure relationship graph.
[0076] Step S400: Based on the node connection weight in the global structure relationship graph, the semantic feature vector is dynamically weighted and distributed to generate a fusion weight matrix, and the semantic feature vector is fused through the fusion weight matrix to obtain a target semantic embedding representation.
[0077] The node connection weight in the global structure relationship graph reflects the association strength between nodes. Dynamic weight distribution is to assign different weights to semantic feature vectors according to node connection weights, so that the semantic feature vectors of nodes with high association strength have greater influence in the fusion process. The fusion weight matrix is a matrix used to represent the fusion weight of the semantic feature vector. Cross-modal feature fusion is to fuse semantic feature vectors of different modalities to obtain a comprehensive representation. The target semantic embedding representation is the final semantic representation obtained by cross-modal feature fusion. For example, the connection weight of node A and node B in the global structure relationship graph is 0.8, and in the dynamic weight distribution, the semantic feature vectors of node A and node B are assigned higher weights. Through the fusion weight matrix, the semantic feature vectors are fused by cross-modal feature fusion to obtain the target semantic embedding representation. In actual operation, according to the node connection weight in the global structure relationship graph, a weight distribution algorithm is used to generate a fusion weight matrix. Then use matrix multiplication and other methods to fuse the semantic feature vectors through the fusion weight matrix.
[0078] As an implementation, in step S400, the semantic feature vector is fused by the fusion weight matrix to obtain the target semantic embedding representation, which can specifically include the following steps S410-S470:
[0079] Step S410: According to the modal identifier of each node in the global structure relationship graph, the semantic feature vector is divided into a text modal subset, a table modal subset and a log modal subset.
[0080] The modal identifier is identification information for identifying the modal to which the semantic feature vector belongs, such as a text modal, a table modal, a log modal, and the like. By dividing the semantic feature vectors into a text modal subset, a table modal subset, and a log modal subset according to the modal identifiers of the nodes in the global structure relationship graph, the semantic feature vectors of different modals can be processed separately, facilitating subsequent cross-modal feature fusion. For example, for a node in the global structure relationship graph, the semantic feature vectors are divided into a text modal subset {vector 1, vector 2}, a table modal subset {vector 3, vector 4}, and a log modal subset {vector 5, vector 6} according to the modal identifiers. In actual operation, the nodes in the global structure relationship graph are traversed, and the semantic feature vectors are assigned to the corresponding modal subsets according to the modal identifiers of the nodes.
[0081] Step S420: For each semantic feature vector in the text modal subset, the cosine similarity average with other semantic feature vectors in the same modal subset is calculated to generate the intra-text similarity, and the cosine similarity maximum with each semantic feature vector in the table modal subset and the log modal subset is calculated to generate the text cross-modal similarity.
[0082] The cosine similarity is a method for calculating the similarity between two vectors, which measures the similarity between two vectors by calculating the cosine of the included angle. The intra-text similarity is the average similarity of the semantic feature vectors in the text modal subset with other semantic feature vectors in the same modal subset, reflecting the similarity of the semantic feature vectors in the text modal subset. The text cross-modal similarity is the maximum similarity of the semantic feature vectors in the text modal subset with each semantic feature vector in the table modal subset and the log modal subset, reflecting the similarity of the semantic feature vectors in the text modal subset with the semantic feature vectors in other modal subsets. For example, for the semantic feature vector vector 1 in the text modal subset, the cosine similarity with vector 2 is calculated to obtain a similarity value. Then the average of all similarity values is calculated to obtain the intra-text similarity. At the same time, the cosine similarity of vector 1 with each semantic feature vector in the table modal subset and the log modal subset is calculated, and the maximum value is taken to obtain the text cross-modal similarity. In actual operation, the cosine similarity calculation formula is used to calculate the similarity between the semantic feature vectors in the text modal subset and the similarity with the semantic feature vectors in other modal subsets. Then the average and the maximum value are calculated to obtain the intra-text similarity and the text cross-modal similarity.
[0083] Step S430: For each semantic feature vector in the table modal subset, the cosine similarity average with other semantic feature vectors in the same modal subset is calculated to generate the intra-table similarity, and the cosine similarity maximum with each semantic feature vector in the text modal subset and the log modal subset is calculated to generate the table cross-modal similarity.
[0084] The table intra-class similarity is the average of the similarities between the semantic feature vectors in the table modal subset and other semantic feature vectors in the same modal subset, reflecting the similarity degree of the semantic feature vectors in the table modal subset. The table cross-modal similarity is the maximum of the similarities between the semantic feature vectors in the table modal subset and the semantic feature vectors in the text modal subset and the log modal subset, reflecting the similarity degree of the semantic feature vectors in the table modal subset and the semantic feature vectors in other modal subsets. For example, for the semantic feature vector V3 in the table modal subset, the cosine similarity between V3 and V4 is calculated, and the similarity value is obtained. Then, the average of all similarity values is calculated to obtain the table intra-class similarity. At the same time, the cosine similarity between V3 and the semantic feature vectors in the text modal subset and the log modal subset is calculated, and the maximum value is obtained to obtain the table cross-modal similarity. In actual operation, the cosine similarity calculation formula is used to calculate the similarities between the semantic feature vectors in the table modal subset and the similarities between the semantic feature vectors in the table modal subset and the semantic feature vectors in other modal subsets. Then, the average and the maximum value are calculated to obtain the table intra-class similarity and the table cross-modal similarity.
[0085] Step S440: For each semantic feature vector in the log modal subset, the average of the cosine similarities between the semantic feature vector and other semantic feature vectors in the same modal subset is calculated to generate the log intra-class similarity, and the maximum of the cosine similarities between the semantic feature vector and the semantic feature vectors in the text modal subset and the table modal subset is calculated to generate the log cross-modal similarity.
[0086] The log intra-class similarity is the average of the similarities between the semantic feature vectors in the log modal subset and other semantic feature vectors in the same modal subset, reflecting the similarity degree of the semantic feature vectors in the log modal subset. The log cross-modal similarity is the maximum of the similarities between the semantic feature vectors in the log modal subset and the semantic feature vectors in the text modal subset and the table modal subset, reflecting the similarity degree of the semantic feature vectors in the log modal subset and the semantic feature vectors in other modal subsets. For example, for the semantic feature vector V5 in the log modal subset, the cosine similarity between V5 and V6 is calculated, and the similarity value is obtained. Then, the average of all similarity values is calculated to obtain the log intra-class similarity. At the same time, the cosine similarity between V5 and the semantic feature vectors in the text modal subset and the table modal subset is calculated, and the maximum value is obtained to obtain the log cross-modal similarity. In actual operation, the cosine similarity calculation formula is used to calculate the similarities between the semantic feature vectors in the log modal subset and the similarities between the semantic feature vectors in the log modal subset and the semantic feature vectors in other modal subsets. Then, the average and the maximum value are calculated to obtain the log intra-class similarity and the log cross-modal similarity.
[0087] Step S450: The text intra-class similarity and the text cross-modal similarity are fused according to a preset ratio to generate a text modal fusion coefficient, the table intra-class similarity and the table cross-modal similarity are fused according to the same ratio to generate a table modal fusion coefficient, and the log intra-class similarity and the log cross-modal similarity are fused according to the same ratio to generate a log modal fusion coefficient.
[0088] The preset ratio is a ratio preset for fusing the intra-class similarity and the cross-modal similarity, such as 0.5:0.5. The text modal fusion coefficient is a coefficient obtained by fusing the text intra-class similarity and the text cross-modal similarity according to the preset ratio, and reflects the importance of the text modal in cross-modal feature fusion. The table modal fusion coefficient is a coefficient obtained by fusing the table intra-class similarity and the table cross-modal similarity according to the preset ratio, and reflects the importance of the table modal in cross-modal feature fusion. The log modal fusion coefficient is a coefficient obtained by fusing the log intra-class similarity and the log cross-modal similarity according to the preset ratio, and reflects the importance of the log modal in cross-modal feature fusion. For example, the preset ratio is 0.5:0.5, the text intra-class similarity is 0.6, and the text cross-modal similarity is 0.7, and then the text modal fusion coefficient is 0.5*0.6+0.5*0.7=0.65. In actual operation, the intra-class similarity and the cross-modal similarity are fused according to the preset ratio by using the weighted average method to generate the modal fusion coefficient.
[0089] Step S460: The text modal fusion coefficient, the table modal fusion coefficient, and the log modal fusion coefficient are weighted and superimposed based on the dynamic weight parameters corresponding to each modal in the fusion weight matrix to generate a global fusion coefficient, and the global fusion coefficient is converted into a normalized fusion weight in the form of a probability distribution by using a normalization exponential function.
[0090] The dynamic weight parameters corresponding to each modality in the fusion weight matrix are allocated according to the node connection weight in the global structure relationship graph, and reflect the importance of each modality in cross-modal feature fusion. The global fusion coefficient is a coefficient obtained by weighted superposition of the text modality fusion coefficient, the table modality fusion coefficient and the log modality fusion coefficient, and comprehensively considers the importance of each modality. The normalized exponential function is a function for converting numerical values into a probability distribution, such as the Softmax function. The normalized fusion weight is a weight converted from the global fusion coefficient into a probability distribution form by the normalized exponential function, and is used for weighted summation of the semantic feature vectors. For example, the dynamic weight parameters corresponding to the text modality, the table modality and the log modality in the fusion weight matrix are 0.3, 0.4 and 0.3 respectively, the text modality fusion coefficient is 0.6, the table modality fusion coefficient is 0.7, and the log modality fusion coefficient is 0.5, then the global fusion coefficient is 0.3*0.6+0.4*0.7+0.3*0.5=0.61. Then the global fusion coefficient is converted into the normalized fusion weight by using the Softmax function. In actual operation, the method of weighted superposition is used to calculate the global fusion coefficient. The Softmax function is used to convert the global fusion coefficient into the normalized fusion weight.
[0091] Step S470: weighted summation of the semantic feature vectors in the text modality subset, the table modality subset and the log modality subset according to the normalized fusion weight, to generate a target semantic embedding representation, wherein the semantic feature vectors in the same modality subset share the same normalized fusion weight.
[0092] The normalized fusion weight reflects the importance of each modality in cross-modal feature fusion, and by weighted summation of the semantic feature vectors in the text modality subset, the table modality subset and the log modality subset according to the normalized fusion weight, the semantic feature vectors of different modalities can be fused to obtain the target semantic embedding representation. The semantic feature vectors in the same modality subset share the same normalized fusion weight, which ensures the consistency of the semantic feature vectors in the same modality in the fusion process.
[0093] Step S500: generating a standardized corpus associated with government services according to the target semantic embedding representation.
[0094] The target semantic embedding representation is the final semantic representation obtained through cross-modal feature fusion, and contains comprehensive semantic information of the government service data. The standardized corpus is a processed and organized corpus for storing standardized data associated with government services. By generating a standardized corpus associated with government services according to the target semantic embedding representation, the government service data can be uniformly managed and stored, facilitating subsequent retrieval and analysis. For example, the target semantic embedding representation is associated with the corresponding corpus unit and stored in the standardized corpus. In actual operation, a database management system is used to create a standardized corpus, and the target semantic embedding representation and related corpus units are stored in the database.
[0095] As an implementation, step S500, generating a standardized corpus associated with government services according to the target semantic embedding representation, can specifically include steps S510-S540:
[0096] Step S510: input the target semantic embedding representation into the pre-trained semantic clustering model, and divide the corpus units with a similarity higher than a threshold value into the same semantic cluster according to the distance measurement of the embedding vectors.
[0097] The pre-trained semantic clustering model is a model pre-trained on large-scale data, such as a K-Means clustering model. The distance measurement of the embedding vectors is a method for measuring the distance between two embedding vectors, such as Euclidean distance, cosine distance, etc. The similarity threshold is a threshold value pre-set for judging whether the corpus units belong to the same semantic cluster. By inputting the target semantic embedding representation into the pre-trained semantic clustering model, the corpus units with a similarity higher than the threshold value can be divided into the same semantic cluster according to the distance measurement of the embedding vectors, realizing the clustering of the corpus units. For example, for target semantic embedding representation vectors V1, V2, and V3, use the K-Means clustering model to calculate the Euclidean distance between them. If the distance between vector V1 and vector V2 is less than the similarity threshold, they are divided into the same semantic cluster. In actual operation, the target semantic embedding representation is input into the K-Means clustering model, the similarity threshold is set, and the clustering operation is performed.
[0098] Step S520: assign a unique semantic identifier to each semantic cluster, and extract the common attribute keys of the corpus units in the semantic cluster as cluster description metadata.
[0099] The semantic identifier is identification information for uniquely identifying the semantic cluster, facilitating management and query of the semantic cluster. The common attribute key is an attribute key that the corpus units in the semantic cluster all have, reflecting the common characteristics of the semantic cluster. The cluster description metadata is metadata for describing the semantic cluster, containing the common attribute key and the like. By assigning a unique semantic identifier to each semantic cluster and extracting the common attribute key of the corpus units in the semantic cluster as the cluster description metadata, the semantic cluster can be clearly identified and described. For example, for a semantic cluster, assign it a semantic identifier "cluster 001", and extract the common attribute keys "government service matter code" and "user identifier" of the corpus units in the semantic cluster as the cluster description metadata. In actual operation, a unique identifier generation algorithm is used to assign a semantic identifier to each semantic cluster. The corpus units in the semantic cluster are traversed, and the common attribute keys are extracted as the cluster description metadata.
[0100] Step S530: Based on the semantic identifier and the cluster description metadata, an inverted index structure is constructed, and the inverted index structure contains a multi-level mapping relationship from the semantic label to the corpus unit.
[0101] The inverted index structure is an index structure for quickly retrieving data, and by constructing a multi-level mapping relationship from the semantic label to the corpus unit, the efficiency of data retrieval can be improved. The semantic identifier and the cluster description metadata can be used as semantic labels to identify and describe the semantic cluster. By constructing the inverted index structure based on the semantic identifier and the cluster description metadata, the semantic labels can be associated with the corpus units, facilitating quick finding of the corresponding corpus units according to the semantic labels. For example, for the semantic identifier "cluster 001" and the cluster description metadata "government service matter code: 001", the inverted index structure is constructed, and they are mapped with the corpus units belonging to the semantic cluster. In actual operation, an inverted index construction algorithm is used to construct the inverted index structure according to the semantic identifier and the cluster description metadata.
[0102] Step S540: Store the inverted index structure and the target semantic embedding representation to the distributed database to generate a standardized corpus library supporting multi-condition combined query.
[0103] The distributed database is a kind of database system for storing and managing data in a distributed manner, with high scalability and fault tolerance. By embedding the inverted index structure and target semantic embedding representation into the distributed database, distributed storage and management of data can be realized. The standardized corpus supporting multi-condition combined query is a corpus that can be queried according to multiple conditions, improving the flexibility and accuracy of data query. For example, users can query according to multiple conditions such as government service item code, user identifier, etc. to obtain relevant corpus units from the standardized corpus. In actual operation, the inverted index structure and target semantic embedding representation are stored in the distributed database using a distributed database management system, and the database is configured to support multi-condition combined query function.
[0104] As an implementation, the method provided by the application is executed by a multi-source heterogeneous corpus fusion model, wherein the multi-source heterogeneous corpus fusion model includes a multi-modal semantic encoding network, a topology structure encoding network and a fusion weight prediction network. Based on this, the method provided by the embodiment of the application further includes a training process of the multi-source heterogeneous corpus fusion model, which can specifically include the following steps S10-S60:
[0105] Step S10: obtaining a multi-source corpus unit sample set of the same government service item in historical government service data, the sample set containing structured table data, unstructured text data and semi-structured log data, and labeling the corresponding standardized corpus label.
[0106] The historical government service data is the government service related data accumulated in the past period of time. The multi-source corpus unit sample set of the same government service item is a collection of corpus unit samples collected from multiple different data sources for the same government service item, containing structured table data, unstructured text data and semi-structured log data. The standardized corpus label is a label for labeling the corpus unit, used to represent the standard semantic information of the corpus unit. By obtaining the multi-source corpus unit sample set of the same government service item in the historical government service data and labeling the corresponding standardized corpus label, supervised sample data can be provided for the training of the multi-source heterogeneous corpus fusion model. For example, for the government service item "enterprise registration", relevant structured table data, unstructured text data and semi-structured log data are obtained from the business systems of different departments, policy documents and operation logs to form a sample set. Then, each corpus unit is labeled with a standardized corpus label such as "enterprise registration". In actual operation, a data collection tool is used to obtain the multi-source corpus unit sample set of the same government service item from the historical government service data. Artificial labeling or automatic labeling tool is used to label the standardized corpus label for the sample set.
[0107] Step S20: Perform cross-modal semantic alignment processing on the multi-source corpus unit sample set to generate a set of standardized data blocks for training, and perform multi-modal semantic encoding on the set of standardized data blocks through a multi-modal semantic encoding network to obtain semantic feature vector samples of each corpus unit.
[0108] The cross-modal semantic alignment processing is a processing of unifying and aligning corpus units of different modalities at the semantic level to generate a set of standardized data blocks for training. The multi-modal semantic encoding network is a network for converting standardized data blocks into semantic feature vectors, which can use the pre-trained language model mentioned above, graph neural network, etc. The semantic feature vector sample is a vector sample obtained after multi-modal semantic encoding of the corpus unit, which is used for model training. By performing cross-modal semantic alignment processing on the multi-source corpus unit sample set to generate a set of standardized data blocks for training, the semantic differences between different modal data can be eliminated. By performing multi-modal semantic encoding on the set of standardized data blocks through a multi-modal semantic encoding network, semantic feature vector samples of each corpus unit are obtained, which can convert the data into a vector form suitable for model training. For example, for structured table data, unstructured text data and semi-structured log data in the multi-source corpus unit sample set, perform cross-modal semantic alignment processing to generate a set of standardized data blocks for training. Then input these standardized data blocks into the multi-modal semantic encoding network, encode the unstructured text data using the pre-trained language model (such as the BERT model) combined with the multi-head attention mechanism, construct the relationship graph network between the fields based on the semantic labels of the table headers and the distribution rules of the cell contents for the structured table data, and then encode it through the graph neural network (such as GCN), parse the time distribution pattern of the operation encoding sequence and parameter set for the semi-structured log data, extract the time sequence features of the operation sequence using the time convolution network (such as TCN), and map the parameter set to a dense vector through the embedding layer for encoding, and finally obtain the semantic feature vector samples of each corpus unit. In actual operation, according to the steps of cross-modal semantic alignment processing, different types of corpus units are processed in turn to obtain standardized data blocks. Then input the standardized data blocks into the corresponding encoding model according to different modalities, and after a series of calculations and processing, output the semantic feature vector samples.
[0109] Step S30: Perform topological structure encoding on the set of standardized data blocks through a topological structure encoding network based on the semantic feature vector samples to generate a global structure relationship graph sample for training, wherein the node feature matrix is composed of semantic feature vector samples, and the adjacency matrix is calculated from the attribute overlap and semantic correlation between sample nodes.
[0110] The topology coding network is used to convert the associated attribute set in the normalized data block set into a graph structure to represent the relationship between data. The semantic feature vector sample contains the semantic information of the corpus unit. Based on these semantic feature vector samples, the attribute overlap and semantic correlation between nodes can be better calculated. The node feature matrix is composed of semantic feature vector samples, which reflects the semantic features of each node. The adjacency matrix is calculated by the attribute overlap and semantic correlation between sample nodes, which is used to represent the connection relationship and connection strength between nodes. By using the topology coding network to code the associated attribute set in the normalized data block set, a global structure relationship graph sample for training is generated, which can provide the model with the structure information between data. For example, common attribute keys (such as government service item code, user identifier and time interval) are extracted from the associated attribute set of the normalized data block set, and each normalized data block is taken as a node. The initial node connection edge is constructed based on the matching relationship of the common attribute keys. The attribute overlap between nodes is calculated, that is, the union and intersection of all attribute keys in the associated attribute set are extracted, and the proportion of the number of attribute keys contained in the intersection to the number of attribute keys contained in the union is calculated. The semantic correlation is calculated, and the sub-vector related to the government service scene (including item classification, time sensitivity and user group feature dimension) is extracted from the semantic feature vector sample of the normalized data block. The cosine similarity of the sub-vector of each candidate connection node pair is calculated. According to the attribute overlap and semantic correlation, the initial node connection edge is weighted to generate a weighted edge set. Based on the node and weighted edge set, a global structure relationship graph sample containing a node feature matrix and an adjacency matrix is constructed. In actual operation, the topology coding network is used to calculate and process according to the above steps to obtain the global structure relationship graph sample for training.
[0111] Step S40: input the semantic feature vector sample into the initial fusion weight prediction network, generate dynamic weight distribution parameters based on the node connection weight in the global structure relationship graph sample, and obtain the predicted semantic embedding representation sample through cross-modal feature fusion.
[0112] The initial fusion weight prediction network is used to assign dynamic weights to the semantic feature vector samples according to the node connection weights in the global structure relation graph sample. The dynamic weight distribution parameters reflect the importance of different semantic feature vectors in cross-modal feature fusion. Through cross-modal feature fusion, the semantic feature vectors of different modalities can be fused to obtain a predicted semantic embedding representation sample. For example, according to the modality identifiers of each node in the global structure relation graph sample, the semantic feature vector samples are divided into a text modality subset, a table modality subset, and a log modality subset. For the semantic feature vector samples in each modality subset, intra-class similarity and cross-modal similarity are calculated respectively. The intra-class similarity and the cross-modal similarity are fused according to a preset proportion to generate a modality fusion coefficient. Based on the dynamic weight parameters corresponding to each modality in the fusion weight matrix, the modality fusion coefficients are weighted and superimposed to generate a global fusion coefficient, and the global fusion coefficient is converted into a normalized fusion weight in the form of a probability distribution through a normalization exponential function. According to the normalized fusion weight, the semantic feature vector samples in each modality subset are weighted and summed to obtain a predicted semantic embedding representation sample. In actual operation, the semantic feature vector samples are input into the initial fusion weight prediction network, and the network outputs the dynamic weight distribution parameters according to the node connection weights in the global structure relation graph sample. Then, according to the steps of cross-modal feature fusion, the calculation and processing are performed to obtain the predicted semantic embedding representation sample.
[0113] Step S50: Calculate the semantic similarity loss value between the predicted semantic embedding representation sample and the labeled standardized corpus label, and calculate the topological consistency loss value between the global structure relation graph sample and the manually labeled real association relationship. The semantic similarity loss value and the topological consistency loss value are weighted and summed according to a preset proportion to generate a multi-task joint loss value.
[0114] The semantic similarity loss value is used to measure the semantic difference between the predicted semantic embedding representation sample and the labeled standardized corpus label. The cosine similarity method can be used for calculation. The topological consistency loss value is used to measure the topological difference between the global structure relationship graph sample and the artificially labeled real association relationship. The graph edit distance method can be used for calculation. The preset proportion is a proportion preset for weighted sum of the semantic similarity loss value and the topological consistency loss value. The multi-task joint loss value is a loss value obtained by weighted sum of the semantic similarity loss value and the topological consistency loss value according to the preset proportion, and is used to comprehensively measure the training error of the model. For example, for the predicted semantic embedding representation sample and the labeled standardized corpus label, the cosine similarity is calculated, and the semantic similarity loss value is obtained by subtracting 1 from the cosine similarity. For the global structure relationship graph sample and the artificially labeled real association relationship, the graph edit distance is calculated as the topological consistency loss value. Assuming that the preset proportion is 0.6:0.4, then the multi-task joint loss value = 0.6 x semantic similarity loss value + 0.4 x topological consistency loss value. In actual operation, the corresponding calculation method is used to calculate the semantic similarity loss value and the topological consistency loss value respectively, and then the weighted sum is performed according to the preset proportion to obtain the multi-task joint loss value.
[0115] Step S60: The parameters of the multi-modal semantic encoding network, the topological structure encoding network and the fusion weight prediction network are updated synchronously by the back propagation algorithm until the multi-task joint loss value reaches the convergence threshold.
[0116] The back propagation algorithm is used to update the parameters of the neural network. The gradient of the loss function with respect to the network parameters is calculated, and the parameters are updated in the opposite direction of the gradient to reduce the value of the loss function. The multi-modal semantic encoding network, the topological structure encoding network and the fusion weight prediction network are components of the multi-source heterogeneous corpus fusion model. By synchronously updating the parameters of these networks, the performance of the model can be optimized. The convergence threshold is a threshold preset for judging whether the model converges. When the multi-task joint loss value is less than the convergence threshold, it is considered that the model has reached the convergence state. For example, in each training iteration, the gradient of the loss function with respect to each parameter in the multi-modal semantic encoding network, the topological structure encoding network and the fusion weight prediction network is calculated using the back propagation algorithm according to the multi-task joint loss value. Then the parameters of these networks are updated according to the gradient. Repeat this process until the multi-task joint loss value is less than the convergence threshold.
[0117] As an implementation, step S60, the parameters of the multi-modal semantic encoding network, the topological structure encoding network and the fusion weight prediction network are updated synchronously by the back propagation algorithm, which can specifically include the following steps S61-S64:
[0118] Step S61: In a single training iteration, the parameters of the multi-modal semantic encoding network and the topology structure encoding network are fixed, and only the parameters of the fusion weight prediction network are updated, so that the dynamic weight distribution parameters are preferentially adapted to the distribution characteristics of the current semantic feature vector sample.
[0119] In a single training iteration, in order to enable the fusion weight prediction network to better adapt to the distribution characteristics of the semantic feature vector sample, the parameters of the multi-modal semantic encoding network and the topology structure encoding network are fixed, and only the parameters of the fusion weight prediction network are updated. In this way, the dynamic weight distribution parameters can be more in line with the characteristics of the current semantic feature vector sample, and the effect of cross-modal feature fusion can be improved. For example, in a certain training iteration, the parameters of the multi-modal semantic encoding network and the topology structure encoding network are fixed, the gradient of the multi-task joint loss value with respect to the parameters of the fusion weight prediction network is calculated using the back propagation algorithm, and then the parameters of the fusion weight prediction network are updated using an optimizer (such as an Adam optimizer). In actual operation, the parameters of the multi-modal semantic encoding network and the topology structure encoding network are set to a non-trainable state, and only the parameters of the fusion weight prediction network are updated.
[0120] Step S62: In subsequent training iterations, the parameters of the fusion weight prediction network are fixed, and the parameters of the multi-modal semantic encoding network and the topology structure encoding network are updated, so that the generation process of the semantic feature vector sample and the encoding process of the global structure relationship graph sample adapt to the current dynamic weight distribution strategy.
[0121] After the parameters of the fusion weight prediction network are optimized through the previous training iterations, in subsequent training iterations, the parameters of the fusion weight prediction network are fixed, and the parameters of the multi-modal semantic encoding network and the topology structure encoding network are updated. In this way, the generation process of the semantic feature vector sample and the encoding process of the global structure relationship graph sample can better adapt to the optimized dynamic weight distribution strategy, and the performance of the model can be further improved. For example, in a subsequent training iteration, the parameters of the fusion weight prediction network are fixed, the gradient of the multi-task joint loss value with respect to the parameters of the multi-modal semantic encoding network and the topology structure encoding network is calculated using the back propagation algorithm, and then the parameters are updated using an optimizer.
[0122] Step S63: The above parameter updating steps are alternately performed until the decline rate of the multi-task joint loss value is lower than a preset threshold, and it is determined that the model has reached a convergence state.
[0123] By alternately performing the two steps of updating and fusing the weight prediction network parameters of the fixed multimodal semantic encoding network and the topological structure encoding network, and updating the parameters of the multimodal semantic encoding network and the topological structure encoding network of the fixed fusion weight prediction network, each part of the model can be gradually optimized and adapted to each other. The preset threshold is a decline rate threshold for judging whether the model converges. When the decline rate of the multi-task joint loss value is lower than the threshold, it indicates that the performance of the model has tended to be stable, and the model is determined to be in a convergent state. For example, after updating the parameters each time, the decline rate of the multi-task joint loss value is calculated, that is, the difference between the current loss value and the last loss value divided by the current loss value. When the decline rate is lower than the preset threshold for a plurality of times in succession, it is determined that the model is in a convergent state. In actual operation, the multi-task joint loss value is recorded each time in the training loop, the decline rate is calculated, and compared with the preset threshold.
[0124] Step S64: In the verification stage, input the multi-source corpus unit of the verification set into the trained multi-source heterogeneous corpus fusion model, respectively calculate the semantic similarity between the generated predicted semantic embedding representation and the verification label, and the topological consistency between the generated global structure relationship graph and the verification associated relationship, if both reach the precision threshold, the training is completed, otherwise increase the number of training iterations until both reach the precision threshold.
[0125] The verification stage is used to evaluate the performance of the trained multi-source heterogeneous corpus fusion model. The multi-source corpus unit of the verification set is independent of the training set data, which is used to verify the generalization ability of the model. The predicted semantic embedding representation is the result obtained after the model processes the multi-source corpus unit of the verification set, and the verification label is the real label corresponding to the multi-source corpus unit of the verification set. Semantic similarity is used to measure the semantic closeness between the predicted semantic embedding representation and the verification label, which can be calculated using methods such as cosine similarity. The global structure relationship graph is the graph structure obtained after the model topologically encodes the multi-source corpus unit of the verification set, and the verification associated relationship is the real associated relationship of the multi-source corpus unit of the verification set. Topological consistency is used to measure the topological similarity between the global structure relationship graph and the verification associated relationship, which can be calculated using methods such as graph edit distance. The precision threshold is a threshold preset to judge whether the model performance meets the standard. For example, input the multi-source corpus unit of the verification set into the trained multi-source heterogeneous corpus fusion model to obtain the predicted semantic embedding representation and the global structure relationship graph. Calculate the cosine similarity between the predicted semantic embedding representation and the verification label, and the graph edit distance between the global structure relationship graph and the verification associated relationship. If the cosine similarity is greater than or equal to the precision threshold and the graph edit distance is less than or equal to the precision threshold, the model performance is considered to meet the standard, and the training is completed; otherwise, increase the number of training iterations and continue to train the model until both reach the precision threshold.
[0126] As an implementation, the standardized corpus is used to support semantic retrieval and decision analysis of multi-source government service data. The method provided by the embodiment of the application further includes the following steps:
[0127] Step S600: receiving a government service query request input by a user, and parsing keywords and filtering conditions in the query request.
[0128] The government service query request is a request submitted by a user to the system for querying government service related information. The keywords are keywords in the query request used to describe the query content, and the filtering conditions are conditions used to further filter the query results. By receiving the government service query request input by the user and parsing the keywords and filtering conditions therein, the query intention of the user can be determined. For example, the query request input by the user is “query government service information related to enterprise registration from January to March 2024”, the keywords are “enterprise registration”, and the filtering conditions are “time range: January to March 2024”. In actual operation, an input interface is used to receive the query request of the user, and natural language processing techniques (such as word segmentation and part-of-speech tagging) are used to parse the keywords and filtering conditions in the query request.
[0129] Step S700: retrieving a target corpus unit matching the keywords and filtering conditions from the standardized corpus, and calculating semantic similarity between the target semantic embedding representation and historical similar cases.
[0130] The standardized corpus stores processed and sorted corpus units related to government services. The target corpus unit is a corpus unit in the standardized corpus that matches the keywords and filtering conditions input by the user. The target semantic embedding representation is the semantic embedding representation corresponding to the target corpus unit, and the historical similar cases are cases in the standardized corpus that are similar in semantics to the target corpus unit. By retrieving the target corpus unit matching the keywords and filtering conditions from the standardized corpus, and calculating the semantic similarity between the target semantic embedding representation and the historical similar cases, cases related to the user query and similar in semantics can be found. For example, according to the keywords “enterprise registration” and the filtering conditions “time range: January to March 2024”, the matching target corpus unit is found in the inverted index structure of the standardized corpus. Then, the target semantic embedding representation of the target corpus unit is compared with the target semantic embedding representations of other corpus units in the standardized corpus, the cosine similarity is calculated, and the historical similar cases with high semantic similarity are found. In actual operation, a database query statement is used to retrieve the target corpus unit from the standardized corpus in combination with the inverted index structure. The cosine similarity calculation method is used to calculate the semantic similarity between the target semantic embedding representation and the historical similar cases.
[0131] Step S800: Sort the search results according to semantic similarity, extract high-frequency attribute keys and associated matter codes in the sorted results, and generate a decision analysis report.
[0132] The semantic similarity reflects the semantic closeness between the target corpus unit and the historical similar cases. By sorting the search results according to the semantic similarity, the results with high semantic similarity can be placed in the front, which is convenient for users to view. The high-frequency attribute key is an attribute key that appears frequently in the sorted results, and the associated matter code is a government service matter code related to the target corpus unit. By extracting the high-frequency attribute key and the associated matter code in the sorted results, a decision analysis report can be generated, which can provide valuable information for government service decision-making. For example, the search results are sorted according to the semantic similarity from high to low, the frequency of each attribute key in the sorted results is counted, and the high-frequency attribute key is found. At the same time, the associated matter code is extracted. The high-frequency attribute key, the associated matter code, and the related target corpus unit information are sorted into a decision analysis report. In actual operation, the sorting algorithm is used to sort the search results, the statistical method is used to count the high-frequency attribute key, the associated matter code is extracted, and the document generation tool is used to generate the decision analysis report.
[0133] Step S900: Visualize the key indicators in the decision analysis report and push them to the government service management platform.
[0134] The key indicators are indicators with important significance in the decision analysis report, such as high-frequency attribute keys, associated matter codes, etc. Visualization is to display the key indicators in a chart, graph, or other intuitive way, which is convenient for users to understand and analyze. The government service management platform is a platform for managing government service-related information. By visualizing the key indicators in the decision analysis report and pushing them to the government service management platform, government service management personnel can more intuitively understand the decision analysis results and make more reasonable decisions. For example, the frequency of the high-frequency attribute key is displayed in the form of a column chart, and the associated matter code is displayed in the form of a list. Data visualization tools such as Matplotlib, Seaborn, etc. are used to realize the visualization of the key indicators. Then the visualized results are pushed to the government service management platform, such as sending data to the specified location of the platform through the API interface.
[0135] As an implementation, the method provided by the embodiment of the application further includes a real-time updating process, which specifically includes the following steps:
[0136] Step S1000: Monitor the incremental update events of the government service data source, and capture the newly added corpus unit and its associated attribute set.
[0137] The government service data source is a source of government service related data, such as a business system, a database, etc. The incremental update event is an event in which data in the data source is newly added, modified, or deleted, etc. The newly added corpus unit is a new corpus unit generated in the incremental update event, and the associated attribute set is a set of attributes related to the newly added corpus unit. By monitoring the incremental update event of the government service data source, the newly added corpus unit and its associated attribute set can be captured, and the latest government service data can be obtained in a timely manner. For example, a data monitoring tool (such as a database trigger, a message queue, etc.) is used to monitor the incremental update event of the government service data source. When new data is detected, the newly added corpus unit and its associated attribute set are captured. In actual operation, according to different data source types, appropriate data monitoring tools and methods are selected to realize the monitoring of the incremental update event and the capture of the corpus unit and the associated attribute set.
[0138] Step S1100: Perform cross-modal semantic alignment processing and multi-modal semantic encoding on the newly added corpus unit to generate an incremental semantic feature vector.
[0139] The cross-modal semantic alignment processing is a processing of unifying and aligning the newly added corpus units of different modalities at the semantic level, and the multi-modal semantic encoding is a conversion of the newly added corpus units after the cross-modal semantic alignment processing into vector representation. The incremental semantic feature vector is a vector obtained after the cross-modal semantic alignment processing and the multi-modal semantic encoding of the newly added corpus unit. By performing the cross-modal semantic alignment processing and the multi-modal semantic encoding on the newly added corpus unit, the incremental semantic feature vector is generated, and the newly added corpus unit can be included in the existing semantic framework. For example, for the newly added structured table data, unstructured text data, and semi-structured log data, the above-mentioned cross-modal semantic alignment processing steps are performed to process the data and generate standardized data blocks. Then, the multi-modal semantic encoding network is used to encode the standardized data blocks to generate the incremental semantic feature vector. In actual operation, the newly added corpus unit is processed using a trained model and algorithm to obtain the incremental semantic feature vector.
[0140] Step S1200: Insert the incremental semantic feature vector into the global structural relationship graph, and update the fusion weight matrix according to the connection weight between the newly added node and the existing node.
[0141] The global structure relationship graph is a graph structure representing the semantic and attribute association relationship between government service data. The new node is a node representing a new corpus unit. The connection weight reflects the association strength between nodes. The fusion weight matrix is a weight matrix used for cross-modal feature fusion. By inserting the incremental semantic feature vector into the global structure relationship graph and updating the fusion weight matrix according to the connection weight between the new node and the existing node, the global structure relationship graph and the fusion weight matrix can be updated to contain the latest government service data information. For example, the incremental semantic feature vector is inserted into the node feature matrix of the global structure relationship graph as the feature vector of the new node. The attribute overlap and semantic correlation between the new node and the existing node are calculated, and the connection weight between the new node and the existing node is determined according to the calculation results, and the adjacency matrix is updated. Then, the fusion weight matrix is updated according to the updated global structure relationship graph. In actual operation, the new node is added to the data structure of the global structure relationship graph, the connection weight is calculated and the adjacency matrix is updated, and the fusion weight matrix is recalculated using the updated global structure relationship graph.
[0142] Step S1300: Dynamically fusing the incremental semantic feature vector based on the updated fusion weight matrix, and synchronizing the result increment to the inverted index structure of the standardized corpus library.
[0143] Dynamic fusion is cross-modal feature fusion of the incremental semantic feature vector based on the updated fusion weight matrix, to obtain the fused semantic representation. Incremental synchronization is to incrementally update the fused result to the inverted index structure of the standardized corpus library. By dynamically fusing the incremental semantic feature vector based on the updated fusion weight matrix, and synchronizing the result increment to the inverted index structure of the standardized corpus library, the real-time and accuracy of the data in the standardized corpus library can be ensured. For example, according to the updated fusion weight matrix, the incremental semantic feature vector is weighted and summed to obtain the fused semantic representation. Then the fused semantic representation and the corresponding new corpus unit information are incrementally updated to the inverted index structure of the standardized corpus library. In actual operation, matrix operations are used to realize dynamic fusion, and database operations are used to realize incremental synchronization. In this way, the standardized corpus library can timely reflect the latest changes of the government service data source, and provide more accurate and real-time data support for semantic retrieval and decision analysis of government services.
[0144] Please refer to Figure 2 , Figure 2A structural schematic diagram of a computer system provided by an embodiment of the present application is shown in FIG. 1. The computer system includes at least a processor 101, a communication interface 102, and a memory 103. The processor 101, the communication interface 102, and the memory 103 can be connected by a bus or other means. The processor 101 (also referred to as a central processing unit (CPU)) is the computing core and control core of the computer system, which can parse various instructions in the computer system and process various data of the computer system. The communication interface 102 can optionally include a standard wired interface, a wireless interface (such as WI-FI, a mobile communication interface, etc.), and can be used to send and receive data under the control of the processor 101; the communication interface 102 can also be used for transmission and interaction of data within the computer system. The memory 103 is a memory device in the computer system, used to store programs and data. It can be understood that the memory 103 can include a built-in memory of the computer system, and of course can also include an extended memory supported by the computer system. The memory 103 provides a storage space that stores an operating system of the computer system, which can include but is not limited to: an Android system, an iOS system, a Windows Phone system, etc., and the present application is not limited thereto.
[0145] In an embodiment, the processor 101 executes the computer program in the memory 103 to perform the multi-source heterogeneous corpus fusion method based on government service data provided by the above embodiment of the present application.
Claims
1. A method for fusing multi-source heterogeneous corpora based on government service data, characterized in that, The method comprises: acquiring a raw corpus set of multiple data sources in government service, wherein the raw corpus set contains corpus units of different data types; performing cross-modal semantic alignment processing on each corpus unit in the raw corpus set to generate a normalized data block corresponding to each corpus unit, the normalized data block containing a unified semantic label and an associated attribute set; respectively performing multi-modal semantic encoding on the normalized data blocks to obtain semantic feature vectors of each corpus unit, and performing topology structure encoding on the associated attribute set between the normalized data blocks to generate a global structure relationship graph, specifically including: extracting common attribute keys from the associated attribute set of each normalized data block, the common attribute keys including government service matter codes, user identifiers, and time intervals; taking each normalized data block as a node, constructing an initial node connection edge based on the matching relationship of the common attribute keys, and calculating the attribute overlap degree and semantic correlation between nodes; according to the attribute overlap degree and semantic correlation, performing weighted processing on the initial node connection edge to generate a weighted edge set; based on the nodes and the weighted edge set, constructing the global structure relationship graph containing a node feature matrix and an adjacency matrix, wherein the node feature matrix is composed of semantic feature vectors of each node; based on the node connection weight in the global structure relationship graph, performing dynamic weight distribution on the semantic feature vectors to generate a fusion weight matrix, and performing cross-modal feature fusion on the semantic feature vectors through the fusion weight matrix to obtain a target semantic embedding representation; generating a standardized corpus library associated with government service according to the target semantic embedding representation.
2. The method of claim 1, wherein, The data types include structured table data, unstructured text data, and semi-structured log data. The cross-modal semantic alignment processing on each corpus unit in the raw corpus set to generate a normalized data block corresponding to each corpus unit comprises: for corpus units of the structured table data type, extracting table header fields and row-column relationships, mapping the table header fields to candidate labels in a preset semantic label set, and determining the final semantic label of the table header fields according to the semantic similarity between the field content and the candidate labels; for corpus units of the unstructured text data type, extracting government service entities in the text through an entity recognition model, and matching the government service entities with a preset entity library to generate attribute key-value pairs containing entity types and entity relationships; for corpus units of the semi-structured log data type, parsing the timestamps, operation types, and parameter lists in the log templates, mapping the operation types to unified operation codes, and converting the parameter lists into attribute sets in the form of key-value pairs; performing relevance verification on the final semantic labels, attribute key-value pairs, and attribute sets, deleting redundant attributes with semantic conflicts, and filling in missing attribute values to generate the normalized data block containing complete semantic labels and associated attribute sets.
3. The method of claim 2, wherein, The corpus unit for the structured table data type extracts table header fields and row and column relationships, maps the table header fields to candidate labels in a preset semantic label set, and determines the final semantic label of the table header field according to the semantic similarity between the field content and the candidate label. The table structure in the corpus unit of the structured table data type is parsed, the nested level and the merged cell information across rows and columns of the table are identified, a hierarchical relationship tree of the table header fields is generated, and the hierarchical relationship tree includes the parent-child relationship between parent table header fields and child table header fields. Based on the text description of each table header field in the hierarchical relationship tree, candidate labels containing the same core vocabulary as the text description are selected from the preset semantic label set to generate an initial candidate label list. The initial candidate label list is traversed, and the semantic context template associated with each candidate label is extracted, including label definition, synonym set and typical application scenario description. The text description of the table header field and the semantic context template are input into a semantic matching model, the context matching degree of the text description and each candidate label is calculated, and the matching degree of the child table header field is weighted and corrected based on the matching result of the parent table header field in the hierarchical relationship tree. The initial candidate label list is sorted according to the corrected context matching degree, the top K candidate labels with the highest matching degree are selected to generate an optimized candidate label set, and the compatibility score of each optimized candidate label and the cell content type is calculated based on the distribution characteristics of the cell content under the table header field in the table. The comprehensive weight is generated by fusing the context matching degree and the compatibility score, the candidate label with the maximum comprehensive weight is determined as the final semantic label of the table header field, and the final semantic label and the semantic label of the adjacent table header field in the hierarchical relationship tree are logically consistent, and the complete mapping result is output after correcting the conflict label.
4. The method of claim 2, wherein, The multi-modal semantic encoding of the normalized data block is performed to obtain the semantic feature vector of each corpus unit, including: For the normalized data block of unstructured text data type, the pre-trained language model is used to extract the context semantic features of the text content, and the long-distance dependency relationship is modeled through the multi-head attention mechanism to generate the first semantic feature vector; For the normalized data block of structured table data type, the relationship graph network between fields is constructed based on the semantic label of the table header field and the distribution rule of the cell content, and the feature representation of adjacent fields is aggregated through the graph neural network to generate the second semantic feature vector; For the normalized data block of semi-structured log data type, the time distribution mode of the operation code sequence and the parameter set is parsed, the time convolution network is used to extract the time sequence features of the operation sequence, and the parameter set is mapped to a dense vector through an embedding layer to generate the third semantic feature vector; The first semantic feature vector, the second semantic feature vector and the third semantic feature vector are normalized to unify the vector dimensions of each semantic feature vector, and the modal identifiers of each semantic feature vector are retained.
5. The method of claim 1, wherein, The cross-modal feature fusion of the semantic feature vectors by the fusion weight matrix comprises: According to the modal identifiers of each node in the global structure relationship graph, the semantic feature vectors are divided into a text modal subset, a table modal subset, and a log modal subset; For each semantic feature vector in the text modal subset, the cosine similarity average of the semantic feature vector with other semantic feature vectors in the same modal subset is calculated to generate a text intra-class similarity, and the cosine similarity maximum of the semantic feature vector with each semantic feature vector in the table modal subset and the log modal subset is calculated to generate a text cross-modal similarity; For each semantic feature vector in the table modal subset, the cosine similarity average of the semantic feature vector with other semantic feature vectors in the same modal subset is calculated to generate a table intra-class similarity, and the cosine similarity maximum of the semantic feature vector with each semantic feature vector in the text modal subset and the log modal subset is calculated to generate a table cross-modal similarity; For each semantic feature vector in the log modal subset, the cosine similarity average of the semantic feature vector with other semantic feature vectors in the same modal subset is calculated to generate a log intra-class similarity, and the cosine similarity maximum of the semantic feature vector with each semantic feature vector in the text modal subset and the table modal subset is calculated to generate a log cross-modal similarity; The text intra-class similarity and the text cross-modal similarity are fused according to a preset ratio to generate a text modal fusion coefficient, the table intra-class similarity and the table cross-modal similarity are fused according to the same ratio to generate a table modal fusion coefficient, and the log intra-class similarity and the log cross-modal similarity are fused according to the same ratio to generate a log modal fusion coefficient; Based on the dynamic weight parameters corresponding to each modal in the fusion weight matrix, the text modal fusion coefficient, the table modal fusion coefficient, and the log modal fusion coefficient are weighted and superimposed to generate a global fusion coefficient, and the global fusion coefficient is converted into a normalized fusion weight in the form of a probability distribution through a normalization exponential function; According to the normalized fusion weight, the semantic feature vectors in the text modal subset, the table modal subset, and the log modal subset are weighted and summed to generate the target semantic embedding representation, wherein the semantic feature vectors in the same modal subset share the same normalized fusion weight.
6. The method of claim 1, wherein, The generation of a standardized corpus associated with government services according to the target semantic embedding representation comprises: The target semantic embedding representation is input into a pre-trained semantic clustering model, and according to the distance measurement of embedding vectors, corpus units with a similarity higher than a threshold value are divided into the same semantic cluster; Each semantic cluster is assigned a unique semantic identifier, and the common attribute keys of the corpus units in the semantic cluster are extracted as cluster description metadata; Based on the semantic identifier and the cluster description metadata, an inverted index structure is constructed, and the inverted index structure contains a multi-level mapping relationship from a semantic tag to a corpus unit; The inverted index structure and the target semantic embedding representation are stored in a distributed database to generate the standardized corpus supporting multi-condition combined queries.
7. The method of claim 1, wherein, The method is performed by a multi-source heterogeneous corpus fusion model, the multi-source heterogeneous corpus fusion model comprising a multi-modal semantic encoding network, a topology structure encoding network and a fusion weight prediction network, and the method further comprises a training process of the multi-source heterogeneous corpus fusion model, comprising: obtaining a multi-source corpus unit sample set of the same government affair service matter in historical government affair service data, the sample set containing structured table data, unstructured text data and semi-structured log data, and marking corresponding standardized corpus labels; performing cross-modal semantic alignment processing on the multi-source corpus unit sample set to generate a standardized data block set for training, performing multi-modal semantic encoding on the standardized data block set by the multi-modal semantic encoding network to obtain semantic feature vector samples of each corpus unit; based on the semantic feature vector samples, performing topology structure encoding on the associated attribute set in the standardized data block set by the topology structure encoding network to generate a global structure relationship graph sample for training, wherein a node feature matrix is composed of semantic feature vector samples, and an adjacency matrix is calculated based on attribute overlap and semantic correlation between sample nodes; inputting the semantic feature vector samples into an initial fusion weight prediction network, generating dynamic weight distribution parameters based on the node connection weight in the global structure relationship graph sample, and obtaining a predicted semantic embedding representation sample through cross-modal feature fusion; calculating semantic similarity loss values between the predicted semantic embedding representation sample and the marked standardized corpus labels, and calculating topology consistency loss values between the global structure relationship graph sample and the artificially marked real associated relationship, weighting and summing the semantic similarity loss values and the topology consistency loss values according to a preset proportion to generate a multi-task joint loss value; synchronously updating parameters of the multi-modal semantic encoding network, the topology structure encoding network and the fusion weight prediction network by a back propagation algorithm until the multi-task joint loss value reaches a convergence threshold.
8. The method of claim 7, wherein, The synchronous updating of the parameters of the multi-modal semantic encoding network, the topology structure encoding network and the fusion weight prediction network by the back propagation algorithm comprises: in a single training iteration, fixing the parameters of the multi-modal semantic encoding network and the topology structure encoding network, and only updating the parameters of the fusion weight prediction network, so that the dynamic weight distribution parameters are preferentially adapted to the distribution characteristics of the current semantic feature vector samples; in subsequent training iterations, fixing the parameters of the fusion weight prediction network and updating the parameters of the multi-modal semantic encoding network and the topology structure encoding network, so that the generation process of the semantic feature vector samples and the encoding process of the global structure relationship graph sample are adapted to the current dynamic weight distribution strategy; alternately performing the above parameter updating steps until the decline rate of the multi-task joint loss value is lower than a preset threshold, and determining that the model reaches a convergence state; In the verification phase, the multi-source corpus unit of the verification set is input into the trained multi-source heterogeneous corpus fusion model, the semantic similarity between the generated prediction semantic embedding representation and the verification label is calculated, and the topological consistency between the generated global structure relationship graph and the verification associated relationship is calculated, if both reach the precision threshold, the training is completed, otherwise the number of training iterations is increased until both reach the precision threshold.
9. A computer system, characterized by Comprise: A memory having a computer program stored therein; A processor for loading the computer program to implement the multi-source heterogeneous corpus fusion method based on government service data according to any one of claims 1-8.
Citation Information
Patent Citations
Multi-modal knowledge graph completion method and system based on embedded synchronization and alignment
CN118821921A
Method for processing multi-scenario heterogeneous data
WO2024216803A1