Training method, classification method and device for cross-domain text classification model

Through the dual graph convolution network and attention mechanism, the local and global embedding information of text graphs of different domains is fused, combined with classifier losses, class alignment losses and domain confrontation losses, the problems of low accuracy and class imbalance in cross-domain text classification are solved, and the prediction accuracy of the model in the target domain is improved.

CN116263785BActive Publication Date: 2025-08-22CHINA MOBILE (SUZHOU) SOFTWARE TECH CO LTD +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211435736.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-11-16
Publication Date
2025-08-22
Estimated Expiration
2042-11-16

AI Technical Summary

Technical Problem

Existing models are difficult to capture the text distribution characteristics shared by the source domain and the target domain, resulting in low accuracy of cross-domain classification and failure to effectively solve the problem of category imbalance, affecting the model's migration performance in the target domain.

Method used

The dual graph convolution network and attention mechanism are used to capture the local embedding and global embedding information of text graphs in different domains. By jointly training classifier losses, class alignment losses and domain confrontation losses, multiple alignments are achieved and cross-domain text classification performance is improved.

Benefits of technology

The prediction accuracy of the cross-domain text classification model in the target domain is improved, the category imbalance problem is solved, and the migration performance of the model in different fields is enhanced.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116263785B_ABST
    Figure CN116263785B_ABST
Patent Text Reader

Abstract

The present invention discloses a training method, classification method and device for a cross-domain text classification model, wherein the method includes: obtaining two sample sets of a source domain and a target domain, inputting them into a representation learner respectively, obtaining local embedding information and global embedding information of each sample; fusing each local embedding information and global embedding information to obtain corresponding deep semantic features respectively; determining a classifier loss and a first label according to the first deep semantic information, and obtaining a second label according to the second deep semantic information; determining a domain adversarial loss according to each deep semantic information and a domain discriminator; determining a class alignment loss by the difference between text graph samples of different domains; performing iterative update training, optimizing the classifier loss, class alignment loss and domain adversarial loss, until a training end condition is met, and determining a cross-domain text classification model. In this way, the present invention realizes the migration of the model from the source domain to the target domain, and improves the accuracy of text classification.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of artificial intelligence technology, and in particular to a training method, a classification method and a device for a cross-domain text classification model. Background Art

[0002] Text classification is a fundamental problem in natural language processing. It uses algorithms to automatically categorize or label text collections according to a specific classification system or standard. It has numerous applications, such as document organization, news filtering, and content review. Cross-domain classification refers to significant differences in data distribution between the source domain (training set) and the target domain (test set). A common solution is to leverage source domain knowledge and sufficient labeled data through techniques such as domain adaptation, thereby improving prediction performance in the target domain even without labeled data.

[0003] The existing solutions have the following problems: the existing models find it difficult to capture the text distribution characteristics shared by the source domain and the target domain, thereby reducing the cross-domain classification accuracy; they do not consider the quantitative differences between the same type of text in different domains, which will cause category imbalance problems, which to a certain extent has a negative impact on the model's migration performance from the source domain to the target domain; they do not fully consider and evaluate the transferability of different source domains to the target domain. If there is unreliable source domain information, it will cause adverse effects of negative transfer on the model. Summary of the Invention

[0004] In view of the above problems, the present invention is proposed to provide a training method, classification method and device for a cross-domain text classification model that overcomes the above problems or at least partially solves the above problems.

[0005] According to one aspect of the present invention, a method for training a cross-domain text classification model is provided, the method comprising:

[0006] Obtain a first text graph sample set and a second text graph sample set, input them into the representation learner respectively, and obtain local embedding information and global embedding information corresponding to each text graph sample;

[0007] Based on the attention mechanism, each of the local embedding information and the global embedding information are respectively integrated to obtain a first deep semantic feature and a second deep semantic feature;

[0008] Inputting the first deep semantic feature into a label classifier to determine a classifier loss and a first label, and inputting the second deep semantic feature into the label classifier to obtain a second label;

[0009] Inputting the first deep semantic feature and the second deep semantic feature into a domain discriminator to determine a domain adversarial loss;

[0010] determining a class alignment loss based on differences between text graph samples of the same class in the first text graph sample set and the second text graph sample set;

[0011] Iterative update training is performed to optimize the classifier loss, the class alignment loss, and the domain adversarial loss until a training end condition is met, thereby determining the cross-domain text classification model.

[0012] Optionally, the acquiring of the first text graph sample set and the second text graph sample set, respectively inputting them into the representation learner, and obtaining the local embedding information and the global embedding information corresponding to each text graph sample includes:

[0013] Calculating local embedding information of each node in each of the text graph samples using convolution based on the graph adjacency matrix;

[0014] The semantic similarity between each node in each text graph sample is calculated using a random walk method to obtain a frequency matrix; based on the frequency matrix, a positive point mutual information matrix is ​​calculated; and based on the convolution of the positive point mutual information matrix, the global embedding information of each node is calculated.

[0015] Optionally, the fusing of each of the local embedding information and the global embedding information based on the attention mechanism to obtain the first deep semantic feature and the second deep semantic feature includes:

[0016] Utilizing the graph attention mechanism, the first deep semantic feature and the second deep semantic feature are generated by respectively aggregating the local embedding information and the global embedding information of each node in each text graph sample in the first text graph sample set and the second text graph sample set.

[0017] Optionally, inputting the first deep semantic feature into a label classifier and determining the classifier loss and the first label includes:

[0018] Inputting the first deep semantic feature into a label classifier to obtain a predicted value of the first label;

[0019] Determine a cross entropy loss based on the predicted value and the true value of the labeled nodes in the first text graph sample set, and use the cross entropy loss as the classifier loss;

[0020] Inputting the second deep semantic feature into the label classifier to obtain the second label includes:

[0021] Inputting the second deep semantic feature into the label classifier to obtain output codes of corresponding nodes, and determining the second label according to the output codes;

[0022] Inputting the first deep semantic feature and the second deep semantic feature into a domain discriminator to determine the domain adversarial loss includes:

[0023] Inputting the first deep semantic feature and the second deep semantic feature into a domain identifier to obtain a domain label value;

[0024] The domain adversarial loss between the first text image sample set and the second text image sample set is calculated according to the domain label value and the earthwork movement distance.

[0025] Optionally, determining the class alignment loss based on the difference between text graph samples of the same class in the first text graph sample set and the second text graph sample set includes:

[0026] Calculate the covariance of the first deep semantic feature and the second deep semantic feature of each same category in the first text graph sample set and the second text graph sample set respectively;

