Text data processing method and device, computer device and storage medium

By extracting and classifying the semantic role features of text data and performing gradient inversion and feature mapping processing, the problem of insufficient feature vector representation in traditional language models in text data processing is solved, and more efficient text data relevance calculation is achieved.

CN115129869BActive Publication Date: 2025-10-17TENCENT TECH WUHAN
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202210578761.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-05-26
Publication Date
2025-10-17
Estimated Expiration
2042-05-26

AI Technical Summary

Technical Problem

Traditional language models lack the ability to represent feature vectors in text data processing, resulting in low text data processing efficiency and low accuracy in relevance determination.

Method used

By extracting the first text feature aligned with the semantic role and the second text feature embedded with the target semantic role from the text data pair, gradient inversion and feature mapping processing are performed to obtain pure features representing the semantic relationship between data and common features of the fuzzy relationship, respectively. The features are then reorganized through the self-attention model, and finally the relevance of the text data is calculated based on the reorganized features.

Benefits of technology

The feature accuracy of text data processing and the accuracy of correlation calculation are improved, thereby improving the efficiency of text data processing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115129869B_ABST
    Figure CN115129869B_ABST
Patent Text Reader

Abstract

The application relates to a text data processing method and device, computer equipment, a computer readable storage medium and a computer program product. The method comprises the following steps: extracting text features of target text data pairs from target text data pairs comprising at least two text data; performing feature classification on the text features to obtain pure features representing semantic relationships between data and public features representing fuzzy relationships between data; recombining the pure features and the public features to obtain recombined features of the target text data pairs; and performing correlation calculation on the at least two text data in the target text data pairs based on the recombined features to determine the correlation of the at least two text data. The method can improve the processing efficiency of the text data.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of computer, in particular to a text data processing method and device, computer equipment, computer readable storage medium and computer program product. BACKGROUND

[0002] With the development of computer technology, natural language processing technology related to text data has appeared and has been widely used, which can realize communication between users and computers through the use of natural language such as text. In the traditional technology, a language model capable of realizing natural language reasoning can be used to determine the relevance of text data.

[0003] The language model in the traditional technology generally obtains a vector representation of the text data first, and then determines the relevance of the text data according to the vector representation. However, this approach has two obvious defects: first, the language model is insufficient in obtaining feature vector representation, and second, the accuracy of relevance determination using extracted text features is not high, resulting in relatively low processing efficiency of text data. SUMMARY

[0004] Therefore, it is necessary to provide a text data processing method, device, computer equipment, computer readable storage medium and computer program product capable of improving the processing efficiency of text data in view of the above technical problems.

[0005] In a first aspect, the present application provides a text data processing method. The method comprises:

[0006] extracting text features of a target text data pair comprising at least two text data from the target text data pair;

[0007] performing feature classification on the text features to obtain pure features representing semantic relationships between data and public features representing fuzzy relationships between data;

[0008] recombining the pure features and the public features to obtain recombined features of the target text data pair;

[0009] based on the recombined features, performing relevance calculation on at least two text data in the target text data pair to determine the relevance of the at least two text data.

[0010] In one embodiment, the extracting text features of a target text data pair comprising at least two text data from the target text data pair comprises:

[0011] extracting semantic role alignment first text features and target semantic role embedded second text features from a target text data pair comprising at least two text data;

[0012] The feature classification on the text features respectively obtains a pure feature representing semantic relationships between data and a public feature representing fuzzy relationships between data.

[0013] The gradient inversion processing on the second text feature obtains a public feature representing fuzzy relationships between the at least two text data.

[0014] According to the public feature, the feature mapping processing on the first text feature obtains a pure feature representing semantic relationships between the at least two text data.

[0015] In an embodiment, the gradient inversion processing on the second text feature to obtain a public feature representing fuzzy relationships between the at least two text data comprises:

[0016] In the forward propagation process of the second text feature, a feature identity transformation is performed, and in the backward propagation process, the gradient direction is negated to obtain a gradient inversion result of the second text feature.

[0017] The gradient inversion result of the second text feature is determined as the public feature of the target text data pair.

[0018] In an embodiment, according to the public feature, the feature mapping processing on the first text feature to obtain a pure feature representing semantic relationships between the at least two text data comprises:

[0019] The first text feature is mapped to a target feature direction of the public feature to obtain a mapping feature corresponding to the first text feature.

[0020] The feature difference calculation on the first text feature and the mapping feature corresponding to the first text feature obtains a pure feature of the target text data pair.

[0021] In an embodiment, the first text feature of semantic role alignment comprises:

[0022] The word segmentation processing on the target text data pair obtains each word segmentation of the target text data pair.

[0023] The vectorization processing on each word segmentation respectively obtains each word segmentation feature of the target text data pair.

[0024] The merging of each word segmentation feature and the alignment of semantic roles corresponding to each word segmentation obtain the first text feature of the target text data pair.

[0025] In an embodiment, the second text feature embedded with the target semantic role is extracted, including:

[0026] The target text data pair is subjected to word segmentation processing to obtain each word segmentation of the target text data pair.

[0027] Based on the semantic role corresponding to each word segmentation, a target word segmentation corresponding to a target semantic role is determined.

[0028] Each word segmentation is subjected to vectorization processing to obtain each word segmentation feature of the target text data pair.

[0029] Each word segmentation feature is merged, and a target word segmentation feature corresponding to the target word segmentation is embedded to obtain a second text feature of the target text data pair.

[0030] In an embodiment, the recombined feature of the pure feature and the public feature is obtained, including:

[0031] Based on the pure feature and the public feature, a pure feature weight of the pure feature and a public feature weight of the public feature are determined through a self-attention model.

[0032] According to the pure feature and the pure feature weight, and the public feature and the public feature weight, the pure feature and the public feature are subjected to weighted summation to obtain a recombined feature of the target text data pair.

[0033] In an embodiment, the correlation between at least two text data in the target text data pair is calculated based on the recombined feature to determine the correlation between the at least two text data, including:

[0034] Based on the recombined feature, a correlation probability parameter of at least two text data in the target text data pair corresponding to the recombined feature is calculated.

[0035] According to the correlation probability parameter of at least two text data in the target text data pair, the correlation between the at least two text data is determined.

[0036] In a second aspect, the present application further provides a text data processing device. The device comprises:

[0037] A feature acquisition module is configured to extract a text feature of a target text data pair from the target text data pair comprising at least two text data.

[0038] A feature classification module is configured to perform feature classification on the text feature to obtain a pure feature representing a semantic relationship between data and a public feature representing a fuzzy relationship between data, respectively.

[0039] a feature recombination module, configured to recombine the pure feature and the common feature, to obtain a recombined feature of the target text data pair;

[0040] a result determination module, configured to perform correlation calculation on at least two text data in the target text data pair based on the recombined feature, to determine the correlation of the at least two text data.

[0041] In a third aspect, a computer device is provided. The computer device includes a memory and a processor. The memory stores a computer program. The processor implements the steps of the method described above when executing the computer program.

[0042] In a fourth aspect, a computer readable storage medium is provided. The computer readable storage medium stores a computer program. The computer program, when executed by a processor, implements the steps of the method described above.

[0043] In a fifth aspect, a computer program product is provided. The computer program product includes a computer program. The computer program, when executed by a processor, implements the steps of the method described above.

