Carbon emission factor matching method based on multi-granularity semantic embedding and multi-direction semantic interaction
Patent Information
- Application Number
- CN202511749442.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-26
- Publication Date
- 2026-09-08
- Estimated Expiration
- 2045-11-26
AI Technical Summary
[0013]a. 人工依赖度高:部分建材缺乏对应的碳排放因子,通常需通过近似替代因子参与计算,这些问题导致现行方法在匹配过程中高度依赖人工操作,需要逐项分析并手动选择合适的碳排放因子;
[0059] (1) Multi-granularity semantic fusion enhances the integrity and robustness of semantic expression:
Smart Images

Figure CN121524952B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to a matching method, and more particularly to an intelligent matching method for carbon emission factors based on multi-granularity semantic embedding and multi-directional semantic interaction. It belongs to the field of carbon emission accounting and intelligent semantic matching technology and is applicable to carbon emission accounting throughout the entire life cycle of buildings. Background Technology
[0002] Currently, both domestically and internationally, the accounting method based on the product of activity data and carbon emission factors is widely adopted. Data sources include national standards (such as GB / T51366-2019 "Standard for Calculation of Building Carbon Emissions"), industry guidelines, and enterprise internal data systems. However, existing carbon emission factor matching technologies mainly rely on manual retrieval or keyword-based fuzzy matching, resulting in low levels of automation and intelligence. In the context of the informatization and digital transformation of carbon emission accounting, traditional matching methods struggle to meet the following emerging trends:
[0003] a. The continuous emergence of new materials, new processes, and new energy sources has led to the loss of carbon emission factors in some materials;
[0004] b. Carbon emission accounting scenarios place higher demands on automatic data matching, semantic understanding, and intelligent recommendation;
[0005] c. Construction engineering data is diverse and unstructured, containing a large number of non-standard terms and professional abbreviations.
[0006] In recent years, the rapid development of semantic understanding and natural language processing (NLP) technologies has provided new solutions for intelligent matching of carbon emission factors. Text similarity calculation based on pre-trained language models (such as BERT, ERNIE, and RoBERTa) has been widely applied to question-answering matching, information retrieval, and semantic reasoning tasks. Specifically, existing technical solutions employ a dynamic carbon emission factor matching method based on a large language model. Through multi-step optimization, this method achieves efficient and accurate matching: First, carbon emission factors and activity data are collected from multiple sources, and the data is cleaned and standardized. Then, a pre-trained and domain-fine-tuned large language model is used to perform deep semantic parsing on the data, generating high-quality semantic vectors. The system unifies the data format and completes physical quantity conversion through unit recognition and conversion mechanisms. During the matching process, the system performs intelligent matching by calculating the cosine similarity of semantic vectors. When the similarity is close, a weighted average mechanism is applied to optimize the results, further improving matching accuracy. Simultaneously, the system utilizes a dynamic factor library update mechanism to analyze the relevance of newly submitted data, dynamically expand the factor library, and continuously optimize matching performance. The overall method improves matching accuracy and efficiency, reduces human intervention and errors, and lowers the cost of carbon emission calculation.
[0007] However, directly applying these general models to carbon emission accounting scenarios still has significant shortcomings. First, existing solutions directly calculate the cosine similarity between the semantic vectors of project activity data and the semantic vectors of factors in the carbon emission factor library, quantifying the semantic similarity between texts. This approach simply encodes each sentence individually into a vector to model sentence pairs, and then directly calculates the similarity between the two vectors as the matching degree between texts. A single-granularity vector cannot accurately represent a piece of text. Second, there is no explicit interaction between the two sentences, which may lead to the loss of some important information, lacking an effective inter-sentence interaction mechanism.
[0008] Furthermore, a significant problem remains in text matching tasks: the Out-of-Vocabulary (OOV) problem. There are only about 2500 commonly used Chinese characters in daily life, yet the number of words composed of these characters is enormous. Under current technological conditions, we cannot obtain the word vector representation for every single word. For a trained model, if the input sentence contains untrained words, the model cannot obtain the word vector representations for these untrained words, which negatively impacts the overall model performance. Specifically:
[0009] a. Lack of domain-specific corpus training makes it difficult for the model to recognize engineering terminology;
[0010] b. Single-granularity semantic representation cannot fully depict the multi-layered semantic relationships between material names and process descriptions;
[0011] c. The model has a large number of parameters and is computationally complex, making it difficult to meet the real-time requirements of engineering applications.
[0012] Therefore, constructing an intelligent matching method for the carbon emission field, featuring multi-granular semantic expression and efficient interaction mechanisms, has become a key research focus and development direction. Existing carbon emission factor matching methods have significant limitations in the following aspects:
[0013] a. High dependence on manual labor: Some building materials lack corresponding carbon emission factors and usually need to be used in the calculation through approximate substitution factors. These problems make the current method highly dependent on manual operation in the matching process, requiring item-by-item analysis and manual selection of appropriate carbon emission factors;
[0014] b. Insufficient semantic expressive power: One-way vectorization methods cannot accurately express multi-level semantic relationships;
[0015] c. Lack of inter-sentence interaction mechanism: There is a lack of two-way semantic alignment between activity data and carbon factor descriptions;
[0016] d. Out-of-vocabulary (OOV) terms are a prominent issue: it is unable to handle domain-specific terms and names of new materials and processes.
[0017] Driven by both current "dual-carbon" policies and digital management, building carbon emission accounting urgently needs to be implemented.
[0018] a. High-precision intelligent matching: Automatically identifies the semantic relationship between activity data and carbon factors, replacing manual judgment;
[0019] b. High-efficiency computing capabilities: Supports batch calculations and real-time response for large-scale projects;
[0020] c. Highly robust model design: capable of handling multi-source heterogeneous data and new domain terms, maintaining long-term applicability.
[0021] In summary, while existing technologies have made some progress in semantic matching, there are still systemic deficiencies in areas such as semantic representation hierarchy, inter-sentence interaction mechanisms, and out-of-vocabulary word processing. These issues urgently need to be addressed through technological innovation to provide a more accurate, efficient, and reliable intelligent matching solution for carbon emission accounting. Summary of the Invention
[0022] To address the shortcomings of existing technologies, this invention discloses an intelligent matching method for carbon emission factors based on multi-granularity semantic embedding and multi-directional semantic interaction, the technical solution of which is as follows:
[0023] A method for intelligent matching of carbon emission factors based on multi-granularity semantic embedding and multi-directional semantic interaction, characterized by comprising the following steps:
[0024] Step A1: Data Input and Input Preprocessing: Systematically preprocess the acquired data to unify the data format and unit expression; accept Chinese activity data text; use a word segmentation tool to segment words while retaining character-level representation; construct a dictionary and character index table to generate word sequences and character sequences;
[0025] Step A2: Word Vector and Character Vector Embedding: The character sequence generated in Step A1 is embedded with character vectors. After representing the sentence as a character vector matrix, features are extracted, and an attention mechanism is added to weight key characters. The word sequence generated in Step A1 is embedded with word vectors, using a model fine-tuned with a semantic similarity dataset from the architectural domain to generate word vectors. The word vectors are concatenated with the character vectors to obtain a sentence vector representation that integrates character-level and word-level semantics.
[0026] Step A3: Feature Extraction: Input the sentence vector representation obtained in Step A2 into the encoder to capture the contextual dependencies of the text and output the contextual feature sequence;
[0027] Step A4: Interaction layer fusion of interaction information: Based on the context feature sequence obtained in step A3, calculate the cosine similarity matrix between sentences; perform average pooling and max pooling operations on the similarity matrix to obtain overall interaction information and capture the strongest matching signal; calculate the attention weight matrix and generate an attention weighted vector based on this matrix to achieve semantic alignment between sentences;
[0028] Step A5: Comparison function G and time step aggregation: At each time step, the same feedforward network G containing linear layers and ReLU activation function is used for comparison to obtain a comparison vector; the average pooling vector, max pooling vector obtained in step A4 and the comparison vector obtained in this step are concatenated to obtain the final matching result of the sentence at each time step;
[0029] Step A6: Discriminator and Loss Function: The matching result sequence obtained in Step A5 is aggregated into a fixed-length matching vector using a BiLSTM layer; after inputting the matching vector into several fully connected layers, the prediction score is output through the Softmax function; the Sigmoid cross-entropy loss function is used to minimize the cross-entropy between the predicted label and the real label through backpropagation, so as to update and optimize the parameters of the entire network.
[0030] Preferably, step A1 specifically includes: step A11: collecting activity data from the personnel and machinery table provided in the engineering case, collecting carbon emission factor data from government reports, industry standards, academic research and internal enterprise records, and systematically preprocessing the acquired data. The preprocessing process includes data cleaning and standardization operations to remove redundant information, correct abnormal or erroneous data, and unify data format and unit expression.
[0031] Step A12: Accept a pair of Chinese activity data P and Q;
[0032] Step A13: Use Jieba to segment P and Q into words, while retaining character-level representations to alleviate the problem of semantic loss in short texts; clean up stop words and special symbols, and unify the text format;
[0033] Step A14: Construct the dictionary and character index table, and generate word sequences and character sequences.
[0034] Preferably, step A2 specifically includes: step A21: character vector embedding, representing each character in a sentence of length n as the index position of the character in the dictionary, and then representing the sentence as an n*k character vector matrix, where k is the dimension of each character vector; inputting the matrix into an LSTM to extract features, and adding an attention mechanism to weight key characters to capture character-level features;
[0035] Step A22: Word vector embedding. The T-BERT-ARCH model, fine-tuned using a semantic similarity dataset in the architecture domain, is used as input for sentence P and sentence Q to obtain the word vector matrices of the two sentences.
[0036] Step A23: Concatenate the character vector obtained in step A21 with the word vector obtained in step A22 to obtain the final vector representation of sentences P and Q.
[0037] Preferably, step A4 specifically includes:
[0038] Step A41: Cosine similarity averaging and max pooling. Calculate the cosine similarity for each pair of time steps to form a similarity matrix; perform average pooling and max pooling on this matrix respectively.
[0039] Step A42: Calculate the attention weight matrix. Calculate the attention weight matrix based on the context feature sequence, and calculate the weighted sum of the attention weights to obtain the attention weight vector.
[0040] Step A43: Deep interaction. By calculating the difference and element-wise product between the context feature sequence and the attention weighted vector, the original vector is concatenated with the difference and element-wise product features to obtain the vector after deep interaction.
[0041] Preferably, step A5 specifically includes:
[0042] Step A51: Comparison function G(·), the deep interaction vector obtained in step A43 is compared at each time step using the same feedforward network G, which contains linear layers and ReLU activation function, to obtain the comparison vector;
[0043] Step A52: Time step aggregation. The average pooling vector, max pooling vector, and comparison vector obtained in step A41 are concatenated to form the final matching result for each time step of the sentence.
[0044] Preferably, step A6 specifically includes:
[0045] Step A61: Use a BiLSTM layer to aggregate the matching results of the two sequences into a fixed-length matching vector; input the matching vector into several fully connected layers, and output the prediction score through the Softmax function;
[0046] Step A62: Use the Sigmoid cross-entropy loss function to minimize the cross-entropy between the predicted and true labels through backpropagation to update the network parameters.
[0047] This invention also discloses an intelligent matching system for carbon emission factors based on multi-granularity semantic embedding and multi-directional semantic interaction, used to implement the above-mentioned method, characterized in that the system includes:
[0048] The data input and preprocessing module is used to perform step A1;
[0049] The word vector and character vector embedding module is used to perform step A2;
[0050] The feature extraction module is used to perform step A3;
[0051] The interaction layer integrates the interaction information module to execute step A4;
[0052] The comparison and time step aggregation module is used to execute the right step A5;
[0053] The discrimination and output module is used to execute step A6.
[0054] Preferably, the data input and preprocessing module is further configured to perform steps A11, A12, A13 and A14.
[0055] Preferably, the word vector and character vector embedding module is further configured to perform steps A21, A22 and A23.
[0056] Preferably, the interaction layer fusion interaction information module is further configured to perform steps A41, A42 and A43.
[0057] The present invention also discloses a non-volatile storage medium, characterized in that the non-volatile storage medium includes a stored program, wherein the program, when running, controls the device where the non-volatile storage medium is located to execute the method described thereon.
[0058] This invention also discloses a terminal device, characterized in that the terminal device includes: a processor, a memory, a communication interface, and a bus; the processor, the memory, and the communication interface are connected via the bus and communicate with each other; the memory stores executable program code; the processor reads the executable program code stored in the memory to run a program corresponding to the executable program code, for executing the method described. Beneficial Effects
[0059] (1) Multi-granularity semantic fusion enhances the integrity and robustness of semantic expression:
[0060] Existing methods typically rely on single-granularity text vector representations, making it difficult to fully capture multi-layered semantic information within sentences. This invention proposes a multi-granularity semantic embedding mechanism that fuses character-level and word-level semantics, while simultaneously utilizing character sequences to capture fine-grained structural features and domain-adjusted word vectors to capture global semantic features.
[0061] (2) Multi-directional semantic interaction structure to achieve bidirectional information coupling and deep semantic alignment:
[0062] Traditional models lack explicit interaction mechanisms during inter-sentence encoding, resulting in insufficient alignment of semantic information. This invention proposes a multi-directional semantic interaction structure that integrates average pooling, max pooling, and attention mechanisms to achieve multi-layer semantic alignment from global trends to strong local matching.
[0063] (3) Systematic solutions to the out-of-vocabulary (OOV) word problem:
[0064] Traditional methods fail to generate stable vectors when faced with novel or rare words in the domain, leading to matching failures. This invention achieves semantic word complementarity through character-level BiLSTM and an attention-weighted mechanism. Attached Figure Description
[0065] Figure 1 This is a schematic diagram of the transfer learning process of the present invention;
[0066] Figure 2 This is a schematic diagram of the process of the present invention. Detailed Implementation
[0067] A method for intelligent matching of carbon emission factors based on multi-granularity semantic embedding and multi-directional semantic interaction includes the following steps:
[0068] Step A1: Data Input and Preprocessing: Systematically preprocess the acquired data to standardize data format and unit representation; accept Chinese activity data text; segment the data using a word segmentation tool while preserving character-level representation; construct a dictionary and character index table to generate word sequences and character sequences.
[0069] Step A11: Data Preprocessing: Collect activity data from the personnel, resources, and machinery tables provided in the engineering case study, and collect carbon emission factor data from government reports, industry standards, academic research, and internal company records. Systematically preprocess the acquired data. The preprocessing process includes data cleaning and standardization to remove redundant information, correct abnormal or erroneous data, standardize data formats and unit expressions, and ensure the accuracy, consistency, and completeness of the data content. This provides a reliable data foundation for subsequent dynamic matching and model calculation of carbon emission factors.
[0070] Step A12: Input: Accept a pair of Chinese activity data P and Q, where:
[0071] (1)
[0072] (2)
[0073] In the formula: and Let m and n be the m-th and n-th characters of sentences P and Q, respectively, where m and n are the lengths of sentences P and Q, respectively.
[0074] Step A13: Tokenization and Character Splitting: Jieba is used to segment P and Q into words separately, while preserving character-level representations to alleviate the semantic loss problem in short texts. Stop words and special symbols are cleaned, and the text format is standardized to ensure data consistency and integrity.
[0075] Step A14: Output: Construct a dictionary and character index table, generate word sequences and character sequences, clean up stop words and special symbols, and unify the text format; ensure data consistency and integrity.
[0076] Step A2: Word Vector and Character Vector Embedding: The character sequence generated in Step A1 is embedded using character vectors. The sentence is represented as a character vector matrix, features are extracted, and an attention mechanism is added to weight key characters. The word sequence generated in Step A1 is embedded using word vectors, generated using a model fine-tuned with a semantic similarity dataset from the architectural domain. The word vectors are concatenated with the character vectors to obtain a sentence vector representation that integrates character-level and word-level semantics.
[0077] Step A21: Character Vector Embedding. Each character in a sentence of length n is represented as its index in the dictionary. The sentence is then represented as an n*k matrix, where k is the dimension of each character vector. We set the character vector dimension to 100. This matrix is then fed into an LSTM to extract features, and an attention mechanism is added to weight key characters, capturing character-level features (for short text enhancement). This allows for finer-grained analysis and capture of text sequence features, further addressing the OOV (Out of Context) problem.
[0078] Step A22: Word Vector Embedding. The model and training are based on transfer learning. The BERT model is first pre-trained on general-domain text using a transfer learning strategy to extract semantic features. Then, the learned semantic features are copied to the architectural domain and fine-tuned on an architectural semantic similarity dataset to obtain the T-BERT-ARCH model. The word vector dimension is set to 100. Input sentence P and sentence Q, and the word vector matrices of the two sentences are obtained. and , where d is the dimension of the word vector, and m and n are the lengths of sentences P and Q, respectively.
[0079] Step A23: Output: Concatenate the word vectors and character vectors to obtain the vector representations of sentences P and Q.
[0080] Step A3: Feature Extraction: Input the sentence vector representation obtained in Step A2 into the encoder to capture the contextual dependencies of the text and output a sequence of contextual features.
[0081] Step A31: Input P and Q into the BiLSTM encoder respectively to obtain the context feature sequence:
[0082] (3) (4)
[0083] In the formula: The vector of the i-th element of sentence P encoded by BiLSTM. The vector of the j-th element of sentence Q encoded by BiLSTM. It is the vector of the i-th word in sentence P. It is the vector of the j-th word in sentence Q.
[0084] The main structure of BiLSTM consists of two unidirectional LSTMs. LSTM is a special type of recurrent neural network used to solve long-term dependency problems. An LSTM unit is called a memory block, which consists of three gates and a memory cell. The cell state in the memory block controls the transmission of information to the next time step. The three gates are the forget gate, the input gate, and the output gate. The input gate controls how much information from the current input is written to the cell state, the forget gate controls how much information is forgotten from the previous cell state, and the output gate controls how much information is output from the cell state to the final hidden state. The formula for this step of the LSTM is as follows:
[0085] (5)
[0086] (6)
[0087] (7)
[0088] (8)
[0089] (9)
[0090] (10)
[0091] in, , and These represent the input gate, forget gate, and output gate, respectively. , and Here are the weight matrices for the input gate, forget gate, and output gate. , and Here are the bias matrices for the input gate, forget gate, and output gate. For the current time, For the previous moment, and These represent the states of the previous hidden layer and the current hidden layer, respectively. The activation function is used. The input gate is set to the current input. And the previous final hidden state As input. The value of the forget gate is 0, which means from The information obtained will not be transferred In the calculation, the value of the forget gate is 1, meaning that from... All initial information will be transferred to In the calculation, the output gate controls how much information is output from the cell state to the final hidden state. These are called candidate values, used to calculate the current cell state. Equation (8) is the update method for the current cell state, where x(t) and h(t) are the current input sequence and output sequence, respectively. The formulas for calculating tanh are as follows: (11)
[0092] (12)
[0093] Step A32: Output: Context sequence: (13)
[0094] (14)
[0095] In the formula: and These are the context feature sequences of sentences P and Q, respectively.
[0096] Step A4: Interaction Layer Fusion of Interaction Information: Based on the context feature sequence obtained in Step A3, calculate the cosine similarity matrix between sentences; perform average pooling and max pooling operations on this similarity matrix to obtain overall interaction information and capture the strongest matching signal; calculate the attention weight matrix and generate an attention weighted vector based on this matrix to achieve semantic alignment between sentences.
[0097] Step A41: Cosine similarity averaging and max pooling
[0098] Step A411: Calculate the cosine similarity for each pair of time steps (i,j):
[0099] (15)
[0100] In the formula: Let be the cosine similarity between position i in sentence P and position j in sentence Q.
[0101] Step A412: Average pooling (averaging over rows / columns) to obtain overall interaction information. For each position i of sentence P, average similarity is applied to Q.
[0102] (16) (17)
[0103] In the formula: Let Q be the average similarity between each position i in sentence P and Q. Let be the average similarity between each position j of sentence Q and Q.
[0104] Step A413: Max pooling (taking the most similar match) can capture the strongest matching signal:
[0105] (18) (19)
[0106] In the formula: Let Q be the maximum similarity between each position i in sentence P and Q. Let be the maximum similarity between each position j of sentence Q and Q.
[0107] Step A42: Attention Weight Matrix (Alignment)
[0108] The attention weight matrix is represented as Based on the attention weight matrix S, the semantic relevance between two sentences is calculated. The goal is to accurately match the relevant semantic information in sentences P and Q. The formula is as follows:
[0109] (20) (twenty one)
[0110] in This is a weighted alignment vector of attention weights, representing the relevance between words in sentence P and each word in sentence Q. The same applies to Q in Equation 21.
[0111] Step A43: Deep Interaction
[0112] To obtain more information, we perform deep interaction between the context representation and the attention vector. We assess the tightness of the connection between two sentences by calculating the difference and element-wise product between the context representation vector and the attention vector, and then concatenate the original vector with the embedding according to the following formula. This operation helps sharpen semantic information and capture semantic relationships.
[0113] (twenty two) (twenty three)
[0114] In the formula: Let P be the multi-channel fused semantic vector at the i-th time step. The multi-channel fused semantic vector of sentence Q at the j-th time step.
[0115] Step A5: Comparison Function G and Time Step Aggregation: At each time step, the same feedforward network G containing linear layers and ReLU activation functions is used for comparison to obtain a comparison vector; the average pooling vector, max pooling vector obtained in Step A4, and the comparison vector obtained in this step are concatenated to obtain the final matching result for each time step of the sentence:
[0116] Step A51: Comparison function G(·): Apply the same feedforward network G (containing linear layers + ReLU activation) to the above concatenated vector at each time step to obtain the comparison vector:
[0117] (twenty four) (25)
[0118] The activation function for G is the ReLU activation function. and These are the comparison vectors, Let G be the output dimension of the neural network.
[0119] Step A52: Concatenate the interaction vectors obtained from average pooling, max pooling, and the deep interaction between the context representation and the attention vector to obtain the final matching result for each time step of the sentence. The formula is as follows:
[0120] (26) (27)
[0121] In the formula: This represents the final matching result for sentence P. The final matching result for sentence Q
[0122] Step A6: Discriminator and Loss Function: The matching result sequence obtained in Step A5 is aggregated into a fixed-length matching vector using a BiLSTM layer; this matching vector is then input into several fully connected layers, and the prediction score is output through the Softmax function; the Sigmoid cross-entropy loss function is used to minimize the cross-entropy between the predicted label and the true label through backpropagation, in order to update and optimize the parameters of the entire network.
[0123] Step A61: Use a BiLSTM layer to aggregate the matching results of the two sequences into a fixed-length matching vector. Apply BiLSTM to the two matching sequences, then concatenate the last timestep vector of the BiLSTM to obtain the final matching vector. Finally, ... After inputting several fully connected layers, the output is the prediction score. :
[0124] (28)
[0125] in, This is the weight matrix. The bias matrix, For predicted scores. Symbols This represents the Softmax function, used to convert the real-valued vector output by the fully connected layer. The mapping is to a probability distribution, and the specific calculation formula is as follows:
[0126] (29)
[0127] in For the number of categories, For the input sample to belong to the first The probability of a class. The Softmax function guarantees that all components of the output vector are non-negative and sum to 1, making it suitable for multi-class classification tasks.
[0128] Step A62: Loss Function: This paper uses the sigmoid cross-entropy loss function. The training objective is to minimize the cross-entropy between the predicted and true labels and obtain the network parameters. The formula can be expressed as:
[0129] (30)
[0130] in For truth labels, To predict probabilities, the entire network minimizes this loss through backpropagation to update network parameters.
[0131] This invention establishes a multi-path semantic interaction mechanism (pooling, attention, and differential multiplication features) by fusing character-level and word-level multi-granular semantic representations, and uses a lightweight neural network structure for semantic aggregation. This effectively solves the problems of insufficient semantic information, inadequate inter-sentence interaction, and excessive model complexity in traditional short text matching models, and significantly improves the accuracy and generalization ability of Chinese semantic matching.
[0132] The foregoing has shown and described the basic principles, main features, and advantages of the present invention. Those skilled in the art should understand that the present invention is not limited to the above embodiments. The embodiments and descriptions in the specification are merely principles of the invention. Various changes and modifications can be made to the invention without departing from its spirit and scope, and all such changes and modifications fall within the scope of the claimed invention. The scope of protection claimed by the appended claims and their equivalents is defined.
Claims
1. A method for intelligent matching of carbon emission factors based on multi-granularity semantic embedding and multi-directional semantic interaction, characterized in that, Includes the following steps: Step A1: Data Input and Input Preprocessing: Systematically preprocess the acquired data to unify the data format and unit expression; Accept Chinese activity data text; use a word segmentation tool to segment words while preserving character-level representation; construct a dictionary and character index table, and generate word sequences and character sequences; Step A2: Word Vector and Character Vector Embedding: The character sequence generated in Step A1 is embedded with character vectors. After representing the sentence as a character vector matrix, features are extracted, and an attention mechanism is added to weight key characters. The word sequence generated in Step A1 is embedded with word vectors, using a model fine-tuned with a semantic similarity dataset from the architectural domain to generate word vectors. The word vectors are concatenated with the character vectors to obtain a sentence vector representation that integrates character-level and word-level semantics. Step A3: Feature Extraction: Input the sentence vector representation obtained in Step A2 into the encoder to capture the contextual dependencies of the text and output the contextual feature sequence; Step A4: Interaction layer fuses interaction information: Based on the context feature sequence obtained in step A3, calculate the cosine similarity matrix between sentences; Average pooling and max pooling operations are performed on the similarity matrix to obtain overall interaction information and capture the strongest matching signal. Calculate the attention weight matrix and generate an attention weighted vector based on this matrix to achieve semantic alignment between sentences; Step A5: Comparison function G and time step aggregation: At each time step, the same feedforward network G containing linear layers and ReLU activation function is used for comparison to obtain a comparison vector; the average pooling vector, max pooling vector obtained in step A4 and the comparison vector obtained in this step are concatenated to obtain the final matching result of the sentence at each time step; Step A6: Discriminator and Loss Function: The matching result sequence obtained in Step A5 is aggregated into a fixed-length matching vector using a BiLSTM layer; after inputting the matching vector into several fully connected layers, the prediction score is output through the Softmax function; the Sigmoid cross-entropy loss function is used to minimize the cross-entropy between the predicted label and the real label through backpropagation, so as to update and optimize the parameters of the entire network.
2. The method according to claim 1, characterized in that, The specific steps of step A1 include: Step A11: Collect activity data from the personnel and machinery table provided in the engineering case, collect carbon emission factor data from government reports, industry standards, academic research and internal enterprise records, and systematically preprocess the acquired data. The preprocessing process includes data cleaning and standardization operations to remove redundant information, correct abnormal or erroneous data, and unify data format and unit expression. Step A12: Accept a pair of Chinese activity data P and Q; Step A13: Use Jieba to segment P and Q into words, while retaining character-level representations to alleviate the problem of semantic loss in short texts; clean up stop words and special symbols, and unify the text format; Step A14: Construct the dictionary and character index table, and generate word sequences and character sequences.
3. The method according to claim 1, characterized in that, Step A2 specifically includes: Step A21: Character vector embedding, representing each character in a sentence of length n as the index position of the character in the dictionary, and then representing the sentence as an n*k character vector matrix, where k is the dimension of each character vector; inputting this matrix into an LSTM to extract features, and adding an attention mechanism to weight key characters to capture character-level features; Step A22: Word vector embedding. The T-BERT-ARCH model, fine-tuned using a semantic similarity dataset in the architecture domain, is used as input for sentence P and sentence Q to obtain the word vector matrices of the two sentences. Step A23: Concatenate the character vector obtained in step A21 with the word vector obtained in step A22 to obtain the final vector representation of sentences P and Q.
4. The method according to claim 1, characterized in that, Step A4 specifically includes: Step A41: Cosine similarity averaging and max pooling. Calculate the cosine similarity for each pair of time steps to form a similarity matrix; perform average pooling and max pooling on this matrix respectively. Step A42: Calculate the attention weight matrix. Calculate the attention weight matrix based on the context feature sequence, and calculate the weighted sum of the attention weights to obtain the attention weight vector. Step A43: Deep interaction. By calculating the difference and element-wise product between the context feature sequence and the attention weighted vector, the original vector is concatenated with the difference and element-wise product features to obtain the vector after deep interaction.
5. The method according to claim 4, characterized in that, Step A5 specifically includes: Step A51: Comparison function G(·), the deep interaction vector obtained in step A43 is compared at each time step using the same feedforward network G, which contains linear layers and ReLU activation function, to obtain the comparison vector; Step A52: Time step aggregation. The average pooling vector, max pooling vector, and comparison vector obtained in step A41 are concatenated to form the final matching result for each time step of the sentence.
6. The method according to claim 1, characterized in that, Step A6 specifically includes: Step A61: Use a BiLSTM layer to aggregate the matching results of the two sequences into a fixed-length matching vector; input the matching vector into several fully connected layers, and output the prediction score through the Softmax function; Step A62: Use the Sigmoid cross-entropy loss function to minimize the cross-entropy between the predicted and true labels through backpropagation to update the network parameters.
7. A carbon emission factor intelligent matching system based on multi-granularity semantic embedding and multi-directional semantic interaction, used to implement the method described in any one of claims 1 to 6, characterized in that, The system includes: A data input and preprocessing module, used to perform step A1 as described in claim 1; A word vector and character vector embedding module is used to perform step A2 as described in claim 1; The feature extraction module is used to perform step A3 as described in claim 1; The interaction layer integrates the interaction information module, which is used to perform step A4 as described in claim 1; A comparison and time step aggregation module is used to perform step A5 as described in claim 1; The discrimination and output module is used to perform step A6 as described in claim 1.
8. A non-volatile storage medium, characterized in that, The non-volatile storage medium includes a stored program, wherein the program, when executed, controls the device where the non-volatile storage medium is located to perform the method described in any one of claims 1 to 6.
9. A terminal device, characterized in that, The terminal device includes: a processor, a memory, a communication interface, and a bus; the processor, the memory, and the communication interface are connected through the bus and communicate with each other; the memory stores executable program code; the processor reads the executable program code stored in the memory to run a program corresponding to the executable program code, so as to perform the method as described in any one of claims 1-6 above.
Citation Information
Patent Citations
A text implication relation recognition method based on multi-granularity information fusion
CN109299262A
Chinese sentence semantic intelligent matching method and device based on multi-granularity fusion model
CN111310438A