[0027] The distance between the covariance of the first deep semantic feature and the second deep semantic feature of the same category is calculated, and the sum of the distances is used as the class alignment loss.

[0028] Optionally, performing iterative training to optimize the classifier loss, the class alignment loss, and the domain adversarial loss until a training end condition is met, and determining the cross-domain text classification model includes:

[0029] constructing an objective loss function based on the classifier loss, the class alignment loss, and the domain adversarial loss;

[0030] Performing iterative training using the first text graph sample set and the second text graph sample set to update parameters in the cross-domain text classification model;

[0031] When the target loss function is minimized or the number of iterative training reaches a preset value, the training is stopped and the current cross-domain text classification model is determined to be a trained cross-domain text classification model.

[0032] According to another aspect of the present invention, a cross-domain text classification method is provided, the method comprising:

[0033] Receive the text to be detected;

[0034] The text to be detected is input into a label classifier in a cross-domain text classification model to obtain a classification label of the text to be detected; wherein the cross-domain text classification model is trained according to any of the methods described above.

[0035] According to another aspect of the present invention, a training device for a cross-domain text classification model is provided, the device comprising:

[0036] An embedding information acquisition module, adapted to acquire a first text graph sample set and a second text graph sample set, and input them into the representation learner respectively, to obtain local embedding information and global embedding information corresponding to each text graph sample;

[0037] a semantic feature extraction module adapted to fuse the local embedding information and the global embedding information based on an attention mechanism to obtain a first deep semantic feature and a second deep semantic feature;

[0038] a classification label acquisition module, adapted to input the first deep semantic feature into a label classifier, determine a classifier loss and a first label, and input the second deep semantic feature into the label classifier to obtain a second label;

[0039] an adversarial loss determination module, adapted to input the first deep semantic feature and the second deep semantic feature into a domain discriminator to determine a domain adversarial loss;

[0040] an alignment loss determining module, adapted to determine a class alignment loss based on differences between text graph samples of the same class in the first text graph sample set and the second text graph sample set;

[0041] The classification model determination module is suitable for performing iterative update training to optimize the classifier loss, the class alignment loss and the domain adversarial loss until the training end condition is met, thereby determining the cross-domain text classification model.

[0042] According to another aspect of the present invention, there is provided a computing device comprising: a processor, a memory, a communication interface, and a communication bus, wherein the processor, the memory, and the communication interface communicate with each other via the communication bus;

[0043] The memory is used to store at least one executable instruction, and the executable instruction enables the processor to execute operations corresponding to the above-mentioned training method for the cross-domain text classification model or the cross-domain text classification method.

[0044] According to another aspect of the present invention, a computer storage medium is provided, wherein the storage medium stores at least one executable instruction, and the executable instruction enables a processor to perform operations corresponding to the above-mentioned training method for a cross-domain text classification model or the cross-domain text classification method.

[0045] According to the training scheme of the cross-domain text classification model of the present invention, a cross-domain text classification training method based on dual graph convolution multi-semantic alignment is constructed. The local embedding information and global embedding information of text graphs in different domains are captured and fused through the dual graph convolution network and attention mechanism. By simultaneously considering the classifier loss, class alignment loss and domain adversarial loss, the deep semantic features of text graphs in different domains are multi-aligned to maximize the text classification performance of the classification model in cross-domain scenarios, thereby realizing text classification in cross-domain scenarios.

[0046] The above description is only an overview of the technical solution of the present invention. In order to more clearly understand the technical means of the present invention, it can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are specifically listed below. BRIEF DESCRIPTION OF THE DRAWINGS

[0047] Various other advantages and benefits will become apparent to those skilled in the art upon reading the detailed description of the preferred embodiment below. The accompanying drawings are for illustration purposes only and are not to be considered as limiting the present invention. The same reference symbols are used throughout the drawings to represent the same components. In the drawings:

[0048] Figure 1 A flowchart of a method for training a cross-domain text classification model provided by one embodiment of the present invention is shown;

[0049] Figure 2 A structural diagram of a cross-domain text classification training framework provided by an embodiment of the present invention is shown;

[0050] Figure 3 A flowchart of a cross-domain text classification model training according to an embodiment of the present invention is shown;

[0051] Figure 4 shows a structural diagram of a text graph provided by an embodiment of the present invention;

[0052] Figure 5 A flowchart of a cross-domain text classification method provided by one embodiment of the present invention is shown;

[0053] Figure 6 A schematic diagram of the structure of a training device for a cross-domain text classification model provided by an embodiment of the present invention is shown;

[0054] Figure 7 A structural diagram of a cross-domain text classification device provided by one embodiment of the present invention is shown;

[0055] Figure 8 A schematic structural diagram of a computing device provided by an embodiment of the present invention is shown. DETAILED DESCRIPTION

[0056] Exemplary embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. Although exemplary embodiments of the present invention are shown in the accompanying drawings, it should be understood that the present invention can be implemented in various forms and should not be limited by the embodiments set forth herein. Rather, these embodiments are provided to enable a more thorough understanding of the present invention and to fully convey the scope of the present invention to those skilled in the art.

[0057] The concepts in the embodiments of the present invention are explained as follows:

[0058] Dual graph convolutional network (DGCN): The DGCN dual graph convolutional network introduces a dual graph convolutional structure with two parallel graph convolutional layers. It captures local and global structural information by integrating the outputs of the dual graph convolutional layers without stacking multiple graph convolutional layers.

[0059] Positive Point-wise Mutual Information (PPMI) is usually used to measure the correlation between two objects. Compared with point mutual information, PPMI has an additional operation to determine the maximum value.

[0060] The Graph Attention Mechanism (GAM) uses the attention mechanism in neural networks to achieve better neighbor aggregation. By learning the weights of neighbors, it can achieve weighted aggregation of neighbors. This mechanism is not only robust to noisy neighbors, but also gives the model a certain degree of interpretability.

[0061] Generative Adversarial Networks (GANs) are a deep learning model that has emerged as one of the most promising methods for unsupervised learning on complex distributions in recent years. This network model generates outputs through a learning game between (at least) two modules in the framework: a generative model and a discriminative model.

[0062] Earth Mover's Distance (EMD) is a measure of the distance between two probability distributions in a region. If the two distributions are viewed as two different ways of piling up a certain number of hills in the region, then the EMD is the minimum distance needed to move a unit block to turn one pile into another.

[0063] Category Alignment Loss (CAL) maps two different categories of data to be aligned into the same space, so that the distance between the aligned entities is close.