[0044] The text data processing method, device, computer device, computer readable storage medium and computer program product described above can effectively distinguish semantic information in text features by extracting text features of a target text data pair from a target text data pair including at least two text data, and performing feature classification on the text features to respectively obtain pure features representing semantic relationships between data and common features representing fuzzy relationships between data. Then, the recombined feature of the target text data pair can be obtained by recombining the pure features and the common features, so as to fully utilize and mine useful information in the pure features and the common features, improve the accuracy of the obtained features of the target text data pair, and improve the ability of the feature representation of the obtained target text data pair as a whole. Finally, the correlation of at least two text data in the target text data pair can be determined by performing correlation calculation on the at least two text data based on the recombined feature, so as to improve the accuracy of the determined correlation of the text data, and finally improve the processing efficiency of the text data. BRIEF DESCRIPTION OF DRAWINGS

[0045] Figure 1 An application environment diagram of a text data processing method of an embodiment is shown in FIG. 1;

[0046] Figure 2 A flowchart of a text data processing method of an embodiment is shown in FIG. 2;

[0047] Figure 3A schematic diagram of a framework of a text data processing method according to an embodiment;

[0048] Figure 4 A schematic diagram of a framework of a text data processing method according to an embodiment;

[0049] Figure 5 A schematic diagram of a feature extraction part of a text data processing method according to an embodiment;

[0050] Figure 6 A schematic diagram of a feature recombination part of a text data processing method according to an embodiment;

[0051] Figure 7 A schematic diagram of a framework of a text data processing method according to an embodiment;

[0052] Figure 8 A schematic diagram of a flow of a text data processing method according to an embodiment;

[0053] Figure 9 A structural block diagram of a text data processing apparatus according to an embodiment;

[0054] Figure 10 An internal structure diagram of a computer device according to an embodiment;

[0055] Figure 11 An internal structure diagram of a computer device according to another embodiment. DETAILED DESCRIPTION

[0056] In order to make the purposes, technical solutions and advantages of the present application clearer, the present application will be further described in detail below with reference to the drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and should not be used to limit the present application.

[0057] It should be noted that the text data involved in the present application is data authorized by the user or fully authorized by all parties, and the collection, use and processing of the relevant data need to comply with the relevant laws, regulations and standards of the relevant countries and regions.

[0058] In an embodiment, the text data processing method provided by the present application can be applied to an application environment as shown in Figure 1 The application environment can involve terminal 102 and server 104 at the same time. In some embodiments, terminal 106 can also be involved at the same time. The terminal 102 and the terminal 106 communicate with the server 104 through a network. The data storage system can store the data required to be processed by the server 104. The data storage system can be integrated on the server 104, or placed on the cloud or other servers.

[0059] Specifically, the user can have a voice interaction with the terminal 102 and / or the terminal 106, so that the terminal 102 and / or the terminal 106 converts the voice data into text data. Alternatively, the user can directly input the text data through the terminal 102 and / or the terminal 106. Alternatively, the terminal 102 and / or the terminal 106 can obtain the text data from any public text data set. In this way, the server 104 can obtain the text data from the terminal 102 and / or the terminal 106, so that the server 104 can combine any two text data to obtain a text data pair based on the obtained text data. The two text data to be combined can be from the same terminal or from different terminals.

[0060] Then, the server 104 can extract text features of the target text data pair from the target text data pair including the at least two text data, perform feature classification on the text features, and respectively obtain pure features representing semantic relationships between data and public features representing fuzzy relationships between data; further, recombine the pure features and the public features to obtain recombined features of the target text data pair; based on the recombined features, perform correlation calculation on the at least two text data in the target text data pair to determine the correlation of the at least two text data. The server 104 can store the determined correlation of the at least two text data. Alternatively, the correlation of the at least two text data is sent to the terminal 102 and / or the terminal 106. So that the terminal 102, the terminal 106 and the server 104 perform subsequent operations. For example, to realize voice interaction, data search recommendation, etc.

[0061] The terminal 102 and the terminal 106 can be, but are not limited to, various desktop computers, notebook computers, smart phones, Internet of Things devices and portable wearable devices, etc. The Internet of Things device can be a smart speaker, a smart television, a smart vehicle device, etc. The portable wearable device can be a smart watch, a smart bracelet, etc. The server 104 can be implemented by an independent server or a server cluster composed of multiple servers.

[0062] Natural language processing (NLP) is an important direction in the field of computer science and the field of artificial intelligence. It studies various theories and methods that can realize effective communication between people and computers using natural language. Natural language processing is a science that integrates linguistics, computer science and mathematics. Therefore, the research in this field will involve natural language, i.e. the language used in daily life, so it has a close relationship with the study of linguistics. Natural language processing technology usually includes text processing, semantic understanding, machine translation, robot question and answer, knowledge graph, etc. The embodiments of the present application are mainly text data processing methods for processing text data.

[0063] In one embodiment, as shown in Figure 2 Fig. 1, a text data processing method is provided, which is applied to the server 104 in Figure 1 for example, and includes the following steps:

[0064] Step S202, extracting text features of the target text data pair from the target text data pair including at least two text data.

[0065] Text data refers to data that uses written language to express semantics, and the text data can be a sentence, a paragraph, or a chapter, etc. The text data is semi-structured data, which can include structured data and unstructured data. The structured data can be title, author, date, length, classification, etc., and the unstructured data can be abstract, content, etc. The semantic expression of the text data can be embodied in the cases of polysemy, univocity, context correlation in time and space, etc.

[0066] A text data pair refers to a data pair composed of at least two text data, and a target text data pair refers to a text data pair that needs to be processed and determines the correlation between the text data. The text features refer to the features obtained after feature extraction processing of the target text data pair, which can also be called traditional features. In this embodiment, the target text data pair is obtained, which includes at least two text data. Then, the text features of the target text data pair are extracted from the target data pair including at least two text data.

[0067] Specifically, the text features of the target text data pair can be extracted in any possible way according to actual technical needs. For example, the text features can be extracted by a pre-trained neural network model. The neural network model can be a Bags of words model, which can make a dictionary of all words appearing in the training data, and determine the text features of the target text data pair by counting the number of times each word appears in the target text data pair. The neural network model can also be a BERT model or a derivative model thereof, which is composed of multiple layers of Transformer stacked. The Transformer can integrate all word information in the target text data pair due to its Self-Attention mechanism, and obtain the text features of the target text data pair. The text features of the target text data pair can also be obtained by TF-IDF algorithm.

[0068] In one embodiment, the text features of the target text data pair are extracted from the target text data pair comprising at least two text data, which can be completed by a feature extraction part in the pre-trained text processing model. The feature extraction part can be composed of one or more neural network models in the above-mentioned embodiments. When the feature extraction part is composed of multiple neural network models, the feature extraction part can be a multi-branch structure with multiple branches, and each branch can extract text features respectively and then be processed subsequently. Specifically, please refer to Figure 3 The feature extraction part in the text processing model obtains the target text data pair and extracts features of the target text data pair, thereby obtaining text features. The text features can be represented by vectors. In one specific example, the text features can be embedding vectors.

[0069] In step S204, the text features are classified to obtain pure features representing semantic relationships between data and common features representing fuzzy relationships between data.

