Text processing method and device, terminal equipment and computer readable storage medium

By determining multiple view features and similarity features of the to-process text, the problem of view feature conflict in multi-view feature latitude data processing is solved, and more accurate text classification is achieved.

CN119904877APending Publication Date: 2025-04-29TCL TECHNOLOGY GROUP CORPORATION
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311417164.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-10-27
Publication Date
2025-04-29

AI Technical Summary

Technical Problem

When processing multi-view feature latitude data, the prior art ignores the unique information of different view features, resulting in errors in clustering results.

Method used

By determining multiple view features of the text to be processed and determining similarity features based on these view features, conflicts between view features are avoided, and the classification results of the text are determined more accurately.

Benefits of technology

This method can better utilize the information in multi-view features, avoid clustering errors, and improve the accuracy of text classification.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119904877A_ABST
    Figure CN119904877A_ABST
Patent Text Reader

Abstract

The invention provides a text processing method and device, terminal equipment and a computer readable storage medium. The method comprises the steps that multiple view features of a to-be-processed text are determined; determining similarity features of the view features; and determining a classification result of the to-be-processed text according to the similarity characteristics. According to the text processing method provided by the invention, the plurality of view features of the to-be-processed text are firstly determined, and then the similarity features of the to-be-processed text are determined based on the plurality of view features, so that the similarity among the view features can be determined according to the similarity features, the conflict among the plurality of view features is avoided, and the text processing efficiency is improved. Therefore, the classification result of the to-be-processed text can be better determined, and the actual execution action corresponding to the to-be-processed text can be determined and executed according to the classification label in a subsequent application scene.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a text processing method, apparatus, terminal device and computer-readable storage medium. Background Art

[0002] With the advent of the big data era, the expression of text data has gradually changed from single-view feature dimension to multi-view feature dimension. For example, data such as news headlines, news text, and news picture titles can constitute a multi-view feature dataset for a piece of news; lyrics, song names, and song comments can constitute a multi-view feature dataset for a song. Each feature can be called a view feature of a sample. The information between multiple view features complements and verifies each other, and can jointly guide the optimal division of clusters. Compared with the traditional method of using only the content of the news text or all the lyrics for single-view feature clustering, the multi-view feature text clustering method obviously makes more reasonable use of the rich information in the data to improve the final effect of the task. The complementary and consistent information between multiple view features brings opportunities for conventional single-view feature text clustering. How to effectively use this information to further improve the performance of text clustering has great research value.

[0003] In addition, another conventional method for processing multi-view feature dimension data is to fuse the original multi-view feature data into single-view feature data, that is, to fuse the multiple view features of the sample into a comprehensive single feature by simple splicing or other methods. However, this method ignores the fact that different view features of the same sample contain their own unique view feature information. There may be conflicts between multiple view features, so they will point to different clusters, which will lead to incorrect clustering results. Summary of the invention

[0004] The present application provides a text processing method, which can better determine the classification label of the text to be processed by finding the similarity between different view features.

[0005] In a first aspect, the present application provides a text processing method, the method comprising:

[0006] determining a plurality of view features of the text to be processed;

[0007] determining similarity features of each of the view features;

[0008] According to the similarity feature, the classification result of the text to be processed is determined.

[0009] In a second aspect, the present application further provides a text processing device, the device comprising:

[0010] A first determination module, used to determine a plurality of view features of the text to be processed;

[0011] A second determination module, used to determine similarity features of each of the view features;

[0012] The third determination module is used to determine the classification result of the text to be processed according to the similarity feature.

[0013] In a third aspect, the present application also provides a terminal device, comprising a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps in any one of the text processing methods described.

[0014] In a fourth aspect, the present application further provides a computer-readable storage medium, on which a computer program is stored, and the computer program is executed by a processor to implement the steps in any one of the text processing methods described.

[0015] The text processing method provided in the present application first determines multiple view features of the text to be processed, and then determines the similarity features of the text to be processed based on the multiple view features, so that the similarity between each view feature can be determined according to the similarity feature, avoiding the conflict between multiple view features, and then better determining the classification result of the text to be processed, so that in subsequent application scenarios, the actual execution action corresponding to the text to be processed can be determined according to the classification label. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.

[0017] Figure 1 is a scenario diagram of a text processing system provided in an embodiment of the present application;

[0018] Figure 2 This is a flowchart of an embodiment of the text processing method in the embodiment of the present application;

[0019] Figure 3 is a functional module schematic diagram of a text processing device in an embodiment of the present application;

[0020] Figure 4 It is a schematic diagram of the structure of the terminal device in the embodiment of the present application. DETAILED DESCRIPTION

[0021] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of this application.

[0022] In the description of the present application, it should be understood that the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the feature. In the description of the present application, "plurality" means two or more, unless otherwise clearly and specifically defined.