[0064] The main idea of ​​the embodiment of the present invention is to combine Figure 1-3 As shown, a cross-domain text classification scheme based on dual graph convolution multi-semantic alignment is disclosed. By jointly training the source domain labeled text and the target domain unlabeled text, a dual graph convolutional network is used to simultaneously capture the local embedding and global embedding information of the text graphs of different domains, and the two are fused through the attention mechanism to learn the deep semantic features of the text graphs of different domains. By simultaneously considering the classifier loss, class alignment loss and domain adversarial loss, the deep semantic features of the text graphs of different domains are multi-aligned, so that the model can effectively improve the prediction accuracy of the target domain text. The embodiment of the present invention focuses on the cross-domain classification of text data, that is, using the labeled source domain text information to assist in learning text classification in the unlabeled target domain.

[0065] Figure 1 A flowchart illustrating an embodiment of a method for training a cross-domain text classification model according to the present invention is provided. The method is applied to a computing device. The computing device includes an intelligent terminal device, a computer device, and / or a cloud device with a computer program installed. The intelligent terminal device includes, but is not limited to, a smartphone and a PAD. The computer device includes, but is not limited to, a personal computer, a laptop computer, an industrial computer, a network host, a single network server, or a collection of multiple network servers. The cloud is composed of a large number of computers or network servers based on cloud computing. Cloud computing is a type of distributed computing, consisting of a group of loosely coupled computers forming a virtual supercomputer.

[0066] like Figure 1 As shown, the method includes the following steps:

[0067] Step 110: Obtain a first text graph sample set and a second text graph sample set, input them into the representation learner respectively, and obtain local embedding information and global embedding information corresponding to each text graph sample.

[0068] Among them, the first text graph sample set and the second text graph sample set are sample sets of different types (domains), the first text graph sample set is preferably a labeled training set (source domain), and the second text graph sample set is preferably an unlabeled test set (target domain).

[0069] Combine Figure 2As shown, the representation learner is a feature extractor that is mainly used to extract information from the text graph and can extract any deep learning network of local and global embedding information in the sample. Preferably, the representation learner can be composed of a set of dual graph convolutional networks.

[0070] Step 120: Based on the attention mechanism, each of the local embedding information and the global embedding information is respectively fused to obtain a first deep semantic feature and a second deep semantic feature.

[0071] This step 120 optionally uses a graph attention mechanism (GAM) to generate a unified representation by aggregating embedding information from text graphs of different domains. The node features of the text graphs of the first text graph sample set (source domain) and the second text graph sample set (target domain) are used as inputs to the attention module, and the node embedding information is used as the output of the attention module. The attention coefficients are then normalized to obtain deep semantic features as output.

[0072] Step 130: Input the first deep semantic feature into a label classifier to determine the classifier loss and the first label, and input the second deep semantic feature into the label classifier to obtain a second label.

[0073] Continue to see Figure 2 and Figure 3 As shown, after obtaining the deep semantic features, the category of the text graph node is predicted by the label classifier to obtain the first label and the second label, which respectively represent the category of each sample.

[0074] Preferably, the label classifier can be composed of a multi-layer fully connected network.

[0075] In addition, the cross entropy loss of all labeled nodes in the first text graph sample set can be used as the loss function of the label classifier.

[0076] Step 140: Input the first deep semantic feature and the second deep semantic feature into a domain discriminator to determine a domain adversarial loss.

[0077] Specifically, the representation learner is regarded as the generator in a generative adversarial network (GAN), which is used to learn domain-invariant text graph node representations. The domain discriminator is regarded as the discriminator in the GAN, which is used to identify node representations from the first and second text graph sample sets. The two form an adversarial relationship of mutual competition. The deep node features of the text graphs of the first and second text graph sample sets extracted by the representation learner are input into the domain discriminator, and the output is the domain label value. The earth moving distance (EMD) is used to calculate the domain adversarial loss of the source and target domain text graphs to measure the distribution difference of node representations between text graphs of different domains.

[0078] The domain identifier can be composed of any deep learning network, preferably a model composed of a multi-layer fully connected network.

[0079] Step 150: Determine a class alignment loss based on the difference between text graph samples of the same class in the first text graph sample set and the second text graph sample set.

[0080] For texts in different fields, there is usually a problem of category imbalance, that is, there are significant differences in the number of text graph nodes in different categories in different fields, which often leads to a decrease in the migration performance of the model. Therefore, class alignment loss is used to compensate for the problem caused by sample differences.

[0081] The class alignment loss in step 150 is used to align the deep features of text graphs of the same category in different domains. Fine-grained alignment at the category level is achieved by minimizing the class alignment loss, thereby solving the category imbalance problem between text graphs in different domains to a certain extent.

[0082] Step 160: Perform iterative update training to optimize the classifier loss, the class alignment loss, and the domain adversarial loss until a training end condition is met, thereby determining the cross-domain text classification model.

[0083] According to step 160, the classifier loss, class alignment loss, and domain adversarial loss are comprehensively considered, and by continuously updating the representation learner parameters, label classifier parameters, and domain discriminator parameters in the model, the model is able to learn the multiple semantic and domain invariance features between text graphs in different domains and categories.

[0084] Optional, combined Figure 3 As shown, when the above loss reaches the convergence condition or the number of training times meets the preset value, the training is stopped to obtain the final classification model.

[0085] In summary, this embodiment discloses a training scheme for a cross-domain text classification model based on dual graph convolution multi-semantic alignment, which comprehensively considers classifier loss, class alignment loss, and domain adversarial loss, thereby improving the text classification performance of the classification model in cross-domain scenarios and improving the accuracy of text classification.

[0086] In an optional embodiment, the text graph is obtained in the following manner:

[0087] Since a corpus consists of several documents, and each document consists of many words, the edges between nodes are constructed based on the appearance of words in documents (document-word edges) and the co-occurrence of words in the entire corpus (word-word edges). A fixed-size sliding window W is used to collect co-occurrence statistics for all documents in the corpus. Therefore, the relationship between words and documents and between words in the corpus can be represented by a text graph, such as Figure 4 As shown. Among them, d i Represents the i-th document node, t i represents the i-th word node, the thick black edges are document-word edges, the thin gray edges are word-word edges, and the number of nodes in the text graph is equal to the sum of the number of documents (corpus size) and the number of unique words (vocabulary size).

[0088] Therefore, the embodiment of the present invention preferably uses point mutual information (PMI) to calculate the edge weight between two word nodes, and uses term frequency-inverse document frequency (TF-IDF) to calculate the edge weight between document nodes and word nodes. Therefore, the edge weight matrix A between nodes i and j is ij The definition is as follows:

[0089]

[0090] Where, the PMI value of word pair (i, j) is calculated as follows:

[0091]