[0070] The text features include pure features and common features. The text features can be understood as the fusion of pure features and common features. The definitions of pure features and common features are relative. Pure features refer to features extracted from text features for representing semantic relationships between data of text data, which can play a more explicit indicating role in determining the semantics or relevance of text data. Common features refer to features extracted from text features for representing fuzzy relationships between data of text data, which cannot play an explicit indicating role in determining the semantics or relevance of text data.

[0071] Taking sentiment classification of text data as an example, sentiment classification aims to extract subjective information such as inclination and evaluation in text data. For example, in sentiment classification of text data, words such as perfect and happy can more explicitly express positive semantics, and words such as terrible and sad can more explicitly express negative semantics. Such words can form pure features of text data after feature extraction and classification. Words such as computer, mobile phone and sound system cannot play an explicit indicating role in sentiment classification of text data. Such words can form common features of text data after feature extraction and classification.

[0072] After the text features of the target text data pair including at least two text data are extracted, the text features can be further classified into pure features representing semantic relationships between the data and common features representing fuzzy relationships between the data. Semantic roles refer to different semantic relationships between predicates (verbs) and arguments (nouns) in the text data in the target text data pair, and the arguments are classified into multiple types, which can be referred to as semantic roles. The semantics of the text data represented by the semantic roles can be used to distinguish the pure features and the common features.

[0073] Specifically, the semantic roles in the target text data pair can be labeled to form a label sequence of the semantic roles corresponding to the target text data pair. When the text features of the target text data pair are extracted, the sequence labeling information of the semantic roles can be embedded into the text features, so that the text features can be classified according to the sequence labeling information of the semantic roles to determine the pure features and the common features.

[0074] It should be noted that the feature types and feature dimensions of the text features, pure features and common features involved in the above embodiments are consistent, so as to facilitate subsequent calculation and processing. When the feature types or feature dimensions of any one of the features are inconsistent, feature type conversion or feature dimension transformation needs to be performed to maintain the consistency of the feature types and feature dimensions, so as to facilitate subsequent operations.

[0075] Step S206, recombining the pure features and the common features to obtain recombined features of the target text data pair.

[0076] The recombined features refer to the features obtained by recombining the pure features and the common features. The recombined features are still the features of the target text data pair. The recombination manner can be set according to actual technical needs.

[0077] Specifically, for example, the pure features and the common features can be simply spliced to obtain the recombined features of the target text data pair. The feature weights corresponding to the pure features and the common features can also be assigned to recombine the pure features and the common features based on the feature weights to obtain the recombined features of the target text data pair.

[0078] Step S208, based on the recombined features, calculating the correlation between the at least two text data in the target text data pair to determine the correlation between the at least two text data.

[0079] The relevance refers to the degree of association between the text data, and determining the relevance of the text data can also be understood as determining whether the text data is of the same semantic. The relevance calculation refers to determining the relevance probability parameter between at least two text data in the target text data pair through calculation, i.e., determining the probability that the text data is of the same meaning. The value range of the relevance probability parameter can be between 0-1. The greater the relevance between the text data, the greater the value of the calculated relevance probability parameter. Specifically, based on the recombination feature, the relevance of at least two text data in the target text data pair is calculated to determine the relevance of the at least two text data.

[0080] It can be understood that when the relevance of at least two text data in the target text data pair is calculated, the relevance between any two combinations of two text data can be determined, and the relevance between multiple text data can also be determined at the same time. For example, the target text data pair contains three text data, which are text data 1, text data 2 and text data 3. After the relevance calculation, the relevance between text data 1 and text data 2, the relevance between text data 1 and text data 3, the relevance between text data 2 and text data 3, and the relevance between text data 1, text data 2 and text data 3 can be determined.

[0081] In an embodiment, please refer to Figure 3 The feature classification, feature recombination and relevance determination of the text feature in the above embodiment can be completed by the feature recombination part in the pre-trained text processing model. The input of the feature recombination part is the text feature extracted by the feature extraction part. It can be understood that when the feature extraction part is a multi-branch structure, the corresponding feature recombination part can also be a multi-branch structure, so that the relevance of at least two text data in the target text data pair is finally determined by the feature recombination part.

[0082] In the text data processing method, the text features of the target text data pair are extracted from the target text data pair including at least two text data, and the text features are classified to obtain pure features representing semantic relationships between data and common features representing fuzzy relationships between data, so that the semantic information in the text features can be effectively distinguished. Then, the reorganized features of the target text data pair are obtained by reorganizing the pure features and the common features, so that the useful information in the pure features and the common features can be fully utilized and mined, the accuracy of the features of the obtained target text data pair is improved, and the ability of the feature representation of the obtained target text data pair is improved as a whole. Finally, based on the reorganized features, the correlation of the at least two text data in the target text data pair is calculated to determine the correlation of the at least two text data, so that the accuracy of the determined correlation of the text data is improved, and finally the processing efficiency of the text data is improved.

[0083] Referring to Figure 4 The overall architecture of the text processing method is shown in the figure, and the pre-trained text processing model involved in the present application includes a feature extraction part and a feature reorganization part. The feature extraction part can be used to extract the text features corresponding to the target text data pair including at least two text data input into the text processing model, and the feature reorganization part can be used to process the text features in a series of processes and finally output the correlation of the at least two text data. The following embodiments are related to the specific contents and processing methods of the feature extraction part and the feature reorganization part.

[0084] In one embodiment, the text features of the target text data pair are extracted by the feature extraction part in the pre-trained text processing model. The feature extraction part is a multi-branch structure, and the feature extraction part is taken as a multi-branch structure with two branches as an example. Referring to Figure 4 and Figure 5 , the P-network model (P-net) and the C-network model (C-net) are respectively arranged on the two branches of the feature extraction part. The model structures of P-net and C-net are completely consistent, and can be set according to actual technical needs, for example, the BERT model and its derivative models in natural language processing model can be used. The text features extracted by C-net are finally used to determine common features, and the text features extracted by P-net are finally used to obtain pure features.

[0085] Specifically, the text features of the target text data pair are extracted from the target text data pair including at least two text data, including: extracting the first text features of semantic role alignment and the second text features embedded with target semantic roles from the target text data pair including at least two text data.

[0086] The text features extracted by the P-net are referred to as first text features, which can be represented as H1. The first text features are features of corresponding alignment of each semantic role of the text data in the target text data pair. That is, the text features extracted by the P-net are the first text features of semantic role alignment. The text features extracted by the C-net are referred to as second text features, which can be represented as H2. The second text features are features of embedding of the target semantic roles of the text data in the target text data pair. That is, the text features extracted by the C-net are the second text features embedded with target semantic roles. The target semantic role can be one of each semantic role in the text data, which can be set according to actual technical needs. In one specific example, the target semantic role refers to a predicate verb.

[0087] It can be understood that in the embodiment, the feature extraction part is taken as an example of a multi-branch structure with two branches, and more or fewer branch structures can also be set according to actual technical needs. For example, when it is also necessary to determine the correlation between the text data and the image data, a data processing branch for image data can also be additionally provided.

[0088] In the embodiment, the extraction of text features is completed by the feature extraction part, which can effectively improve the extraction efficiency of text data. By setting a multi-branch structure, each branch respectively extracts features of the same target text data pair and respectively obtains text features, which can ensure that complete semantic information of the target text data pair is extracted, fully utilize the semantic information, and improve the accuracy of the text features.