[0023] In this application, the word "exemplary" is used to mean "used as an example, illustration or description". Any embodiment described as "exemplary" in this application is not necessarily to be construed as being more preferred or advantageous than other embodiments. At the same time, it is to be understood that in the specific implementation of this application, when user information, user data and other related data are involved, when the above embodiments of this application are applied to specific products or technologies, user permission or consent is required, and the collection, use and processing of relevant data shall comply with relevant laws, regulations and standards of relevant countries and regions.

[0024] In order to enable any person skilled in the art to implement and use the present application, the following description is provided. In the following description, details are listed for the purpose of explanation. It should be understood that those of ordinary skill in the art will recognize that the present application can be implemented without using these specific details. In other examples, known structures and processes will not be elaborated in detail to avoid unnecessary details that make the description of the present application obscure. Therefore, the present application is not intended to be limited to the embodiments shown, but is consistent with the widest range of principles and features disclosed in the present application.

[0025] The present application provides a text processing method, apparatus, device and storage medium, which are described in detail below.

[0026] See also Figure 1 , Figure 1 Schematic diagram of a text processing system provided in an embodiment of the present application. The text processing system may include a terminal device 100 and a storage device 200. The storage device 200 may transmit data to the terminal device 100. Figure 1 The terminal device 100 in the storage device 200 can obtain the multi-view features of the text to be processed stored in the storage device 200 to execute the text processing method in the present application.

[0027] In the embodiment of the present application, the terminal device 100 includes but is not limited to a desktop computer, a portable computer, a network server, a PDA (Personal Digital Assistant), a tablet computer, a wireless terminal device, an embedded device, etc.

[0028] In an embodiment of the present application, communication between the terminal device 100 and the storage device 200 can be achieved through any communication method, including but not limited to mobile communications based on the 3rd Generation Partnership Project (3GPP), Long Term Evolution (LTE), and Worldwide Interoperability for Microwave Access (WiMAX), or computer network communications based on the TCP / IP Protocol Suite (TCP / IP) and User Datagram Protocol (UDP).

[0029] It should be noted that Figure 1 The scenario diagram of the text processing system shown is merely an example. The text processing system and scenario described in the embodiment of the present application are intended to more clearly illustrate the technical solution of the embodiment of the present application, and do not constitute a limitation on the technical solution provided in the embodiment of the present application. A person of ordinary skill in the art can appreciate that with the evolution of the text processing system and the emergence of new business scenarios, the technical solution provided in the embodiment of the present application is equally applicable to similar technical problems.

[0030] like Figure 2 As shown, Figure 2 This is a flow chart of an embodiment of a text processing method in an embodiment of the present application. The text processing method may include the following steps 201 to 203:

[0031] 201. Determine multiple view features of the text to be processed.

[0032] The text to be processed in the embodiments of the present application can be any type of text, including text in different file formats, such as txt format, docx format, etc.; it also includes different types of text, such as news text, lyrics text, etc., which is not limited to the specific embodiments of the present application.

[0033] The method of obtaining the text to be processed can be as described in the above embodiment, through a corresponding storage medium or cloud. Of course, it can also be the text currently input by the user, and the specific embodiment of the present application is not limited thereto.

[0034] In addition, the multi-view features of the text to be processed can be determined by any speech processing model. For example: the text to be processed is input into the trained BERT model, and the view features of each part of the text to be processed are determined by the BERT model to obtain the multi-view features of the text to be processed. Including: determining the title view features corresponding to the title in the text to be processed; determining the main text view features corresponding to the main text in the text to be processed; determining the appendix view features corresponding to the appendix in the text to be processed, and so on. It should be noted that if the text to be processed is news, lyrics and other types of text, these texts usually also include a comment part. Therefore, when determining the multiple view features of the text to be processed, the comment view features can also be determined for the comment part of the text. In other words, determining the multiple view features of the text to be processed is to extract the corresponding view features for different text parts of the text to be processed.

[0035] 202. Determine similarity features of each view feature.

[0036] In the embodiment of the present application, the similarity features of each view feature can be determined by determining the distance between each view feature. For example: the feature distance between each view feature is determined, and then a feature distance with the minimum feature distance value can be obtained. At this time, the two view features corresponding to the feature distance with the minimum feature distance value can be used as the similarity features of each view feature. Among them, in the embodiment of the present application, the distance between each view feature can be determined by the following methods, including: Euclidean distance, which can calculate the straight-line distance between two vectors in the feature space. Euclidean distance can be used for continuous data. Manhattan distance, also known as city block distance, can calculate the sum of the absolute differences between the corresponding dimension values ​​of two vectors in the feature space. Manhattan distance is applicable to continuous and discrete data. Cosine similarity can measure the cosine value of the angle between two vectors, which is applicable to the similarity calculation of large-scale sparse data and text data. Correlation coefficient can measure the linear correlation between two features. Commonly used correlation coefficients include the Pearson Correlation Coefficient and the Spearman's Rank Correlation Coefficient. The correlation coefficient can be used for continuous data. The Jaccard Similarity Coefficient can measure the similarity between two sets and is suitable for classification or binary data. Feature Distance Measures: For different types of features, corresponding distance measurement methods can be used. Specifically, other methods for determining the distance between view features may also be included, which are not limited in the embodiments of the present application.