[0092] Where |W(i)| is the number of sliding windows in the corpus containing word i, |W(i,j)| is the number of sliding windows containing both words i and j, and |W| is the total number of sliding windows in the corpus. The PMI value is used to measure the relevance between two words. A positive PMI value indicates a high degree of semantic relevance between the words in the corpus, while a negative PMI value indicates a low or no semantic relevance between the words in the corpus. Therefore, edges are only added between word pairs with positive PMI values.

[0093] Term Frequency-Inverse Document Frequency (TF-IDF) is used to evaluate the importance of a word to a document in a corpus and is calculated as follows:

[0094] TF-IDF ij =TF ij ×IDF i

[0095] Where TF ij is the word frequency, which indicates the frequency of word i appearing in document j, IDF i is the inverse document frequency, which is used to measure the importance of a word in the entire corpus and is calculated as follows:

[0096]

[0097] Among them, n ij represents the number of times word i appears in document j, |D| is the total number of documents in the corpus, |j:t i ∈d j | represents the number of documents containing word i.

[0098] In summary, we construct text graphs of the source domain and the target domain respectively, and record the source domain text graph as G s =(V s ,A s ,X s ), the target domain text is denoted by G t =(V t ,A t ,X t ), where V s 、V t G s and G t The node set, the number of nodes is n s and n t , D s 、D t G s and G t The degree matrix of A represents the number of adjacent nodes of node i, s 、A t G s and G t The weighted adjacency matrix of represents the edge weight between nodes i and j, X s 、X t G s and G t The attribute matrix of the text map can be set to the identity matrix I, d s d t G s and G t The node attribute dimension, Y s G s The label matrix of Indicates G s The label value of the i-th node in is k, otherwise Y s The number of label categories is C, G t All nodes in have no labels.

[0099] In one or some embodiments, obtaining a first text graph sample set and a second text graph sample set, inputting them into a representation learner respectively, and obtaining local embedding information and global embedding information corresponding to each text graph sample includes:

[0100] Calculating local embedding information of each node in each of the text graph samples using convolution based on the graph adjacency matrix;

[0101] The semantic similarity between each node in each text graph sample is calculated using a random walk method to obtain a frequency matrix; based on the frequency matrix, a positive point mutual information matrix is ​​calculated; and based on the convolution of the positive point mutual information matrix, the global embedding information of each node is calculated.

[0102] Specifically, the semantic information of each node in the text graph of different domains is encoded to capture the local embedding and global embedding information of the graph. The representation learner can be composed of a set of dual graph convolutional networks, denoted as f g (A r ,X r θ g ), where r∈{s,t}, θ g is the training parameter.

[0103] For local embedding information, a convolution method based on the graph adjacency matrix is ​​used; for global embedding information, a convolution method based on random walks is used. Both the source and target graphs are input into the dual graph convolutional network, and an attention mechanism is used to fuse the local and global embedding information of text graphs in different domains, ultimately obtaining deep semantic features of text graphs in different domains.

[0104] Regarding the calculation of local embedding information: the convolution method based on the graph adjacency matrix is ​​used to calculate the local embedding information of each node in the text graph. Given the feature matrix X and the adjacency matrix A, the output of the i-th layer local embedding network is Defined as:

[0105]

[0106] Where, is the normalized graph adjacency matrix, is the output matrix of the i-1 layer network is the training weight matrix of the i-th layer network, σ(·) is the activation function, usually using the linear rectification function ReLU(x)=max(0,x), The adjacency matrix and degree matrix of the graph with self-loop edges are calculated as follows:

[0107]

[0108] Where D is the degree matrix of graph G, I is the unit diagonal matrix, and Ii,i =1.

[0109] Regarding the calculation of global embedding information: First, the semantic similarity information between the nodes of the text graph is calculated by the random walk method to obtain the frequency matrix F. Suppose the random walker is at node x at time t i , its state can be defined as s(t)=x i Given adjacency matrix A, F i,j Represents the slave node x i Jump to its adjacent node x j The transition probability, denoted as p, is calculated as follows:

[0110] F i,j =p(s(t+1)=x j |s(t)=x i )=A i,j / ∑ j A i,j

[0111] Based on the frequency matrix F, the positive point mutual information (PPMI) matrix is ​​calculated as follows:

[0112]

[0113] Where p i,j 、p i,* 、p *,j The calculations are as follows:

[0114]

[0115] The convolution method based on PPMI matrix is ​​used to calculate the global embedding information of each node in the text graph. Given the input feature matrix X, the output of the i-th layer global embedding network is Defined as:

[0116]

[0117] Where D is the degree matrix of graph G, is the output matrix of the i-1 layer network is the training weight matrix of the i-th layer network, σ(·) is the activation function, and the linear rectification function ReLU(x)=max(0,x) is usually used.

[0118] In one or some embodiments, fusing the local embedding information and the global embedding information based on the attention mechanism to obtain the first deep semantic feature and the second deep semantic feature includes:

[0119] Utilizing the graph attention mechanism, the first deep semantic feature and the second deep semantic feature are generated by respectively aggregating the local embedding information and the global embedding information of each node in each text graph sample in the first text graph sample set and the second text graph sample set.

[0120] Specifically, both the source and target domain text graphs are input into the dual graph convolutional network to obtain local and global embedding information of the source and target domain text graphs. Graph Attention Mechanism (GAM) is then used to generate a unified representation by aggregating the embedding information from text graphs in different domains. Node features of the source and target domain text graphs are used as input to the attention module, and node embedding information is used as output of the attention module. The local and global attention coefficients between the nodes of the source and target domain text graphs are calculated using the following formulas:

[0121]

[0122] Where r∈{s,t}, are the local and global attention coefficients, respectively, which are used to measure the importance of each node in the graph relative to its adjacent nodes. S is a shared initialization weight matrix, which is used to make the input and output of the attention module have the same dimension. f(·) is usually a single-layer fully connected network, which can be expanded as:

[0123]

[0124] in, represents the jth eigenvalue of the i-th node, α and β are network weights, and σ(·) is the activation function, usually the LeakyReLU function, with the following formula:

[0125] LeakyReLU(x)=max(0,x)+k min(0,x)

[0126] Here, k∈(0,1) is the negative input slope.

[0127] The softmax function is then used to normalize the attention coefficient, and its formula is as follows:

[0128]

[0129] Where exp(·) represents an exponential function with a constant e as the base, and node k represents all adjacent nodes of node i. After using the attention mechanism and normalization, the final output H representing the learner is obtained r :

[0130]

[0131] Where, are the local and global normalized attention coefficients, respectively.