[0089] In one embodiment, the P-net extracts text features of the target text data pair, including: performing word segmentation processing on the target text data pair to obtain each word segmentation of the target text data pair; vectorizing each word segmentation to obtain each word segmentation feature of the target text data pair; and merging each word segmentation feature and aligning the semantic roles corresponding to each word segmentation to obtain the first text features of the target text data pair.

[0090] The word segmentation processing refers to splitting the text data into a combination of words, and the split words are referred to as tokens. Specifically, any implementable manner can be used to perform word segmentation processing on the target text data pair to obtain each token of the target text data pair. For example, at least one of the forward maximum matching method, the reverse maximum matching method, and the bidirectional maximum matching method can be used to perform word segmentation processing on the target text data pair.

[0091] After obtaining the tokens of the target text data pair, before vectorizing the tokens, the semantic roles corresponding to the tokens of the target text data pair are labeled, thereby forming the sequence labeling of the target text data pair. Specifically, the labeling manner can be to label the semantic roles corresponding to the tokens by using the role identifiers corresponding to each semantic role. In addition, the beginning and end of each text data in the target text data pair can be labeled with attributes. The labeling manner can be to label the attributes by using the beginning identifier and the end identifier to distinguish different text data sentences.

[0092] The features corresponding to the tokens are referred to as token features. The features of the target text data pair in the embodiment are referred to as first text features. Specifically, P-net can be used to vectorize each token to obtain the token features corresponding to each token in the target text data pair. P-net can be a BERT model and its derivative models in natural language processing models. Then, the token features can be merged by convolution and pooling, and the semantic roles corresponding to the tokens can be aligned to obtain the first text features of the target text data pair.

[0093] In the embodiment, the P-net is used to extract features of the target text data pair, which can quickly and effectively obtain the first text features of the target text data pair and improve the efficiency of text feature acquisition.

[0094] In one embodiment, the internal structure of the C-net is completely consistent with that of the P-net, and the data processing manner is also basically the same. The C-net and the P-net can be run simultaneously. For the C-net to extract the text features of the target text data pair, the following steps are included: performing word segmentation processing on the target text data pair to obtain the tokens of the target text data pair; determining the target token corresponding to the target semantic role based on the semantic roles corresponding to the tokens; vectorizing each token to obtain the token features of the target text data pair; merging the token features and embedding the target token feature corresponding to the target token to obtain the second text features of the target text data pair.

[0095] Specifically, the target text data pair can be segmented in any implementable manner to obtain each segment of the target text data pair. For example, the target text data pair can be segmented in at least one of a forward maximum matching method, a backward maximum matching method, and a bidirectional maximum matching method. The segmentation manners of the C-net and the P-net can be the same or different.

[0096] After obtaining the segments of the target text data pair, before vectorizing the segments, the semantic roles corresponding to the segments of the target text data pair are labeled, thereby forming sequence labeling of the target text data pair. Thus, the target semantic role can be determined from the semantic roles, and the target semantic role can be a predicate verb. Furthermore, the segment corresponding to the target semantic role, i.e., the target segment, is determined.

[0097] The features of the target text data pair of the present embodiment are referred to as second text features. Specifically, the segments of the target text data pair can be vectorized by the C-net to obtain respective segment features of the target text data pair, and then the segment features are combined and the target segment feature corresponding to the target segment is embedded to obtain the second text features of the target text data pair.

[0098] In the present embodiment, the C-net is used to extract features of the target text data pair, which can quickly and effectively obtain the second text features of the target text data pair and improve the efficiency of obtaining text features. Moreover, the P-net and the C-net belong to different branches, and the two models can be run simultaneously, i.e., the target text data pair can be simultaneously extracted for features to obtain the first text features and the second text features, thereby improving the processing efficiency of the text data.

[0099] In one embodiment, the text features of the target text data pair are classified by a feature reorganization part of the pre-trained text processing model. When the feature extraction part is a multi-branch structure, the feature reorganization part is also a multi-branch structure. For example, the feature extraction part is a multi-branch structure having two branches, and the feature reorganization part is also a multi-branch structure having two branches. Figure 4 With Figure 6 The feature reorganization part includes a gradient reverse layer and a feature mapping layer. Specifically, a gradient reverse layer (GRL) is arranged on the branch of the C-net to perform gradient reverse processing and finally obtain common features. A feature mapping layer (OPL) is arranged on the branch of the P-net to perform feature mapping processing and finally obtain pure features.

[0100] Specifically, the text features are classified into pure features representing semantic relationships between data and common features representing fuzzy relationships between data, including: performing gradient reversal processing on the second text features to obtain common features representing fuzzy relationships between at least two text data; and performing feature mapping processing on the first text features according to the common features to obtain pure features representing semantic relationships between at least two text data.

[0101] The gradient reversal processing can be performed by a gradient reversal layer. The gradient reversal layer can reverse the gradient of the features during the backward propagation of the features, add a negative sign by derivation, make the model training targets before and after the gradient reversal opposite, and make the model not converge to the optimal solution, so as to obtain the common features. After obtaining the common features, the common features can be input into the feature mapping layer, so that the feature mapping layer performs feature mapping processing on the first text features according to the common features to obtain the pure features.

[0102] In this embodiment, the gradient reversal layer is configured to extract the common features, and the feature mapping layer is configured to extract the pure features, so as to further effectively distinguish the text features and improve the efficiency of subsequent text data processing.

[0103] In one embodiment, for the gradient reversal layer, the gradient reversal processing on the second text features to obtain the common features representing fuzzy relationships between at least two text data can include: performing feature identity transformation during the forward propagation of the second text features, and performing gradient direction negation during the backward propagation to obtain a gradient reversal result of the second text features; and determining the gradient reversal result of the second text features as the common features of the target text data pair.

[0104] The result obtained after the gradient reversal processing of the second text features by the gradient reversal layer is referred to as the gradient reversal result of the second text features, and the gradient reversal result is denoted as Therefore, the gradient reversal result of the second text features can be determined as the common features of the target text data pair, that is, the common features can be represented as Specifically, the gradient reversal layer performs feature identity transformation during the forward propagation of the second text features, and performs gradient direction negation during the backward propagation, which are respectively denoted as:

[0105] GRL(x)=x

[0106]

[0107] wherein x represents the second text features, I represents the gradient, and λ is a hyperparameter.

[0108] In this embodiment, the second text feature is processed by the gradient reversal layer, so that the common features shared by different categories of text data can be obtained concisely and efficiently. Through the forward propagation and backward propagation of the gradient reversal layer, it can be ensured that the feature distribution is similar, and the accuracy of the obtained common features is improved.

[0109] In one embodiment, please refer to Figure 4 With Figure 6 , the branch of the C-net of the text processing model can also be provided with a classifier. The classifier can be used to classify text data, and through the classifier, the correlation probability parameters between text data can be determined. The type of the classifier can be set according to actual technical needs, for example, it can be a strong classifier, a weak classifier, a support vector machine (SVM) classifier, etc. The input of the classifier is the output of the gradient reversal layer. Specifically, the common features obtained after the gradient reversal layer is processed by gradient reversal are sent to the classifier, and the calculation formula is represented as:

[0110]