[0037] 203. Determine the classification result of the text to be processed based on the similarity features.

[0038] In the embodiments of the present application, the similarity features can be input into a trained classification model to obtain the classification result of the text to be processed. In the embodiments of the present application, determining the classification result of the text to be processed can be to determine the classification label of the text to be processed. For example: after inputting the similarity features into the classification model, the classification model can calculate the similarity matching between the similarity features and the labeled sample features, and assign the label of the most similar labeled sample features to the similarity features, including using the nearest neighbor algorithm or clustering algorithm to classify the similarity features into the category with the most similar features. Or, using methods such as decision trees, logistic regression, support vector machines, neural networks, etc., training the classification model on the existing labeled samples, and using the obtained model to predict the unlabeled similarity features, so as to determine the classification label of the similarity features. Specifically, the classification result of the text to be processed can be determined in different ways, which are not limited in the embodiments of the present application.

[0039] The text processing method provided by the present application can first determine multiple view features of the text to be processed, and then determine the similarity features of the text to be processed based on the multiple view features, so as to be able to determine the similarity between each view feature according to the similarity features, avoid the conflict between multiple view features, and further be able to better determine the classification result of the text to be processed, so that in subsequent application scenarios, the actual execution action corresponding to the text to be processed can be determined according to the classification label.

[0040] In order to better implement the embodiments of the present application, in one embodiment of the present application, determining multiple view features of the text to be processed includes:

[0041] Removing the noise words in the text to be processed to obtain an initially processed text; extracting view features from the initially processed text to obtain multiple view features of the text to be processed.

[0042] In the above embodiments, a scheme for directly determining each view feature according to the text to be processed is provided. However, in some actual situations, the text to be processed includes some interfering words, noise words, etc. For example, stop words are a common type of noise word. Among them, stop words can refer to words with a very high frequency of occurrence but no statistical value, such as "de", "di", "de" in Chinese. Currently, based on the existing open-source stop word list, each word in the text to be processed can be matched with the words in the stop word list. If there is a word in the text to be processed that matches the stop word list, the successfully matched word in the text to be processed can be deleted.

[0043] After deleting the noise words in the text to be processed, an initially processed text that has been preliminarily processed can be obtained. Then, the initially processed text can be used to determine each view feature of the text to be processed according to the method of the above embodiments, and the details are not described here again.

[0044] In an embodiment of the present application, after deleting the noise words in the text to be processed, different view features are determined based on the text with the noise words deleted, so that interfering features in the features can be eliminated, which facilitates the subsequent better determination of similar features and classification labels.

[0045] In order to better implement the embodiment of the present application, in one embodiment of the present application, before determining multiple view features of the text to be processed, the method further includes:

[0046] Obtain sample text; perform masking operation on words in the sample text to obtain masked text; and train a preset multi-view feature extraction model based on the sample text and the masked text.

[0047] The above embodiment provides an implementation method for determining multiple view features of the text to be processed through a language model. In an embodiment of the present application, a method for training a multi-view feature extraction model is also provided. In an embodiment of the present application, the sample text can also be any type of text, including text in different file formats, such as txt format, docx format, etc.; also including different types of text, such as news text, lyrics text, etc., the specific embodiment of the present application is not limited. Among them, the number of sample texts can be determined according to actual conditions.

[0048] In addition, in the embodiment of the present application, the masking operation on the sample text can be performed in a random masking manner. For example, 15% of the words in the sample text are selected for masking operation to obtain masked text, and the masked text is restored through the network to learn context-sensitive text representation. In this way, the cycle is repeated until the multi-view feature extraction model is trained.

[0049] In order to better implement the embodiment of the present application, in one embodiment of the present application, a preset multi-view feature extraction model is trained according to the sample text and the mask text, including:

[0050] According to the sample text and the mask text, the first dimension information corresponding to the sample text and the second dimension information corresponding to the mask text are determined; according to the first dimension information and the second dimension information, the positive sample pairs and the negative sample pairs are determined; according to the positive samples and the negative sample pairs, a preset multi-view feature extraction model is trained.

[0051] In the embodiment of the present application, it should be noted that both the first dimension information and the second dimension information can be latent representations. The latent representation refers to a low-dimensional representation feature with potential meaning and structure extracted from the original data. In the field of machine learning and deep learning, latent representation is a learned representation that can capture important features and changes in the data. The concept of latent representation is often associated with models such as autoencoders, variational autoencoders, and generative adversarial networks. These models map input data to a low-dimensional latent space by learning, and use the structure and distribution properties in the latent space to perform tasks such as data generation, dimensionality reduction, and clustering. By learning latent representations, we can achieve many useful functions. For example, in natural language processing, the learned latent representation can be used for tasks such as semantic search, text generation, and sentiment analysis. The advantage of latent representation is that it can reduce the dimension of the data and capture important information of the data. It can help us understand the intrinsic structure of the data and provide a more compact and expressive representation, thereby providing a better foundation for subsequent tasks and analysis.