[0132] In one or some embodiments, inputting the first deep semantic feature into a label classifier and determining the classifier loss and the first label includes:

[0133] Inputting the first deep semantic feature into a label classifier to obtain a predicted value of the first label;

[0134] Determine a cross entropy loss based on the predicted value and the true value of the labeled nodes in the first text graph sample set, and use the cross entropy loss as the classifier loss;

[0135] Inputting the second deep semantic feature into the label classifier to obtain the second label includes:

[0136] Inputting the second deep semantic feature into the label classifier to obtain output codes of corresponding nodes, and determining the second label according to the output codes;

[0137] Inputting the first deep semantic feature and the second deep semantic feature into a domain discriminator to determine the domain adversarial loss includes:

[0138] Inputting the first deep semantic feature and the second deep semantic feature into a domain identifier to obtain a domain label value;

[0139] The domain adversarial loss between the first text image sample set and the second text image sample set is calculated according to the domain label value and the earthwork movement distance.

[0140] Specifically, first, the first label and classification loss of the source domain text are calculated through the label classifier: based on the deep features of the source domain text graph extracted by the representation learner, the category of the text graph node is predicted through the label classifier.

[0141] Optionally, the label classifier is composed of a multi-layer fully connected network, which is represented by f c (H r θ c ), where r∈{s,t}, H r is the deep features of text graphs in different domains, θ c is a trainable parameter. The output of the label classifier is the category label, so the predicted label value of the node in the source domain text graph, that is, the first label, is expressed as:

[0142]

[0143] The cross entropy loss of all labeled nodes in the source domain text graph is used as the loss function of the label classifier (classifier loss):

[0144]

[0145] Where Y s is the true label matrix of the source domain text graph nodes, represents the actual output matrix of category k for node i in the source domain text graph, C is the number of categories, n s is the number of nodes in the source domain text graph.

[0146] Since all text graph nodes in the target domain are unlabeled, the deep features of the target domain text graph are input into the label classifier to obtain the output encoding of the target domain text graph node. The predicted label value of the node in the target domain text graph is calculated as follows:

[0147]

[0148] Assign a pseudo label based on the output encoding That is, the second label, which is calculated by the following formula:

[0149]

[0150] Where, Represents the actual output value of the kth category obtained by the label classifier of the target domain text graph node.

[0151] Furthermore, the domain discriminator is used to assist the representation learner in aligning the deep features of the text graphs in the source domain and the target domain: the representation learner is regarded as the generator in the generative adversarial network (GAN), which is used to learn domain-invariant text graph node representations, and the domain discriminator is regarded as the discriminator in the GAN, which is used to identify whether the node representation comes from the source domain or the target domain. The two constitute a mutually competitive adversarial relationship.

[0152] The deep features of the nodes of the source domain and target domain text graphs extracted by the representation learner are input into the domain discriminator, and the output is the domain label value. The domain discriminator is preferably composed of a multi-layer fully connected network, denoted as f d (H r θ d ), where r∈{s,t}, H r is the deep features of text graphs in different domains, θ d is a trainable parameter.

[0153] Then, the earth movement distance (EMD) is used to calculate the domain adversarial loss of the source domain and target domain text graphs, which is used to measure the distribution difference of node representations between text graphs in different domains, as shown in the following formula:

[0154]

[0155] Where n s 、n tare the number of nodes in the text graph of the original domain and the target domain, respectively.

[0156] To avoid the gradient vanishing or exploding problem, the domain discriminator parameters θ are calculated d The gradient penalty is:

[0157]

[0158] Where, is the node representation of the source and target domain text graphs and the random points on the line between them, is the gradient, ||·|| is the two-norm, and the formula is as follows:

[0159]

[0160] in, is the dimension of node representation, is the gradient vector representing the node, that is:

[0161]

[0162] Ultimately, the optimization objective function between the domain discriminator and the representation learner is as follows:

[0163]

[0164] Where γ is the gradient penalty coefficient. When training the representation learner, the value of γ should be set to 0.

[0165] In one or some embodiments, determining the class alignment loss based on the difference between text graph samples of the same class in the first text graph sample set and the second text graph sample set includes:

[0166] Calculate the covariance of the first deep semantic feature and the second deep semantic feature of each same category in the first text graph sample set and the second text graph sample set respectively;

[0167] The distance between the covariance of the first deep semantic feature and the second deep semantic feature of the same category is calculated, and the sum of the distances is used as the class alignment loss.

[0168] The covariance may be first-order, second-order or higher-order covariance.

[0169] Specifically, for texts in different fields, there is usually a problem of category imbalance, that is, there are significant differences in the number of text graph nodes in different categories in different fields, which often leads to a decrease in the migration performance of the model.

[0170] In order to solve this problem, an embodiment of the present invention proposes a class alignment loss for aligning the deep features of text graphs in the same category in different fields, and achieves fine-grained alignment at the category level by minimizing the class alignment loss, thereby solving the category imbalance problem between text graphs in different domains to a certain extent. Considering that the target domain text does not contain labels, the target domain pseudo-labels generated by the label classifier are used for category alignment. Specifically, the class alignment loss is defined as the distance between the second-order statistics (covariance) of the deep features of the same category of text graphs in the source domain and the target domain, that is:

[0171]

[0172] Where C is the number of label categories, cov(·) is the covariance matrix, is the square of the matrix Frobenius norm, which is calculated as follows:

[0173]

[0174]

[0175] Where r∈{s,t}, is the number of text graph nodes of the kth category in domain r, is the deep feature of the text graph of the kth category in domain r, represents the i-th feature vector of the k-th category in the domain r, N is the feature dimension, Features The mean of , that is:

[0176]

[0177] In one embodiment, performing iterative training to optimize the classifier loss, the class alignment loss, and the domain adversarial loss until a training end condition is met, and determining the cross-domain text classification model includes:

[0178] constructing an objective loss function based on the classifier loss, the class alignment loss, and the domain adversarial loss;

[0179] Performing iterative training using the first text graph sample set and the second text graph sample set to update parameters in the cross-domain text classification model;

[0180] When the target loss function is minimized or the number of iterative training reaches a preset value, the training is stopped and the current cross-domain text classification model is determined to be a trained cross-domain text classification model.

[0181] Optionally, consider the above classifier loss L c , class alignment loss L caand domain adversarial loss L d , by continuously updating the representation learner parameters θ in the model g , label classifier parameters θ c , domain discriminator parameters θ d , which enables the model to learn the multiple semantic and domain-invariant features between text graphs in different fields and categories. The final objective loss function of the model is as follows:

[0182]

[0183] Where μ, λ, and γ are the balancing factors for different loss terms during training.