[0111] Among them, the weight coefficient W3 of the common feature and the correction parameter b3 of the common feature can be determined in the training process.

[0112] The loss function is represented as:

[0113] Loss c =CrossEntropy(Y truth ,Y GRL )

[0114] Among them, Y GRL represents the prediction probability of the text data pair belonging to a certain category determined by the classifier, and Y truth represents the true probability of the text data pair belonging to a certain category.

[0115] In this embodiment, the prediction classification corresponding to the text data is determined by setting the classifier, and then the vector representation of the common feature is obtained through back propagation and an optimization function, which can provide a basis for adjusting the parameters of the entire text processing model in the training process of the text processing model, and finally the accuracy of the obtained pure features and common features can be improved.

[0116] In an embodiment, for the feature mapping layer, the feature mapping processing is performed on the first text feature according to the common feature to obtain a pure feature representing the semantic relationship between the at least two text data, which can include: mapping the first text feature to a target feature direction of the common feature to obtain a mapping feature corresponding to the first text feature; and performing feature difference calculation on the first text feature and the mapping feature corresponding to the first text feature to obtain a pure feature of the target text data pair.

[0117] The feature mapping can also be understood as the projection of a vector. The target feature direction refers to the direction when the first text feature is mapped to the common feature, which can be set according to actual technical needs. For example, the target feature direction can be set as an orthogonal direction, and the first text feature is mapped to the orthogonal direction of the common feature, that is, the first text feature is mapped to the orthogonal direction of the common feature. The mapping feature refers to the first text feature after the mapping processing. The feature difference calculation refers to the difference between two features, that is, the difference.

[0118] Specifically, the target feature direction is an orthogonal direction, the first text feature H1 is mapped to the orthogonal direction of the common feature , and the mapping feature corresponding to the first text feature is obtained, which is denoted as H'1, and the calculation formula is:

[0119]

[0120]

[0121] Then, the feature difference calculation is performed on the first text feature and the mapping feature corresponding to the first text feature to obtain a pure feature of the target text data pair, which is denoted as , and the calculation formula is:

[0122]

[0123] In this embodiment, the common feature and the first text feature are processed by the feature mapping layer to finally obtain the pure feature, which can eliminate the common feature in the first text feature and ensure that the pure feature with a clear direction is obtained between the text data, avoiding confusion when the common feature is classified by the subsequent classifier. At the same time, by distinguishing the pure feature and the common feature, the subsequent self-attention model can assign different feature weights to different features, improve the accuracy of the determined feature weights, and thus improve the accuracy of feature recombination.

[0124] In an embodiment, the recombination of the pure feature and the common feature is performed by the feature recombination part in the pre-trained text processing model. Please refer to Figure 4 and Figure 6, the feature recombination part further comprises a self-attention model. Specifically, an attention unit is further arranged on the branch of the feature mapping layer, which can adopt an attention manner to fully utilize and mine useful information in the pure features and the public features, and assign feature weights corresponding to the pure features and the public features respectively, so as to facilitate feature processing and feature recombination of the pure features and the public features.

[0125] Specifically, the recombination of the pure features and the public features to obtain the recombination features of the target text data pair can comprise: determining pure feature weights of the pure features and public feature weights of the public features based on the pure features and the public features through the self-attention model; and performing weighted summation on the pure features and the public features according to the pure features and the pure feature weights and the public features and the public feature weights to obtain the recombination features of the target text data pair.

[0126] The feature weight corresponding to the pure features is referred to as a pure feature weight, denoted as w p . The feature weight corresponding to the public features is referred to as a public feature weight, denoted as w c . In the self-attention model, the pure features and the public features are first sent to a linear layer to obtain initial pure feature weights W p and initial public feature weights W c . After normalization processing, the pure feature weights and the public feature weights are obtained respectively, and the calculation formula of the linear layer is represented as:

[0127]

[0128]

[0129] wherein, the weight coefficient W4 of the pure features, the weight coefficient W5 of the public features, the correction parameter b4 of the pure features, and the correction parameter b5 of the public features can be determined through a training process, and W p , W c represent the initial pure feature weights and the initial public feature weights respectively.

[0130] The initial pure feature weights and the initial public feature weights can be spliced first, and then normalized. The calculation formula of the normalization processing is represented as:

[0131] w=softmax([W p , W c ])

[0132] wherein, w represents a feature weight sequence.

[0133] According to the pure features w and the pure feature weight w p , and the public feature and the public feature weight w c , the processed pure feature att p and the processed public feature att c , are respectively represented as:

[0134]

[0135]

[0136] wherein w p may be the first weight value in the feature weight sequence w, denoted as w[0], and w c may be the second weight value in the feature weight sequence w, denoted as w[1].

[0137] The weighted sum of the pure feature and the public feature, that is, the sum of the processed pure feature and the processed public feature, can obtain the reorganized feature of the target text data pair, and the reorganized feature is denoted as final, and the calculation formula is represented as:

[0138]

[0139] In this embodiment, based on the attention mechanism, the pure feature weight corresponding to the pure feature and the public feature weight corresponding to the public feature are allocated through the self-attention model, and the feature reorganization is performed based on the features and the corresponding feature weights, which can fully utilize and mine the useful information in the pure feature and the public feature, and obtain the reorganized feature which is more effective for the processing of the text data, so as to effectively improve the processing efficiency of the text data when the text data is processed based on the reorganized feature.

[0140] In one embodiment, the feature reorganization part in the pre-trained text processing model determines the correlation based on the reorganized feature after the feature reorganization of the pure feature and the public feature. Please refer to Figure 4 and Figure 6 The feature reorganization part further includes a classifier, and the input of the classifier is the output of the self-attention model. The classifier can be used for classifying the text data, and through the classifier, the correlation probability parameter between at least two text data can be determined. The type of the classifier can be set according to actual technical needs, for example, it can be a strong classifier, a weak classifier, a support vector machine (SVM) classifier, etc.

[0141] Specifically, based on the recombination feature, the correlation calculation of the at least two text data in the target text data pair is performed, and the correlation of the at least two text data is determined, which can include: based on the recombination feature, calculating the correlation probability parameter of the at least two text data in the target text data pair corresponding to the recombination feature; according to the correlation probability parameter of the at least two text data in the target text data pair, the correlation of the at least two text data is determined.

[0142] The correlation probability parameter of the text data pair refers to the probability that the text data in the text data pair belongs to the same category and has the same meaning. Specifically, for the classifier, based on the recombination feature, the correlation probability parameter of the at least two text data in the target text data pair corresponding to the recombination feature is calculated, and the calculation formula is represented as:

[0143] Y OPL =softmax(final·W6+b6)

[0144] Wherein, the weight coefficient W6 of the recombination feature and the correction parameter b6 of the recombination feature can be determined in the training process.

[0145] The loss function is represented as:

[0146] Loss p =CrossEntropy(Y truth ,Y OPL )

[0147] Wherein, Y OPL represents the predicted probability of the text data pair belonging to a certain category determined by the classifier, and Y truth represents the real probability of the text data pair belonging to a certain category.

[0148] In this embodiment, by setting the classifier, the correlation of the text data can be quickly and effectively determined based on the recombination feature, and the processing efficiency of the text data is improved.

[0149] In order to make the purpose, technical scheme and advantages of the present application more clear, the present application is further described in detail below in combination with the drawings and specific embodiments.

