A Method and System for Cross-Language Text Classification and Processing Based on Deep Transfer Learning

By using a multi-level semantic transfer network and a multi-task learning model, the problems of insufficient feature transfer and inadequate model generalization ability in cross-language text classification are solved, achieving more accurate feature alignment and higher classification accuracy.

CN121478978BActive Publication Date: 2026-04-03SHANGHAI XIRUAN TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2026-01-09
Publication Date
2026-04-03

AI Technical Summary

Technical Problem

Existing cross-language text classification methods ignore the heterogeneity and similarity of different languages ​​at multiple levels, resulting in insufficient feature transfer, limited model generalization ability, and a lack of effective target language pseudo-label iterative optimization mechanism, making it impossible to make full use of unlabeled data for adaptive model adjustment.

Method used

Multi-level features of the source and target languages ​​are extracted through a multi-level semantic transfer network. The optimal alignment path is determined based on the feature dimension ratio for non-linear mapping alignment. Category semantics are propagated through a semantic bridging function. The pseudo-label confidence distribution is iteratively updated by combining a multi-task learning model to achieve cross-language text classification.

Benefits of technology

It achieves comprehensive feature capture from lexical, syntactic and semantic aspects, solves the feature dimension mismatch problem, improves the accuracy of cross-language transfer and classification accuracy, and reduces the dependence on target language labeled data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121478978B_ABST
    Figure CN121478978B_ABST
Patent Text Reader

Abstract

This invention provides a method and system for cross-lingual text classification and processing based on deep transfer learning, belonging to the field of text processing technology. It includes extracting feature representations of source and target language texts at different linguistic levels through a multi-level semantic transfer network, determining the optimal alignment path for nonlinear mapping alignment to obtain fused features, using a semantic bridging function to propagate category semantics and iteratively update the pseudo-label confidence distribution of the target language text, and combining a multi-task learning model to complete the classification. This invention effectively solves the text classification problem in cross-lingual scenarios and improves the accuracy and efficiency of low-resource language text processing.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of text processing technology, and in particular to a method and system for cross-language text classification and processing based on deep transfer learning. Background Technology

[0002] With the acceleration of global information exchange, cross-lingual text classification and processing technology has become increasingly important. This technology aims to apply classification models trained in one language to text classification tasks in other languages, addressing the problem of insufficient labeled data in the target language. Traditional cross-lingual text classification methods mainly rely on techniques such as machine translation, multilingual word vectors, or parallel corpora, achieving knowledge transfer by establishing mapping relationships between different languages. In recent years, the rapid development of deep learning technology has provided new solutions for cross-lingual text classification; methods such as pre-trained multilingual models, transfer learning, and adversarial training have been widely applied in this field.

[0003] Existing methods typically focus only on feature representations at a single linguistic level, such as lexical or syntactic levels, ignoring the heterogeneity and similarities that exist between different languages ​​at multiple levels. This results in insufficient feature transfer and limited model generalization ability.

[0004] Traditional feature alignment methods often employ linear transformations or simple vector space mappings, which cannot effectively capture the complex nonlinear semantic relationships between different languages. In particular, when there are significant language differences, the alignment effect is poor, affecting classification accuracy.

[0005] Most existing technologies lack effective pseudo-label iterative optimization mechanisms for target languages, and cannot make full use of unlabeled data in the target language for adaptive model adjustment, resulting in insufficient understanding and classification capabilities of the unique expressions of the target language in practical applications. Summary of the Invention

[0006] This invention provides a method and system for cross-language text classification and processing based on deep transfer learning, which can solve the problems in the prior art.

[0007] A first aspect of this invention provides a cross-lingual text classification and processing method based on deep transfer learning, comprising:

[0008] Obtain target language text data and source language annotated text data to be classified; extract feature representations of the source language annotated text data and the target language text data at different linguistic levels through a multi-level semantic transfer network to obtain a source language multi-level feature set and a target language multi-level feature set;

[0009] The optimal alignment path is determined based on the ratio of the number of feature dimensions in the source language multi-level feature set to the number of feature dimensions in the target language multi-level feature set. Then, based on the optimal alignment path, each level of feature in the source language multi-level feature set is non-linearly mapped and aligned with the corresponding level of feature in the target language multi-level feature set to obtain the fused features after level alignment.

[0010] The category semantics of the source language labeled text data are propagated to the feature space of the target language text data along a semantic bridging function. The pseudo-label confidence distribution of the target language text data is iteratively updated, and the classification result of the target language text data is determined by combining it with a pre-trained multi-task learning model. The multi-task learning model is trained using the fused features.

[0011] The target language text data is classified according to the classification results.

[0012] Feature representations of the source language annotated text data and the target language text data at different linguistic levels are extracted using a multi-level semantic transfer network, resulting in a multi-level feature set for the source language and a multi-level feature set for the target language, including:

[0013] Lexical segmentation is performed on the source language annotated text data and the target language text data to obtain source language lexical unit sequences and target language lexical unit sequences;

[0014] The source language lexical unit sequence and the target language lexical unit sequence are vectorized and encoded by the lexical-level encoding layer in the multi-level semantic transfer network to obtain the source language lexical-level feature matrix and the target language lexical-level feature matrix.

[0015] Based on the parsing of the syntactic structure information of the source language lexical unit sequence and the target language lexical unit sequence, the syntactic structure information corresponding to the source language lexical-level feature matrix and the target language lexical-level feature matrix are fused and encoded through the syntactic-level encoding layer in the multi-level semantic transfer network to obtain the source language syntactic-level feature matrix and the target language syntactic-level feature matrix.

[0016] By performing context association analysis on the source language syntactic feature matrix and the target language syntactic feature matrix through the discourse-level coding layer in the multi-level semantic transfer network, the multi-level feature set of the source language and the multi-level feature set of the target language are obtained.

[0017] The optimal alignment path is determined based on the ratio of the number of feature dimensions in the source language multi-level feature set to the number of feature dimensions in the target language multi-level feature set. Then, according to the optimal alignment path, each level of feature in the source language multi-level feature set is non-linearly mapped and aligned with the corresponding level of feature in the target language multi-level feature set, resulting in the following hierarchically aligned fused features:

[0018] Determine the dimension ratio between the number of first feature dimensions of each level feature in the source language multi-level feature set and the number of second feature dimensions of the corresponding level feature in the target language multi-level feature set. When the dimension ratio is greater than a unit value, select the first path with a single or double hop count as the optimal alignment path. When the dimension ratio is less than a unit value, select the second path with a three or more hop count as the optimal alignment path.

[0019] A hop-by-hop nonlinear transformation is performed on each level feature in the source language multi-level feature set along the optimal alignment path. The nonlinear intensity of the feature transformation is adjusted according to the current path hop count for each nonlinear transformation operation. Based on the nonlinear intensity, the source language level features at the path start point are gradually transformed into source language path transformation features at the path end point.

[0020] A hop-by-hop nonlinear transformation is performed on the corresponding hierarchical features in the multi-level feature set of the target language along the reverse optimal alignment path, gradually transforming the target language hierarchical features at the starting point of the path into the target language path transformation features at the ending point of the path.

[0021] The source language path transformation features and the target language path transformation features are fused to obtain the fused features.

[0022] Each nonlinear transformation operation adjusts the nonlinear intensity of the feature transformation based on the current path hop count. Based on the nonlinear intensity, the source language hierarchical features at the path starting point are progressively transformed into source language path transformation features at the path ending point, including:

[0023] Initialize a path traversal counter, which records the number of path hops completed and the number of path hops to be traversed. Then, visit each intermediate node in sequence according to the node traversal sequence of the optimal alignment path.

[0024] The nonlinear intensity adjustment coefficient is calculated based on the number of path hops currently completed in the path traversal counter and the total number of path hops of the optimal alignment path. The nonlinear intensity adjustment coefficient is equal to the ratio of the number of path hops currently completed to the total number of path hops.