[0184] Model training ends when the convergence condition is reached or the number of iterations reaches the preset value.

[0185] Figure 5 FIG. 1 is a flow chart showing an embodiment of a method for classifying cross-domain texts according to the present invention, wherein the method is applied in a computing device. Figure 5 As shown, the method includes the following steps:

[0186] Step 510: Receive text to be detected.

[0187] Specifically, the text to be detected may be a variety of texts across fields, and it is preferably preprocessed to obtain a text graph having the same structure and composition as the above-mentioned text graph.

[0188] Step 520: Input the text to be detected into the label classifier of the cross-domain text classification model to obtain the classification label of the text to be detected; wherein, the cross-domain text classification model is trained according to any of the above-mentioned training method embodiments.

[0189] Optionally, input the target domain unlabeled text into the model and obtain the label prediction value of the target domain text based on the output of the label classifier. The calculation is as follows:

[0190]

[0191] Where, Represents the actual output value of the kth category obtained by the classification model for the target domain text.

[0192] In an optional implementation example, the training steps of the cross-domain text classification algorithm based on dual graph convolutional multi-semantic alignment (DGCMSA) are shown in Table 1. First, the domain discriminator f is optimized using the gradient descent method. d The parameter θ d Then, fix θ d The value of remains unchanged, by minimizing the classifier loss L c , class alignment loss Lca and domain adversarial loss L d , update the representation learner f g The parameter θ g and label classifier f c The parameter θ c Finally, when the model converges, the learned deep representation of the target domain text graph is fed into the trained label classifier f c , the category label of the target domain text can be predicted.

[0193] Table 1

[0194]

[0195]

[0196] Figure 6 FIG. 1 is a schematic diagram showing a structural embodiment of a training device for a cross-domain text classification model according to the present invention. Figure 6 As shown, the apparatus 600 includes:

[0197] An embedding information acquisition module 610 is adapted to acquire a first text graph sample set and a second text graph sample set, and input each of these into a representation learner to obtain local embedding information and global embedding information corresponding to each text graph sample;

[0198] A semantic feature extraction module 620 is adapted to fuse the local embedding information and the global embedding information based on an attention mechanism to obtain a first deep semantic feature and a second deep semantic feature;

[0199] a classification label acquisition module 630 adapted to input the first deep semantic feature into a label classifier, determine a classifier loss and a first label, and input the second deep semantic feature into the label classifier to obtain a second label;

[0200] an adversarial loss determination module 640 , adapted to input the first deep semantic feature and the second deep semantic feature into a domain discriminator to determine a domain adversarial loss;

[0201] an alignment loss determining module 650 adapted to determine a class alignment loss based on differences between text graph samples of the same class in the first text graph sample set and the second text graph sample set;

[0202] The classification model determination module 660 is adapted to perform iterative update training to optimize the classifier loss, the class alignment loss, and the domain adversarial loss until a training end condition is met, thereby determining the cross-domain text classification model.

[0203] In one embodiment, the embedded information acquisition module 610 is further adapted to:

[0204] Calculating local embedding information of each node in each of the text graph samples using convolution based on the graph adjacency matrix;

[0205] The semantic similarity between each node in each text graph sample is calculated using a random walk method to obtain a frequency matrix; based on the frequency matrix, a positive point mutual information matrix is ​​calculated; and based on the convolution of the positive point mutual information matrix, the global embedding information of each node is calculated.

[0206] In one embodiment, the semantic feature extraction module 620 is further adapted to:

[0207] Utilizing the graph attention mechanism, the first deep semantic feature and the second deep semantic feature are generated by respectively aggregating the local embedding information and the global embedding information of each node in each text graph sample in the first text graph sample set and the second text graph sample set.

[0208] In one embodiment, the classification label acquisition module 630 is further adapted to:

[0209] Inputting the first deep semantic feature into a label classifier to obtain a predicted value of the first label;

[0210] Determine a cross entropy loss based on the predicted value and the true value of the labeled nodes in the first text graph sample set, and use the cross entropy loss as the classifier loss;

[0211] The classification label acquisition module 630 is further adapted to:

[0212] Inputting the second deep semantic feature into the label classifier to obtain output codes of corresponding nodes, and determining the second label according to the output codes;

[0213] The adversarial loss determination module 640 is further adapted to:

[0214] Inputting the first deep semantic feature and the second deep semantic feature into a domain identifier to obtain a domain label value;

[0215] The domain adversarial loss between the first text image sample set and the second text image sample set is calculated according to the domain label value and the earthwork movement distance.

[0216] In one embodiment, the alignment loss determination module 650 is further adapted to:

[0217] Calculate the covariance of the first deep semantic feature and the second deep semantic feature of each same category in the first text graph sample set and the second text graph sample set respectively;

[0218] The distance between the covariance of the first deep semantic feature and the second deep semantic feature of the same category is calculated, and the sum of the distances is used as the class alignment loss.

[0219] In one embodiment, the classification model determination module 660 is further adapted to:

[0220] constructing an objective loss function based on the classifier loss, the class alignment loss, and the domain adversarial loss;

[0221] Performing iterative training using the first text graph sample set and the second text graph sample set to update parameters in the cross-domain text classification model;

[0222] When the target loss function is minimized or the number of iterative training reaches a preset value, the training is stopped and the current cross-domain text classification model is determined to be a trained cross-domain text classification model.

[0223] Figure 7 FIG. 1 shows a schematic diagram of a cross-domain text classification device embodiment of the present invention. Figure 7 As shown, the apparatus 700 includes:

[0224] The text acquisition module 710 receives the text to be detected.

[0225] Specifically, the text to be detected may be a variety of texts across fields, and it is preferably preprocessed to obtain a text graph having the same structure and composition as the above-mentioned text graph.

[0226] Text classification module 720: inputs the text to be detected into the label classifier of the cross-domain text classification model to obtain the classification label of the text to be detected; wherein, the cross-domain text classification model is trained according to any of the above-mentioned training method embodiments.

[0227] In summary, the present invention discloses a cross-domain text classification scheme based on dual graph convolution multi-semantic alignment. First, a representation learner composed of a dual graph convolutional network is used to extract the local embedding and global embedding information of the source domain and target domain text graphs, and the two are fused through the attention mechanism to obtain the deep semantic features of the text graphs of different domains. Then, the deep features of the source domain and target domain text graphs are input into the label classifier to obtain the predicted label (first label) of the source domain text and the pseudo label (second label) of the target domain text, and the label classifier is trained by calculating the classifier loss of the source domain text. Subsequently, the class alignment loss of the deep features of the text graphs of different domains is calculated using the real label of the source domain text and the pseudo label of the target domain text to assist in the training of the representation learner. Then, the deep features of the text graphs of the source domain and target domain are input into the domain discriminator, and the domain discriminator is trained by calculating the domain adversarial loss, while assisting the representation learner to align the deep features between the text graphs of different domains. Finally, the weight parameters of the model are continuously updated by combining the classifier loss, class alignment loss and domain adversarial loss. After the model training is completed, the target domain unlabeled text is input into the model, and the predicted label of the target domain text is obtained based on the output of the label classifier.