[0052] In the above embodiment, a scheme for training a multi-view feature extraction model based on masked text is provided. In order to further improve the training quality of the model, in the embodiment of the present application, a scheme for training a multi-view feature extraction model by determining positive sample pairs and negative sample pairs is also provided. As can be obtained according to the method of the above embodiment, when performing a masking operation on a sample text, some words in the sample text are selected for random masking operation. Therefore, if the masking operation is repeated multiple times, one sample text can correspond to multiple masked texts. Therefore, when training the model, the sample text and a masked text can be used as a training group respectively, thereby obtaining multiple training groups. Afterwards, different training groups are input into the model, and at this time, the multi-view feature extraction model can obtain different potential representations according to different training groups. And because the masking operation is a random operation on some words, masked texts with strong correlation and masked texts with weaker correlation can be obtained.

[0053] Specifically, in the embodiment of the present application, if the sample text set is When , after inputting the multi-view feature extraction model, the first dimension information of the sample text is obtained: If the mask text set is When , after inputting the multi-view feature extraction model, the second dimension information corresponding to the mask text is Among them, M is the number of sample texts, m is the imaginary number of sample texts, N is the number of masked texts, and i is the ordinal number of masked texts.

[0054] In addition, it should be noted that the present application can determine positive sample pairs and negative sample pairs in the following manner. Assuming that there is an existing sample set {m1, m2, m3} with M = 3, after random masking, a masked text set {m1`, m2`, m3`} can be obtained. For sample x1, its corresponding positive sample pair consists only of m1 and the text m1` after m1 masking, expressed as {m1, m1`}; its negative sample pair is {m1, m2}, {m1, m3}, {m1, m2`}, {m1, m3'}. Because the text length is generally not very short, after using the random masking strategy, it can be naturally considered that {m1, m1`} are relatively close in semantics and are a positive sample pair. Therefore, under the view feature m, it can be used represents a positive sample pair, Represents a negative sample pair. Suppose we use the cosine similarity d shown in the following formula (1) to measure the similarity between two different embeddings:

[0055]

[0056] And, after the cosine similarity d is determined, the multi-view feature extraction model can be adjusted according to the following loss functions (2) and (3). Specifically, the loss function (2) and the loss function (3) are as follows:

[0057]

[0058]

[0059] Among them, formula (2) is The contrast loss between the two samples is τ (τ>0), and τ (τ>0) represents the temperature parameter. Finally, in the embodiment of the present application, the model can be continuously trained by positive sample pairs and negative sample pairs until L CL The numerical value of has converged.

[0060] In order to better implement the embodiment of the present application, in one embodiment of the present application, before determining the similarity features of each view feature, the method further includes:

[0061] Obtain each sample view feature corresponding to the sample text; determine the first comparison loss between each sample view feature according to a preset similarity feature extraction model; determine the second comparison loss between each sample view feature according to the first comparison loss; adjust the parameters of the similarity feature extraction model according to the second comparison loss to obtain a similarity feature extraction model that has been adjusted.

[0062] The above embodiment provides an implementation method of determining similarity features by distances between various view features. In the embodiment of the present application, a solution of adjusting a similarity feature extraction model by two loss functions is provided.

[0063] Specifically, in the embodiment of the present application, each view feature can be input into the preset similarity feature extraction model. Assuming H m With H n For different view features, the similarity feature extraction model can be based on different view features H m With H n The first contrast loss is obtained, as shown in the loss function (4):

[0064]

[0065] Among them, in the loss function (4), τF is the temperature parameter, is the view feature H m The similarity feature corresponding to the i-th sample in , is the view feature H n The similarity feature corresponding to the i-th sample in , is the view feature H v The similarity feature corresponding to the j-th sample in .

[0066] After obtaining the first comparison loss, the first comparison loss is substituted into the loss function (5) to obtain the second comparison loss. The specific loss function (5) is as follows:

[0067]

[0068] Finally, by adjusting the parameters in the similarity feature extraction model and making L H After convergence is completed, it can be determined that the similarity feature extraction model has completed training.

[0069] In summary, if is a collection of view features. Input the similarity feature extraction model, and you can get the similarity feature set Among them, M is the number of features and m is the feature ordinal number.

[0070] In order to better implement the embodiment of the present application, in one embodiment of the present application, the classification result of the text to be processed is determined according to the similarity feature, including:

[0071] According to the features of each view, the cluster classification probability of the text to be processed is determined; according to the cluster classification probability and similarity features, the classification result of the text to be processed is determined.

[0072] However, in actual situations, there are many types of semantics that texts may express. Therefore, during the training phase, clustering can be used to determine the clusters of each sample text. Furthermore, in the actual application process, after obtaining the text to be processed, it is possible to first determine which cluster the text to be processed belongs to, and then further determine the classification label of the text to be processed based on the subordinate cluster relationship and similarity features. Compared with determining the classification label of the text to be processed only by similarity features, combining the cluster classification probability on the basis of similarity features can better determine the classification label of the text to be processed.

[0073] Specifically, each view feature of the text to be processed can be input into the trained cluster probability output model to obtain the cluster classification probability of the text to be processed. Among them, a label can be added to each classification cluster. At this time, a cluster classification with the maximum probability of the text to be processed can be obtained according to the cluster classification probability of the text to be processed. Further, the label of the similarity feature can be determined according to the method of the above embodiment. At the same time, if the label of the cluster classification with the maximum probability is the same as the label of the similarity feature, the classification label of the text to be processed can be determined. It can be seen that based on the cluster classification probability, the label of the similarity feature can be reviewed, which improves the accuracy of determining the classification label. In addition, it should be noted that if the label of the cluster classification with the maximum probability is different from the label of the similarity feature, the corresponding operation can be performed when they are different. For example: the prompt model needs to be retrained; or, the label of the similarity feature is used as the classification label of the text to be processed. The specific execution operation can be set according to the actual situation, and the embodiment of the present application is not limited.

[0074] In order to better implement the embodiment of the present application, in one embodiment of the present application, before determining the cluster classification probability of the text to be processed according to each view feature, the method further includes:

[0075] Obtain each sample view feature corresponding to the sample text; determine the third comparison loss between each sample view feature according to a preset cluster probability output model; determine the fourth comparison loss between each sample view feature according to the third comparison loss; adjust the parameters of the cluster probability output model according to the fourth comparison loss to obtain a cluster probability output model that has been adjusted.

[0076] The above embodiment provides an implementation method for determining cluster classification probability through a cluster probability output model. In an embodiment of the present application, an implementation method for training a cluster probability output model is provided. Among them, the cluster probability output model can be adjusted and trained according to the following loss function (6), loss function (7) and loss function (8). Specifically, loss function (6), loss function (7) and loss function (8) are as follows:

[0077]

[0078] in, represents the probability of belonging to the jth cluster under the mth view feature, represents the probability that the nth view feature belongs to the jth cluster, represents the probability that the feature in the vth view belongs to the kth cluster; τL is a temperature parameter that can affect the distances within and between clusters. d is the cosine distance in the above formula (1).

[0079]

[0080] After the third comparison loss is obtained according to formula (6), the third comparison loss is substituted into formula (7) to obtain the fourth comparison loss. is the average probability that a sample is assigned to the jth cluster under the mth view feature.

[0081]

[0082] It should be noted that L in formula (8) H Compared with L in the above formula (5) H The same. Among them, is a collection of similarity features; is the probability distribution of the text to be processed. H , W Q And θ is the model parameter. Then, based on formula (8), the parameters in the model are adjusted until L converges, and the training of the cluster probability output model is completed.

[0083] In order to better implement the embodiment of the present application, in one embodiment of the present application, before determining the classification result of the text to be processed according to the cluster classification probability and the similarity feature, the method further includes:

[0084] Obtain sample text; determine sample similarity features corresponding to the sample text; determine cluster information features of the sample similarity features; determine initial feature labels of the sample text based on the sample similarity features; determine initial cluster labels of the sample text based on the cluster information features; adjust a preset label classification model based on the initial feature labels and initial cluster labels to obtain an adjusted label classification model, which is used to determine classification labels of the text to be processed.

[0085] In the above embodiment, an implementation method of training a cluster probability output model is described. However, the cluster probability output model can be further adjusted to make the output of the model more consistent with the actual situation. Specifically, it is known that the model has obtained similarity features and probability distribution In this embodiment, the probability distribution needs to be Similarity Features The cluster information contained in is matched, and the cluster probability output model is further adjusted to improve the final clustering effect.

[0086] At the same time, according to the description of the above embodiment, it can be obtained that if the label of the cluster classification with the maximum probability is different from the label of the similarity feature, the corresponding operation can be performed when they are different. Therefore, there is a time when the cluster classification label is different from the similarity feature label. When the situation is different, the above embodiment provides a method of retraining the model or using one of the labels as the classification label. However, these processing methods cannot effectively determine the most realistic label of the text to be processed. Therefore, in the embodiment of the present application, a method is also provided to solve the problem of how to make the labels of the two consistent when they are different.

[0087] Specifically, in the embodiment of the present application, the cluster information features of the sample similarity features can be determined by clustering. For example, the cluster information features of the sample similarity features can be obtained by K-means clustering. Specifically, the sample similarity features can be clustered by formula (9), and formula (9) is as follows:

[0088]

[0089] in, represents the number of clusters, Represents a specific cluster. is the view feature H m The similarity feature corresponding to the i-th sample in .

[0090] After obtaining the cluster information features according to the above formula (9), the initial feature label of the sample text can also be obtained according to the following formula (10). The specific formula (10) is as follows:

[0091]

[0092] in, Represents a specific cluster. is the view feature H m The similarity feature corresponding to the i-th sample in .

[0093] In addition, the method for obtaining the initial cluster label can be based on the method of the above embodiment, first determining the probability distribution of each cluster corresponding to multiple sample view features corresponding to the sample text, and then determining the initial cluster label corresponding to each sample view according to the maximum probability. Specifically, it can be shown in the following formula (11):

[0094]

[0095] in, is the probability distribution of each cluster corresponding to the multiple sample view features. Moreover, one cluster corresponds to one label, and when multiple sample view features correspond to clusters, the initial cluster labels corresponding to the multiple sample view features can be determined.

[0096] In addition, the label classification model in the embodiment of the present application can be used to analyze each view feature to determine the corresponding initial cluster label and initial feature label. When the initial cluster label is different from the initial feature label, the parameters in the label classification model can be adjusted to make the initial cluster label the same as the initial feature label. Finally, when the initial cluster label is the same as the initial feature label, the same label can be output as the final label.

[0097] In order to better implement the embodiment of the present application, in one embodiment of the present application, according to the initial feature label and the initial cluster label, the preset label classification model is adjusted to obtain the adjusted label classification model, including:

[0098] According to the initial feature labels and the initial cluster labels, label correction information is determined; according to the label correction information, the initial feature labels are corrected to obtain corrected feature labels; according to the corrected feature labels, a preset label classification model is adjusted, and the label classification model is used to determine the classification result of the text to be processed.

[0099] In the above embodiment, an implementation method for adjusting parameters in a label classification model is provided. In order to better adjust the parameters in the label classification model, the embodiment of the present application also provides a method for adjusting the parameters. Specifically, the adjustment can be performed using the Hungarian algorithm.

[0100] Preferably, after the initial feature label and the initial cluster label are obtained, the label correction information can be determined by formula (12) and formula (13). In the embodiment of the present application, the label correction information can be a cost matrix. The specific formula (12) and formula (13) are as follows:

[0101]

[0102]

[0103] in, and are the initial feature labels and initial cluster labels obtained in the above formula (11) and formula (10) respectively. Then, the output of formula (12) is substituted into formula (13) to obtain the cost matrix.

[0104] After the cost matrix (label correction information) is obtained, the initial feature label is corrected according to the cost matrix (label correction information), and the corrected feature label can be corrected by formula (14). The specific formula (14) is as follows:

[0105]

[0106] Among them, A in formula (14) m is a Boolean matrix representing the allocation result obtained after optimization using the Hungarian algorithm. When we make the corrected label The kth element of is 1. In other words, when and When it is established, we correct the label of the i-th sample in the m-th view to k. After obtaining all the corrected labels After that, we can use the cross entropy loss to fine-tune the label MLP, as shown in the following formula (15):

[0107]

[0108] The parameters in formula (15) are all the parameters involved in the above embodiments or formulas, and will not be described in detail here. P After that, by adjusting the label classification model, L P Convergence completes the training of the label classification model.

[0109] Finally, when the label classification model is trained, the similarity features corresponding to the text to be processed and the related view features are input into the label classification model to obtain the corresponding final label, as shown in the following formula (16):

[0110]

[0111] Among them, the parameters in formula (16) are all the parameters involved in the above embodiments or formulas, and will not be described in detail here.

[0112] In order to better implement the text processing method in the embodiment of the present application, in addition to the text processing method, the embodiment of the present application also provides a text processing device, such as Figure 3 As shown, the device 300 includes:

[0113] A first determining module 301 is used to determine a plurality of view features of a text to be processed;

[0114] A second determination module 302, configured to determine similarity features of each view feature;

[0115] The third determination module 303 is used to determine the classification result of the text to be processed according to the similarity feature.

[0116] The text processing device provided by the present application first determines multiple view features of the text to be processed through the first determination module 301, so that the second determination module 302 determines the similarity features of the text to be processed based on the multiple view features, so that the similarity between each view feature can be determined according to the similarity feature, avoiding the conflict between multiple view features, and then the third determination module 303 can better determine the classification result of the text to be processed, so that in subsequent application scenarios, the actual execution action corresponding to the text to be processed can be determined according to the classification label.

[0117] In some embodiments of the present application, the first determining module 301 is specifically used to:

[0118] Remove noise words from the text to be processed to obtain the initial processed text;

[0119] The view features of the initial processing text are extracted to obtain multiple view features of the text to be processed.

[0120] In some embodiments of the present application, the text processing device further includes a first training module, and the first training module is specifically used to:

[0121] Get sample text;

[0122] Perform masking operation on words in the sample text to obtain masked text;

[0123] Based on the sample text and mask text, train the preset multi-view feature extraction model.

[0124] In some embodiments of the present application, the first training module is further used to:

[0125] Determine, according to the sample text and the mask text, first dimension information corresponding to the sample text and second dimension information corresponding to the mask text;

[0126] Determine positive sample pairs and negative sample pairs according to the first dimension information and the second dimension information;

[0127] Based on the positive and negative sample pairs, the preset multi-view feature extraction model is trained.

[0128] In some embodiments of the present application, the text processing device further includes a second training module, and the second training module is specifically used to:

[0129] Determine the first comparison loss between the features of each sample view according to a preset similarity feature extraction model;

[0130] Determine a second comparison loss between each sample view feature according to the first comparison loss;

[0131] According to the second comparison loss, the parameters of the similarity feature extraction model are adjusted to obtain an adjusted similarity feature extraction model.

[0132] In some embodiments of the present application, the third determination module 303 is specifically used to:

[0133] Determine the cluster classification probability of the text to be processed according to the features of each view;

[0134] According to the cluster classification probability and similarity characteristics, the classification result of the text to be processed is determined.

[0135] In some embodiments of the present application, the text processing device further includes a third training module, and the third training module is specifically used to:

[0136] Determine the third comparison loss between each sample view feature according to a preset cluster probability output model;

[0137] Determining a fourth comparison loss between each sample view feature according to the third comparison loss;

[0138] According to the fourth comparison loss, parameters of the cluster probability output model are adjusted to obtain an adjusted cluster probability output model.

[0139] In some embodiments of the present application, the third training module is further used to:

[0140] Get sample text;

[0141] Determine sample similarity features corresponding to the sample text;

[0142] Determine the cluster information features of sample similarity characteristics;

[0143] Determine the initial feature label of the sample text according to the sample similarity features;

[0144] Determine the initial cluster label of the sample text according to the cluster information features;

[0145] According to the initial feature labels and the initial cluster labels, the preset label classification model is adjusted to obtain an adjusted label classification model, and the label classification model is used to determine the classification result of the text to be processed.

[0146] In some embodiments of the present application, the third training module is further used to:

[0147] Determine label correction information according to the initial feature label and the initial cluster label;

[0148] According to the label correction information, the initial feature label is corrected to obtain a corrected feature label;

[0149] According to the modified feature labels, the preset label classification model is adjusted, and the label classification model is used to determine the classification result of the text to be processed.

[0150] The present application also provides a terminal device, which includes a processor, a memory, and a computer program stored in the memory and executable on the processor, and the processor executes the computer program to implement the steps in any one of the text processing methods in the present application. The terminal device integrates any one of the text processing methods provided in the present application. Figure 4 As shown, it shows a schematic diagram of the structure of the terminal device involved in the embodiment of the present application, specifically:

[0151] The terminal device may include one or more processing core processors 401, one or more computer-readable storage media memories 402, a power supply 403, an input unit 404 and other components. Those skilled in the art will appreciate that Figure 4 The terminal device structure shown in the figure does not constitute a limitation on the terminal device, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently. Among them:

[0152] The processor 401 is the control center of the terminal device, and uses various interfaces and lines to connect various parts of the entire terminal device. By running or executing software programs and / or modules stored in the memory 402, and calling data stored in the memory 402, the processor 401 executes various functions of the terminal device and processes data, thereby monitoring the terminal device as a whole. Optionally, the processor 401 may include one or more processing cores; the processor 401 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc. Preferably, the processor 401 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, the user interface and the application program, etc., and the modem processor mainly processes wireless communication. It is understandable that the above-mentioned modem processor may not be integrated into the processor 401.

[0153] The memory 402 can be used to store software programs and modules. The processor 401 executes various functional applications and data processing by running the software programs and modules stored in the memory 402. The memory 402 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area may store data created according to the use of the terminal device, etc. In addition, the memory 402 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices. Accordingly, the memory 402 may also include a memory controller to provide the processor 401 with access to the memory 402.

[0154] The terminal device also includes a power supply 403 for supplying power to each component. Preferably, the power supply 403 can be logically connected to the processor 401 through a power management system, so as to manage charging, discharging, power consumption management and other functions through the power management system. The power supply 403 can also include any components such as one or more DC or AC power supplies, recharging systems, power failure detection circuits, power converters or inverters, and power status indicators.

[0155] The terminal device may further include an input unit 404, which may be used to receive input digital or character information and generate keyboard, mouse, joystick, optical or trackball signal input related to user settings and function control.

[0156] Although not shown, the terminal device may further include a display unit, etc., which will not be described in detail herein. Specifically in this embodiment, the processor 401 in the terminal device will load the executable files corresponding to the processes of one or more application programs into the memory 402 according to the following instructions, and the processor 401 will run the application programs stored in the memory 402, thereby realizing various functions, such as:

[0157] determining a plurality of view features of the text to be processed;

[0158] Determining similarity features of features of each view;

[0159] According to the similarity features, the classification result of the text to be processed is determined.

[0160] A person of ordinary skill in the art will appreciate that all or part of the steps in the various methods of the above embodiments may be completed by instructions, or by controlling related hardware through instructions. The instructions may be stored in a computer-readable storage medium and loaded and executed by a processor.

[0161] To this end, the embodiment of the present application provides a computer-readable storage medium, which may include: a read-only memory (ROM), a random access memory (RAM), a disk or an optical disk, etc. A computer program is stored thereon, and the computer program is loaded by a processor to execute the steps in any text processing method provided in the embodiment of the present application. For example, the computer program is loaded by a processor to execute the following steps:

[0162] determining a plurality of view features of the text to be processed;

[0163] Determining similarity features of features of each view;

[0164] According to the similarity features, the classification result of the text to be processed is determined.

[0165] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, please refer to the detailed description of other embodiments above, and will not be repeated here.

[0166] In specific implementation, the above units or structures can be implemented as independent entities, or can be arbitrarily combined to be implemented as the same or several entities. The specific implementation of the above units or structures can refer to the previous method embodiments, which will not be repeated here.

[0167] The specific implementation of the above operations can be found in the previous embodiments, which will not be described in detail here.

[0168] The above is a detailed introduction to a text processing method and device provided in an embodiment of the present application. Specific examples are used herein to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea. At the same time, for technical personnel in this field, according to the idea of ​​the present application, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.

Claims

1. A text processing method, characterized in that: The method comprises: determining a plurality of view features of the text to be processed; determining similarity features of each of the view features; According to the similarity feature, the classification result of the text to be processed is determined.

2. The text processing method according to claim 1, characterized in that: The step of determining multiple view features of the text to be processed includes: Removing noise words from the text to be processed to obtain an initial processed text; Performing view feature extraction on the initial processing text to obtain a plurality of view features of the text to be processed.

3. The text processing method according to claim 1, characterized in that: Before determining a plurality of view features of the text to be processed, the method further includes: Get sample text; Performing a masking operation on the words in the sample text to obtain a masked text; Training a preset multi-view feature extraction model according to the sample text and the mask text; Determining a first comparison loss between each of the sample view features according to a preset similarity feature extraction model; Determining a second comparison loss between each of the sample view features according to the first comparison loss; According to the second comparison loss, adjusting parameters of the similarity feature extraction model to obtain an adjusted similarity feature extraction model; Determining a third comparison loss between each of the sample view features according to a preset cluster probability output model; Determining a fourth comparison loss between each of the sample view features according to the third comparison loss; According to the fourth comparison loss, parameters of the cluster probability output model are adjusted to obtain an adjusted cluster probability output model.

4. The text processing method according to claim 3, characterized in that: The step of training a preset multi-view feature extraction model according to the sample text and the mask text includes: Determine, according to the sample text and the mask text, first dimension information corresponding to the sample text and second dimension information corresponding to the mask text; Determine a positive sample pair and a negative sample pair according to the first dimensional information and the second dimensional information; A preset multi-view feature extraction model is trained according to the positive samples and the negative sample pairs.

5. The text processing method according to claim 1, characterized in that: Determining the classification label of the text to be processed according to the similarity feature includes: Determining the cluster classification probability of the text to be processed according to each of the view features; According to the cluster classification probability and the similarity feature, a classification label of the text to be processed is determined.

6. The text processing method according to claim 5, characterized in that: Before determining the classification result of the text to be processed according to the cluster classification probability and the similarity feature, the method further includes: Get sample text; Determining sample similarity features corresponding to the sample text; Determining cluster information features of the sample similarity features; Determining an initial feature label of the sample text according to the sample similarity feature; Determining an initial cluster label of the sample text according to the cluster information feature; According to the initial feature labels and the initial cluster labels, a preset label classification model is adjusted to obtain an adjusted label classification model, and the label classification model is used to determine the classification result of the text to be processed.

7. The text processing method according to claim 6, characterized in that: The step of adjusting a preset label classification model according to the initial feature labels and the initial cluster labels to obtain an adjusted label classification model includes: Determining label correction information according to the initial feature label and the initial cluster label; According to the label correction information, the initial feature label is corrected to obtain a corrected feature label; According to the modified feature labels, a preset label classification model is adjusted, and the label classification model is used to determine the classification result of the text to be processed.

8. A text processing device, characterized in that: The device comprises: A first determination module, used to determine a plurality of view features of the text to be processed; A second determination module, used to determine similarity features of each of the view features; The third determination module is used to determine the classification result of the text to be processed according to the similarity feature.

9. A terminal device, characterized in that: The terminal device includes a processor, a memory, and a computer program stored in the memory and executable on the processor, and the processor executes the computer program to implement the steps of the text processing method according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and the computer program is executed by a processor to implement the steps in the text processing method according to any one of claims 1 to 7.