[0025] Extract the node embedding vector of the current intermediate node, perform element-wise multiplication of the node embedding vector with the nonlinear intensity adjustment coefficient to generate an intensity-adjusted node embedding vector, and construct a node transformation parameter matrix based on the intensity-adjusted node embedding vector;

[0026] The node transformation parameter matrix is ​​used to perform matrix multiplication transformation on the source language hierarchical features to obtain the output features of the current intermediate node;

[0027] The output feature of the current intermediate node is used as the input feature of the next intermediate node. The number of completed path hops and the number of remaining path hops to be traversed in the path traversal counter are updated. When the number of remaining path hops to be traversed in the path traversal counter is zero, the output feature of the last intermediate node is used as the source language path transformation feature.

[0028] The category semantics of the source language labeled text data are propagated to the feature space of the target language text data along a semantic bridging function. The pseudo-label confidence distribution of the target language text data is iteratively updated, and the classification result of the target language text data is determined by combining it with a pre-trained multi-task learning model, including:

[0029] Annotated samples of each category are extracted from the source language annotated text data. Cluster centers are calculated for the annotated samples of each category to obtain the source language category center feature vectors.

[0030] Using the semantic bridging function, a spatial transformation operation is performed on the source language category center feature vector to map it to the target language feature space, thereby obtaining the target language category reference feature vector;

[0031] Calculate the feature similarity value between the features corresponding to the target language text data and the target language category reference feature vector, and normalize the feature similarity value to generate a pseudo-label confidence distribution vector;

[0032] In each iteration, the pseudo-label confidence distribution vector and the fused features are input into the multi-task learning model to obtain the category prediction probability distribution vector. The category with the highest probability value in the category prediction probability distribution vector is taken as the classification result of the target language text data.

[0033] The method also includes training a multi-task learning model:

[0034] Source language samples and target language samples are constructed by sampling from the source language annotated text data and the target language text data. The source language samples and target language samples are input into the multi-task learning model to be trained to obtain batch feature representation and batch classification prediction results.

[0035] For source language samples, the source language classification loss value is calculated using the true category label. When the source language classification loss value is less than a preset loss threshold, the first feature corresponding to the source language sample is stored in the feature memory queue of the corresponding category. When the source language classification loss value is greater than the preset loss threshold, the second feature corresponding to the target language sample is stored in the feature memory queue of the corresponding category, thus obtaining a category feature memory library.

[0036] Historical feature representations are sampled and extracted from the category feature memory queues of the category feature memory bank. Feature aggregation is performed on the historical feature representations of the same category to obtain the category historical feature prototype vector. The feature consistency metric between the batch feature representation and the category historical feature prototype vector is calculated as the memory distillation loss value.

[0037] The similarity distribution of the batch feature representation is calculated using the prototype vector of the category historical features. The similarity distribution is then normalized and weighted with the batch classification prediction result to obtain the target language memory-enhanced pseudo-label loss value.

[0038] The memory-enhanced pseudo-label loss value of the target language and the memory distillation loss value are weighted and summed to obtain the memory-enhanced comprehensive loss value. The parameters of the multi-task learning model are updated according to the memory-enhanced comprehensive loss value. When the memory queue of each category reaches the capacity limit, the earliest feature is removed according to the first-in-first-out principle. When the memory-enhanced comprehensive loss value is less than the preset training termination threshold, the parameters of the current multi-task learning model are saved as the model parameters after training is completed.

[0039] A second aspect of the present invention provides a cross-language text classification and processing system based on deep transfer learning, comprising:

[0040] The first module is used to acquire target language text data to be classified and source language annotated text data; and to extract feature representations of the source language annotated text data and the target language text data at different linguistic levels through a multi-level semantic transfer network, thereby obtaining a multi-level feature set of the source language and a multi-level feature set of the target language.

[0041] The second module is used to determine the optimal alignment path based on the ratio of the number of feature dimensions in the source language multi-level feature set to the number of feature dimensions in the target language multi-level feature set, and to perform non-linear mapping alignment between each level feature in the source language multi-level feature set and the corresponding level feature in the target language multi-level feature set according to the optimal alignment path, thereby obtaining the fused features after level alignment;

[0042] The third module is used to propagate the category semantics of the source language labeled text data to the feature space of the target language text data along the semantic bridging function, iteratively update the pseudo-label confidence distribution of the target language text data, and determine the classification result of the target language text data by combining it with a pre-trained multi-task learning model, wherein the multi-task learning model is trained through the fused features;

[0043] The fourth module is used to perform classification processing on the target language text data based on the classification results.

[0044] A third aspect of the present invention provides an electronic device, comprising:

[0045] processor;

[0046] Memory used to store processor-executable instructions;

[0047] The processor is configured to invoke instructions stored in the memory to execute the aforementioned method.

[0048] A fourth aspect of the present invention provides a computer-readable storage medium having stored thereon computer program instructions that, when executed by a processor, implement the aforementioned method.

[0049] The beneficial effects of this application are as follows:

[0050] By extracting feature representations at different linguistic levels through a multi-level semantic transfer network, comprehensive feature capture from lexical, syntactic to semantic levels is achieved. Compared with single-level feature extraction methods, it can more comprehensively preserve text information and improve the accuracy of cross-language transfer.

[0051] The optimal alignment path is determined by the ratio of the number of feature dimensions in the multi-level feature sets of the source and target languages, and non-linear mapping alignment is performed. This solves the problem of mismatch between feature dimensions of different languages ​​in traditional cross-language feature alignment, and achieves more accurate feature alignment.

[0052] An innovative semantic bridging function is designed to propagate the category semantics of the source language annotated text data to the feature space of the target language text data. By iteratively updating the pseudo-label confidence distribution of the target language text data, the problem of insufficient label information transfer in cross-language text classification is effectively alleviated.

[0053] By integrating multi-task learning models with hierarchically aligned fusion features, the model's generalization ability is taken into account while maintaining the accuracy of feature transfer. Compared with existing technologies, it can significantly improve the classification accuracy of target language text and reduce the dependence on target language labeled data. Attached Figure Description

[0054] Figure 1 This is a flowchart illustrating the cross-lingual text classification and processing method based on deep transfer learning, as described in an embodiment of the present invention.

[0055] Figure 2 This is a flowchart of the source language-level path linearization processing procedure in an embodiment of the present invention. Detailed Implementation

[0056] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0057] The technical solution of the present invention will be described in detail below with reference to specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments.

[0058] Figure 1 This is a flowchart illustrating the cross-lingual text classification and processing method based on deep transfer learning, as described in an embodiment of the present invention. Figure 1 As shown, the method includes:

[0059] Obtain target language text data and source language annotated text data to be classified; extract feature representations of the source language annotated text data and the target language text data at different linguistic levels through a multi-level semantic transfer network to obtain a source language multi-level feature set and a target language multi-level feature set;

[0060] The optimal alignment path is determined based on the ratio of the number of feature dimensions in the source language multi-level feature set to the number of feature dimensions in the target language multi-level feature set. Then, based on the optimal alignment path, each level of feature in the source language multi-level feature set is non-linearly mapped and aligned with the corresponding level of feature in the target language multi-level feature set to obtain the fused features after level alignment.

[0061] The category semantics of the source language labeled text data are propagated to the feature space of the target language text data along a semantic bridging function. The pseudo-label confidence distribution of the target language text data is iteratively updated, and the classification result of the target language text data is determined by combining it with a pre-trained multi-task learning model. The multi-task learning model is trained using the fused features.

[0062] The target language text data is classified according to the classification results.

[0063] In one optional implementation, feature representations of the source language annotated text data and the target language text data at different linguistic levels are extracted using a multi-level semantic transfer network, resulting in a source language multi-level feature set and a target language multi-level feature set, including:

[0064] Lexical segmentation is performed on the source language annotated text data and the target language text data to obtain source language lexical unit sequences and target language lexical unit sequences;