[0150] In one specific embodiment, please refer to Figure 7The text data processing method can be processed based on a text processing model, the text processing model can be set in a computer device, and the text processing model includes two branches, mainly including a feature extraction part and a feature reorganization part. The feature extraction part includes a P-network model (P-net) and a C-network model (C-net), and the internal structures of the two models are completely consistent and can also be run simultaneously. The feature reorganization part includes a feature mapping layer (OPL), a gradient reversal layer (GRL), an attention unit, and two classifiers. Among them, the feature mapping layer, the attention unit, and the classifier are sequentially arranged on the branch of the P-net, and the gradient reversal layer and the classifier are sequentially arranged on the branch of the C-net. Specifically, please refer to Figure 8 The steps of the text data processing method are as follows:

[0151] In step S701, a target text data pair including at least two text data is obtained. Specifically, the text data in the target text data pair can be a sentence.

[0152] For the P-net, the first text feature of the target text data pair is extracted, including:

[0153] In step S702, the target text data pair is processed by word segmentation to obtain each word segmentation of the target text data pair. Specifically, at least one of the forward maximum matching method, the reverse maximum matching method, and the bidirectional maximum matching method can be used to process the target text data pair by word segmentation.

[0154] In step S703, each word segmentation is vectorized to obtain the word segmentation feature of the target text data pair. Specifically, the obtained word segmentation feature can be an embedding feature of a predetermined dimension.

[0155] In step S704, the word segmentation features are combined, and the semantic roles corresponding to each word segmentation are aligned to obtain the first text feature of the target text data pair, and the first text feature is denoted as H1.

[0156] For the C-net, the second text feature of the target text data pair is extracted, including:

[0157] In step S705, the target text data pair is processed by word segmentation to obtain each word segmentation of the target text data pair. Specifically, the word segmentation processing method can be the same as the processing method in step S702.

[0158] In step S706, based on the semantic roles corresponding to each word segmentation, the target word segmentation corresponding to the target semantic role is determined. Specifically, the target semantic role is set as a predicate verb, i.e., the word segmentation corresponding to the predicate verb is determined.

[0159] Step S707, vectorize each wordpiece to obtain the wordpiece feature of each wordpiece of the target text data pair. Specifically, the obtained wordpiece feature can be an embedding feature of a predetermined dimension.

[0160] Step S708, merge each wordpiece feature and embed the target wordpiece feature corresponding to the target wordpiece to obtain the second text feature of the target text data pair, and represent the second text feature as H2.

[0161] Wherein, the first text feature H1 and the second text feature H2 are embedding features of the same feature dimension. And the steps S702 to S704 and the steps S705 to S708 can be executed simultaneously.

[0162] For the gradient reversal layer, it can learn to obtain the common feature, including:

[0163] Step S709, perform feature identity transformation in the forward propagation process of the second text feature, and perform gradient direction negation in the backward propagation process to obtain the gradient reversal result of the second text feature; and determine the gradient reversal result of the second text feature as the common feature of the target text data pair.

[0164] Specifically, the calculation formulas of the forward propagation process and the backward propagation process can be represented as:

[0165] GRL(x)=x

[0166]

[0167] Wherein, x represents the second text feature, I represents the gradient, and λ is a hyperparameter.

[0168] After the second text feature is processed by the gradient reversal layer, the common feature obtained by the gradient reversal layer is sent into the classifier, and the calculation formula is represented as:

[0169]

[0170] Wherein, the weight coefficient W3 of the common feature and the correction parameter b3 of the common feature can be determined in the training process.

[0171] The loss function is represented as:

[0172] Loss c =CrossEntropy(Y truth ,Y GRL )

[0173] Wherein, Y GRLrepresents a prediction probability of the text data pair belonging to a certain category determined by the classifier, Y truth represents a real probability of the text data pair belonging to a certain category.

[0174] At this point, the C-net branch completes the extraction of the common feature of the target text data pair. Then, the common feature is sent to the feature mapping layer to complete the extraction of the pure feature.

[0175] For the feature mapping layer, it can process to obtain the pure feature, including:

[0176] Step S710, map the first text feature to the target feature direction of the common feature to obtain the mapping feature corresponding to the first text feature; perform feature difference calculation on the first text feature and the mapping feature corresponding to the first text feature to obtain the pure feature of the target text data pair.

[0177] Specifically, the target feature direction is an orthogonal direction. Map the first text feature H1 to the orthogonal direction of the common feature to obtain the mapping feature corresponding to the first text feature, denoted as H'1, and the calculation formula is:

[0178]

[0179]

[0180] Then, perform feature difference calculation on the first text feature and the mapping feature corresponding to the first text feature to obtain the pure feature of the target text data pair, denoted as The calculation formula is:

[0181]

[0182] Step S711, based on the pure feature and the common feature, determine the pure feature weight of the pure feature and the common feature weight of the common feature through the self-attention model; perform weighted summation on the pure feature and the common feature according to the pure feature and the pure feature weight, and the common feature and the common feature weight, to obtain the recombined feature of the target text data pair.

[0183] Recombine the pure feature and the common feature through the self-attention model. Specifically, through the self-attention model, obtain the initial pure feature weight W p and the initial common feature weight W c , denoted as:

[0184]

[0185]

[0186] The weight coefficient W4 of the pure feature, the weight coefficient W5 of the common feature, the correction parameter b4 of the pure feature, and the correction parameter b5 of the common feature can be determined through a training process.

[0187] Then, the initial pure feature weight and the initial common feature weight are spliced first, and then normalized to obtain the feature weight sequence w. The calculation formula of the normalization processing is represented as:

[0188] w = softmax ([W p , W c ])

[0189] According to the pure feature and the pure feature weight wp, and the common feature and the common feature weight w c , the processed pure feature att p and the processed common feature att c can be obtained, which are respectively represented as:

[0190]

[0191]

[0192] Wherein, w p may be the first weight value in the feature weight sequence w, represented as w[0], and w c may be the second weight value in the feature weight sequence w, represented as w[1].

[0193] The weighted sum of the pure feature and the common feature can obtain the reorganization feature of the target text data pair, and the reorganization feature is represented as final, and the calculation formula is represented as:

[0194]

[0195] Step S712, based on the reorganization feature, calculate the correlation probability parameter of at least two text data in the target text data pair corresponding to the reorganization feature; according to the correlation probability parameter of at least two text data in the target text data pair, determine the correlation of at least two text data.

[0196] Specifically, the reorganization feature final is sent into the classifier to calculate the correlation probability parameter of at least two text data in the target text data pair corresponding to the reorganization feature, that is, to determine the correlation of at least two text data. The calculation formula of the classifier is represented as:

[0197] Y OPL =softmax(final·W6+b6)

[0198] wherein the weight coefficient W6 of the reorganized feature and the correction parameter b6 of the reorganized feature can be determined in a training process.

[0199] The loss function is represented as:

[0200] Loss p =CrossEntropy(Y truth ,Y OPL )

[0201] wherein Y OPL represents the prediction probability of the text data pair belonging to a certain classification determined by the classifier, and Y truth represents the real probability of the text data pair belonging to a certain classification.