[0228] The cross-domain text classification solution based on dual graph convolution multi-semantic alignment provided by the embodiment of the present invention fully considers three aspects: classifier loss, class alignment loss and domain adversarial loss, in order to solve the cross-domain text classification problem in practical scenarios.

[0229] The embodiments of the present invention achieve the following beneficial effects:

[0230] 1. An embodiment of the present invention proposes a cross-domain text classification scheme based on dual graph convolution multi-semantic alignment. By jointly training source domain labeled text and target domain unlabeled text, a dual graph convolutional network is used to simultaneously capture the local embedding and global embedding information of text graphs in different domains, and the two are fused through an attention mechanism to learn the deep semantic features of text graphs in different domains. By simultaneously considering the classifier loss, class alignment loss, and domain adversarial loss, the deep semantic features of text graphs in different domains are multi-aligned, so that the model can effectively improve the prediction accuracy of target domain text. The embodiment of the present invention focuses on the study of cross-domain classification of text data, and uses labeled source domain text information to assist in learning text classification in the unlabeled target domain.

[0231] 2. The embodiment of the present invention utilizes the deep features of the source domain and target domain text graphs as well as the source domain real labels and the target domain pseudo labels to further calculate the class alignment loss, which can alleviate the category imbalance problem between texts in different domains; the domain discriminator assists the representation learner in aligning the deep features of the source domain and target domain text graphs by calculating the domain adversarial loss, which can realize the migration of the model from the source domain to the target domain; thereby solving the cross-domain text classification problem in actual scenarios.

[0232] An embodiment of the present invention provides a non-volatile computer storage medium, which stores at least one executable instruction. The computer executable instruction can execute the above-mentioned cross-domain text classification model training method or cross-domain text classification method in any of the above-mentioned method embodiments.

[0233] Figure 8 The schematic diagram of the structure of the computing device embodiment of the present invention is shown. The specific embodiment of the present invention does not limit the specific implementation of the computing device.

[0234] like Figure 8 As shown, the computing device may include: a processor 802 , a communications interface 804 , a memory 806 , and a communication bus 808 .

[0235] Processor 802, communication interface 804, and memory 806 communicate with each other via communication bus 808. Communication interface 804 is used to communicate with other devices, such as client devices or other server network elements. Processor 802 is used to execute program 810, which may specifically perform the relevant steps of the aforementioned cross-domain text classification model training method or cross-domain text classification method embodiment for a computing device.

[0236] Specifically, the program 810 may include program codes, which include computer operation instructions.

[0237] Processor 802 may be a central processing unit (CPU), an application-specific integrated circuit (ASIC), or one or more integrated circuits configured to implement embodiments of the present invention. The one or more processors included in a computing device may be processors of the same type, such as one or more CPUs, or processors of different types, such as one or more CPUs and one or more ASICs.

[0238] The memory 806 is used to store the program 810. The memory 806 may include a high-speed RAM memory, and may also include a non-volatile memory (non-volatile memory), such as at least one disk memory.

[0239] The program 810 can be specifically used to enable the processor 802 to execute operations corresponding to the above-mentioned cross-domain text classification model training method or cross-domain text classification method embodiment.

[0240] The algorithm or demonstration provided herein are not inherently relevant to any particular computer, virtual system or other equipment. Various general-purpose systems may also be used together with the teachings based on this. According to the above description, it is apparent that the structure required for constructing this type of system. In addition, the embodiment of the present invention is not directed to any specific programming language yet. It should be understood that various programming languages ​​can be utilized to realize the content of the present invention described herein, and the above description of specific languages ​​is for the purpose of disclosing the best mode of the present invention.

[0241] In the description provided herein, numerous specific details are described. However, it is understood that embodiments of the present invention may be practiced without these specific details. In some instances, well-known methods, structures, and techniques are not shown in detail so as not to obscure the understanding of this description.

[0242] Similarly, it should be understood that in order to streamline the present invention and aid in understanding one or more of the various inventive aspects, in the above description of exemplary embodiments of the invention, various features of the embodiments of the invention are sometimes grouped together into a single embodiment, figure, or description thereof. However, this disclosed method should not be interpreted as reflecting an intention that the claimed invention requires more features than are expressly recited in each claim. Rather, as reflected in the claims below, inventive aspects lie in less than all the features of the individual embodiments disclosed above. Accordingly, the claims that follow the detailed description are hereby expressly incorporated into this detailed description, with each claim standing on its own as a separate embodiment of the invention.

[0243] Those skilled in the art will appreciate that the modules in the devices in the embodiments may be adaptively changed and arranged in one or more devices different from the embodiments. The modules or units or components in the embodiments may be combined into one module or unit or component, and in addition may be divided into multiple submodules or subunits or subcomponents. All features disclosed in this specification (including the accompanying claims, abstracts and drawings) and all processes or units of any method or device disclosed herein may be combined in any combination, except that at least some of such features and / or processes or units are mutually exclusive. Unless expressly stated otherwise, each feature disclosed in this specification (including the accompanying claims, abstracts and drawings) may be replaced by an alternative feature providing the same, equivalent or similar purpose.

[0244] Furthermore, those skilled in the art will appreciate that although some embodiments herein include certain features included in other embodiments but not other features, combinations of features from different embodiments are intended to be within the scope of the present invention and to form different embodiments. For example, in the claims below, any of the claimed embodiments may be used in any combination.

[0245] The various component embodiments of the present invention can be implemented in hardware, or in software modules running on one or more processors, or in a combination thereof. It will be appreciated by those skilled in the art that a microprocessor or digital signal processor (DSP) can be used in practice to implement some or all of the functions of some or all of the components according to an embodiment of the present invention. The present invention can also be implemented as a device or apparatus program (e.g., a computer program and a computer program product) for executing a part or all of the methods described herein. Such a program implementing the present invention can be stored on a computer-readable medium, or can have the form of one or more signals. Such a signal can be downloaded from an Internet website, or provided on a carrier signal, or provided in any other form.