[0065] The source language lexical unit sequence and the target language lexical unit sequence are vectorized and encoded by the lexical-level encoding layer in the multi-level semantic transfer network to obtain the source language lexical-level feature matrix and the target language lexical-level feature matrix.

[0066] Based on the parsing of the syntactic structure information of the source language lexical unit sequence and the target language lexical unit sequence, the syntactic structure information corresponding to the source language lexical-level feature matrix and the target language lexical-level feature matrix are fused and encoded through the syntactic-level encoding layer in the multi-level semantic transfer network to obtain the source language syntactic-level feature matrix and the target language syntactic-level feature matrix.

[0067] By performing context association analysis on the source language syntactic feature matrix and the target language syntactic feature matrix through the discourse-level coding layer in the multi-level semantic transfer network, the multi-level feature set of the source language and the multi-level feature set of the target language are obtained.

[0068] The multi-level semantic transfer network employs a hierarchical architecture, using three dedicated encoding layers to handle feature extraction tasks at the lexical, syntactic, and discourse levels, respectively. The core structure of the network includes a lexical encoding layer, a syntactic encoding layer, and a discourse encoding layer, organized according to a linguistic hierarchy, achieving progressive feature abstraction from basic lexical units to high-level semantic understanding. The network uses an end-to-end training strategy, supporting parallel processing of the source and target languages, and handles cross-lingual feature extraction tasks through a combination of parameter sharing and independent encoding.

[0069] The overall architecture of the multi-level semantic transfer network is based on an encoder-encoder model, which differs from the traditional encoder-decoder structure. The network contains two parallel encoding branches, processing the source and target language inputs respectively. Both branches use the same network structure but their parameters are trained independently. The network has approximately 180 million trainable parameters and supports operation on computing devices with 16GB of GPU memory. The network input interface supports batch processing, with a default batch size of 32, which can be adjusted from 8 to 128 depending on memory capacity. The network employs mixed-precision training, using 16-bit floating-point numbers for forward propagation and gradient calculation, and 32-bit floating-point numbers for storing key parameters, improving training efficiency while ensuring numerical stability.

[0070] The lexical-level encoding layer is built on the Transformer architecture, containing a multi-head self-attention mechanism and a feedforward neural network sublayer. This layer maintains two independent word embedding lookup tables, corresponding to the source language and target language dictionaries, respectively. The source language word embedding matrix has a dimension of 50000×512, and the target language word embedding matrix has the same dimension. The embedding vectors are obtained by pre-training on a large-scale corpus after random initialization. The lexical-level encoding layer contains 6 encoding blocks, each containing a multi-head self-attention sublayer and a feedforward network sublayer. The multi-head self-attention mechanism uses 8 attention heads, each with a dimension of 64, keeping the total attention dimension constant at 512. The feedforward network sublayer contains two linear transformation layers, with the intermediate hidden layer having a dimension of 2048, and the GELU activation function is used. Each sublayer is followed by a residual connection and a layer normalization operation. The epsilon parameter of the layer normalization is set to 1e-6 to ensure numerical stability.

[0071] The syntactic-level encoding layer is implemented based on a graph neural network architecture, specifically handling the fusion encoding task of syntactic structure information. This layer receives a lexical-level feature matrix and a syntactic dependency graph as input, and aggregates node features and edge information through graph convolution operations. The syntactic-level encoding layer contains a syntactic relation embedding matrix with a dimension of 30×512, corresponding to 30 common syntactic relation types. The graph convolutional network uses gated graph convolutional units, each containing an update gate, a reset gate, and a candidate state calculation module. The update gate controls the degree of integration of new information, the reset gate determines the proportion of historical information retained, and the candidate state combines neighbor node features and edge relation information to generate a new node representation. The number of graph convolutional layers is set to 3, with batch normalization and Dropout regularization following each graph convolution operation, and the Dropout ratio is set to 0.1. The syntactic-level encoding layer supports variable-length graph input, handling syntactic structures of different lengths through graph padding and masking mechanisms.

[0072] The discourse-level encoding layer implements long-distance contextual association modeling, employing an enhanced Transformer architecture. This layer introduces two extended modules—position-aware attention and syntactic-aware attention—on top of the standard self-attention mechanism. Position-aware attention captures distance information between words through relative position encoding, supporting a maximum distance of 128 positions; positions exceeding this range are truncated. Syntactic-aware attention utilizes syntactic relation information output from the syntactic-level encoding layer to adjust the attention weight distribution, enhancing the association strength of syntactically related word pairs. The discourse-level encoding layer contains 12 encoding blocks, each with a structure similar to the lexical-level encoding layer but with a larger parameter scale. The multi-head self-attention mechanism uses 16 attention heads, each with a dimension of 32, and the feedforward network hidden layer dimension is expanded to 4096. This layer supports a maximum sequence length of 1024 tokens; when the length is exceeded, a sliding window strategy is used.

[0073] The training process of the multi-level semantic transfer network adopts a multi-task learning framework, simultaneously optimizing representation learning objectives at the lexical, syntactic, and discourse levels. The lexical objective includes a masked language modeling task, randomly masking 15% of the input vocabulary, and training the network to predict the masked words. The syntactic objective includes a syntactic relation prediction task, training the network to predict the syntactic relation type between word pairs based on contextual features. The discourse objective includes a next-sentence prediction task, training the network to determine whether two sentences appear adjacently in the original text. The multi-task loss function uses a weighted summation method, with a weight of 0.4 for the lexical task, 0.3 for the syntactic task, and 0.3 for the discourse task.

[0074] The network was trained using the Adam optimizer with a learning rate of 2e-5, a beta1 parameter of 0.9, a beta2 parameter of 0.999, and a weight decay coefficient of 0.01. A learning rate warm-up strategy was employed: the learning rate increased linearly from 0 to the set value for the first 10% of training steps, followed by cosine decay scheduling for subsequent steps. The gradient clipping threshold was set to 1.0 to prevent gradient explosion. A random sampling strategy was used for training data, randomly shuffling the sample order within each epoch to avoid model dependency on data order.

[0075] The inference process of the multi-level semantic transfer network supports incremental computation and caching optimization. Lexical-level encoding results are cached in memory to avoid repeatedly computing the embedding representations of the same word sequences. Syntactic-level encoding employs a graph decomposition strategy, breaking down a large graph into multiple subgraphs for parallel processing, improving computational efficiency. Discourse-level encoding supports attention matrix sparsity, calculating only positions where attention weights exceed a threshold of 0.01, reducing computational overhead. The inference batch size can be scaled up to 256, leveraging GPU parallel computing capabilities to improve throughput.

[0076] In a specific implementation case, a multi-level semantic transfer network processes the source language text "Deep learning models perform excellently in natural language processing tasks" and the target language text "Deep learning models perform excellently in natural language processing tasks". The lexical segmenter divides the source language text into 10 lexical units and the target language text into 9 lexical units.

[0077] The lexical-level encoding layer transforms the source language sequence into a 10×512-dimensional feature matrix. The word index for "deep learning" is 15678, and the embedding vector obtained by looking up the embedding matrix is ​​[0.234, -0.567, 0.123, 0.789, ...]. The index for "learning" is 8924, and the embedding vector is [-0.345, 0.678, -0.234, 0.456, ...]. After processing through 6 layers of encoding blocks, the lexical features are integrated with contextual information, "deep learning" forms a composite concept representation, and the technical terminology features of "natural language processing" are enhanced.

[0078] The syntactic-level encoding layer receives lexical-level features and a syntactic dependency graph. Syntactic relations include a noun-head relation where "depth" modifies "learning," "model" as a nominal component of "learning," and "performance" as the sentence predicate. The graph convolutional network processes these features through three layers, aggregating syntactic neighbor information. The subject features of "deep learning model" are enhanced through syntactic relations, and the verb-object structure features of "excellent performance" are made more prominent. The output syntactic-level feature matrix maintains a dimension of 10×512 but contains rich syntactic and semantic information.