[0202] In order to verify the beneficial effects of the text processing method in the embodiment, the correlation of the text data pairs in the public data set is benchmark tested by using the existing text processing model, and the correlation of the text data pairs in the public data set is tested by using the text processing model in the embodiment, and the test results are compared. The data comparison results are shown in Table 1. The public data set is the paraphrase corpus (MRPC) data set. The F1 value is shown in the test results. When the F1 value is high, it means that the test method is effective, which proves that the text processing model in the embodiment improves the SemBERT model by 1 percentage point, and proves the effectiveness of the text processing model in the embodiment.

[0203] Table 1 Benchmark test results of public data set and data results of text model

[0204] Model MRPC (F1) BiLSTM + ELMo + self-attention model 84.9 GPT 82.3 BERTbase 88.9 SemBERTbase 88.2 Text processing model of the present embodiment 89.2

[0205] wherein BiLSTM (Bi-directional Long Short-Term Memory) refers to a model composed of a forward LSTM and a backward LSTM. ELMo refers to an autoregressive model. GPT (Generative Pre-Training) is a generative pre-training language model. BERTbase refers to a BERT model, and SemBERTbase refers to a SemBERT (Semantics-aware BERT) model.

[0206] In addition, an ablation experiment is also conducted, and results of the ablation experiment are shown in Table 2. According to the results of the ablation experiment, it is shown that, by using the self-attention mechanism, the F1 value of the SemBERT model is increased by 0.5 percentage points from 88.2 to 88.7, which can prove that the self-attention mechanism has a good effect, and by using the feature reorganization part, the F1 value of the SemBERT model is increased by 0.4 percentage points from 88.2 to 88.6, which also proves the correctness and rationality of the feature reorganization part for feature reorganization.

[0207] Table 2 Ablation experiment results

[0208] Model MRPC (F1) SemBERTbase + self-attention model 88.7 SemBERTbase + feature recombination part 88.6 Text processing model of the present embodiment 89.2

[0209] It should be understood that, although each step in the flowchart involved in each embodiment as described above is displayed in sequence according to the arrow, these steps are not necessarily executed in sequence according to the order of the arrow. Unless otherwise specified herein, the execution of these steps is not strictly limited in sequence, and these steps can be executed in other orders. Moreover, at least part of the steps in the flowchart involved in each embodiment as described above can include multiple steps or stages, which are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily sequential, but can be alternately executed with at least part of other steps or steps or stages in other steps.

[0210] Based on the same inventive concept, the present application also provides a text data processing apparatus for implementing the above-mentioned text data processing method. The implementation scheme for solving the problem provided by the apparatus is similar to the implementation scheme described in the above method, and therefore the specific limitations in one or more text data processing apparatus embodiments provided below can refer to the limitations of the text data processing method described above, which will not be described here again.

[0211] In one embodiment, as shown in Figure 9 a text data processing apparatus is provided, comprising: a feature acquisition module 10, a feature classification module 20, a feature reorganization module 30 and a result determination module 40, wherein:

[0212] The feature acquisition module 10 is configured to extract text features of a target text data pair from the target text data pair comprising at least two text data.

[0213] The feature classification module 20 is configured to perform feature classification on the text features to obtain pure features representing semantic relationships between data and public features representing fuzzy relationships between data.

[0214] The feature recombination module 30 is configured to recombine the pure feature and the common feature to obtain a recombined feature of the target text data pair.

[0215] The result determination module 40 is configured to perform correlation calculation on at least two text data in the target text data pair based on the recombined feature to determine the correlation of the at least two text data.

[0216] In an embodiment, the feature acquisition module 10 comprises:

[0217] The first text feature acquisition unit is configured to extract a semantic role alignment first text feature from the target text data pair comprising at least two text data.

[0218] The second text feature acquisition unit is configured to extract a second text feature embedded with a target semantic role from the target text data pair comprising at least two text data.

[0219] In an embodiment, the feature classification module 20 comprises:

[0220] The common feature classification unit is configured to perform gradient inversion processing on the second text feature to obtain a common feature representing a fuzzy relationship between the at least two text data.

[0221] The pure feature classification unit is configured to perform feature mapping processing on the first text feature according to the common feature to obtain a pure feature representing a semantic relationship between the at least two text data.

[0222] In an embodiment, the common feature classification unit comprises:

[0223] The gradient inversion processing unit is configured to perform feature identity transformation in a forward propagation process of the second text feature and perform gradient direction inversion in a backward propagation process to obtain a gradient inversion result of the second text feature.

[0224] The common feature determination unit is configured to determine the gradient inversion result of the second text feature as the common feature of the target text data pair.

[0225] In an embodiment, the pure feature classification unit comprises:

[0226] The feature mapping processing unit is configured to map the first text feature to a target feature direction of the common feature to obtain a mapping feature corresponding to the first text feature.

[0227] The pure feature determination unit is configured to perform feature difference calculation on the first text feature and the mapping feature corresponding to the first text feature to obtain a pure feature of the target text data pair.

[0228] In an embodiment, the first text feature acquisition unit comprises:

[0229] A first word segmentation processing unit is configured to perform word segmentation processing on the target text data pair to obtain respective words of the target text data pair.

[0230] A first vectorization processing unit is configured to perform vectorization processing on the respective words to obtain respective word features of the target text data pair.

[0231] A first merging processing unit is configured to merge the respective word features and align the semantic roles corresponding to the respective words to obtain first text features of the target text data pair.

[0232] In an embodiment, the second text feature acquisition unit comprises:

[0233] A second word segmentation processing unit is configured to perform word segmentation processing on the target text data pair to obtain respective words of the target text data pair.

[0234] A target word determination unit is configured to determine, based on the semantic roles corresponding to the respective words, a target word corresponding to a target semantic role.

[0235] A second vectorization processing unit is configured to perform vectorization processing on the respective words to obtain respective word features of the target text data pair.

[0236] A second merging processing unit is configured to merge the respective word features and embed a target word feature corresponding to the target word to obtain second text features of the target text data pair.

[0237] In an embodiment, the feature recombination module 30 comprises:

[0238] A feature weight determination unit is configured to determine, based on the pure features and the common features, pure feature weights of the pure features and common feature weights of the common features by using a self-attention model.

[0239] A feature recombination processing unit is configured to perform weighted summation on the pure features and the common features according to the pure features and the pure feature weights and the common features and the common feature weights to obtain recombined features of the target text data pair.

[0240] In an embodiment, the result determination module 40 comprises:

[0241] The probability parameter calculation unit is configured to calculate a correlation probability parameter of at least two pieces of text data in the target text data pair corresponding to the reorganization feature based on the reorganization feature.

[0242] The correlation determination unit is configured to determine the correlation of the at least two pieces of text data in the target text data pair according to the correlation probability parameter of the at least two pieces of text data.

[0243] The above modules in the text data processing apparatus can be realized by software, hardware, or a combination thereof. The above modules can be embedded in or independent of a processor in a computer device in hardware form, or stored in a memory in a computer device in software form, so as to be called and executed by a processor to perform operations corresponding to the above modules.

[0244] In an embodiment, a computer device is provided, which can be a server, and an internal structure diagram of the computer device can be as shown in Figure 10 The computer device includes a processor, a memory, an input / output interface (I / O), and a communication interface. The processor, the memory, and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. The processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for running the operating system and the computer program in the non-volatile storage medium. The database of the computer device is configured to store text data. The input / output interface of the computer device is configured to exchange information between the processor and external devices. The communication interface of the computer device is configured to communicate with external terminals through a network connection. The computer program is executed by the processor to implement a text data processing method.