[0246] It should be noted that the above embodiments illustrate rather than limit the invention, and that alternative embodiments may be devised by a person skilled in the art without departing from the scope of the appended claims. In the claims, any reference signs placed between brackets should not be construed as limiting the claims. The word "comprising" does not exclude the presence of elements or steps not listed in the claims. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. The present invention may be implemented by means of hardware comprising several different elements and by means of appropriately programmed computers. In a unit claim enumerating several means, several of these means may be embodied by the same item of hardware. The use of the words first, second, and third etc. does not indicate any order. These words may be interpreted as names. The steps in the above embodiments should not be understood as limiting the order of execution unless otherwise specified.

Claims

1. A training method for a cross-domain text classification model, the method comprising: Obtain a first text graph sample set and a second text graph sample set, input them into the representation learner respectively, and obtain local embedding information and global embedding information corresponding to each text graph sample; Based on the attention mechanism, each of the local embedding information and the global embedding information are respectively integrated to obtain a first deep semantic feature and a second deep semantic feature; Inputting the first deep semantic feature into a label classifier to determine a classifier loss and a first label, and inputting the second deep semantic feature into the label classifier to obtain a second label; specifically comprising: inputting the first deep semantic feature into the label classifier to obtain a predicted value of the first label; determining a cross entropy loss based on the predicted value and the true value of the labeled nodes in the first text graph sample set, and using the cross entropy loss as the classifier loss; inputting the second deep semantic feature into the label classifier to obtain an output code of each corresponding node, and determining the second label based on the output code; Inputting the first deep semantic feature and the second deep semantic feature into a domain discriminator to determine a domain adversarial loss; specifically comprising: inputting the first deep semantic feature and the second deep semantic feature into the domain discriminator to obtain a domain label value; and calculating a domain adversarial loss between the first text graph sample set and the second text graph sample set based on the domain label value and the earthwork movement distance; determining a class alignment loss based on differences between text graph samples of the same class in the first text graph sample set and the second text graph sample set; Iterative update training is performed to optimize the classifier loss, the class alignment loss, and the domain adversarial loss until a training end condition is met, thereby determining the cross-domain text classification model.

2. The method according to claim 1, characterized in that The first text graph sample set and the second text graph sample set are obtained and respectively input into the representation learner to obtain local embedding information and global embedding information corresponding to each text graph sample, including: Calculating local embedding information of each node in each of the text graph samples using convolution based on the graph adjacency matrix; The semantic similarity between each node in each text graph sample is calculated using a random walk method to obtain a frequency matrix; based on the frequency matrix, a positive point mutual information matrix is ​​calculated; and based on the convolution of the positive point mutual information matrix, the global embedding information of each node is calculated.

3. The method according to claim 1, characterized in that The first deep semantic feature and the second deep semantic feature are obtained by fusing the local embedding information and the global embedding information based on the attention mechanism, including: Utilizing the graph attention mechanism, the first deep semantic feature and the second deep semantic feature are generated by respectively aggregating the local embedding information and the global embedding information of each node in each text graph sample in the first text graph sample set and the second text graph sample set.

4. The method according to any one of claims 1 to 3, characterized in that The determining of the class alignment loss according to the difference between the text graph samples of the same class in the first text graph sample set and the second text graph sample set includes: Calculate the covariance of the first deep semantic feature and the second deep semantic feature of each same category in the first text graph sample set and the second text graph sample set respectively; The distance between the covariance of the first deep semantic feature and the second deep semantic feature of the same category is calculated, and the sum of the distances is used as the class alignment loss.

5. The method according to any one of claims 1 to 3, characterized in that The iterative training is performed to optimize the classifier loss, the class alignment loss, and the domain adversarial loss until a training end condition is met, and determining the cross-domain text classification model includes: constructing an objective loss function based on the classifier loss, the class alignment loss, and the domain adversarial loss; Performing iterative training using the first text graph sample set and the second text graph sample set to update parameters in the cross-domain text classification model; When the target loss function is minimized or the number of iterative training reaches a preset value, the training is stopped and the current cross-domain text classification model is determined to be a trained cross-domain text classification model.

6. A cross-domain text classification method, the method comprising: Receive the text to be detected; The text to be detected is input into a label classifier in a cross-domain text classification model to obtain a classification label of the text to be detected; wherein the cross-domain text classification model is trained according to the method described in any one of claims 1-5.

7. A training device for a cross-domain text classification model, comprising: An embedding information acquisition module, adapted to acquire a first text graph sample set and a second text graph sample set, and input them into the representation learner respectively, to obtain local embedding information and global embedding information corresponding to each text graph sample; a semantic feature extraction module adapted to fuse the local embedding information and the global embedding information based on an attention mechanism to obtain a first deep semantic feature and a second deep semantic feature; A classification label acquisition module is adapted to input the first deep semantic feature into a label classifier, determine a classifier loss and a first label, and input the second deep semantic feature into the label classifier to obtain a second label; specifically comprising: inputting the first deep semantic feature into the label classifier to obtain a predicted value of the first label; determining a cross entropy loss based on the predicted value and the true value of the labeled nodes in the first text graph sample set, and using the cross entropy loss as the classifier loss; inputting the second deep semantic feature into the label classifier to obtain an output code of each corresponding node, and determining the second label based on the output code; The adversarial loss determination module is adapted to input the first deep semantic feature and the second deep semantic feature into a domain discriminator to determine a domain adversarial loss. The module specifically comprises: inputting the first deep semantic feature and the second deep semantic feature into the domain discriminator to obtain a domain label value; and calculating the domain adversarial loss between the first text graph sample set and the second text graph sample set based on the domain label value and the earthwork movement distance. an alignment loss determining module, adapted to determine a class alignment loss based on differences between text graph samples of the same class in the first text graph sample set and the second text graph sample set; The classification model determination module is suitable for performing iterative update training to optimize the classifier loss, the class alignment loss and the domain adversarial loss until the training end condition is met, thereby determining the cross-domain text classification model.

8. A computing device comprising: A processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface communicate with each other via the communication bus; The memory is used to store at least one executable instruction, and the executable instruction enables the processor to execute operations corresponding to the training method of the cross-domain text classification model according to any one of claims 1-5 or the cross-domain text classification method according to claim 6.

9. A computer storage medium, wherein at least one executable instruction is stored in the storage medium, and the executable instruction enables a processor to execute operations corresponding to the training method of a cross-domain text classification model according to any one of claims 1-5 or the cross-domain text classification method according to claim 6.

Citation Information

Patent Citations

  • Fine-grained zero-sample classification method based on multi-layer semantic supervised attention model

    CN109447115A

  • Deep learning multi-label text classification method based on graph model

    CN113806547A