[0079] The discourse-level coding layer analyzes long-distance dependencies using 16-head self-attention. The attention mechanism reveals the domain association between "deep learning" and "natural language processing," the subject-predicate relationship between "model" and "performance," and the impact of "excellence" on the sentiment polarity of the entire sentence. Position-aware attention captures the relative positional information between words, while syntax-aware attention adjusts the attention distribution using syntactic relations. After processing through 12 layers of coding blocks, a discourse-level feature matrix with dimensions of 10×512 is generated.

[0080] The target language branch processes English text in parallel, generating corresponding lexical, syntactic, and discourse-level feature matrices, each with a dimension of 9×512. The network outputs a multi-level feature set for the source language containing three feature matrices, and a multi-level feature set for the target language containing the corresponding three English feature matrices. These feature sets provide a hierarchical language representation foundation for subsequent cross-language alignment, semantic transfer, and translation generation tasks, demonstrating a complete semantic modeling capability from vocabulary to discourse.

[0081] In one optional implementation, an optimal alignment path is determined based on the ratio of the number of feature dimensions in the source language multi-level feature set to the number of feature dimensions in the target language multi-level feature set. Then, according to the optimal alignment path, each level of feature in the source language multi-level feature set is non-linearly mapped and aligned with the corresponding level of feature in the target language multi-level feature set, resulting in the following hierarchically aligned fused features:

[0082] Determine the dimension ratio between the number of first feature dimensions of each level feature in the source language multi-level feature set and the number of second feature dimensions of the corresponding level feature in the target language multi-level feature set. When the dimension ratio is greater than a unit value, select the first path with a single or double hop count as the optimal alignment path. When the dimension ratio is less than a unit value, select the second path with a three or more hop count as the optimal alignment path.

[0083] A hop-by-hop nonlinear transformation is performed on each level feature in the source language multi-level feature set along the optimal alignment path. The nonlinear intensity of the feature transformation is adjusted according to the current path hop count for each nonlinear transformation operation. Based on the nonlinear intensity, the source language level features at the path start point are gradually transformed into source language path transformation features at the path end point.

[0084] A hop-by-hop nonlinear transformation is performed on the corresponding hierarchical features in the multi-level feature set of the target language along the reverse optimal alignment path, gradually transforming the target language hierarchical features at the starting point of the path into the target language path transformation features at the ending point of the path.

[0085] The source language path transformation features and the target language path transformation features are fused to obtain the fused features.

[0086] The dimensionality ratio calculator receives multi-level feature sets from both the source and target languages ​​and analyzes the dimensionality relationships between features at each level. The calculator performs dimensionality statistics on lexical, syntactic, and discourse-level features to obtain the number of first-feature dimensions in the source language and the number of second-feature dimensions in the target language. Dimensionality statistics are achieved through matrix shape analysis, extracting the number of rows and columns of the feature matrix. The number of rows represents the sequence length, and the number of columns represents the number of feature dimensions. The calculator maintains a dimensionality statistics cache to avoid repeatedly calculating the dimensionality information of the same feature matrix. The cache capacity is set to 1000 records, and a least recently used eviction policy is employed.

[0087] The dimensionality ratio is obtained through division, by dividing the number of dimensions of the first feature by the number of dimensions of the second feature, with the result rounded to four decimal places. The unit value in the dimensionality ratio determination refers to 1.0, serving as a baseline threshold to distinguish between dimensional expansion and dimensional compression scenarios. When the number of feature dimensions in the source language is equal to the number of feature dimensions in the target language, the dimensionality ratio is exactly equal to the unit value of 1.0, indicating a perfect dimensionality match between the two language features. Batch processing is supported, allowing simultaneous analysis of dimensionality ratios for multiple feature pairs. When the number of dimensions of the second feature is zero, the dimensionality ratio is set to a predefined maximum value of 10.0 to avoid division-by-zero anomalies. The valid range for the dimensionality ratio is 0.1 to 10.0; outliers outside this range are truncated.

[0088] The optimal alignment path selector performs path decision operations based on a comparison between the dimensionality ratio and the unit value of 1.0. The path hop count represents the number of layers or steps of nonlinear transformation performed during feature alignment, determining the depth and complexity of the transformation network. A single-hop path contains one nonlinear transformation layer, directly mapping the source features to the target dimensionality space, suitable for simple alignment tasks with a dimensionality difference within 20%. A double-hop path contains two cascaded nonlinear transformation layers, using an intermediate layer as a transition state to perform progressive dimensionality adjustment, suitable for medium-complexity alignment tasks with a dimensionality difference ranging from 20% to 200%. Paths with three or more hops contain three or more nonlinear transformation layers, performing partial dimensionality adjustment at each hop step, handling complex alignment tasks with a dimensionality difference exceeding 200% through multi-step progressive transformation.

[0089] The path selection logic compares the dimensionality ratio with a unit value of 1.0. When the dimensionality ratio is greater than the unit value, the number of source language feature dimensions exceeds the number of target language feature dimensions, requiring dimensionality compression transformation, and the selector activates the first path branch. The first path branch prioritizes low-complexity path configurations with single or double hops. Single-hop paths are suitable for dimensionality ratios between 1.0 and 1.2, while double-hop paths are suitable for dimensionality ratios between 1.2 and 3.0. When the dimensionality ratio is less than the unit value, the number of source language feature dimensions is less than the number of target language feature dimensions, requiring dimensionality expansion transformation, and the selector activates the second path branch. The second path branch selects high-complexity path configurations with three or more hops. Three-hop paths are suitable for dimensionality ratios between 0.5 and 1.0, four-hop paths are suitable for dimensionality ratios between 0.3 and 0.5, and paths with five or more hops are suitable for extreme compression scenarios with dimensionality ratios less than 0.3.

[0090] The path hop count determiner analyzes the numerical characteristics of the dimension ratio to calculate the optimal hop count configuration parameters. The hop count calculation employs a logarithmic transformation strategy, determining the transformation complexity requirement through the absolute value of the natural logarithm of the dimension ratio. The logarithmic base is set to the natural constant e, and the absolute value of the logarithm determines the lower bound of the path hop count. The hop count adjustment factor is set according to the feature type: 1.2 for lexical features, 1.0 for syntactic features, and 0.8 for discourse features. The final hop count is obtained by multiplying the logarithmic result by the adjustment factor and rounding up. The hop count range is strictly limited to 1 to 8; hop counts exceeding this range are truncated using boundary value truncation.

[0091] The source language path transformer performs hop-by-hop nonlinear transformations on multi-level features of the source language along the optimal alignment path. The transformer constructs a corresponding number of nonlinear transformation layers based on the determined path hop count. Each layer contains a linear transformation matrix, a bias vector, and an activation function component. The parameters of the linear transformation matrix are randomly initialized using a normal distribution, with a mean of 0 and a standard deviation set to the reciprocal of the square root of the input dimension. The bias vector is initialized to a zero vector with the same dimension as the current layer's output. The activation function is selected based on the current path hop count and layer position: ReLU activation is used for single-hop paths, GELU activation for two-hop paths, and Swish activation is used for paths with three or more hops to ensure gradient flow stability.

[0092] The nonlinear intensity adjuster dynamically adjusts the nonlinearity parameter of each hop transformation based on the current path hop count. The nonlinear intensity coefficient for a single-hop path is set to 0.8, corresponding to a relatively mild transformation amplitude. The coefficient for a two-hop path is 1.0, representing the standard transformation intensity. The coefficient for a three-hop path is 1.2, and for paths with four or more hops, the coefficient increases by 0.1 until it reaches a maximum value of 2.0. Intensity adjustment is achieved through the slope parameter of the activation function and the weight scaling factor of the transformation matrix. Higher nonlinear intensity enhances the expressive power and dimensionality adaptability of the feature transformation. The hop-by-hop transformation process maintains all intermediate feature states. After each hop transformation, a new feature representation is generated for the next hop input. The transformation states are stored using 32-bit floating-point tensors, supporting the construction of a computational graph for gradient backpropagation.