[0245] In an embodiment, a computer device is provided, which can be a terminal, and an internal structure diagram of the computer device can be as shown in Figure 11As shown. The computer device includes a processor, a memory, an input / output interface, a communication interface, a display unit and an input device. The processor, the memory and the input / output interface are connected via a system bus, and the communication interface, the display unit and the input device are connected to the system bus via the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be implemented through WIFI, a mobile cellular network, NFC (near field communication) or other technologies. When the computer program is executed by the processor, a text data processing method is implemented. The display unit of the computer device is used to form a visually visible image, and can be a display screen, a projection device or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen. The input device of the computer device can be a touch layer covering the display screen, or a button, trackball or touchpad set on the computer device casing, or an external keyboard, touchpad or mouse, etc.

[0246] Those skilled in the art will understand that Figure 10 and Figure 11 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.

[0247] In one embodiment, a computer device is provided, including a memory and a processor. The memory stores a computer program, and the processor implements the steps of the above method when executing the computer program.

[0248] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps of the above method are implemented.

[0249] In one embodiment, a computer program product is provided, comprising a computer program, which implements the steps of the above method when executed by a processor.

[0250] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a non-volatile computer readable storage medium, and when the computer program is executed, the processes of the above-mentioned embodiments of the methods can be included. Any reference to memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (Read-Only Memory, ROM), magnetic tape, floppy disk, flash memory, optical storage, high-density embedded non-volatile memory, resistive memory (ReRAM), magnetoresistive random access memory (Magnetoresistive Random Access Memory, MRAM), ferroelectric memory (Ferroelectric Random Access Memory, FRAM), phase change memory (Phase Change Memory, PCM), graphene memory, etc. Volatile memory can include random access memory (Random Access Memory, RAM) or external cache memory, etc. As an illustration but not limitation, RAM can be in various forms, such as static random access memory (Static Random Access Memory, SRAM) or dynamic random access memory (Dynamic Random Access Memory, DRAM), etc. The database involved in the embodiments provided in the present application can include at least one of a relational database and a non-relational database. The non-relational database can include a distributed database based on a block chain, etc., without being limited thereto. The processor involved in the embodiments provided in the present application can be a general-purpose processor, a central processing unit, a graphics processing unit, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., without being limited thereto.

[0251] Any combination of the technical features of the above-mentioned embodiments can be made. In order to make the description simple, all possible combinations of the technical features in the above-mentioned embodiments are not described, however, as long as the combination of the technical features does not exist contradictory, it should be considered as the scope of the present application.

[0252] The above-mentioned embodiments only express several embodiments of the present application, and the description is more specific and detailed, but it should not be understood as limiting the scope of the patent of the present application. It should be pointed out that for ordinary skilled in the art, without departing from the concept of the present application, a number of modifications and improvements can be made, which are within the scope of protection of the present application. Therefore, the protection scope of the present application should be subject to the appended claims.

Claims

1. A text data processing method, characterized in that: The method comprises: Extracting a first text feature aligned with a semantic role and a second text feature embedded with a target semantic role from a target text data pair including at least two text data; Performing gradient reversal processing on the second text feature to obtain a common feature representing the fuzzy relationship between the at least two text data; Performing feature mapping processing on the first text feature according to the common feature to obtain a pure feature representing the semantic relationship between the at least two text data; Recombining the pure features and the common features to obtain recombined features of the target text data pair; Based on the recombinant features, correlation calculation is performed on at least two text data in the target text data pair to determine the correlation between the at least two text data.

2. The method according to claim 1, characterized in that The step of performing gradient reversal processing on the second text feature to obtain a common feature representing the fuzzy relationship between the at least two text data includes: Performing a feature identity transformation during the forward propagation of the second text feature, and reversing the gradient direction during the backward propagation to obtain a gradient reversal result of the second text feature; The gradient inversion result of the second text feature is determined as the common feature of the target text data pair.

3. The method according to claim 1, characterized in that The step of performing feature mapping processing on the first text feature according to the common feature to obtain a pure feature representing the semantic relationship between the at least two text data includes: Mapping the first text feature to the target feature direction of the common feature to obtain a mapping feature corresponding to the first text feature; A feature difference calculation is performed between the first text feature and a mapping feature corresponding to the first text feature to obtain a pure feature of the target text data pair.

4. The method according to claim 1 or 3, characterized in that Extract the first text features of semantic role alignment, including: Performing word segmentation processing on the target text data pair to obtain each word segment of the target text data pair; Vectorizing each of the word segments to obtain each word segmentation feature of the target text data pair; The word segmentation features are merged, and the semantic roles corresponding to the word segmentations are aligned to obtain the first text feature of the target text data pair.

5. The method according to claim 1 or 2, characterized in that Extract the second text features embedded with the target semantic role, including: Performing word segmentation processing on the target text data pair to obtain each word segment of the target text data pair; Determining a target segmentation corresponding to a target semantic role based on the semantic roles corresponding to the segmentations; Vectorizing each of the word segments to obtain each word segmentation feature of the target text data pair; The word segmentation features are merged and embedded into the target word segmentation feature corresponding to the target word segmentation to obtain the second text feature of the target text data pair.

6. The method according to claim 1, characterized in that The recombining the pure features and the common features to obtain the recombined features of the target text data pair includes: Based on the pure features and the common features, determining the pure feature weights of the pure features and the common feature weights of the common features through a self-attention model; According to the pure features and the pure feature weights, and the common features and the common feature weights, a weighted sum is performed on the pure features and the common features to obtain a recombined feature of the target text data pair.

7. The method according to claim 1 or 6, characterized in that The step of performing correlation calculation on at least two text data in the target text data pair based on the recombined features to determine the correlation between the at least two text data includes: Based on the recombinant feature, calculating a correlation probability parameter of at least two text data in the target text data pair corresponding to the recombinant feature; The correlation between the at least two text data in the target text data pair is determined according to the correlation probability parameters of the at least two text data.

8. A text data processing device, characterized in that: The device comprises: A feature acquisition module, configured to extract text features of a target text data pair from a target text data pair comprising at least two text data; The feature acquisition module includes: A first text feature acquisition unit is configured to extract a first text feature of semantic role alignment from a target text data pair comprising at least two text data; A second text feature acquisition unit is configured to extract a second text feature embedded with a target semantic role from a target text data pair comprising at least two text data; Feature classification module, including common feature classification units and pure feature classification units; a common feature classification unit, configured to perform gradient inversion processing on the second text feature to obtain a common feature representing the fuzzy relationship between the at least two text data; a pure feature classification unit, configured to perform feature mapping processing on the first text feature according to the common feature to obtain a pure feature representing a semantic relationship between the at least two text data; A feature recombination module, configured to recombine the pure features and the common features to obtain recombined features of the target text data pair; The result determination module is configured to perform a correlation calculation on at least two text data in the target text data pair based on the recombinant features, and determine the correlation between the at least two text data.

9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the method according to any one of claims 1 to 7 is implemented.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.

11. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

  • Information processing method and device and computer readable storage medium

    CN111241298A