Multi-source heterogeneous corpus fusion method and system based on government affair service data
Through cross-modal semantic alignment and multi-modal coding processing, standardized data blocks are generated and a fusion weight matrix is constructed, the semantic difference problem of multi-source heterogeneous government data is solved, efficient semantic retrieval and decision-making analysis are realized, and government data governance efficiency and cross-departmental collaboration capabilities are improved.
Patent Information
- Application Number
- CN202510578949.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-07
- Publication Date
- 2025-08-15
- Estimated Expiration
- 2045-05-07
AI Technical Summary
The existing technology cannot effectively solve the problem of semantic particle size differences and lack of association relationships in multi-source heterogeneous government data, resulting in inefficient cross-departmental data coordination.
Standardized data blocks are generated through cross-modal semantic alignment processing, multi-modal semantic coding and topological structure coding, fusion weight matrix is generated, cross-modal feature fusion is realized, and standardized corpus is built.
It improves the accuracy of semantic retrieval and comprehensiveness of decision-making analysis in government service scenarios, enhances the robustness of semantic representation, and automatically builds a standardized corpus that supports multi-condition query, improving the efficiency of government data governance and cross-departmental collaboration capabilities.
Smart Images

Figure CN120493159A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of text processing, and in particular to a method and system for fusing multi-source heterogeneous corpora based on government service data. Background Art
[0002] With the deepening of the digital transformation of government services, multi-source heterogeneous corpus fusion technology has become a core link in government data governance. Its purpose is to build a standardized semantic knowledge base by integrating multimodal data to support efficient decision-making. Existing technologies are generally unable to overcome the problems of semantic granularity differences and missing associations between multi-source data. Specifically, the inconsistency of cross-modal semantic labeling systems leads to attribute mapping conflicts, static fusion strategies cannot adapt to changes in modal importance in dynamic business scenarios, and semantic retrieval bias caused by the separation of local feature encoding and global topological association. Based on this, the efficiency of cross-departmental data collaboration in government service scenarios is restricted. Summary of the Invention
[0003] The present invention provides a multi-source heterogeneous corpus fusion method and system based on government service data.
[0004] In the first aspect, an embodiment of the present invention provides a multi-source heterogeneous corpus fusion method based on government service data, the method comprising: obtaining an original corpus set from multiple data sources in government services, wherein the original corpus set contains corpus units of different data types; performing cross-modal semantic alignment processing on each corpus unit in the original 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; performing multimodal semantic encoding on the normalized data blocks respectively to obtain a semantic feature vector of each corpus unit, and performing topological structure encoding on the associated attribute sets between the normalized data blocks to generate a global structural relationship graph; based on the node connection weights in the global structural relationship graph, dynamically assigning weights to 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; based on the target semantic embedding representation, generating a standardized corpus associated with government services.
[0005] In a second aspect, an embodiment of the present invention provides a computer system, comprising: a memory storing a computer program; and a processor for loading the computer program to implement the multi-source heterogeneous corpus fusion method based on government service data as described above.
[0006] The multi-source heterogeneous corpus fusion method based on government service data provided by the present invention uniformly maps corpus units of different data types to normalized data blocks through cross-modal semantic alignment processing, eliminates the semantic gap and format differences of multi-source data, and generates a fusion weight matrix based on the synergy of multimodal semantic encoding and global topological structure encoding, realizes cross-modal feature fusion under dynamic weight allocation, and enables the target semantic embedding representation to accurately express the semantic details of a single modality and capture the global correlation rules of cross-modal data, thereby significantly improving the accuracy of semantic retrieval and the comprehensiveness of decision analysis in government service scenarios; through end-to-end model training and application consistency The paper adopts the unsupervised semantic density clustering and multi-level mapping mechanism to automatically construct a standardized corpus that supports multi-condition combination queries without manual labeling, which not only overcomes the problems of high cost and strong subjectivity of manual labeling, but also solves the problem of semantic aggregation of unevenly distributed corpus units through dynamic clustering radius adjustment and variance-driven sub-cluster splitting strategy, greatly improving the efficiency of government data governance and cross-departmental collaboration capabilities. BRIEF DESCRIPTION OF THE DRAWINGS
[0007] Figure 1 This is a flowchart of a multi-source heterogeneous corpus fusion method based on government service data provided by an embodiment of the present invention.
[0008] Figure 2 It is a schematic diagram of the composition of a computer system provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0009] See also Figure 1 , Figure 1 A flowchart of a multi-source heterogeneous corpus fusion method based on government service data provided in an embodiment of the present invention. The multi-source heterogeneous corpus fusion method based on government service data can be executed by a computer system and specifically includes the following steps:
[0010] Step S100: obtaining an original corpus set from multiple data sources in government services, wherein the original corpus set includes corpus units of different data types.
[0011] Government services involve multiple different data sources, each of which generates and stores data related to government services. A raw corpus is the collection of all relevant data collected from these multiple data sources. Corpus units are the basic components of the raw corpus and have different data types. For example, in government services, business systems, databases, and log records from different departments can all serve as data sources. Data obtained from these data sources may include structured tabular data, such as a department's personnel information table, which contains fields such as name, position, and contact information, neatly arranged in a table format; unstructured text data, such as policy documents and service manuals, which have no fixed format or structure; and semi-structured log data, such as system operation logs, which contain information such as timestamps, operation types, and operation parameters, but whose format is not as strictly standardized as structured tables. By collecting and integrating data from these different data sources, a raw corpus containing corpus units of different data types can be obtained. In practice, data interfaces and data extraction tools can be used to extract data from various data sources and aggregate it into a unified storage location to form the raw corpus.
[0012] Step S200: performing cross-modal semantic alignment processing on each corpus unit in the original corpus set to generate a normalized data block corresponding to each corpus unit, wherein the normalized data block includes a unified semantic label and an associated attribute set.
[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 to give the corpus unit a label that can accurately express its semantic meaning, and the associated attribute set 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 foundation for subsequent data analysis and processing. For example, for a structured table data about enterprise registration and an unstructured text data about the enterprise registration process, through cross-modal semantic alignment processing, they can both be given a unified semantic label such as "enterprise registration" and associated with relevant attributes such as enterprise name, registration time, and registration address.
[0014] As mentioned above, the data types of the corpus units may include structured table data, unstructured text data, and semi-structured log data. Based on this, step S200 performs cross-modal semantic alignment on each corpus unit in the original corpus set to generate a normalized data block corresponding to each corpus unit. Specifically, the following steps S210 to S240 may be included:
[0015] Step S210: For corpus units of structured table data types, extract the header fields and row and column relationships, map the header fields to candidate tags in a preset semantic tag set, and determine the final semantic tag of the header field based on the semantic similarity between the field content and the candidate tags.
[0016] Structured tabular data has clear header fields and row-column relationships. The header fields are used to identify the meaning of each column of data. A preset semantic tag set is a set of predefined semantic tags used to map header fields. Candidate tags are labels that are selected from the preset semantic tag set and potentially match the header fields. Semantic similarity measures the semantic proximity between the field content and the candidate tags. By extracting the header fields and the row-column relationships, we can better understand the structure and meaning of the tabular data. The header fields are then mapped to the preset semantic tag set to identify potential matching candidate tags. Finally, the most appropriate final semantic tag is determined based on the semantic similarity between the field content and the candidate tags. For example, in a company employee information table, the header field "Employee Name" may have candidate tags such as "Personnel Name" and "Employee Name" in the preset semantic tag set. By calculating the semantic similarity between "Employee Name" and these candidate tags, "Personnel Name" is determined as the final semantic tag. In practice, natural language processing techniques, such as word embedding models, can be used to convert the header fields and candidate tags into vector representations. Semantic similarity can then be determined by calculating the similarity between the vectors.
[0017] As an embodiment, step S210 extracts the header fields and row-column relationships for the corpus unit of the structured table data type, maps the header fields to candidate tags in a preset semantic tag set, and determines the final semantic tag of the header field based on the semantic similarity between the field content and the candidate tags. Specifically, the following steps S211 to S216 may be included:
[0018] Step S211: parse 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, and generate a hierarchical relationship tree of the header fields. The hierarchical relationship tree includes the subordinate relationship between the parent header field and the child header field.
[0019] Structured table data may contain nested hierarchies and merged cells. Parsing the table structure involves identifying these complex structural information. Nested hierarchies refer to the presence of multiple headers within a table. For example, a company's financial report may have a general header "Financial Information," with sub-headers such as "Income Information" and "Expense Information." Merged cells across rows and columns refer to cells in a table that span multiple rows or columns. A hierarchical relationship tree is a tree-like structure used to represent the subordinate relationships between header fields. Parent header fields are parent header fields, and child header fields are child header fields. By parsing the table structure and identifying nested hierarchies and merged cells, an accurate hierarchical relationship tree for header fields can be generated. For example, in a table containing department and employee information, "Department Information" might be the parent header field, with "Department Name" and "Department Number" being sub-header fields. In practice, table parsing algorithms, such as rule-based parsing or machine learning algorithms, can be used to parse the table, extract the structure, and generate a hierarchical relationship tree.
[0020] Step S212: Based on the text description of each header field in the hierarchical relationship tree, candidate tags containing the same core vocabulary as the text description are screened from a preset semantic tag set to generate an initial candidate tag list.
[0021] The text description of the header field is the specific textual content expressed by the header field, and the core vocabulary is the vocabulary with key semantics in the text description. The preset semantic tag set is a predefined series of semantic tags. By comparing the text description of the header field with the preset semantic tag set, candidate tags containing the same core vocabulary are screened out to form an initial candidate tag list. For example, for the header field "Employee Age", the preset semantic tag set includes tags such as "Personnel Age" and "Employee Age". Since these tags all contain the core vocabulary "Age", they can be screened out to generate an initial candidate tag list. In actual operation, string matching algorithms, such as regular expression matching or fuzzy matching algorithms, can be used to screen candidate tags containing the same core vocabulary.
[0022] Step S213: traverse the initial candidate tag list, and extract the semantic context template associated with each candidate tag. The semantic context template includes a tag definition, a synonym set, and a typical application scenario description.
[0023] A semantic context template is a template used to describe the semantic information of candidate tags. It includes a tag definition, a synonym set, and a description of typical application scenarios. The tag definition explains the specific meaning of the candidate tag, the synonym set is a collection of words with similar meanings to the candidate tag, and the typical application scenario description is a specific scenario in which the candidate tag is actually used. By traversing the initial list of candidate tags and extracting the associated semantic context template for each candidate tag, a more comprehensive understanding of the semantic information of the candidate tag can be obtained. For example, for the candidate tag "personnel age," its tag definition might be "indicates the age of a person," its synonym set might include "age" and "years," and a typical application scenario description might be "used in scenarios such as personnel information management and statistical analysis." In practice, natural language processing techniques, such as text mining and information extraction, can be used to extract the semantic context templates of candidate tags from relevant knowledge bases or documents.
[0024] Step S214: Input the text description of the header field and the semantic context template into the semantic matching model, calculate the context matching degree between the text description and each candidate tag, and perform weighted correction on the matching degree of the child header field based on the matching result of the parent header field in the hierarchical relationship tree.
[0025] A semantic matching model is used to calculate the degree of semantic matching between texts. Deep learning models, such as the BERT model, can be used. Contextual matching is a metric that measures the degree of match between the text description of a header field and the semantic context template of a candidate tag. By inputting the text description and semantic context template of a header field into the semantic matching model, the contextual matching degree between the text description and each candidate tag can be calculated. Furthermore, due to the subordinate relationship between parent and child header fields in the hierarchical relationship tree, the matching result of the parent header field affects the matching degree of the child header field. Therefore, weighting the matching degree of the child header field based on the matching result of the parent header field in the hierarchical relationship tree can more accurately determine the matching degree of the child header field. For example, for a table containing "Department Information" and "Employee Information," if the matching result for the parent header field "Department Information" is better, a higher weight can be given when calculating the matching degree of the child header field "Employee Information." In practice, the text description and semantic context template of the header field can be converted into vector representations and input into the BERT model for calculation to obtain the contextual matching degree. Then, according to the matching results of the parent header fields in the hierarchical relationship tree, the matching weights of the child header fields are adjusted.
[0026] Step S215: Sort the initial candidate tag list according to the corrected context matching degree, select the top K candidate tags with the highest matching degree to generate an optimized candidate tag set, and calculate the compatibility score between each optimized candidate tag and the cell content type based on the distribution characteristics of the cell content below the header field in the table, K>1.
[0027] The corrected contextual match is the contextual match weighted by the matching results of the parent header field. By sorting the initial candidate label list based on the corrected contextual match, we can identify candidate labels with high matching scores. The top K candidate labels with the highest matching scores are selected to form an optimized candidate label set, narrowing the candidate label pool and improving subsequent processing efficiency. The distribution characteristics of cell content refer to characteristics such as the type, value range, and frequency of the cell content below the header field in the table. The compatibility score measures the degree of match between the optimized candidate label and the cell content type. By calculating the compatibility score between each optimized candidate label and the cell content type, we can further filter out the candidate label that best matches the cell content type. For example, for the header field "Employee Gender," if the cell content below is "Male" or "Female," the optimized candidate label set may include labels such as "Personnel Gender" and "Employee Gender." By calculating the compatibility scores of these labels with the cell content type, we can determine the most suitable label. In practice, statistical analysis methods, such as calculating the frequency distribution and value range of cell content, can be used to determine the distribution characteristics of cell content. Then, the compatibility score is calculated based on the compatibility scoring rules, such as the consistency between the label and the cell content type, the coverage of the cell content by the label, etc.
[0028] Step S216: The context matching degree and the compatibility score are integrated to generate a comprehensive weight, and the candidate label with the largest comprehensive weight is determined as the final semantic label of the header field. The final semantic label is then logically checked for consistency with the semantic labels of adjacent header fields in the hierarchical relationship tree. After correcting the conflicting labels, the complete mapping result is output.
[0029] The comprehensive weight is a weighted value derived by combining the contextual match and compatibility score. It comprehensively measures the degree of match between candidate labels and header fields. By selecting the candidate label with the highest comprehensive weight as the final semantic label for the header field, the label that best matches the semantics of the header field can be obtained. Logical consistency checking verifies the logical consistency of the final semantic label with the semantic labels of adjacent header fields in the hierarchical relationship tree. If conflicting labels exist, they must be corrected to ensure semantic consistency across the entire table. For example, in a table containing "employee information" and "department information," the final semantic label for "employee name" is determined to be "personnel name," and the final semantic label for "department name" is determined to be "organization name." It is necessary to check the logical consistency of these two labels. In practice, a weighted average method can be used to combine the contextual match and compatibility score to generate a comprehensive weight. Logical rules or a knowledge base are then used to verify the logical consistency of the final semantic label with the semantic labels of adjacent header fields, and to correct conflicting labels.
[0030] Step S220: For the corpus unit of the unstructured text data type, the government service entities in the text are extracted through the entity recognition model, and the government service entities are 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 a fixed format or structure, such as policy documents and service guides. An entity recognition model is used to identify entities in text. Deep learning models, such as the BiLSTM-CRF model, can be used. Government service entities are entities with meaning in the government service domain, such as enterprises, individuals, and policies. A predefined entity library is a collection of predefined government service entities and their related information. Attribute key-value pairs are a data structure used to represent entity types and relationships, with the key representing the entity type and the value representing the entity relationship. By extracting government service entities from text using an entity recognition model and then matching these entities with the predefined entity library, the entity types and relationships can be determined, generating attribute key-value pairs containing the entity types and relationships. For example, in an unstructured text article about corporate tax policies, an entity recognition model can identify entities such as "enterprise" and "tax policy." By matching these entities with the predefined entity library, it can be determined that "enterprise" is the principal entity and "tax policy" is the related policy entity, generating an attribute key-value pair such as "Principal entity: enterprise, Related policy entity: tax policy." In practice, unstructured text is input into the BiLSTM-CRF model for entity recognition. A similarity matching algorithm is then used to match the identified entities with entities in a pre-set entity library to generate attribute key-value pairs.
[0032] Step S230: For a corpus unit of a 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 into an attribute set in the form of key-value pairs.
[0033] Semi-structured log data is structured but not fully standardized data, such as system operation logs. The log template is the basic format of log data, containing information such as timestamp, operation type, and parameter list. The timestamp is used to record the time when the operation occurred, the operation type indicates the specific type of operation, and the parameter list is the relevant parameters involved in the operation. Unified operation coding is to uniformly encode different operation types into preset codes to facilitate subsequent processing and analysis. The attribute set is a data set that converts the parameter list into a key-value pair format, where the key represents the parameter name and the value represents the parameter value. By parsing the timestamp, operation type, and parameter list in the log template, key information can be extracted. The operation type is then mapped to the unified operation code, and the parameter list is converted into an attribute set in the form of key-value pairs, making the semi-structured log data 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." The "User Login" operation type is mapped to the unified operation code "001," and the parameter list is converted into the attribute set "Username: Zhang San, Password: 123456." In practice, you can use regular expressions or log parsing tools to parse the information in the log template. Then, use the operation type mapping table to map the operation type to the unified operation code. Finally, convert the parameter list into key-value pairs to generate the attribute set.
[0034] Step S240: performing relevance check on the final semantic label, attribute key-value pair, and attribute set, deleting redundant attributes with semantic conflicts, and filling in missing attribute values to generate a normalized data block containing a complete semantic label and associated attribute set.
[0035] Relevance checking examines the semantic relevance and consistency between the final semantic label, attribute key-value pairs, and attribute set. Semantically conflicting redundant attributes are attributes that semantically conflict with or duplicate the final semantic label or other attributes. Missing attribute values occur when certain attributes in the attribute set do not have corresponding values. Relevance checking ensures the semantic consistency and integrity of the information in the normalized data block. Removing semantically conflicting redundant attributes reduces data redundancy and improves data quality. Filling in missing attribute values ensures data integrity. For example, in a normalized data block about enterprise registration, the final semantic label is "Enterprise Registration," the attribute key-value pairs include "Subject Entity: Enterprise," and the attribute set includes information such as "Enterprise Name: XX Company" and "Registered Address: XX Road, XX." If an attribute in the attribute set is found to be semantically irrelevant to "Enterprise Registration," such as "Employee Hobbies," it is removed. If the attribute value for "Registration Time" is missing, it is filled in by querying relevant records or using a default value. In practice, semantic inference rules or a knowledge base can be used to perform relevance checking on the final semantic label, attribute key-value pairs, and attribute set. Use data cleaning algorithms to remove redundant attributes with semantic conflicts. Use data filling algorithms, such as mean filling and median filling, to fill in missing attribute values.
[0036] Step S300: performing multimodal semantic coding on the normalized data blocks respectively to obtain the semantic feature vector of each corpus unit, and performing topological structure coding on the associated attribute sets between the normalized data blocks to generate a global structural relationship diagram.
[0037] Multimodal semantic encoding converts 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 converts the associated attribute sets between normalized data blocks into a graph structure to represent the relationships between data. A global structural relationship graph is a graph structure used to represent the semantic and attribute associations between all normalized data blocks. By performing multimodal semantic encoding on normalized data blocks, data from different modalities can be converted into a vector form that can be compared and analyzed. Topological structure encoding of the associated attribute sets between normalized data blocks can construct a relationship network between the data, providing a foundation for subsequent data analysis and mining. For example, for a set of normalized data blocks containing structured tabular data, unstructured text data, and semi-structured log data, multimodal semantic encoding can obtain the semantic feature vector of each corpus unit, and topological structure encoding can generate a global structural relationship graph representing the relationships between these data blocks.
[0038] As an implementation method, in step S300, multimodal semantic encoding is performed on each normalized data block to obtain a semantic feature vector of each corpus unit, which may specifically include the following steps:
[0039] Step S310: For the normalized data block of the unstructured text data type, a pre-trained language model is used to extract the contextual semantic features of its text content, and the long-distance dependency relationship is modeled through a multi-head attention mechanism to generate a first semantic feature vector.
[0040] Pretrained language models, such as the BERT model, are pretrained on large-scale text data. Contextual semantic features are semantic information about a text in context and can better reflect its true meaning. The multi-head attention mechanism is a mechanism for processing sequential data that can capture dependencies between different positions in a sequence, particularly long-range dependencies. The first semantic feature vector is obtained by encoding a normalized data block of an unstructured text data type. By using a pretrained language model to extract contextual semantic features of text content, the linguistic knowledge learned by the pretrained model on large-scale data can be fully utilized. Modeling long-range dependencies using the multi-head attention mechanism can better understand the relationships between different parts of the text and generate more accurate semantic feature vectors. For example, an unstructured text about government policies can be input into the BERT model to extract its contextual semantic features. The multi-head attention mechanism is then used to model the dependencies between different sentences and paragraphs in the text to generate the first semantic feature vector. In practice, unstructured text data is segmented and then input into the BERT model to obtain a feature representation of the text. These feature representations are then input into the multi-head attention mechanism for further processing to generate the first semantic feature vector.
[0041] Step S320: For the normalized data block of the structured table data type, based on the semantic labels of its header fields and the distribution pattern of the cell content, a relationship graph network between the fields is constructed, and the feature representations of adjacent fields are aggregated through the graph neural network to generate a second semantic feature vector.
[0042] A field-to-field relationship graph network is a graph structure used to represent the relationships between fields in structured tabular data. The semantic labels of header fields represent the semantic meaning of each field, while the distribution patterns of cell content reflect the data associations between fields. A graph neural network is a neural network designed to process graph-structured data and can aggregate the feature representations of nodes in the graph. The second semantic feature vector is a semantic feature vector obtained by encoding normalized data blocks of the structured tabular data type. By constructing a field-to-field relationship graph network based on the semantic labels of header fields and the distribution patterns of cell content, structured tabular data can be converted into a graph structure, making it easier to process using a graph neural network. Aggregating the feature representations of adjacent fields through a graph neural network comprehensively considers the relationships between fields and generates a more comprehensive semantic feature vector. For example, for a company employee information table, a field-to-field relationship graph network is constructed based on the semantic labels of header fields such as "employee name," "employee age," and "department name," as well as the distribution patterns of cell content. A graph neural network, such as a GCN (graph convolutional network), is then used to aggregate the feature representations of adjacent fields to generate a second semantic feature vector. In practice, the connectivity between fields is first determined based on the semantic labels of header fields and the distribution patterns of cell content, and the relationship graph network is constructed. The feature representation of each field is then used as the node feature in the graph and 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, parse the time distribution pattern of its operation coding sequence and parameter set, use a temporal convolutional network to extract the timing features of the operation sequence, and map the parameter set into a dense vector through an embedding layer to generate a third semantic feature vector.
[0044] An operation code sequence is a sequence of uniform operation codes corresponding to operation types in semi-structured log data, reflecting the order of operations. The temporal distribution pattern of a parameter set is the distribution of the parameter set at different time points. A temporal convolutional network (TCN) is a convolutional network used to process sequential data and can extract temporal features from the sequence. An embedding layer converts discrete data into a continuous vector representation. The third semantic feature vector is obtained by encoding normalized data blocks of the semi-structured log data type. By analyzing the temporal distribution pattern of the operation code sequence and the parameter set, the temporal characteristics of semi-structured log data can be understood. Using a TCN to extract temporal features of the operation sequence can capture the temporal dependencies between operations. By mapping the parameter set into a dense vector through the embedding layer, discrete parameter data can be converted into a continuous vector representation, facilitating subsequent processing. For example, for a system operation log, the operation code sequence "001, 002, 003" and the temporal distribution pattern of the parameter set can be analyzed. A TCN (Temporal Convolutional Network) can be used to extract temporal features of the operation sequence. The embedding layer maps parameters such as "username" and "password" in the parameter set into dense vectors to generate a third semantic feature vector. In practice, the operation code sequence and parameter set are first preprocessed. The operation code sequence is then input into the TCN to extract temporal features. The parameter set is then input into the embedding layer to obtain a dense vector representation. Finally, the temporal features and the dense vector are concatenated to generate the third semantic feature vector.
[0045] Step S340: normalize the first semantic feature vector, the second semantic feature vector, and the third semantic feature vector to unify the vector dimensions of each semantic feature vector and retain the modality identifier of each semantic feature vector.
[0046] Normalization maps the value range of a vector to a preset interval, such as [0, 1] or [-1, 1], to eliminate scale differences between different vectors. Vector dimension unification adjusts the dimensions of different semantic feature vectors to the same dimensionality to facilitate subsequent comparison and calculation. A modality identifier identifies the modality to which a semantic feature vector belongs, such as text, table, or log. Normalizing the first, second, and third semantic feature vectors allows these vectors to be compared and analyzed at the same scale. Unifying the vector dimensions of each semantic feature vector facilitates subsequent vector operations. Retaining the modality identifiers of each semantic feature vector allows data from different modalities to be distinguished during subsequent processing. For example, if 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, then dimension unification adjusts these dimensions to 150. Furthermore, modality identifiers such as "text," "table," and "log" are added to each semantic feature vector. In practice, normalization algorithms such as Min-Max normalization or Z-Score normalization can be used to normalize semantic feature vectors. Zero padding or truncation can be used to unify the dimensions of the vectors. A modality identifier can be added to each semantic feature vector.
[0047] As an implementation manner, in step S300, topological structure encoding is performed on the associated attribute sets between the normalized data blocks to generate a global structure relationship graph, which may specifically include the following steps:
[0048] Step S350: extract common attribute keys from the associated attribute set of each normalized data block, the common attribute keys including the government service item code, user identifier and time interval.
[0049] An associated attribute set is a collection of attributes in a normalized data block that are associated with other data blocks. A common attribute key is an attribute key that exists in the associated attribute sets of multiple normalized data blocks. The government service item code is a code used to uniquely identify a government service item, the user identifier is identification information used to uniquely identify a user, and the time interval is the time range in which an operation or event occurs. By extracting common attribute keys from the associated attribute sets of each normalized data block, clues to the associations between different data blocks can be found. For example, for multiple normalized data blocks related to government service items, they may all contain common attribute keys such as government service item codes, user identifiers, and time intervals. In actual operation, the associated attribute sets of each normalized data block can be traversed and the common attribute keys can be extracted using an attribute key matching algorithm.
[0050] Step S360: Using each normalized data block as a node, constructing initial node connection edges based on the matching relationship of common attribute keys, and calculating the attribute overlap and semantic relevance between nodes.
[0051] Nodes are the basic elements of a graph structure, and here, each normalized data block is used as a node. Initial node-connecting edges are established between nodes based on matching relationships between common attribute keys. Attribute overlap is the proportion of identical attribute keys in the associated attribute sets of two nodes, reflecting the degree of attribute similarity between the nodes. Semantic relevance is the degree of correlation between the semantic feature vectors of two nodes, reflecting the degree of semantic similarity between the nodes. By using each normalized data block as a node and constructing initial node-connecting edges based on matching relationships between common attribute keys, a preliminary relationship network between the data blocks can be constructed. Calculating attribute overlap and semantic relevance between nodes further quantifies the relationship between the nodes. For example, if two normalized data blocks both contain the government service item code "001" in their associated attribute sets, an initial node-connecting edge is established between the two nodes. Their attribute overlap and semantic relevance are then calculated. In practice, initial node-connecting edges are established for matching node pairs based on matching common attribute keys. Attribute overlap is calculated using set operations, and semantic relevance is calculated using methods such as cosine similarity.
[0052] As an implementation method, step S360 uses each normalized data block as a node, constructs initial node connection edges based on the matching relationship of common attribute keys, and calculates attribute overlap and semantic relevance between nodes. Specifically, the following steps S361 to S364 may be included:
[0053] Step S361: traverse all normalized data block node pairs, detect whether there is at least one identical common attribute key in the associated attribute sets of the two nodes, if so, mark the two nodes as candidate connection node pairs, and record the matching number and specific key value of the common attribute key.
[0054] By traversing all normalized data block node pairs, the associated attribute sets between nodes can be comprehensively checked. By detecting whether there is at least one identical common attribute key in the associated attribute sets of 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 candidate connection node pairs, and the matching number and specific key value of the common attribute key are recorded to provide a basis for subsequent processing. For example, for node A and node B, the government service item code "001" exists in their associated attribute sets, then node A and node B are marked as candidate connection node pairs, the matching number is recorded as 1, and the specific key value is "Government Service Item Code: 001". In actual operation, a double loop is used to traverse all node pairs, 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 set, calculate the ratio 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.
[0056] The union of attribute keys is the set of all distinct attribute keys in the associated attribute sets of two nodes, while the intersection of attribute keys is the set of identical attribute keys in the associated attribute sets of two nodes. Attribute overlap is calculated by calculating the ratio of the number of attribute keys contained in the intersection to the number of attribute keys contained in the union, reflecting the degree of attribute similarity between the two nodes. For example, for a candidate connecting node pair A and B, node A's associated attribute set includes the attribute keys "government service item code" and "user identifier," while node B's associated attribute set includes the attribute keys "government service item code" and "time interval." The union of the attribute keys is "government service item code, user identifier, time interval," and the intersection of the attribute keys is "government service item code," resulting in an attribute overlap of 1 / 3. In practice, set operations are used to calculate the union and intersection of attribute keys. The number of attribute keys in the intersection and union is then calculated to determine the attribute overlap.
[0057] Step S363: extracting sub-vectors related to the government service scenario from the semantic feature vector of the normalized data block, where the sub-vectors include the dimensions of matter classification, time sensitivity, and user group characteristics.
[0058] A semantic feature vector is a semantic representation of a normalized data block, containing information related to the government service scenario. Subvectors are partial vectors extracted from the semantic feature vector and include dimensions such as item classification, time sensitivity, and user group characteristics. Item classification refers to the category of government service items, such as administrative approval and public services. Time sensitivity refers to the time sensitivity of government service items, such as urgent and non-urgent items. User group characteristics are characteristics related to user groups, such as age, gender, and occupation. By extracting subvectors related to government service scenarios from the semantic feature vector of a normalized data block, key information about government service scenarios can be focused on. For example, for a normalized data block's semantic feature vector, subvectors related to the item classification "administrative approval," the time sensitivity "urgent," and the user group characteristic dimension "age 30-40" are extracted. In practice, corresponding subvectors are extracted from the semantic feature vector based on pre-defined indexes of item classification, time sensitivity, and user group characteristics.
[0059] Step S364: performing cosine similarity calculation on the sub-vectors of each candidate connection node pair to generate a semantic correlation coefficient reflecting the strength of semantic association.
[0060] Cosine similarity is a method used to calculate the similarity between two vectors. It measures their similarity by calculating the cosine of the angle between the two vectors. The semantic relevance coefficient is calculated by taking the cosine similarity of the subvectors of a candidate connected node pair and reflects the strength of the semantic association between the two nodes.
[0061] Step S370: weighting the edges connecting the initial nodes according to the attribute overlap and semantic relevance to generate a weighted edge set.
[0062] Attribute overlap and semantic relevance reflect the degree of association between nodes. By weighting the initial node-connecting edge based on attribute overlap and semantic relevance, more accurate weights can be assigned to the edge, reflecting the actual strength of the association between the nodes. For example, if the initial node-connecting edge connects nodes A and B, and their attribute overlap is 0.5 and their semantic relevance coefficient is 0.8, a weight value can be assigned to the edge based on a preset weighting rule, such as linear weighting.
[0063] Step S380: Based on the nodes and the weighted edge sets, a global structural relationship graph including a node feature matrix and an adjacency matrix is constructed, wherein the node feature matrix is composed of the semantic feature vector of each node.
[0064] The node feature matrix is a matrix in which each row represents the semantic feature vector of a node, reflecting the semantic information of the node. The adjacency matrix is a matrix used to represent the connection relationships and connection weights between nodes. The global structural relationship graph is a graph structure that uses the node feature matrix and the adjacency matrix to represent the semantic and attribute associations between nodes. By constructing a global structural relationship graph based on the nodes and weighted edge sets, which includes the node feature matrix and the adjacency matrix, the relationships between normalized data blocks can be comprehensively represented. For example, for a case with three nodes, the node feature matrix is a three-row matrix, with each row containing the semantic feature vector of a node. The adjacency matrix is a 3×3 matrix, and its elements represent the connection weights between nodes. In practice, the semantic feature vectors of each node are arranged in sequence to form the node feature matrix. Based on the weighted edge set, the edge weights are filled into the corresponding positions in the adjacency matrix to construct the global structural relationship graph.
[0065] As an implementation method, step S380 constructs a global structural relationship graph including a node feature matrix and an adjacency matrix based on the nodes and weighted edge sets, wherein the node feature matrix is composed of the semantic feature vectors of each node. Specifically, the following steps S381 to S385 may be included:
[0066] Step S381: Traverse each edge in the weighted edge set, extract the two node identifiers connected by the edge and the corresponding weight values, map the node identifiers to row indices in the node feature matrix, and fill the weight values into the positions corresponding to the row indices in the adjacency matrix to generate the initial adjacency matrix.
[0067] The weighted edge set contains the connection relationship and connection weight between nodes. The node identifier is the 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 and extracting the two node identifiers connected by the edge and the corresponding weight values, the connection relationship and weight between the nodes can be determined. The node identifier is mapped to the row index in the node feature matrix, and the weight value is filled into the position corresponding to the row index in the adjacency matrix to construct the initial adjacency matrix. For example, for an edge in the weighted edge set connecting nodes A and B, the weight value is 0.5. The identifiers of nodes A and B are mapped to row indices 1 and 2 in the node feature matrix, and 0.5 is filled into the positions of row 1, column 2 and row 2, column 1 in the adjacency matrix. In actual operation, a loop is used to traverse the weighted edge set, and the weight value is filled into the adjacency matrix based on the mapping relationship between node identifiers and row indices.
[0068] Step S382: Check whether there is a bidirectionally connected edge in the weighted edge set. If so, update the weight value of the corresponding position in the adjacency matrix to the sum of the bidirectional weights and mark it as an undirected edge.
[0069] A bidirectional edge exists between two nodes, with two edges running in opposite directions and potentially having different weights. This special connection situation can be handled by checking the weighted edge set for bidirectional edges. The weight value of the corresponding position in the adjacency matrix is updated to the sum of the bidirectional weights and marked as an undirected edge, accurately representing the connection relationship between the nodes. For example, if the weighted edge set contains an edge from node A to node B with a weight of 0.3 and an edge from node B to node A with a weight of 0.2, the weight value of the corresponding position in the adjacency matrix is updated to 0.5 and marked as an undirected edge. In practice, the weighted edge set is traversed to check for bidirectional edges. If so, the weight value of the corresponding position in the adjacency matrix is updated and marked as an undirected edge.
[0070] Step S383: Based on 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, normalize the connection weights of the corresponding nodes in the adjacency matrix based on the distribution density, and generate a symmetric normalized adjacency matrix.
[0071] Predefined government service scenario dimensions are predefined dimensions related to government service scenarios, such as item classification and time sensitivity. Distribution density is the distribution of nodes along these dimensions, reflecting the degree of node clustering along these dimensions. By calculating the distribution density of each node along these dimensions based on the semantic feature vectors in each row of the node feature matrix, we can understand the distribution characteristics of nodes within these scenarios. Normalizing the connection weights of corresponding nodes in the adjacency matrix based on the distribution density can optimize the connection weights and generate a symmetric normalized adjacency matrix. For example, for the predefined government service scenario dimension "item classification," the distribution density of each node along this dimension is calculated. Then, based on the distribution density, the connection weights of corresponding nodes in the adjacency matrix are normalized. In practice, statistical analysis methods are used to calculate the distribution density of each node along these dimensions. A normalization algorithm, such as the symmetric normalization algorithm, is used to normalize the connection weights of corresponding nodes in the adjacency matrix.
[0072] Step S384: Group the semantic feature vectors in the node feature matrix according to the government service item classification dimension, smoothly enhance the connection weights of the nodes in the same classification group in the adjacency matrix, and generate an optimized adjacency matrix.
[0073] The government service item classification dimension is a dimension that divides government service items according to their categories, such as administrative approval and public services. By grouping the semantic feature vectors in the node feature matrix according to the government service item classification dimension, nodes with the same item classification can be grouped together. Smoothing and enhancing the connection weights of nodes within the same classification group in the adjacency matrix can highlight the associations between nodes within the same classification group and generate an optimized adjacency matrix. For example, for the government service item classification dimension "administrative approval," the semantic feature vectors of nodes belonging to this classification are grouped together. The connection weights of the nodes within this group in the adjacency matrix are then smoothed and enhanced, such as using a smoothing algorithm to increase the stability of the connection weights. In practice, the semantic feature vectors in the node feature matrix are grouped according to the government service item classification dimension. Using a smoothing algorithm, the connection weights of nodes within the same classification group in the adjacency matrix are smoothly enhanced.
[0074] Step S385: Combine the node feature matrix with the optimized adjacency matrix to generate a global structural relationship graph containing node semantic features and topological connection weights, where the non-zero element position of the adjacency matrix represents the existence of semantic or attribute associations 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 and topological connection weights of the nodes can be integrated into a single graph structure, generating a global structural relationship graph that includes the node semantic features and topological connection weights. The non-zero position of the adjacency matrix element indicates the existence of a semantic or attribute association between the nodes, and the element value indicates the strength of the association. For example, a value of 0.8 in the first row and second column of the adjacency matrix indicates a strong association between nodes 1 and 2. In practice, the node feature matrix and the optimized adjacency matrix are concatenated or combined to generate a global structural relationship graph.
[0076] Step S400: Based on the node connection weights in the global structure relationship graph, dynamically assign weights to the semantic feature vectors to generate a fusion weight matrix, and perform cross-modal feature fusion on the semantic feature vectors through the fusion weight matrix to obtain the target semantic embedding representation.
[0077] The node connection weights in the global structural relationship graph reflect the strength of the associations between nodes. Dynamic weight assignment assigns different weights to semantic feature vectors based on the node connection weights, so that the semantic feature vectors of nodes with higher association strengths have greater influence in the fusion process. The fusion weight matrix is a matrix used to represent the fusion weights of semantic feature vectors. Cross-modal feature fusion fuses semantic feature vectors from different modalities to obtain a comprehensive representation. The target semantic embedding representation is the final semantic representation obtained through cross-modal feature fusion. For example, if the connection weight between nodes A and B in the global structural relationship graph is 0.8, the dynamic weight assignment assigns higher weights to the semantic feature vectors of nodes A and B. The target semantic embedding representation is obtained by cross-modal feature fusion of the semantic feature vectors using the fusion weight matrix. In practice, a weight assignment algorithm is used based on the node connection weights in the global structural relationship graph to generate a fusion weight matrix. The fusion weight matrix is then used to perform cross-modal feature fusion of the semantic feature vectors using methods such as matrix multiplication.
[0078] As an implementation method, in step S400, cross-modal feature fusion is performed on the semantic feature vector through a fusion weight matrix to obtain a target semantic embedding representation, which may specifically include the following steps S410 to S470:
[0079] Step S410: Divide the semantic feature vector into a text modality subset, a table modality subset, and a log modality subset according to the modality identifier of each node in the global structure relationship graph.
[0080] The modality identifier is identification information used to identify the modality to which the semantic feature vector belongs, such as text modality, table modality, log modality, etc. By dividing the semantic feature vector into text modality subsets, table modality subsets, and log modality subsets according to the modality identifiers of each node in the global structure relationship graph, the semantic feature vectors of different modalities can be processed separately, which is convenient for subsequent cross-modal feature fusion. For example, for the nodes in the global structure relationship graph, the semantic feature vectors are divided into text modality subset {vector 1, vector 2}, table modality subset {vector 3, vector 4}, and log modality subset {vector 5, vector 6} according to their modality identifiers. In actual operation, the nodes in the global structure relationship graph are traversed, and the semantic feature vectors are assigned to the corresponding modality subsets according to the modality identifiers of the nodes.
[0081] Step S420: For each semantic feature vector in the text modal subset, calculate the mean cosine similarity between it and other semantic feature vectors in the same modal subset to generate the intra-text similarity, and calculate the maximum cosine similarity between it and each semantic feature vector in the table modal subset and the log modal subset to generate the cross-modal text similarity.
[0082] Cosine similarity is a method used to calculate the similarity between two vectors. It measures their similarity by calculating the cosine of the angle between the two vectors. Intra-class text similarity is the average similarity between the semantic feature vectors within a text modality subset and other semantic feature vectors in the same modality subset, reflecting the degree of similarity between the semantic feature vectors within the text modality subset. Cross-modal text similarity is the maximum similarity between the semantic feature vectors within the text modality subset and the semantic feature vectors in the table modality subset and the log modality subset, reflecting the degree of similarity between the semantic feature vectors within the text modality subset and the semantic feature vectors in the other modality subsets. For example, for semantic feature vector vector 1 within the text modality subset, calculate its cosine similarity with vector 2 to obtain the similarity value. Then, calculate the average of all similarity values to obtain the intra-class text similarity. Simultaneously, calculate the cosine similarity between vector 1 and the semantic feature vectors in the table modality subset and the log modality subset, and take the maximum value to obtain the cross-modal text similarity. In practice, the cosine similarity formula is used to calculate the similarity between semantic feature vectors within a text modality subset and the similarity with semantic feature vectors from other modality subsets. The mean and maximum values are then calculated to obtain the intra-class similarity and cross-modal similarity.
[0083] Step S430: For each semantic feature vector in the table modal subset, calculate the mean cosine similarity between it and other semantic feature vectors in the same modal subset to generate the intra-table similarity, and calculate the maximum cosine similarity between it and each semantic feature vector in the text modal subset and the log modal subset to generate the cross-modal similarity of the table.
[0084] The intra-table similarity is the average of the similarities between the semantic feature vectors within the table modal subset and other semantic feature vectors in the same modal subset, reflecting the degree of similarity between the semantic feature vectors within the table modal subset. The cross-table similarity is the maximum similarity between the semantic feature vectors within the table modal subset and the semantic feature vectors in the text modal subset and the log modal subset, reflecting the degree of similarity between the semantic feature vectors within the table modal subset and the semantic feature vectors in other modal subsets. For example, for semantic feature vector 3 within the table modal subset, calculate its cosine similarity with vector 4 to obtain the similarity value. Then, calculate the average of all similarity values to obtain the intra-table similarity. Simultaneously, calculate the cosine similarity between vector 3 and each semantic feature vector in the text modal subset and the log modal subset, and take the maximum value to obtain the cross-modal similarity. In practice, the cosine similarity calculation formula is used to calculate the similarity between semantic feature vectors within the table modal subset and the similarity with semantic feature vectors in other modal subsets. Then calculate the mean and maximum value to obtain the intra-class similarity and cross-modal similarity of the table.
[0085] Step S440: For each semantic feature vector in the log modal subset, calculate the mean cosine similarity between it and other semantic feature vectors in the same modal subset to generate the intra-log similarity, and calculate the maximum cosine similarity between it and each semantic feature vector in the text modal subset and the table modal subset to generate the cross-modal similarity of the log.
[0086] The intra-class similarity of logs is the average of the similarities between the semantic feature vectors within a log modal subset and other semantic feature vectors in the same modal subset, reflecting the degree of similarity between the semantic feature vectors within the log modal subset. The cross-modal similarity of logs is the maximum similarity between the semantic feature vectors within the log modal subset and the semantic feature vectors in the text modal subset and the table modal subset, reflecting the degree of similarity between the semantic feature vectors within the log modal subset and the semantic feature vectors in other modal subsets. For example, for semantic feature vector V5 within the log modal subset, the cosine similarity between it and vector V6 is calculated to obtain the similarity value. The mean of all similarity values is then calculated to obtain the intra-class similarity of logs. Simultaneously, the cosine similarity between vector V5 and the semantic feature vectors in the text modal subset and the table modal subset is calculated, and the maximum value is taken to obtain the cross-modal similarity of logs. In practice, the cosine similarity calculation formula is used to calculate the similarity between semantic feature vectors within the log modal subset and the similarity with semantic feature vectors in other modal subsets. Then calculate the mean and maximum value to obtain the intra-class similarity of logs and the cross-modal similarity of logs.
[0087] Step S450: The text intra-class similarity and the text cross-modal similarity are fused at a preset ratio to generate a text modal fusion coefficient, the table intra-class similarity and the table cross-modal similarity are fused at the same ratio to generate a table modal fusion coefficient, and the log intra-class similarity and the log cross-modal similarity are fused at the same ratio to generate a log modal fusion coefficient.
[0088] The preset ratio is a pre-set ratio for fusing intra-class similarity and cross-modal similarity, such as 0.5:0.5. The text modality fusion coefficient is obtained by fusing the text intra-class similarity and the text cross-modal similarity at a preset ratio, reflecting the importance of the text modality in cross-modal feature fusion. The table modality fusion coefficient is obtained by fusing the table intra-class similarity and the table cross-modal similarity at a preset ratio, reflecting the importance of the table modality in cross-modal feature fusion. The log modality fusion coefficient is obtained by fusing the log intra-class similarity and the log cross-modal similarity at a preset ratio, reflecting the importance of the log modality in cross-modal feature fusion. For example, if 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, then the text modality fusion coefficient is 0.5 × 0.6 + 0.5 × 0.7 = 0.65. In actual operation, the weighted average method is used to fuse the intra-class similarity and cross-modal similarity according to a preset ratio to generate the fusion coefficient of each modality.
[0089] Step S460: Based on the dynamic weight parameters corresponding to each modality in the fusion weight matrix, the text modality fusion coefficient, the table modality fusion coefficient and the log modality 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 normalized exponential function.
[0090] The dynamic weight parameters corresponding to each modality in the fusion weight matrix are assigned based on the node connection weights in the global structural relationship graph, reflecting the importance of each modality in cross-modal feature fusion. The global fusion coefficient is obtained by weightedly adding the text modality fusion coefficients, the table modality fusion coefficients, and the log modality fusion coefficients, comprehensively considering the importance of each modality. The normalized exponential function is a function used to convert numerical values into probability distributions, such as the Softmax function. The normalized fusion weight is a weight converted from the global fusion coefficients into a probability distribution using the normalized exponential function and used to perform the weighted summation of the semantic feature vectors. For example, if 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, and 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. The Softmax function is then used to convert the global fusion coefficients into normalized fusion weights. In practice, the weighted superposition method is used to calculate the global fusion coefficients. The Softmax function is then used to convert the global fusion coefficients into normalized fusion weights.
[0091] Step S470: Perform weighted summation on the semantic feature vectors in the text modal subset, table modal subset, and log modal subset according to the normalized fusion weight to generate a target semantic embedding representation, where the semantic feature vectors in the same modal subset share the same normalized fusion weight.
[0092] Normalized fusion weights reflect the importance of each modality in cross-modal feature fusion. By weightedly summing the semantic feature vectors in the text, table, and log modal subsets based on the normalized fusion weights, semantic feature vectors from different modalities can be fused to obtain the target semantic embedding representation. Semantic feature vectors within the same modality subset share the same normalized fusion weights, ensuring consistency of semantic feature vectors within the same modality during the fusion process.
[0093] Step S500: Generate a standardized corpus associated with government services based on the target semantic embedding representation.
[0094] The target semantic embedding representation is the final semantic representation obtained through cross-modal feature fusion, which contains the comprehensive semantic information of government service data. The standardized corpus is a processed and organized corpus used to store standardized data associated with government services. By generating a standardized corpus associated with government services based on the target semantic embedding representation, 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 method, step S500 generates a standardized corpus associated with government services based on the target semantic embedding representation, which may specifically include the following steps S510 to S540:
[0096] Step S510: Input the target semantic embedding representation into the pre-trained semantic clustering model, and divide the corpus units with similarity higher than a threshold into the same semantic cluster based on the distance metric of the embedding vector.
[0097] Pre-trained semantic clustering models are models pre-trained on large-scale data, such as the K-Means clustering model. The distance metric of an embedding vector is a method used to measure the distance between two embedding vectors, such as the Euclidean distance and cosine distance. The similarity threshold is a pre-set threshold used to determine whether corpus units belong to the same semantic cluster. By inputting the target semantic embedding representation into the pre-trained semantic clustering model, corpus units with similarity above the threshold can be divided into the same semantic cluster based on the distance metric of the embedding vector, thereby achieving clustering of corpus units. For example, for the target semantic embedding representation vectors V1, V2, and V3, the K-Means clustering model is used to calculate the Euclidean distance between them. If the distance between vectors V1 and V2 is less than the similarity threshold, they are classified as the same semantic cluster. In actual operation, the target semantic embedding representation is input into the K-Means clustering model, a similarity threshold is set, and clustering is performed.
[0098] Step S520: assigning a unique semantic identifier to each semantic cluster, and extracting common attribute keys of the corpus units in the semantic cluster as cluster description metadata.
[0099] A semantic identifier is identification information used to uniquely identify a semantic cluster, facilitating the management and query of semantic clusters. A common attribute key is an attribute key shared by all corpus units in a semantic cluster, reflecting the common characteristics of the semantic cluster. Cluster description metadata is metadata used to describe a semantic cluster and contains information such as the common attribute key. By assigning a unique semantic identifier to each semantic cluster and extracting the common attribute keys of the corpus units in the semantic cluster as cluster description metadata, the semantic cluster can be clearly identified and described. For example, for a semantic cluster, the semantic identifier "Cluster 001" is assigned to it, and the common attribute keys of the corpus units in the semantic cluster, "Government Service Item Code" and "User Identifier", are extracted as cluster description metadata. In practice, 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 cluster description metadata.
[0100] Step S530: constructing an inverted index structure based on the semantic identifier and the cluster description metadata. The inverted index structure includes a multi-level mapping relationship from semantic tags to corpus units.
[0101] The inverted index structure is an index structure used for fast data retrieval. By constructing a multi-level mapping relationship from semantic tags to corpus units, the efficiency of data retrieval can be improved. Semantic identifiers and cluster description metadata can be used as semantic tags to identify and describe semantic clusters. By constructing an inverted index structure based on semantic identifiers and cluster description metadata, semantic tags can be associated with corpus units, making it convenient to quickly find corresponding corpus units based on semantic tags. For example, for the semantic identifier "Cluster 001" and the cluster description metadata "Government Service Item Code: 001", an inverted index structure is constructed to map them with corpus units belonging to the semantic cluster. In actual operation, an inverted index construction algorithm is used to construct an inverted index structure based on semantic identifiers and cluster description metadata.
[0102] Step S540: storing the inverted index structure and the target semantic embedding representation in a distributed database to generate a standardized corpus that supports multi-condition combination queries.
[0103] A distributed database is a database system that stores and manages data in a distributed manner and is highly scalable and fault-tolerant. By storing the inverted index structure and target semantic embedding representation in a distributed database, distributed storage and management of data can be achieved. A standardized corpus that supports multi-condition combination queries is a corpus that can perform combination queries based on multiple conditions, which improves the flexibility and accuracy of data queries. For example, users can perform combination queries based on multiple conditions such as government service item codes and user identifiers to obtain relevant corpus units from the standardized corpus. In actual operation, a distributed database management system is used to store the inverted index structure and target semantic embedding representation in a distributed database, and the database is configured to support multi-condition combination query functions.
[0104] As an embodiment, the method provided by the present invention is performed by a multi-source heterogeneous corpus fusion model, wherein the multi-source heterogeneous corpus fusion model includes a multimodal semantic encoding network, a topological structure encoding network, and a fusion weight prediction network. Based on this, the method provided by the embodiment of the present invention also includes a training process of the multi-source heterogeneous corpus fusion model, which can specifically include the following steps S10 to S60:
[0105] Step S10: Obtain a multi-source corpus unit sample set of the same government service item in historical government service data, where the sample set includes structured table data, unstructured text data, and semi-structured log data, and annotate their corresponding standardized corpus tags.
[0106] Historical government service data is data related to government services accumulated over a period of time. A multi-source corpus unit sample set for the same government service item is a collection of corpus unit samples collected from multiple different data sources, including structured tabular data, unstructured text data, and semi-structured log data. Standardized corpus labels are used to annotate corpus units, representing their standard semantic information. By obtaining a multi-source corpus unit sample set for the same government service item from historical government service data and annotating them with corresponding standardized corpus labels, supervised sample data can be provided for training a multi-source heterogeneous corpus fusion model. For example, for the government service item "enterprise registration," a sample set is constructed by collecting relevant structured tabular data, unstructured text data, and semi-structured log data from business systems, policy documents, and operation logs of different departments. Each corpus unit is then annotated with standardized corpus labels such as "enterprise registration." In practice, a data collection tool is used to obtain a multi-source corpus unit sample set for the same government service item from historical government service data. Standardized corpus labels are then annotated for the sample set using manual or automatic annotation tools.
[0107] Step S20: Perform cross-modal semantic alignment processing on the multi-source corpus unit sample set to generate a normalized data block set for training, perform multimodal semantic encoding on the normalized data block set through a multimodal semantic encoding network, and obtain a semantic feature vector sample of each corpus unit.
[0108] Cross-modal semantic alignment processing is the process of unifying and aligning corpus units of different modalities at the semantic level to generate a set of normalized data blocks for training. The multimodal semantic encoding network is a network used to convert normalized data blocks into semantic feature vectors, and the pre-trained language model, graph neural network, etc. mentioned above can be used. The semantic feature vector samples are vector samples obtained after multimodal semantic encoding of the corpus units, which are used for model training. By performing cross-modal semantic alignment processing on the multi-source corpus unit sample set to generate a set of normalized data blocks for training, the semantic differences between data of different modalities can be eliminated. By performing multimodal semantic encoding on the normalized data block set through the multimodal semantic encoding network, the semantic feature vector samples of each corpus unit are obtained, and the data can be converted 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, cross-modal semantic alignment processing is performed to generate a set of normalized data blocks for training. These normalized data blocks are then fed into a multimodal semantic encoding network. Unstructured text data is encoded using a pre-trained language model (such as the BERT model) combined with a multi-head attention mechanism. Structured tabular data is constructed based on the semantic labels of its header fields and the distribution of cell contents. This is then encoded using a graph neural network (such as a GCN). Semi-structured log data is analyzed for the temporal distribution of its operation encoding sequences and parameter sets. A temporal convolutional network (such as a TCN) is used to extract the temporal features of the operation sequences. The parameter sets are then mapped into dense vectors for encoding via an embedding layer, ultimately yielding semantic feature vector samples for each corpus unit. In practice, different types of corpus units are processed sequentially according to the steps of cross-modal semantic alignment to obtain normalized data blocks. These normalized data blocks are then fed into the corresponding encoding models according to their modalities. After a series of calculations and processing, semantic feature vector samples are output.
[0109] Step S30: Through the topological structure encoding network, based on the semantic feature vector samples, the associated attribute set in the normalized data block set is topologically encoded to generate a global structural relationship graph sample for training, where the node feature matrix is composed of the semantic feature vector samples, and the adjacency matrix is calculated by the attribute overlap and semantic correlation between the sample nodes.
[0110] The topological structure encoding network is used to convert the associated attribute set in the normalized data block set into a graph structure to represent the relationship between the data. The semantic feature vector samples contain the semantic information of the corpus unit. Based on these semantic feature vector samples, the attribute overlap and semantic relevance between nodes can be better calculated. The node feature matrix is composed of semantic feature vector samples and reflects the semantic characteristics of each node. The adjacency matrix is calculated by the attribute overlap and semantic relevance between the sample nodes and is used to represent the connection relationship and connection strength between nodes. The topological structure encoding network is used to perform topological structure encoding on the associated attribute set in the normalized data block set to generate global structural relationship graph samples for training, which can provide the model with structural information between data. For example, common attribute keys (such as government service item codes, user identifiers and time intervals) are extracted from the associated attribute set of the normalized data block set, and each normalized data block is used as a node to construct the initial node connection edge based on the matching relationship of the common attribute keys. Calculate the attribute overlap between nodes, that is, extract the union and intersection of all attribute keys in their associated attribute sets, and calculate the ratio of the number of attribute keys contained in the intersection to the number of attribute keys contained in the union; calculate the semantic relevance, extract sub-vectors related to government service scenarios (including matter classification, time sensitivity and user group feature dimensions) from the semantic feature vector samples of the normalized data blocks, and perform cosine similarity calculations on the sub-vectors of each candidate connection node pair. According to the attribute overlap and semantic relevance, the initial node connection edges are weighted to generate a weighted edge set. Based on the nodes and weighted edge sets, a global structural relationship graph sample containing a node feature matrix and an adjacency matrix is constructed. In actual operation, a topological structure encoding network is used to perform calculations and processing according to the above steps to obtain a global structural relationship graph sample for training.
[0111] Step S40: Input the semantic feature vector sample into the initial fusion weight prediction network, generate dynamic weight allocation parameters based on the node connection weights 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 semantic feature vector samples based on the node connection weights in the global structure relationship graph sample. The dynamic weight assignment parameters reflect the importance of different semantic feature vectors in cross-modal feature fusion. Through cross-modal feature fusion, semantic feature vectors from different modalities can be fused to obtain predicted semantic embedding representation samples. For example, based on the modality identifiers of each node in the global structure relationship graph sample, the semantic feature vector samples are divided into text modality subsets, table modality subsets, and log modality subsets. For the semantic feature vector samples in each modality subset, intra-class similarity and cross-modal similarity are calculated separately. The intra-class similarity and cross-modal similarity are fused at a preset ratio to generate the fusion coefficient for each modality. Based on the dynamic weight parameters corresponding to each modality in the fusion weight matrix, the fusion coefficients of each modality are weighted and superimposed to generate a global fusion coefficient. The global fusion coefficient is then converted into a normalized fusion weight in the form of a probability distribution using a normalized exponential function. The semantic feature vector samples in each modality subset are weighted and summed according to the normalized fusion weights to obtain the predicted semantic embedding representation sample. In practice, a semantic feature vector sample is input into the initial fusion weight prediction network. The network outputs dynamic weight allocation parameters based on the node connection weights in the global structure relationship graph sample. Then, following the steps of cross-modal feature fusion, calculations and processing are performed to obtain a predicted semantic embedding representation sample.
[0113] Step S50: Calculate the semantic similarity loss value between the predicted semantic embedding representation sample and the annotated standardized corpus label, and at the same time calculate the topological consistency loss value between the global structure relationship graph sample and the manually annotated real association relationship, and weight the semantic similarity loss value and the topological consistency loss value according to a preset ratio to generate a multi-task joint loss value.
[0114] The semantic similarity loss measures the semantic difference between the predicted semantic embedding representation and the annotated standardized corpus labels. It can be calculated using methods such as cosine similarity. The topological consistency loss measures the topological difference between the global structural relationship graph and the manually annotated ground-truth relationships. It can be calculated using methods such as graph edit distance. The preset ratio is a pre-set weighted summation of the semantic similarity loss and the topological consistency loss. The multi-task joint loss is the weighted sum of the semantic similarity loss and the topological consistency loss according to a preset ratio and is used to comprehensively measure the model's training error. For example, for the predicted semantic embedding and the annotated standardized corpus labels, their cosine similarity is calculated, and the semantic similarity loss is obtained by subtracting the cosine similarity from 1. For the global structural relationship graph and the manually annotated ground-truth relationships, their graph edit distance is calculated as the topological consistency loss. Assuming the preset ratio is 0.6:0.4, the multi-task joint loss = 0.6 × semantic similarity loss + 0.4 × topological consistency loss. 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 summation is performed according to the preset ratio to obtain the multi-task joint loss value.
[0115] Step S60: Synchronously update the parameters of the multimodal semantic encoding network, the topological structure encoding network, and the fusion weight prediction network through the back-propagation algorithm until the multi-task joint loss value reaches the convergence threshold.
[0116] The backpropagation algorithm is used to update neural network parameters. It calculates the gradient of the loss function with respect to the network parameters and updates the parameters in the opposite direction of the gradient to minimize the loss function. The multimodal semantic encoding network, topological structure encoding network, and fusion weight prediction network are components of the multi-source heterogeneous corpus fusion model. By synchronously updating the parameters of these networks, model performance can be optimized. The convergence threshold is a pre-set threshold used to determine whether the model has converged. When the multi-task joint loss value is less than the convergence threshold, the model is considered to have converged. For example, in each training iteration, the backpropagation algorithm is used to calculate the gradient of the loss function with respect to each parameter in the multimodal semantic encoding network, topological structure encoding network, and fusion weight prediction network based on the multi-task joint loss value. The parameters of these networks are then updated based on the gradient. This process is repeated until the multi-task joint loss value is less than the convergence threshold.
[0117] As an implementation method, step S60 synchronously updates the parameters of the multimodal semantic encoding network, the topological structure encoding network, and the fusion weight prediction network through a back-propagation algorithm, which may specifically include the following steps S61 to S64:
[0118] Step S61: In a single training iteration, the parameters of the multimodal semantic encoding network and the topological structure encoding network are fixed, and only the parameters of the fusion weight prediction network are updated, so that the dynamic weight allocation parameters are preferentially adapted to the distribution characteristics of the current semantic feature vector samples.
[0119] In a single training iteration, in order to make the fusion weight prediction network better adapt to the distribution characteristics of the semantic feature vector samples, the parameters of the multimodal semantic encoding network and the topological structure encoding network are first fixed, and only the parameters of the fusion weight prediction network are updated. This can make the dynamic weight allocation parameters more suitable for the characteristics of the current semantic feature vector samples and improve the effect of cross-modal feature fusion. For example, in a certain training iteration, the parameters of the multimodal semantic encoding network and the topological structure encoding network are fixed, and the backpropagation algorithm is used to calculate the gradient of the multi-task joint loss value with respect to the parameters of the fusion weight prediction network. Then, an optimizer (such as the Adam optimizer) is used to update the parameters of the fusion weight prediction network. In actual operation, the parameters of the multimodal semantic encoding network and the topological 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 multimodal semantic encoding network and the topological structure encoding network are updated, so that the generation process of the semantic feature vector samples and the encoding process of the global structure relationship graph samples adapt to the current dynamic weight allocation 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 multimodal semantic encoding network and the topological structure encoding network are updated instead. This allows the generation process of semantic feature vector samples and the encoding process of global structure relationship graph samples to better adapt to the optimized dynamic weight allocation strategy, further improving model performance. For example, in a subsequent training iteration, the parameters of the fusion weight prediction network are fixed, and the backpropagation algorithm is used to calculate the gradient of the multi-task joint loss value with respect to the parameters of the multimodal semantic encoding network and the topological structure encoding network. These parameters are then updated using the optimizer.
[0122] Step S63: Alternately perform the above parameter updating steps until the decreasing rate of the multi-task joint loss value is lower than the preset threshold, and determine that the model has reached a convergence state.
[0123] By alternating between fixing the parameters of the multimodal semantic encoding network and the topology encoding network and updating the parameters of the fusion weight prediction network, and fixing the parameters of the fusion weight prediction network and updating the parameters of the multimodal semantic encoding network and the topology encoding network, the various components of the model can be gradually optimized and adapted to each other. The preset threshold is a rate of decrease threshold used to determine whether the model has converged. When the rate of decrease of the multi-task joint loss value falls below this threshold, it indicates that the model performance has stabilized and the model is considered to have reached a convergence state. For example, after each parameter update, the rate of decrease of the multi-task joint loss value is calculated, that is, the difference between the current loss value and the previous loss value divided by the current loss value. When the rate of decrease falls below the preset threshold multiple times in a row, the model is considered to have reached a convergence state. In practice, the multi-task joint loss value is recorded for each training loop, the rate of decrease is calculated, and then compared with the preset threshold.
[0124] Step S64: In the verification stage, the multi-source corpus units of the verification set are input into the trained multi-source heterogeneous corpus fusion model, and the semantic similarity between the generated predicted semantic embedding representation and the verification label, as well as the topological consistency between the generated global structural relationship graph and the verification association relationship are calculated respectively. If both reach the accuracy threshold, the training is completed; otherwise, the number of training iterations is increased until both reach the accuracy threshold.
[0125] The validation phase evaluates the performance of the trained multi-source heterogeneous corpus fusion model. The multi-source units in the validation set are independent of the training set and are used to test the model's generalization ability. The predicted semantic embeddings are the result of the model processing the multi-source units in the validation set, and the validation labels are the true labels corresponding to the multi-source units in the validation set. Semantic similarity measures the semantic proximity between the predicted semantic embeddings and the validation labels and can be calculated using methods such as cosine similarity. The global structural relationship graph is the graph structure obtained by the model topologically encoding the multi-source units in the validation set, and the validation associations are the true associations of the multi-source units in the validation set. Topological consistency measures the topological similarity between the global structural relationship graph and the validation associations and can be calculated using methods such as graph edit distance. The accuracy threshold is a pre-set threshold used to determine whether the model's performance meets the requirements. For example, the multi-source units in the validation set are input into the trained multi-source heterogeneous corpus fusion model to obtain the predicted semantic embeddings and the global structural relationship graph. Calculate the cosine similarity between the predicted semantic embedding and the verification label, as well as the graph edit distance between the global structural relationship graph and the verification association. If the cosine similarity is greater than or equal to the accuracy threshold and the graph edit distance is less than or equal to the accuracy threshold, the model performance is considered to be satisfactory and training is completed. Otherwise, increase the number of training iterations and continue training the model until both meet the accuracy threshold.
[0126] As an implementation method, the standardized corpus is used to support semantic retrieval and decision analysis of multi-source government service data. The method provided in the embodiment of the present invention further includes:
[0127] Step S600: Receive a government service query request input by a user, and parse the keywords and filter conditions in the query request.
[0128] A government service query request is a request submitted by a user to the system to query information related to government services. Keywords are key words used to describe the query content in the query request, and 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 user's query intention can be clarified. For example, the query request input by the user is "Query government service information related to enterprise registration from January to March 2024", where the keyword is "enterprise registration" and the filtering condition is "Time range: January to March 2024". In actual operation, the input interface is used to receive the user's query request, and natural language processing technology (such as word segmentation, part-of-speech tagging, etc.) is used to parse the keywords and filtering conditions in the query request.
[0129] Step S700: Retrieve target corpus units that match the keywords and filtering conditions from the standardized corpus, and calculate their semantic similarity with historical similar cases based on the target semantic embedding representation.
[0130] The standardized corpus stores processed and organized corpus units related to government services. The target corpus unit is the corpus unit in the standardized corpus that matches the keywords and filter conditions entered by the user. The target semantic embedding is the semantic embedding corresponding to the target corpus unit, and historically similar cases are cases in the standardized corpus that are semantically similar to the target corpus unit. By retrieving target corpus units that match the keywords and filter conditions from the standardized corpus and calculating the semantic similarity between them and historically similar cases based on the target semantic embedding, cases relevant to the user's query and semantically similar can be found. For example, based on the keyword "enterprise registration" and the filter condition "time range: January to March 2024," the inverted index structure of the standardized corpus is searched for matching target corpus units. The target semantic embedding of the target corpus unit is then compared with the target semantic embeddings of other corpus units in the standardized corpus, and cosine similarity is calculated to identify historically similar cases with high semantic similarity. In practice, a database query statement is used in conjunction with the inverted index structure to retrieve the target corpus unit from the standardized corpus. The cosine similarity calculation method is used to calculate the semantic similarity between the target semantic embedding representation and historical similar cases.
[0131] Step S800: Sort the search results according to semantic similarity, extract high-frequency attribute keys and related item codes in the sorted results, and generate a decision analysis report.
[0132] Semantic similarity reflects the degree of semantic closeness between the target corpus unit and similar historical cases. Sorting search results based on semantic similarity prioritizes results with high semantic similarity for easier viewing. High-frequency attribute keys are attribute keys that appear frequently in the sorted results, and associated issue codes are government service issue codes related to the target corpus unit. By extracting high-frequency attribute keys and associated issue codes from the sorted results and generating a decision analysis report, valuable information can be provided for government service decision-making. For example, search results are sorted from high to low based on semantic similarity, and the frequency of occurrence of each attribute key in the sorted results is counted to identify the high-frequency attribute keys. At the same time, associated issue codes are extracted. High-frequency attribute keys, associated issue codes, and relevant target corpus unit information are compiled into a decision analysis report. In practice, a sorting algorithm is used to sort search results, statistical methods are used to count high-frequency attribute keys, associated issue codes are extracted, and a document generation tool is used to generate a 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] Key indicators are significant indicators in decision analysis reports, such as high-frequency attribute keys and related item codes. Visualization presents key indicators in intuitive formats, such as charts and graphs, to facilitate user understanding and analysis. The government service management platform is a platform for managing government service-related information. By visualizing key indicators in decision analysis reports and pushing them to the government service management platform, government service managers can more intuitively understand the decision analysis results and make more informed decisions. For example, the frequency of occurrence of high-frequency attribute keys can be displayed in the form of a bar chart, and related item codes can be displayed in the form of a list. Use data visualization tools (such as Matplotlib and Seaborn) to visualize key indicators. The visualized results are then pushed to the government service management platform, for example, by sending data to a designated location on the platform through an API.
[0135] As an implementation manner, the method provided in the embodiment of the present invention further includes a real-time update process, specifically including the following steps:
[0136] Step S1000: Monitor the incremental update events of the government service data source and capture the newly added corpus units and their associated attribute sets.
[0137] Government service data sources are the sources of government service-related data, such as business systems and databases. Incremental update events are events in which data in the data source undergoes changes such as addition, modification, or deletion. Newly added corpus units are new corpus units generated in incremental update events, and associated attribute sets are attribute sets associated with newly added corpus units. By monitoring the incremental update events of government service data sources and capturing newly added corpus units and their associated attribute sets, the latest government service data can be obtained in a timely manner. For example, data monitoring tools (such as database triggers, message queues, etc.) are used to monitor incremental update events of government service data sources. When new data is detected, the newly added corpus units and their associated attribute sets are captured. In actual operation, appropriate data monitoring tools and methods are selected according to different data source types to achieve the monitoring of incremental update events and the capture of corpus units and associated attribute sets.
[0138] Step S1100: performing cross-modal semantic alignment processing and multimodal semantic encoding on the newly added corpus units to generate incremental semantic feature vectors.
[0139] Cross-modal semantic alignment is the process of unifying and aligning new corpus units of different modalities at the semantic level, and multimodal semantic encoding is the process of converting the new corpus units that have undergone cross-modal semantic alignment into vector representations. The incremental semantic feature vector is the vector obtained after cross-modal semantic alignment and multimodal semantic encoding of the new corpus units. By performing cross-modal semantic alignment and multimodal semantic encoding on the new corpus units to generate incremental semantic feature vectors, the new corpus units can be incorporated into the existing semantic framework. For example, for newly added structured table data, unstructured text data and semi-structured log data, they are processed according to the cross-modal semantic alignment processing steps mentioned above to generate normalized data blocks. Then, a multimodal semantic encoding network is used to encode the normalized data blocks to generate incremental semantic feature vectors. In actual operation, the trained models and algorithms are used to process the new corpus units to obtain incremental semantic feature vectors.
[0140] Step S1200: inserting the incremental semantic feature vector into the global structural relationship graph, and updating the fusion weight matrix according to the connection weights between the newly added nodes and the existing nodes.
[0141] The global structure relationship graph is a graph structure that represents the semantic and attribute relationships between government service data. New nodes represent newly added corpus units. Connection weights reflect the strength of the associations 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 based on the connection weights between the new node and existing nodes, the global structure relationship graph and the fusion weight matrix can be updated to include the latest government service data information. For example, the incremental semantic feature vector is inserted as the feature vector of the new node into the node feature matrix of the global structure relationship graph. The attribute overlap and semantic relevance between the new node and existing nodes are calculated. Based on these calculation results, the connection weights between the new node and existing nodes are determined, and the adjacency matrix is updated. The fusion weight matrix is then updated based on the updated global structure relationship graph. In practice, the new node is added to the data structure of the global structure relationship graph, the connection weights are calculated, the adjacency matrix is updated, and the fusion weight matrix is recalculated using the updated global structure relationship graph.
[0142] Step S1300: Dynamically fuse the incremental semantic feature vectors based on the updated fusion weight matrix, and synchronize the resulting increments to the inverted index structure of the standardized corpus.
[0143] Dynamic fusion involves cross-modal feature fusion of incremental semantic feature vectors based on an updated fusion weight matrix to produce a fused semantic representation. Incremental synchronization involves incrementally updating the fused results to the inverted index structure of the standardized corpus. By dynamically fusing incremental semantic feature vectors based on an updated fusion weight matrix and synchronizing the results to the inverted index structure of the standardized corpus, the real-time and accuracy of the data in the standardized corpus can be ensured. For example, the incremental semantic feature vectors are weighted and summed according to the updated fusion weight matrix to produce a fused semantic representation. The fused semantic representation and the corresponding newly added corpus unit information are then incrementally updated to the inverted index structure of the standardized corpus. In practice, dynamic fusion is achieved using matrix operations, and incremental synchronization is achieved using database operations. This allows the standardized corpus to promptly reflect the latest changes in government service data sources, providing more accurate and real-time data support for semantic retrieval and decision analysis of government services.
[0144] See also Figure 2 , Figure 2The following is a schematic diagram of the structure of a computer system provided in an embodiment of the present invention. The computer system includes at least a processor 101, a communication interface 102, and a memory 103. The processor 101, communication interface 102, and memory 103 may be connected via a bus or other means. The processor 101 (also known as the Central Processing Unit (CPU)) is the computing and control core of the computer system, capable of parsing various instructions within the computer system and processing various data within the computer system. The communication interface 102 may optionally include a standard wired interface or a wireless interface (such as Wi-Fi or a mobile communication interface), which can be used to send and receive data under the control of the processor 101. The communication interface 102 may also be used for data transmission and interaction within the computer system. The memory 103 is a storage device within the computer system, used to store programs and data. It is understood that the memory 103 herein may include both the computer system's built-in memory and, of course, the computer system's supported extended memory. The memory 103 provides storage space for the computer system's operating system, which may include, but is not limited to, Android, iOS, Windows Phone, and the like, though this invention is not limited thereto.
[0145] In one embodiment, the processor 101 executes the multi-source heterogeneous corpus fusion method based on government service data provided in the above embodiment of the present invention by running the computer program in the memory 103.
Claims
1. A multi-source heterogeneous corpus fusion method based on government service data, characterized by: The method comprises: Acquire a collection of original corpora from multiple data sources in government services, wherein the collection of original corpora includes corpus units of different data types; Performing cross-modal semantic alignment processing on each corpus unit in the original corpus set to generate a normalized data block corresponding to each corpus unit, wherein the normalized data block includes a unified semantic label and an associated attribute set; Performing multimodal semantic coding on the normalized data blocks respectively to obtain semantic feature vectors of each corpus unit, and performing topological structure coding on the associated attribute sets between the normalized data blocks to generate a global structural relationship graph; Based on the node connection weights in the global structure relationship graph, dynamically assign weights to the semantic feature vectors to generate a fusion weight matrix, and perform cross-modal feature fusion on the semantic feature vectors using the fusion weight matrix to obtain a target semantic embedding representation; A standardized corpus associated with government services is generated based on the target semantic embedding representation.
2. The method according to claim 1, characterized in that The data types include structured table data, unstructured text data, and semi-structured log data. The cross-modal semantic alignment processing is performed on each corpus unit in the original corpus set to generate a normalized data block corresponding to each corpus unit, including: For corpus units of structured table data types, extract the header fields and row-column relationships, map the header fields to candidate tags in a preset semantic tag set, and determine the final semantic tag of the header field based on the semantic similarity between the field content and the candidate tags; For corpus units of unstructured text data types, the entity recognition model is used to extract government service entities in the text, and the government service entities are matched with the preset entity library to generate attribute key-value pairs containing entity types and entity relationships; For corpus units of semi-structured log data types, parse the timestamp, operation type, and parameter list in the log template, map the operation type to a unified operation code, and convert the parameter list into an attribute set in the form of key-value pairs; The final semantic label, attribute key-value pair and attribute set are checked for relevance, redundant attributes with semantic conflicts are deleted, and missing attribute values are filled in to generate the normalized data block containing the complete semantic label and associated attribute set.
3. The method according to claim 2, characterized in that The method of extracting header fields and row-column relationships from a corpus unit of a structured table data type, mapping the header fields to candidate tags within a preset semantic tag set, and determining a final semantic tag for the header fields based on semantic similarity between the field content and the candidate tags includes: Parsing the table structure in the corpus unit of the structured table data type, identifying the nesting level of the table and the information of merged cells across rows and columns, and generating a hierarchical relationship tree of the header fields, the hierarchical relationship tree including the subordinate relationship between the parent header field and the child header field; Based on the text description of each header field in the hierarchical relationship tree, candidate tags containing the same core vocabulary as the text description are screened from a preset semantic tag set to generate an initial candidate tag list; Traversing the initial candidate tag list, extracting the associated semantic context template for each candidate tag, wherein the semantic context template includes a tag definition, a synonym set, and a typical application scenario description; Inputting the text description of the header field and the semantic context template into the semantic matching model, calculating the context matching degree between the text description and each candidate tag, and performing weighted correction on the matching degree of the child header field based on the matching result of the parent header field in the hierarchical relationship tree; The initial candidate tag list is sorted according to the corrected context matching degree, and the top K candidate tags with the highest matching degree are selected to generate an optimized candidate tag set. Based on the distribution characteristics of the cell content below the header field in the table, the compatibility score between each optimized candidate tag and the cell content type is calculated; The context matching degree and compatibility score are integrated to generate a comprehensive weight, and the candidate label with the largest comprehensive weight is determined as the final semantic label of the header field. The final semantic label is then logically checked for consistency with the semantic labels of adjacent header fields in the hierarchical relationship tree, and the complete mapping result is output after correcting the conflicting labels.
4. The method according to claim 2, characterized in that The multimodal semantic encoding is performed on the normalized data blocks respectively to obtain the semantic feature vector of each corpus unit, including: For normalized data blocks of unstructured text data types, a pre-trained language model is used to extract the contextual semantic features of the text content, and a multi-head attention mechanism is used to model long-distance dependencies to generate the first semantic feature vector; For normalized data blocks of structured table data types, a relationship graph network between fields is constructed based on the semantic labels of their header fields and the distribution pattern of cell content. The feature representations of adjacent fields are aggregated through a graph neural network to generate a second semantic feature vector. For the normalized data blocks of semi-structured log data types, the temporal distribution patterns of their operation coding sequences and parameter sets are analyzed. A temporal convolutional network is used to extract the temporal features of the operation sequences. The parameter sets are then mapped into dense vectors through an embedding layer to generate a 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 retain the modality identifier of each semantic feature vector.
5. The method according to claim 1, characterized in that The performing topological structure encoding on the associated attribute sets between the normalized data blocks to generate a global structure relationship graph includes: Extracting common attribute keys from the associated attribute set of each normalized data block, wherein the common attribute keys include a government service item code, a user identifier, and a time interval; Taking each normalized data block as a node, constructing initial node connection edges based on the matching relationship of the common attribute keys, and calculating the attribute overlap and semantic relevance between nodes; According to the attribute overlap and semantic relevance, weighted processing is performed on the initial node connection edges to generate a weighted edge set; Based on the nodes and the weighted edge sets, the global structural relationship graph including a node feature matrix and an adjacency matrix is constructed, wherein the node feature matrix is composed of the semantic feature vectors of each node.
6. The method according to claim 1, wherein The cross-modal feature fusion of the semantic feature vector by the fusion weight matrix to obtain a target semantic embedding representation includes: According to the modality identifier of each node in the global structure relationship graph, the semantic feature vector is divided into a text modality subset, a table modality subset, and a log modality subset; For each semantic feature vector in the text modality subset, the mean cosine similarity between it and other semantic feature vectors in the same modality subset is calculated to generate the intra-text similarity, and the maximum cosine similarity between it and the semantic feature vectors in the table modality subset and the log modality subset is calculated to generate the cross-modality similarity of the text; For each semantic feature vector in the table modality subset, calculate the mean cosine similarity between it and other semantic feature vectors in the same modality subset to generate the table intra-class similarity, and calculate the maximum cosine similarity between it and each semantic feature vector in the text modality subset and the log modality subset to generate the table cross-modality similarity; For each semantic feature vector in the log modality subset, calculate the mean cosine similarity between it and other semantic feature vectors in the same modality subset to generate the log intra-class similarity, and calculate the maximum cosine similarity between it and the semantic feature vectors in the text modality subset and the table modality subset to generate the log cross-modality similarity; The text intra-class similarity and the text cross-modal similarity are fused at a preset ratio to generate a text modality fusion coefficient, the table intra-class similarity and the table cross-modal similarity are fused at the same ratio to generate a table modality fusion coefficient, and the log intra-class similarity and the log cross-modal similarity are fused at the same ratio to generate a log modality fusion coefficient; Based on the dynamic weight parameters corresponding to each modality in the fusion weight matrix, the text modality fusion coefficient, the table modality fusion coefficient, and the log modality fusion coefficient are weightedly 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 normalized exponential function; The semantic feature vectors in the text modality subset, the table modality subset and the log modality subset are weightedly summed according to the normalized fusion weight to generate the target semantic embedding representation, wherein the semantic feature vectors in the same modality subset share the same normalized fusion weight.
7. The method according to claim 1, characterized in that Generating a standardized corpus associated with government services based on the target semantic embedding representation includes: Inputting the target semantic embedding representation into a pre-trained semantic clustering model, and dividing corpus units with similarity above a threshold into the same semantic cluster based on the distance metric of the embedding vectors; Assigning a unique semantic identifier to each semantic cluster and extracting the common attribute keys of the corpus units in the semantic cluster as cluster description metadata; Based on the semantic identifier and the cluster description metadata, an inverted index structure is constructed, wherein the inverted index structure includes a multi-level mapping relationship from semantic tags to corpus units; The inverted index structure and the target semantic embedding representation are stored in a distributed database to generate the standardized corpus that supports multi-condition combination query.
8. The method according to claim 1, characterized in that The method is performed by a multi-source heterogeneous corpus fusion model, which includes a multimodal semantic encoding network, a topological structure encoding network, and a fusion weight prediction network. The method also includes a training process of the multi-source heterogeneous corpus fusion model, including: Obtain a sample set of multi-source corpus units for the same government service item in historical government service data, wherein the sample set includes structured table data, unstructured text data, and semi-structured log data, and annotate the corresponding standardized corpus tags; Performing cross-modal semantic alignment processing on the multi-source corpus unit sample set to generate a normalized data block set for training, performing multimodal semantic encoding on the normalized data block set through a multimodal semantic encoding network to obtain a semantic feature vector sample of each corpus unit; Using a topological structure encoding network, and based on the semantic feature vector samples, performing topological structure encoding on the associated attribute sets in the normalized data block set, a global structure relationship graph sample for training is generated, wherein the node feature matrix is composed of the semantic feature vector samples, and the adjacency matrix is calculated by the attribute overlap and semantic relevance between the sample nodes; Inputting the semantic feature vector sample into the initial fusion weight prediction network, generating dynamic weight allocation parameters based on the node connection weights in the global structure relationship graph sample, and obtaining a predicted semantic embedding representation sample through cross-modal feature fusion; Calculate the semantic similarity loss value between the predicted semantic embedding representation sample and the annotated standardized corpus label, and simultaneously calculate the topological consistency loss value between the global structure relationship graph sample and the manually annotated true association relationship, and weight the semantic similarity loss value and the topological consistency loss value according to a preset ratio to generate a multi-task joint loss value; The parameters of the multimodal semantic encoding network, the topological structure encoding network and the fusion weight prediction network are synchronously updated through the back propagation algorithm until the multi-task joint loss value reaches a convergence threshold.
9. The method according to claim 8, characterized in that The synchronous updating of the parameters of the multimodal semantic encoding network, the topological structure encoding network and the fusion weight prediction network by the back propagation algorithm includes: In a single training iteration, the parameters of the multimodal semantic encoding network and the topological structure encoding network are fixed, and only the parameters of the fusion weight prediction network are updated, so that the dynamic weight allocation parameters are preferentially adapted to the distribution characteristics of the current semantic feature vector sample; In subsequent training iterations, the parameters of the fusion weight prediction network are fixed, and the parameters of the multimodal semantic encoding network and the topological structure encoding network are updated so that the generation process of the semantic feature vector samples and the encoding process of the global structure relationship graph samples are adapted to the current dynamic weight allocation strategy; Alternately perform the above parameter updating steps until the decreasing rate of the multi-task joint loss value is lower than a preset threshold, and determine that the model has reached a convergence state; In the verification stage, the multi-source corpus units of the verification set are input into the trained multi-source heterogeneous corpus fusion model, and the semantic similarity between the generated predicted semantic embedding representation and the verification label, as well as the topological consistency between the generated global structural relationship graph and the verification association relationship are calculated respectively. If both reach the accuracy threshold, the training is completed; otherwise, the number of training iterations is increased until both reach the accuracy threshold.
10. A computer system, characterized in that: include: a memory, wherein the computer program is stored in the memory; A processor is used to load the computer program to implement the multi-source heterogeneous corpus fusion method based on government service data as described in any one of claims 1 to 9.
Citation Information
Patent Citations
Intelligent search method and system based on multi-source heterogeneous data
CN116049454A
Multi-modal knowledge graph completion method and system based on embedded synchronization and alignment
CN118821921A
Live broadcast room content identification and intelligent distribution method and system based on multi-modal fusion
CN119377895A
Calculation method and system for unstructured text data
CN119474383A
Cross-modal alignment method and device for multi-modal large language model
CN119580269A
Cited By
Dynamic form generation and cross-database adaptation method based on metadata driving
CN120743967A
A Metadata-Driven Dynamic Form Generation and Cross-Database Adaptation Method
CN120743967B
Automatic data grading protection method and system based on multi-feature fusion
CN120763957A
Information extraction processing method and system applied to data sharing service
CN120875010A
Information extraction processing method and system applied to data sharing service
CN120875010B