[0093] The target language path transformer performs hop-by-hop transformation of target language features along the reverse optimal alignment path. The hop count configuration of the reverse path is consistent with that of the forward path, but the transformation direction shifts from the original dimension of the target language to the matching dimension of the source language path transformation features. The reverse transformer adopts the same network structure design as the forward transformer, containing the same number of transformation layers and activation function configurations, but the parameters are obtained through independent training to adapt to the special requirements of the reverse transformation. The nonlinear intensity adjustment strategy of the reverse transformation remains symmetrical with that of the forward transformation, ensuring the numerical stability and convergence performance of the bidirectional transformation process.

[0094] The fusion feature generator receives dimension-aligned source language path transformation features and target language path transformation features, and performs multi-strategy fusion operations. The fusion generator implements three basic fusion strategies: weighted averaging, element-wise multiplication, and feature concatenation. Weighted averaging fusion linearly combines two features using learnable weight parameters. The initial weight parameter value is set to 0.5 to achieve equal-weight fusion, and the weight distribution is adaptively adjusted during training. Element-wise multiplication fusion captures non-linear interaction information between features through element-wise multiplication, and the product result is selectively activated using a sigmoid gating mechanism. Feature concatenation fusion concatenates two features along their last dimension, generating a fusion representation with doubled dimensions. After concatenation, a linear projection layer compresses the feature dimensions back to their original size.

[0095] In one optional implementation, each nonlinear transformation operation adjusts the nonlinear intensity of the feature transformation based on the current path hop count. The transformation of the source language hierarchical features at the path start point into the source language path transformation features at the path end point based on the nonlinear intensity includes:

[0096] Initialize a path traversal counter, which records the number of path hops completed and the number of path hops to be traversed. Then, visit each intermediate node in sequence according to the node traversal sequence of the optimal alignment path.

[0097] The nonlinear intensity adjustment coefficient is calculated based on the number of path hops currently completed in the path traversal counter and the total number of path hops of the optimal alignment path. The nonlinear intensity adjustment coefficient is equal to the ratio of the number of path hops currently completed to the total number of path hops.

[0098] Extract the node embedding vector of the current intermediate node, perform element-wise multiplication of the node embedding vector with the nonlinear intensity adjustment coefficient to generate an intensity-adjusted node embedding vector, and construct a node transformation parameter matrix based on the intensity-adjusted node embedding vector;

[0099] The node transformation parameter matrix is ​​used to perform matrix multiplication transformation on the source language hierarchical features to obtain the output features of the current intermediate node;

[0100] The output feature of the current intermediate node is used as the input feature of the next intermediate node. The number of completed path hops and the number of remaining path hops to be traversed in the path traversal counter are updated. When the number of remaining path hops to be traversed in the path traversal counter is zero, the output feature of the last intermediate node is used as the source language path transformation feature.

[0101] like Figure 2 As shown, the method includes:

[0102] The path traversal counter, as the core control module, maintains two key state variables: the current number of completed path hops (current_hops) and the remaining number of path hops to be traversed (remaining_hops). During initialization, current_hops is set to 0, and remaining_hops is set to the total length of the optimally aligned path. The total path hop count is obtained by counting the number of adjacent node pairs in the optimally aligned path's node sequence; for example, a path with 5 nodes has a total hop count of 4. The counter uses a 32-bit integer for storage and supports a maximum path length of 1024 nodes. When the input path exceeds this limit, it is automatically truncated to the maximum length.

[0103] The node traversal sequence access controller visits each intermediate node sequentially according to a predefined optimal alignment path node sequence. The node sequence is stored as an ordered array, where each array element is a unique node identifier, encoded as a string or integer. The access controller maintains the current access position index `current_index`, initially set to 1, indicating that the starting node is skipped and the first intermediate node is accessed directly. The index is incremented by 1 after each node visit, and when the index reaches the sequence length minus 1, it indicates that all intermediate nodes have been traversed. Node access employs a strict sequential traversal strategy, disallowing skipped or reverse accesses to ensure path integrity and transformation continuity.

[0104] The nonlinear intensity adjustment coefficient calculation module dynamically calculates the transformation intensity based on the path traversal progress. The adjustment coefficient is equal to the ratio of the number of completed path hops to the total number of path hops, calculated as current_hops divided by total_hops. The result is a floating-point number, strictly limited to the range of 0.0 to 1.0. When current_hops is 0, the adjustment coefficient is 0.0, indicating the minimum transformation intensity; when current_hops equals total_hops, the adjustment coefficient is 1.0, indicating the maximum transformation intensity. Intermediate values ​​are calculated using linear interpolation to ensure a smooth increase in transformation intensity with path progress. Division operations use 64-bit double-precision floating-point numbers to avoid cumulative errors caused by precision loss.

[0105] The node embedding vector extractor obtains the pre-trained embedding representation from the currently visited intermediate node. The node embedding vector dimension is set to 768 dimensions by default, and supports a configurable range of 128 to 2048 dimensions. The dimension selection must be consistent with the subsequent feature vectors. The embedding vector uses a dense numerical representation, with each dimension value being a 32-bit floating-point number, typically ranging from -1.0 to +1.0. Vector storage adopts a row-major memory layout for efficient vectorization operations. The embedding vector is retrieved from a pre-built embedding lookup table using the node identifier. The lookup table is implemented using a hash mapping, supporting fast lookup with O(1) time complexity. For nodes not in the lookup table, a zero vector or a randomly initialized vector is used as the default embedding.

[0106] The node transformation parameter matrix generator performs element-wise multiplication on the extracted node embedding vector and the calculated nonlinear intensity adjustment coefficients. Element-wise multiplication multiplies the scalar adjustment coefficients with each dimension of the embedding vector, generating the modulated parameter vector. The transformation parameter matrix uses a diagonal matrix structure, with the matrix dimension equal to the embedding vector dimension. Diagonal elements are set to the corresponding elements of the modulated parameter vector, while off-diagonal elements are all set to 0. This design ensures that the transformation operation scales only the feature vector dimensions independently, without introducing inter-dimensional coupling. The matrix is ​​stored in a sparse format, storing only non-zero diagonal elements, saving memory space.

[0107] The source language hierarchical feature transformer performs the core matrix multiplication transformation operation. The input source language hierarchical features are represented as column vectors, with dimensions consistent with the node embedding vectors. The matrix multiplication operation multiplies the diagonal transformation parameter matrix with the feature column vectors. Due to the diagonal structure of the matrix, the actual operation simplifies to element-wise multiplication, where the i-th output feature is equal to the i-th input feature multiplied by the element in the i-th row and i-th column of the diagonal matrix. The transformation operation supports batch processing mode, which can process multiple feature vectors simultaneously. The default batch size is 32, which can be adjusted from 1 to 256 depending on computing resources. The operation uses single-precision floating-point numbers, achieving a balance between precision and performance.

[0108] The feature passing and state update mechanism is responsible for transmitting transformation results between path nodes and maintaining system state. The output feature of the current intermediate node serves as the input feature of the next intermediate node, realizing the gradual transformation of features and the flow of information. Feature passing adopts a value copy approach, creating an independent copy of the output feature as the input for the next step, avoiding data races and state pollution caused by reference sharing. After each feature passing is completed, the path traversal counter is automatically updated: current_hops is incremented by 1, and remaining_hops is decremented by 1, ensuring that the counter state remains synchronized with the actual traversal progress. The state update operation is atomic, and concurrency safety is guaranteed through a mutex lock mechanism.

[0109] The path traversal termination checker continuously monitors the value changes of the `remaining_hops` field. When this value decreases to 0, a traversal completion signal is triggered. The completion signal activates the end of the path transformation process, marking the output feature of the last intermediate node as the final source language path transformation feature. The resulting feature includes metadata information, including the path identifier, transformation completion timestamp, feature dimension, and number of transformation rounds, facilitating subsequent processing and debugging analysis.

[0110] In a specific implementation case, consider an optimal alignment path containing a source node, three intermediate nodes, and a target node. The node sequence is [src, mid1, mid2, mid3, dst], and the total path hop count is 4. The source language hierarchical features are 512-dimensional vectors with initial values ​​of [0.8, -0.6, 0.4, 0.2, ...]. During initialization, the path traversal counters are set to current_hops = 0 and remaining_hops = 4.

[0111] The first transformation visits the mid1 node, with current_hops set to 0. The nonlinear intensity adjustment coefficient is calculated as 0 divided by 4, which equals 0.0. The 512-dimensional embedding vector of the mid1 node is [0.3, 0.1, -0.2, 0.5, ...], which is multiplied by the adjustment coefficient 0.0 to generate an all-zero parameter vector. The transformation parameter matrix is ​​a 512×512 zero-diagonal matrix, which is multiplied by the source features to output an all-zero vector [0.0, 0.0, 0.0, 0.0, ...]. The counters are updated to current_hops=1 and remaining_hops=3.

[0112] The second transformation visits the mid2 node, current_hops is 1, and the adjustment coefficient is 1 divided by 4, which equals 0.25. The mid2 embedding vector [0.4, -0.3, 0.7, 0.1, ...] is multiplied by 0.25 to generate the parameter vector [0.1, -0.075, 0.175, 0.025, ...]. The diagonal transformation matrix is ​​multiplied by the all-zero feature from the previous step, and the output is still an all-zero vector. The counters are updated to current_hops=2 and remaining_hops=2.

[0113] The third transformation visits the mid3 node, with current_hops set to 2 and an adjustment coefficient of 2 divided by 4, which equals 0.5. The mid3 embedding vector [0.6, 0.8, -0.4, 0.3, ...] is multiplied by 0.5 to generate the parameter vector [0.3, 0.4, -0.2, 0.15, ...]. Since the input features are still all zeros, the output remains all zeros. The counters are updated to current_hops=3 and remaining_hops=1.

[0114] The fourth transformation visits the dst node, with current_hops set to 3 and an adjustment coefficient of 3 divided by 4, which equals 0.75. The dst embedding vector [0.2, -0.5, 0.9, 0.4, ...] is multiplied by 0.75 to generate a parameter vector [0.15, -0.375, 0.675, 0.3, ...]. The all-zero input features still output all zeros after the transformation. The counters are updated to current_hops=4 and remaining_hops=0.

[0115] When `remaining_hops` drops to 0, the traversal is complete, and the final output of the source language path transformation features is an all-zero vector. This reflects the transformation process starting from zero initial features. In practical applications, the initial features are usually non-zero vectors, and the transformation process produces non-trivial feature evolution, reflecting the semantic gradual transformation effect on the path.

[0116] In one optional implementation, the category semantics of the source language labeled text data are propagated to the feature space of the target language text data along a semantic bridging function. The classification result of the target language text data is determined by iteratively updating the pseudo-label confidence distribution of the target language text data and combining it with a pre-trained multi-task learning model, including:

[0117] Annotated samples of each category are extracted from the source language annotated text data. Cluster centers are calculated for the annotated samples of each category to obtain the source language category center feature vectors.

[0118] Using the semantic bridging function, a spatial transformation operation is performed on the source language category center feature vector to map it to the target language feature space, thereby obtaining the target language category reference feature vector;

[0119] Calculate the feature similarity value between the features corresponding to the target language text data and the target language category reference feature vector, and normalize the feature similarity value to generate a pseudo-label confidence distribution vector;

[0120] In each iteration, the pseudo-label confidence distribution vector and the fused features are input into the multi-task learning model to obtain the category prediction probability distribution vector. The category with the highest probability value in the category prediction probability distribution vector is taken as the classification result of the target language text data.

[0121] Extracting labeled samples of various categories from source language labeled text data involves, in specific operations, using existing labeled source language text datasets. Where xi represents the i-th source language text sample, yi represents its corresponding category label, and the category set is... For each category cj, collect a subset of all samples labeled cj. These samples represent the semantic distribution of this category in the source language space.

[0122] Cluster centers are calculated for the labeled samples of each category to obtain the source language category center feature vectors for each category. A pre-trained multilingual text encoder is used to extract features from each sample xi in Scj, obtaining its corresponding feature vector vi. Then, the center feature vector μcj of category cj is calculated, specifically by averaging the feature vectors of all samples belonging to that category. Where |Scj| represents the number of samples in category cj. Thus, for each category cj, a central feature vector μcj representing the semantics of that category can be obtained.

[0123] A semantic bridging function is used to perform a spatial transformation operation on the source language category center feature vectors, achieving a mapping transformation from the source language feature space to the target language feature space. In practice, this function can be implemented using a pre-trained cross-language alignment model. For each source language category center feature vector... By applying the semantic bridging function, we obtain the category reference feature vector in the target language feature space: This step ensures that the category semantics of the source language can be accurately projected into the feature space of the target language.

[0124] Calculate the feature similarity between the features corresponding to the target language text data and the target language category reference feature vector. For a target language text sample xt, extract its feature vector vt using the same multilingual text encoder. Then calculate the cosine similarity between vt and each target language category reference feature vector ρcj: The cosine similarity is calculated by dividing the dot product of two vectors by their norm product. Thus, for each target language text sample, a similarity vector sim = [sim1, sim2, ..., simn] with each category can be obtained.

[0125] The feature similarity values ​​are normalized to generate a pseudo-label confidence distribution vector. Specifically, the softmax function is used for normalization. , where τ is a temperature parameter used to adjust the smoothness of the distribution. Smaller τ values ​​will cause the distribution to be more concentrated on categories with high similarity, while larger τ values ​​will make the distribution more uniform. After normalization, the pseudo-label confidence distribution vector conf = [conf1, conf2, ..., confn] is obtained, representing the confidence of the target language text sample belonging to each category.

[0126] In each iteration, the pseudo-label confidence distribution vector and the fused features are input into the multi-task learning model to obtain the category prediction probability distribution vector. In practical applications, the fused features can be a combination of the original features of the target language text samples and the enhanced features obtained through cross-lingual knowledge transfer. The multi-task learning model simultaneously optimizes the classification task and other related tasks (such as cross-lingual representation consistency), thereby improving classification performance. The model outputs the predicted probability distribution vector pred = [pred1, pred2, ..., predn] of the target language text samples belonging to each category.

[0127] For the obtained category prediction probability distribution vector, select the category with the highest probability value as the final classification result of the target language text data: This completes the task of classifying the target language text.

[0128] In practical applications, such as multilingual sentiment analysis systems, the source language can be English, and the target language can be French. Using the method described above, rich English sentiment-annotated data can be utilized to classify the sentiment of unannotated French text. In each iteration, as the pseudo-label confidence is continuously updated, the accuracy of the classification results gradually improves.

[0129] The iterative process typically continues until the pseudo-label confidence distribution vector stabilizes or reaches a preset number of iterations. After each iteration, the semantic bridging function can be updated based on the classification results of the current round, further improving the accuracy of cross-language semantic alignment. Through multiple rounds of iterative optimization, the effective transfer of source language annotation information to the target language is ultimately achieved, completing the cross-language text classification task.

[0130] In one alternative implementation, the method further includes training a multi-task learning model:

[0131] Source language samples and target language samples are constructed by sampling from the source language annotated text data and the target language text data. The source language samples and target language samples are input into the multi-task learning model to be trained to obtain batch feature representation and batch classification prediction results.

[0132] For source language samples, the source language classification loss value is calculated using the true category label. When the source language classification loss value is less than a preset loss threshold, the first feature corresponding to the source language sample is stored in the feature memory queue of the corresponding category. When the source language classification loss value is greater than the preset loss threshold, the second feature corresponding to the target language sample is stored in the feature memory queue of the corresponding category, thus obtaining a category feature memory library.

[0133] Historical feature representations are sampled and extracted from the category feature memory queues of the category feature memory bank. Feature aggregation is performed on the historical feature representations of the same category to obtain the category historical feature prototype vector. The feature consistency metric between the batch feature representation and the category historical feature prototype vector is calculated as the memory distillation loss value.

[0134] The similarity distribution of the batch feature representation is calculated using the prototype vector of the category historical features. The similarity distribution is then normalized and weighted with the batch classification prediction result to obtain the target language memory-enhanced pseudo-label loss value.

[0135] The memory-enhanced pseudo-label loss value of the target language and the memory distillation loss value are weighted and summed to obtain the memory-enhanced comprehensive loss value. The parameters of the multi-task learning model are updated according to the memory-enhanced comprehensive loss value. When the memory queue of each category reaches the capacity limit, the earliest feature is removed according to the first-in-first-out principle. When the memory-enhanced comprehensive loss value is less than the preset training termination threshold, the parameters of the current multi-task learning model are saved as the model parameters after training is completed.

[0136] Samples are constructed from source language annotated text data and target language text data. Specifically, several text records can be randomly selected from the source language annotated text data. Each record contains text content and a corresponding category label, such as sampling "This movie is fantastic" and its corresponding "positive review" label from an English news dataset. At the same time, several text records can be randomly selected from the target language text data, such as sampling "This movie is wonderful" from a Chinese movie review dataset. These target language samples usually do not contain labels or the labels are unreliable. The sampled source language samples and target language samples form a training batch, which is then input into the multi-task learning model to be trained.

[0137] A multi-task learning model to be trained typically includes a feature extraction layer and a classification layer. The feature extraction layer can be a pre-trained multilingual model such as the multilingual BERT, used to map text from different languages ​​to a shared feature space. The classification layer is a fully connected layer used to map features to predicted probabilities for each category. After receiving source language samples and target language samples as input, the model outputs batch feature representations (including the first feature corresponding to the source language sample and the second feature corresponding to the target language sample) and batch classification prediction results.

[0138] For source language samples, since they have true category labels, a source language classification loss value can be calculated, typically using the cross-entropy loss function. When the calculated source language classification loss value is less than a preset loss threshold (e.g., 0.1), it indicates that the model's classification of the sample is relatively accurate. In this case, the first feature corresponding to the source language sample is stored in the feature memory queue of the corresponding category. When the source language classification loss value is greater than the preset loss threshold, the model's classification of the sample is not accurate enough. To avoid introducing noise, the second feature corresponding to the target language sample is stored in the feature memory queue of the corresponding category. In this way, feature memory queues are established for each category, and the feature memory queues of all categories constitute a category feature memory library.

[0139] Historical feature representations are sampled and extracted from the feature memory queues of each category in the category feature memory bank. For example, several (e.g., 32) historical feature representations can be randomly selected from the feature memory queue of the "positive evaluation" category. Feature aggregation is performed on the historical feature representations of the same category to obtain the category historical feature prototype vector. The feature aggregation operation can be a simple averaging operation or a weighted averaging operation, with the weights set according to the freshness of the features. A feature consistency metric between the batch feature representations and the category historical feature prototype vector is calculated and used as the memory distillation loss value. The feature consistency metric can use cosine similarity or Euclidean distance, etc.

[0140] The similarity distribution of batch feature representations is calculated using the prototype vectors of category historical features. This involves calculating the similarity between the features of each sample in the batch and the prototype vectors of each category's historical features, forming a similarity vector. The similarity distribution is then normalized and weighted with the batch classification prediction results to obtain the target language memory-enhanced pseudo-label loss value. Normalization can be performed using the softmax function, and weighting can be done using linear interpolation. A weighting coefficient of 0.5 can be set to indicate equal emphasis on the model's current prediction and historical memory.

[0141] The target language memory-enhanced pseudo-label loss value and the memory distillation loss value are weighted and summed to obtain the overall memory-enhanced loss value. The weighting coefficients can be dynamically adjusted according to the training stage; initially, more emphasis can be placed on memory distillation loss, and later the weight of pseudo-label loss can be increased. Based on the overall memory-enhanced loss value, the parameters of the multi-task learning model are updated using gradient descent.

[0142] To maintain the freshness of the feature memory, when the feature memory queue for each category reaches a predetermined capacity limit (e.g., 1000 features per category), the earliest added feature is removed according to the first-in, first-out (FIFO) principle. This mechanism ensures that the feature memory retains the latest and most relevant feature representations.

[0143] The training process continues until the memory enhancement loss value is less than the preset training termination threshold (e.g., 0.01) or the maximum number of training rounds (e.g., 100 rounds) is reached. Then, the training stops and the parameters of the current multi-task learning model are saved as the parameters of the final trained model.

[0144] This method achieves effective transfer of source language knowledge to the target language by establishing a category feature memory, overcoming the problem of insufficient labeled data for the target language in traditional methods. In particular, through a dual mechanism of memory distillation and pseudo-label enhancement, the model can better utilize historical learning experience, improving performance on cross-language classification tasks. Experiments show that this method achieves significant performance improvements in tasks such as multilingual text classification and sentiment analysis.

[0145] A second aspect of the present invention provides a cross-language text classification and processing system based on deep transfer learning, comprising:

[0146] The first module is used to acquire target language text data to be classified and source language annotated text data; and to extract feature representations of the source language annotated text data and the target language text data at different linguistic levels through a multi-level semantic transfer network, thereby obtaining a multi-level feature set of the source language and a multi-level feature set of the target language.

[0147] The second module is used to determine the optimal alignment path based on the ratio of the number of feature dimensions in the source language multi-level feature set to the number of feature dimensions in the target language multi-level feature set, and to perform non-linear mapping alignment between each level feature in the source language multi-level feature set and the corresponding level feature in the target language multi-level feature set according to the optimal alignment path, thereby obtaining the fused features after level alignment;

[0148] The third module is used to propagate the category semantics of the source language labeled text data to the feature space of the target language text data along the semantic bridging function, iteratively update the pseudo-label confidence distribution of the target language text data, and determine the classification result of the target language text data by combining it with a pre-trained multi-task learning model, wherein the multi-task learning model is trained through the fused features;

[0149] The fourth module is used to perform classification processing on the target language text data based on the classification results.

[0150] A third aspect of the present invention provides an electronic device, comprising:

[0151] processor;

[0152] Memory used to store processor-executable instructions;

[0153] The processor is configured to invoke instructions stored in the memory to execute the aforementioned method.

[0154] A fourth aspect of the present invention provides a computer-readable storage medium having stored thereon computer program instructions that, when executed by a processor, implement the aforementioned method.

[0155] This invention can be a method, apparatus, system, and / or computer program product. The computer program product may include a computer-readable storage medium having computer-readable program instructions loaded thereon for performing various aspects of the invention.

[0156] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.

Claims

1. A cross-lingual text classification and processing method based on deep transfer learning, characterized in that, include: Obtain target language text data and source language annotated text data to be classified; extract feature representations of the source language annotated text data and the target language text data at different linguistic levels through a multi-level semantic transfer network to obtain a source language multi-level feature set and a target language multi-level feature set; The optimal alignment path is determined based on the ratio of the number of feature dimensions in the source language multi-level feature set to the number of feature dimensions in the target language multi-level feature set, including: The ratio of the number of first feature dimensions in each level of the source language's multi-level feature set to the number of second feature dimensions in the corresponding level of the target language's multi-level feature set is determined. When the ratio is greater than a unit value, the first path with one or two hops is selected as the optimal alignment path. When the ratio is less than a unit value, the second path with three or more hops is selected as the optimal alignment path. Based on the optimal alignment path, the features at each level in the source language multi-level feature set are non-linearly mapped and aligned with the corresponding features at the target language multi-level feature set to obtain the fused features after level alignment; The category semantics of the source language annotated text data are propagated to the feature space of the target language text data along a semantic bridging function. The pseudo-label confidence distribution of the target language text data is iteratively updated, and the classification result of the target language text data is determined by combining it with a pre-trained multi-task learning model, including: Annotated samples of each category are extracted from the source language annotated text data. Cluster centers are calculated for the annotated samples of each category to obtain source language category center feature vectors for each category. Using the semantic bridging function, the source language category center feature vectors are spatially transformed and mapped to the target language feature space to obtain target language category reference feature vectors. The feature similarity values ​​between the features corresponding to the target language text data and the target language category reference feature vectors are calculated, and the feature similarity values ​​are normalized to generate pseudo-label confidence distribution vectors. In each iteration, the pseudo-label confidence distribution vectors and the fused features are input into the multi-task learning model to obtain category prediction probability distribution vectors. The category with the highest probability value in the category prediction probability distribution vectors is taken as the classification result of the target language text data. The multi-task learning model is trained using the fused features; and classification processing is performed on the target language text data based on the classification results.

2. The method according to claim 1, characterized in that, Feature representations of the source language annotated text data and the target language text data at different linguistic levels are extracted using a multi-level semantic transfer network, resulting in a multi-level feature set for the source language and a multi-level feature set for the target language, including: Lexical segmentation is performed on the source language annotated text data and the target language text data to obtain source language lexical unit sequences and target language lexical unit sequences; The source language lexical unit sequence and the target language lexical unit sequence are vectorized and encoded by the lexical-level encoding layer in the multi-level semantic transfer network to obtain the source language lexical-level feature matrix and the target language lexical-level feature matrix. Based on the parsing of the syntactic structure information of the source language lexical unit sequence and the target language lexical unit sequence, the syntactic structure information corresponding to the source language lexical-level feature matrix and the target language lexical-level feature matrix are fused and encoded through the syntactic-level encoding layer in the multi-level semantic transfer network to obtain the source language syntactic-level feature matrix and the target language syntactic-level feature matrix. By performing context association analysis on the source language syntactic feature matrix and the target language syntactic feature matrix through the discourse-level coding layer in the multi-level semantic transfer network, the multi-level feature set of the source language and the multi-level feature set of the target language are obtained.

3. The method according to claim 1, characterized in that, Based on the optimal alignment path, each level of feature in the source language multi-level feature set is non-linearly mapped and aligned with the corresponding level of feature in the target language multi-level feature set to obtain the fused features after level alignment, including: A hop-by-hop nonlinear transformation is performed on each level feature in the source language multi-level feature set along the optimal alignment path. The nonlinear intensity of the feature transformation is adjusted according to the current path hop count for each nonlinear transformation operation. Based on the nonlinear intensity, the source language level features at the path start point are gradually transformed into source language path transformation features at the path end point. A hop-by-hop nonlinear transformation is performed on the corresponding hierarchical features in the multi-level feature set of the target language along the reverse optimal alignment path, gradually transforming the target language hierarchical features at the starting point of the path into the target language path transformation features at the ending point of the path. The source language path transformation features and the target language path transformation features are fused to obtain the fused features.

4. The method according to claim 3, characterized in that, Each nonlinear transformation operation adjusts the nonlinear intensity of the feature transformation based on the current path hop count. Based on the nonlinear intensity, the source language hierarchical features at the path starting point are progressively transformed into source language path transformation features at the path ending point, including: Initialize a path traversal counter, which records the number of path hops completed and the number of path hops to be traversed. Then, visit each intermediate node in sequence according to the node traversal sequence of the optimal alignment path. The nonlinear intensity adjustment coefficient is calculated based on the number of path hops currently completed in the path traversal counter and the total number of path hops of the optimal alignment path. The nonlinear intensity adjustment coefficient is equal to the ratio of the number of path hops currently completed to the total number of path hops. Extract the node embedding vector of the current intermediate node, perform element-wise multiplication of the node embedding vector with the nonlinear intensity adjustment coefficient to generate an intensity-adjusted node embedding vector, and construct a node transformation parameter matrix based on the intensity-adjusted node embedding vector; The node transformation parameter matrix is ​​used to perform matrix multiplication transformation on the source language hierarchical features to obtain the output features of the current intermediate node; The output feature of the current intermediate node is used as the input feature of the next intermediate node. The number of completed path hops and the number of remaining path hops to be traversed in the path traversal counter are updated. When the number of remaining path hops to be traversed in the path traversal counter is zero, the output feature of the last intermediate node is used as the source language path transformation feature.

5. The method according to claim 1, characterized in that, The method also includes training a multi-task learning model: Source language samples and target language samples are constructed by sampling from the source language annotated text data and the target language text data. The source language samples and target language samples are input into the multi-task learning model to be trained to obtain batch feature representation and batch classification prediction results. For source language samples, the source language classification loss value is calculated using the true category label. When the source language classification loss value is less than a preset loss threshold, the first feature corresponding to the source language sample is stored in the feature memory queue of the corresponding category. When the source language classification loss value is greater than the preset loss threshold, the second feature corresponding to the target language sample is stored in the feature memory queue of the corresponding category, thus obtaining a category feature memory library. Historical feature representations are sampled and extracted from the category feature memory queues of the category feature memory bank. Feature aggregation is performed on the historical feature representations of the same category to obtain the category historical feature prototype vector. The feature consistency metric between the batch feature representation and the category historical feature prototype vector is calculated as the memory distillation loss value. The similarity distribution of the batch feature representation is calculated using the prototype vector of the category historical features. The similarity distribution is then normalized and weighted with the batch classification prediction result to obtain the target language memory-enhanced pseudo-label loss value. The memory-enhanced pseudo-label loss value of the target language and the memory distillation loss value are weighted and summed to obtain the memory-enhanced comprehensive loss value. The parameters of the multi-task learning model are updated according to the memory-enhanced comprehensive loss value. When the memory queue of each category reaches the capacity limit, the earliest feature is removed according to the first-in-first-out principle. When the memory-enhanced comprehensive loss value is less than the preset training termination threshold, the parameters of the current multi-task learning model are saved as the model parameters after training is completed.

6. A cross-lingual text classification and processing system based on deep transfer learning, used to implement the method as described in any one of claims 1-5, characterized in that, include: The first module is used to acquire target language text data to be classified and source language annotated text data; and to extract feature representations of the source language annotated text data and the target language text data at different linguistic levels through a multi-level semantic transfer network, thereby obtaining a multi-level feature set of the source language and a multi-level feature set of the target language. The second module is used to determine the optimal alignment path based on the ratio of the number of feature dimensions in the source language multi-level feature set to the number of feature dimensions in the target language multi-level feature set, and to perform non-linear mapping alignment between each level feature in the source language multi-level feature set and the corresponding level feature in the target language multi-level feature set according to the optimal alignment path, thereby obtaining the fused features after level alignment; The third module is used to propagate the category semantics of the source language labeled text data to the feature space of the target language text data along the semantic bridging function, iteratively update the pseudo-label confidence distribution of the target language text data, and determine the classification result of the target language text data by combining it with a pre-trained multi-task learning model, wherein the multi-task learning model is trained through the fused features; The fourth module is used to perform classification processing on the target language text data based on the classification results.

7. An electronic device, characterized in that, include: processor; Memory used to store processor-executable instructions; The processor is configured to invoke instructions stored in the memory to execute the method according to any one of claims 1 to 5.

8. A computer-readable storage medium having computer program instructions stored thereon, characterized in that, When the computer program instructions are executed by the processor, they implement the method described in any one of claims 1 to 5.

Citation Information

Patent Citations

  • Zero sample cross-language text classification method based on attention adaptive migration

    CN120067329A

  • Cross-language text understanding method fusing transfer learning and domain self-adaption

    CN120688479A