Text processing method, device, equipment and storage medium

CN113408266BActive Publication Date: 2024-08-30TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202011401511.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-12-02
Publication Date
2024-08-30
Estimated Expiration
2040-12-02

Smart Images

  • Figure CN113408266B
    Figure CN113408266B
Patent Text Reader

Abstract

The embodiment of the present application discloses a text processing method, device, equipment and storage medium, which is applicable to the fields of artificial intelligence, big data and natural language processing. The method includes: obtaining a text set to be evaluated and multiple text evaluation features, the text set to be evaluated includes multiple texts to be evaluated; classifying the multiple texts to be evaluated to obtain multiple text sets; based on the number of texts to be evaluated contained in each text set, determining a target text set in the multiple text sets; for each text to be evaluated in the target text set, determining the evaluation result of the text to be evaluated based on the matching degree between the text to be evaluated and the multiple text evaluation features. By adopting the embodiment of the present application, the text processing efficiency can be improved, the text to be evaluated can be accurately evaluated, and the applicability is high.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of artificial intelligence, and in particular to a text processing method, apparatus, device and storage medium. Background Art

[0002] With the rapid development of information technology, all fields need to evaluate a large amount of text information in order to process it in a targeted manner. For example, for enterprises, enterprise information contains a lot of user personal privacy information and a large amount of business information. How to ensure the security of the user's personal privacy information and business information of the enterprise has become the top priority of enterprise information security work. The first thing that enterprises need to do is to evaluate the user's personal privacy information and business information in order to carry out targeted information management.

[0003] Most existing text evaluation methods rely on experience knowledge, specify keywords through experience to match, thereby screening out the text information that needs to be evaluated, and then determine the corresponding evaluation results based on the different keywords included in the text information that needs to be evaluated. Therefore, the existing text evaluation methods have poor flexibility and low evaluation accuracy. Summary of the invention

[0004] The embodiments of the present application provide a text processing method, apparatus, device, and storage medium, which can improve text processing efficiency, improve text evaluation accuracy, and have high applicability.

[0005] The present application provides a text processing method, which includes:

[0006] Obtaining a set of texts to be evaluated and a plurality of text evaluation features for performing text evaluation, wherein the set of texts to be evaluated includes a plurality of texts to be evaluated;

[0007] Classifying the multiple texts to be evaluated to obtain multiple text sets;

[0008] Determining a target text set among the plurality of text sets based on the number of texts to be evaluated contained in each of the text sets;

[0009] For each to-be-evaluated text in the target text set, an evaluation result of the to-be-evaluated text is determined based on the matching degree between the to-be-evaluated text and the plurality of text evaluation features.

[0010] The present application provides a text processing device, which includes:

[0011] An acquisition module, used for acquiring a set of texts to be evaluated and a plurality of text evaluation features for performing text evaluation, wherein the set of texts to be evaluated includes a plurality of texts to be evaluated;

[0012] A classification module is used to classify the multiple texts to be evaluated to obtain multiple text sets;

[0013] A determination module, configured to determine a target text set among the plurality of text sets based on the number of texts to be evaluated contained in each of the text sets;

[0014] The evaluation module is used to determine the evaluation result of each to-be-evaluated text in the target text set based on the matching degree between the to-be-evaluated text and the plurality of text evaluation features.

[0015] An embodiment of the present application provides an electronic device, including a processor and a memory, wherein the processor and the memory are connected to each other;

[0016] The memory is used to store computer programs;

[0017] The above-mentioned processor is configured to execute the text processing method provided in the embodiment of the present application when calling the above-mentioned computer program.

[0018] An embodiment of the present application provides a computer-readable storage medium, which stores a computer program. The computer program is executed by a processor to implement the text processing method provided by the embodiment of the present application.

[0019] The embodiment of the present application provides a computer program product or a computer program, which includes computer instructions stored in a computer-readable storage medium. A processor of an electronic device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the text processing method provided in the embodiment of the present application.

[0020] In the embodiment of the present application, multiple text sets are obtained by classifying the texts to be evaluated, and the target text set is determined according to the number of texts to be evaluated contained in each text set, so that the texts to be evaluated can be filtered, the processing amount of the texts to be evaluated can be reduced, and the text processing efficiency can be improved. On the other hand, each text to be evaluated in the target text set can be accurately evaluated through multiple text evaluation features, which has high applicability. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

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

[0023] Figure 2 It is a flowchart of a text processing method provided in an embodiment of the present application;

[0024] Figure 3a This is a schematic diagram of a scenario for determining a text type provided in an embodiment of the present application;

[0025] Figure 3b is another schematic diagram of a scenario for determining a text type provided in an embodiment of the present application;

[0026] Figure 4 It is a schematic diagram of a scenario for determining word vector distribution provided in an embodiment of the present application;

[0027] Figure 5 is a schematic diagram of a scenario for determining a clustering category provided in an embodiment of the present application;

[0028] Figure 6 It is a schematic diagram of a flow chart of evaluating a text to be evaluated provided in an embodiment of the present application;

[0029] Figure 7 is a schematic diagram of a display scenario of an evaluation result provided in an embodiment of the present application;

[0030] Figure 8 is a structural schematic diagram of a text processing device provided in an embodiment of the present application;

[0031] Fig. 9 It is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0032] 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 ordinary technicians in this field without creative work are within the scope of protection of this application.

[0033] The text processing method provided in the embodiment of the present application involves the fields of big data, machine learning (ML) in artificial intelligence (AI), and natural language processing (NLP). Among them, machine learning is a special study of how computers simulate or implement human learning behavior to acquire new knowledge or skills and reorganize existing knowledge structures to continuously improve their own performance.

[0034] Natural language processing is an important direction in the fields of computer science and artificial intelligence. It studies various theories and methods that can achieve effective communication between people and computers using natural language. Natural language processing is a science that integrates linguistics, computer science, and mathematics. Therefore, research in this field will involve natural language, that is, the language used by people in daily life, so it is closely related to the study of linguistics. Natural language processing technology generally includes text processing, semantic understanding, machine translation, robot question and answer, etc. The text processing method provided in the embodiment of the present application mainly relates to text processing technology in natural language processing.

[0035] Artificial intelligence is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results. For example, the embodiment of this application can be based on neural networks, and through machine learning, the machine can have the ability to process text.

[0036] The graph processing method provided in the embodiment of the present application also involves the fields of cloud computing, artificial intelligence cloud services, etc. in cloud technology. In the embodiment of the present application, the computing tasks involved in the text processing method are distributed on a resource pool composed of a large number of computers through cloud computing to improve the efficiency of text processing. In addition, the text processing method can also be used as an artificial intelligence service, and the corresponding artificial intelligence cloud service for text processing can be provided through the artificial intelligence platform.

[0037] The text processing method provided in the embodiment of the present application can be executed by any terminal device or server. When the text processing method provided in the embodiment of the present application is executed by a server, the server can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server or server cluster that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms. When the text processing method provided in the embodiment of the present application is executed by a terminal device, the terminal device can be a smart phone, a tablet computer, a laptop computer, a desktop computer, a smart speaker, a smart watch, etc., but is not limited to this.

[0038] See also Figure 1 , Figure 1 Schematic diagram of a text processing method provided in an embodiment of the present application. Figure 1As shown, the text set 100 to be evaluated includes multiple texts to be evaluated, and all the texts to be evaluated in the text set 100 to be evaluated belong to the same text type. For example, the text type corresponding to the text set 100 to be evaluated is a log type, then all the texts to be evaluated in the text set 100 to be evaluated are log texts. For another example, the text type corresponding to the text set 100 to be evaluated is a trade type, then all the texts to be evaluated in the text set 100 to be evaluated are trade-related texts. Wherein, the specific classification of the text type corresponding to the text set to be evaluated can be determined based on the actual application scenario requirements, and is not limited here. For example, for an enterprise or an organization, the text type corresponding to the text set to be evaluated can be divided into different text types according to customer information, technical information, major decision information, major meeting minutes, financial budget information and various financial statements.

[0039] Furthermore, although all the texts to be evaluated in the text set 100 belong to the same text type, there may still be significant differences in the text content between the texts to be evaluated. For example, the texts to be evaluated related to trade may include texts related to trade funds, and may also include texts related to product information. Therefore, all the texts to be evaluated in the text set 100 can be classified, and the relatively similar texts to be evaluated can be classified into one category, and each category of texts to be evaluated can be regarded as a text set. Figure 1 As shown in, after classifying all the texts to be evaluated in the text set 100 to be evaluated, a text set 201, a text set 202 and a text set 203 can be obtained, and then according to the number of texts to be evaluated included in each text set, a target text set 204 can be determined from the text set 201, the text set 202 and the text set 203, so as to achieve the purpose of screening the texts to be evaluated. Among them, the texts to be evaluated included in the target text set 204 are the texts that need to be evaluated in the end, such as evaluating the importance, threat and risk of all the texts to be evaluated in the target text set 204. The specific evaluation dimensions can be determined based on the actual text type and the actual application scenario requirements, and are not limited here.

[0040] Specifically, when evaluating all the texts to be evaluated in the target text set 204, multiple text evaluation features 300 for text evaluation can be obtained, and the matching degree between each text to be evaluated in the target text set 204 and the multiple text evaluation features can be determined, and then the evaluation results 400 of all the texts to be evaluated can be determined based on the matching degree corresponding to each text to be evaluated. That is, when evaluating all the texts to be evaluated in the target text set 204, the evaluation results of each text to be evaluated can be obtained based on the multiple text evaluation features. Figure 1In the example, the target text set 204 includes a text to be evaluated 1, a text to be evaluated 2, and a text to be evaluated 3. After determining the degree of matching between each text to be evaluated and the plurality of text evaluation features 300, the evaluation result of the text to be evaluated 1 can be determined based on the degree of matching corresponding to the text to be evaluated 1, the evaluation result of the text to be evaluated 2 can be determined based on the degree of matching corresponding to the text to be evaluated 2, and the evaluation result of the text to be evaluated 3 can be determined based on the degree of matching corresponding to the text to be evaluated 3.

[0041] See also Figure 2 , Figure 2 Schematic diagram of the text processing method provided in the embodiment of the present application. Figure 2 As shown, the text processing method provided in the embodiment of the present application includes the following steps:

[0042] Step S21: Obtain a set of texts to be evaluated and a plurality of text evaluation features for performing text evaluation.

[0043] In some feasible implementations, multiple texts to be evaluated in the obtained text set to be evaluated belong to the same text type, wherein the text type can be divided according to the field involved in the text content, such as classifying the log text of the electronic device as a text type and classifying the enterprise information as a text type. Optionally, the text type can also be divided according to different application scenarios, such as classifying enterprise information as a text type and classifying academic literature as a text type. Optionally, the text type can also be divided according to different information attributes in a certain field or a certain application scenario. For example, for an enterprise or an organization, customer information, technical information, major decision-making information, major meeting minutes, financial budget information and various financial statements can be divided into different text types. It should be noted that the specific division method and granularity of the text type corresponding to the above-mentioned text set to be evaluated can be determined based on the actual application scenario requirements, and are not limited here.

[0044] Specifically, when obtaining the set of texts to be evaluated, the set of texts to be processed may be obtained first, the set of texts to be processed includes multiple texts to be processed, and all the texts to be processed in the set of texts to be processed are the obtained texts to be processed belonging to various text types. For example, for an enterprise or an organization, the text types involved in each text to be processed in the set of texts to be processed may include customer information, technical information, major decision information, major meeting minutes, financial budget information, various financial statements and other text types.

[0045] Furthermore, after obtaining the set of texts to be processed, the text types of all the texts to be processed in the set of texts to be processed can be determined, and the texts to be processed of the same text type can be determined as a set of texts to be evaluated. At this time, the texts to be processed in a set of texts to be evaluated are texts to be evaluated. Then, the set of texts to be evaluated corresponding to each text type can be obtained in turn, and the text processing method provided in the embodiment of the present application can be used to process the texts to be evaluated in the set of texts to be evaluated that belong to the same text type, thereby improving the text processing efficiency.

[0046] Optionally, if it is necessary to evaluate the text to be processed that belongs to a specified text type in actual needs, a set of text to be evaluated corresponding to the specified text type can also be obtained, and the text to be evaluated in the set of text to be evaluated can be processed based on the text processing method provided in the embodiment of the present application.

[0047] Optionally, the importance or type priority corresponding to each text type can be determined, and based on the order of importance or the order of type priority, the set of texts to be evaluated corresponding to each text type can be obtained in sequence. It should be noted that the specific implementation method of obtaining the set of texts to be evaluated is only an example, which can be determined based on the actual application scenario requirements and is not limited here.

[0048] In some feasible implementations, when determining the text types of all the to-be-processed texts in the to-be-processed text set, multiple text type prediction models may be obtained to determine the text type of each to-be-processed text. Each text type prediction model corresponds to a text type, that is, each text type prediction model may determine the probability that the text type of the to-be-processed text is a text type. The number of text type prediction models and the text type prediction models used to predict which text types may be determined based on actual application scenario requirements, and are not limited here.

[0049] Further, for each text to be processed, the prediction probability that the text type of the text to be processed is the text type corresponding to each text type prediction model can be determined based on each text type prediction model. That is, each text to be processed is input into each text type prediction model respectively, and each text type prediction model outputs a prediction probability, which indicates the probability that the text type of the text to be processed is the text type corresponding to the text type prediction model. After determining the prediction probability that the text type of the text to be processed is the text type corresponding to each text type prediction model, the text type corresponding to the text type prediction model with the highest prediction probability can be determined as the text type of the text to be processed. Based on the above implementation method, the text types of all the texts to be processed in the text to be processed can be determined.

[0050] For example, see Figure 3a , Figure 3aIt is a schematic diagram of a scenario for determining text type provided in an embodiment of the present application. Figure 3a Three text type prediction models are shown in the figure, each text type prediction model corresponds to a text type, that is, the first text type prediction model corresponds to the first text type, the second text type prediction model corresponds to the second text type, and the third text type prediction model corresponds to the third text type. For a text to be processed, the text to be processed is input into the first text type prediction model, the second text type prediction model and the third text type prediction model respectively. Based on the first text type prediction model, a first prediction probability is obtained, and the first prediction probability is 0.3, based on the second text type prediction model, a second prediction probability is obtained, and the second prediction probability is 0.8, based on the third text type prediction model, a third prediction probability is obtained, and the third prediction probability is 0.4. Among them, the prediction probability of the second prediction probability obtained based on the second text type prediction model is the highest, so the second text type corresponding to the second text type prediction model can be determined as the text type of the text to be processed.

[0051] Among them, each of the above-mentioned text type prediction models can be a model obtained based on neural network training, which has the ability to determine the prediction probability that the text type of the text to be processed is a certain text type, or it can be a model obtained based on classification algorithm training, which has the ability to determine the prediction probability that the text type of the text to be processed is a certain text type. The specific model can be determined based on the actual application scenario requirements and is not limited here.

[0052] Optionally, when determining the text types of all the to-be-processed texts in the to-be-processed text set, a text type prediction model can also be obtained, and the text type prediction model can be used to predict the text type of each to-be-processed text as the prediction probability of each text type. Among them, the text type that can be predicted by the text type prediction model and the number of predictable text types can be determined based on the actual application scenario requirements, and are not limited here.

[0053] Further, for each text to be processed, the predicted probability of the text type of the text to be processed being each text type can be determined based on the text type prediction model. That is, each text to be processed is input into the text type prediction model, and the text type prediction model can output multiple prediction probabilities, each prediction probability representing the probability that the text type of the text to be processed is a text type. After determining that the text type of the text to be processed is the predicted probability of the text type, the text type corresponding to the highest prediction probability can be determined as the text type of the text to be processed. Based on the above implementation method, the text types of all the texts to be processed in the set of texts to be processed can be determined.

[0054] For example, see Figure 3b , Figure 3bThis is another scenario schematic diagram of determining text type provided in an embodiment of the present application. Figure 3b The text type prediction model shown in can determine the prediction probabilities that the text type of a text to be processed is three text types, that is, the prediction probability that the text type of the text to be processed is the first text type, the prediction probability that the text type of the text to be processed is the second text type, and the prediction probability that the text type of the text to be processed is the third text type. For a text to be processed, the text to be processed is input into the text type prediction model, and the first prediction probability obtained is 0.3, the second prediction probability is 0.8, and the third prediction probability is 0.4. Among them, since the second prediction probability is higher than the first prediction probability and the third prediction probability, the second text type corresponding to the second prediction probability can be determined as the text type of the text to be processed.

[0055] Among them, the above-mentioned text type prediction model can be a model obtained based on neural network training, which has the ability to determine the prediction probability that the text type of the text to be processed is a variety of text types, or it can be a model obtained based on classification algorithm training, which has the ability to determine the prediction probability that the text type of the text to be processed is a variety of text types. The specific model can be determined based on the actual application scenario requirements and is not limited here.

[0056] In some feasible implementations, while obtaining the to-be-evaluated text set, it is also necessary to obtain a plurality of text evaluation features for text evaluation, wherein the obtained plurality of text evaluation features are used to evaluate each to-be-evaluated text in the to-be-evaluated text set.

[0057] The above text evaluation features include at least one of the following:

[0058] at least one information category;

[0059] Text format;

[0060] Keyword library.

[0061] The basis and specific granularity of the above information categories can be determined based on the actual application scenario requirements and are not limited here. For example, for a text to be evaluated of a technical document type, the text content of the text to be evaluated may involve information of multiple information categories such as finance, identity, password, and finance.

[0062] The above text format is used to indicate the return type or text representation of the text to be evaluated, including but not limited to text type, Json type, picture (jpg, png) type, etc., which can be determined based on the actual application scenario requirements and is not limited here.

[0063] The keyword library includes multiple evaluation keywords, each of which corresponds to an information category. The keyword library can be constructed in a variety of ways, such as obtaining evaluation keywords belonging to each information category based on big data and other methods to construct a keyword library, extracting multiple evaluation keywords from sample texts based on keyword extraction algorithms to construct a keyword library, and expanding the existing evaluation keyword set based on the above evaluation keyword acquisition method to construct a keyword library, etc. The specific method can be determined based on the actual application scenario requirements and is not limited here.

[0064] In some feasible implementations, at least part of the evaluation keywords in the keyword library may be determined in the following manner:

[0065] Obtaining a sample text set, the sample text set including a plurality of sample texts;

[0066] Based on the appearance of each candidate word contained in the plurality of sample texts in the plurality of sample texts, an evaluation keyword is determined from each candidate word.

[0067] Among them, for each sample text, the candidate words contained in the sample text are words with higher importance in the sample text, or are words in the sample text that can represent different information categories. The method of determining the candidate words in each sample text and the method of obtaining each sample text are not limited here.

[0068] Among them, the occurrence of each candidate word in multiple sample texts can be information that can reflect the frequency of occurrence of each candidate word in a certain dimension, including but not limited to the number of occurrences of each candidate word in the corresponding sample text, the ratio of the number of occurrences of each candidate word in the corresponding sample text to the total number of words in the sample text, and the ratio of the number of occurrences of each candidate word in the corresponding sample text to the number of occurrences of the word with the most occurrences in the sample text, etc., which are not limited here. For the convenience of description, the occurrence of each candidate word is referred to as the word frequency of the candidate word below.

[0069] On the other hand, since the importance of each candidate word may also be different, for example, if the candidate word "sales" and the candidate word "top secret" appear the same number of times in a sample text, it is obvious that the importance of the candidate word "top secret" is greater than that of the candidate word "sales". Therefore, if a candidate word is relatively rare in normal times, but appears many times in a sample text, then the candidate word is likely to reflect an information category involved in the corresponding sample text, and the candidate word "top secret" can be determined as an evaluation keyword.

[0070] Therefore, for each candidate word, the first number of sample texts containing the candidate word in all sample texts can be determined, as well as the total number of sample texts. Then, the inverse text frequency corresponding to the candidate word is determined based on the first number of texts and the total number of texts:

[0071]

[0072] Among them, the inverse text frequency corresponding to the candidate word is inversely proportional to the commonness of the candidate word.

[0073] Furthermore, for each candidate word, the word weight of the candidate word can be determined based on the inverse text frequency and word frequency corresponding to the candidate word (such as multiplying the inverse text frequency by the word frequency), and then for all candidate words, the candidate words with word weights higher than the word weight threshold can be determined as evaluation keywords. Among them, the above-mentioned word weight threshold can be determined based on the actual application scenario requirements and is not limited here.

[0074] Step S22: classify the multiple texts to be evaluated to obtain multiple text sets.

[0075] In some feasible implementations, for all the texts to be evaluated in the text set to be evaluated that belong to the same text type, there may still be significant differences in the text content of each text to be evaluated. Therefore, all the texts to be evaluated in the text set to be evaluated may be classified, and relatively similar texts to be evaluated may be divided into one category, with each category of texts to be evaluated being regarded as a text set.

[0076] Specifically, the texts to be evaluated that belong to the same text type can be further classified to screen out the texts to be evaluated that need to be evaluated from the text set to be evaluated. Specifically, the text features of each text to be evaluated in the text set to be evaluated can be determined first, and based on the text features of each text to be evaluated, a clustering algorithm or a clustering model can be used to cluster each text feature, and multiple text sets can be obtained based on the clustering results. Among them, at the end of clustering, the texts to be evaluated corresponding to the text features belonging to the same clustering category are regarded as a text set, and the similarity between the text contents of the texts to be evaluated in each text set is relatively high.

[0077] For example, if the risk of the text to be evaluated needs to be evaluated, usually only a small part of the text to be evaluated contains risk information, and the similarity between the texts to be evaluated containing risk information is relatively close. Therefore, by clustering the texts to be evaluated, the texts to be evaluated containing risk information can be classified into the same category, thereby filtering the texts to be evaluated that are suspected of containing risk information.

[0078] The above clustering algorithms include but are not limited to K-Means clustering algorithm, mean shift clustering algorithm and DBSCAN clustering algorithm, etc., which can be determined based on the actual application scenario requirements and are not limited here. The above clustering model can be a clustering model obtained by training based on a clustering algorithm, or a clustering model obtained by training based on a neural network model, which can also be determined based on the actual application scenario requirements and are not limited here.

[0079] Among them, using the text features of each text to be evaluated as a clustering object can reduce the amount of information processing and improve the clustering efficiency. Moreover, since each text feature carries the semantic information of the corresponding text to be evaluated, the similarity between the texts to be evaluated in each text set obtained based on the clustering results can be better, which helps to improve the screening accuracy of the information to be evaluated.

[0080] Optionally, the text set to be evaluated may be divided into multiple text sets based on keyword matching, calculation of text similarity between texts, etc. The specific implementation method of classifying multiple texts to be evaluated may be determined based on actual application scenario requirements and is not limited here.

[0081] In some feasible implementations, when determining the text features of each text to be evaluated, for each text to be evaluated, the text to be evaluated can be directly encoded to obtain the text features of the text to be evaluated. Optionally, each word in each text to be evaluated can be encoded to obtain the encoding features of each word, and further based on the vector extraction model, the word vector corresponding to each word in each text to be evaluated is obtained, and then the text features of the corresponding text to be evaluated are determined based on the word vector corresponding to each word. For example, the word vector corresponding to each word in each text to be evaluated can be processed based on the fully connected layer to obtain the text features of the text to be evaluated.

[0082] Optionally, each text to be evaluated may be preprocessed first, including word segmentation, removal of stop words, punctuation marks, dirty data, etc., to obtain each word of the preprocessed text to be evaluated, and then each word in the preprocessed text to be evaluated may be encoded, and a word vector of each word may be obtained based on a vector extraction model to determine the text features of the corresponding text to be evaluated.

[0083] Among them, the above-mentioned vector extraction model can be obtained based on neural network model training, such as training based on the CBOW model in the word2vec model. The selection of a specific neural network model can be determined based on the actual application scenario requirements and is not limited here.

[0084] In some feasible implementations, when training the vector extraction model, a training data set may be obtained, which includes a plurality of training texts. For each word in each training text, each word may be encoded to obtain the encoding feature of the word. Then, the encoding feature of each word in each training text is input into the neural network model, and for each time, the encoding features of the words adjacent to the word are multiplied by the shared input weight matrix through the neural network model to obtain the word vectors of each adjacent word. The word vectors of each adjacent word are added and averaged as the hidden layer vector.

[0085] Furthermore, the hidden layer vector is multiplied by the output weight matrix and processed by the activation function to obtain the word vector distribution corresponding to each word, that is, a certain word is used as the predicted word, and the word vector distribution corresponding to the predicted word is finally obtained through the encoding features of the words adjacent to the word. Among them, the vector dimension of the word vector distribution is the same as the dimension of the word vector of each adjacent word, and the word vector distribution of each predicted word can represent the probability of the predicted word being each word, so that the word indicated by the maximum probability can be used as the predicted word.

[0086] Optionally, when encoding each word in the training text, each training text may also be subjected to text processing such as word segmentation, removal of stop words, punctuation marks, dirty data, etc., to obtain each word in the preprocessed training text, and then each word in the preprocessed training text may be encoded.

[0087] Furthermore, during the training process, a training loss value can be determined based on each word in each training text and the corresponding predicted word, and the training loss value represents the difference between the word in each training text and the corresponding predicted word. The neural network model is iteratively trained based on the training loss value and the training data set until the training loss value meets the preset training end condition, and the model after the training is determined as the vector extraction model.

[0088] Among them, the above training end condition can be that the training loss value is less than the training loss threshold, or that the training loss value tends to be stable, that is, the difference between the training loss values ​​corresponding to a certain number of consecutive training times is less than the preset difference threshold. When the training loss value meets the preset training end condition, it means that for each word, the difference between the word and the corresponding predicted word is small, and it can further be explained that the word vectors of each word obtained based on the vector extraction model tend to be stable. Then, the final shared input weight matrix of the vector extraction model obtained through training is used to determine the word vector corresponding to any word according to the encoding features of the word.

[0089] Combination Figure 4 , Figure 4 It is a schematic diagram of a scenario for determining word vector distribution provided in an embodiment of the present application. Figure 4The figure shows a text to be evaluated, "Go to Beijing today". For the text to be evaluated, each word of the text to be evaluated can be first hot-coded to obtain the coding features of each word in the text to be evaluated, and the coding features of each word are input into the vector extraction model. For the word "go" in the text to be evaluated, the coding features corresponding to the adjacent words "today", "day", "north", and "Beijing" can be input into the vector extraction model to obtain the word vectors corresponding to the words "today", "day", "north", and "Beijing". The word vectors are further added and averaged as the hidden layer vector, and the hidden layer vector is multiplied by the output weight matrix and processed by the activation function to obtain the word vector distribution corresponding to the word "go" (prediction word).

[0090] In some feasible implementations, when clustering the text features of the text to be evaluated, a K-Means clustering algorithm can be used for clustering. Specifically, when starting clustering, k clustering categories can be determined first, that is, this clustering needs to divide each text feature into k clusters. Among them, the determination of the k value can be determined based on prior experience, or the k value can be a preset value, or the k value can be determined by cross-validating each text to be evaluated.

[0091] When performing cross-validation, the text features corresponding to each text to be evaluated can be divided into a training subset and a test subset. The training subset is used for clustering based on different k values ​​to determine the k value that may be used for the final clustering. The test subset is used to test each k value and determine the final k value for this clustering based on the test results.

[0092] Optionally, the text features corresponding to each text to be evaluated can be divided into m training subsets, and m k values ​​can be determined based on the m training subsets. In the process of determining each k value, a training subset can be selected as a test subset, and a k value can be determined based on the above implementation method according to a test subset and m-1 training subsets. And after each k value is determined, another training subset is selected as a test subset to determine another k value based on the above implementation method, and the above process is repeated to obtain m k values. Further, the mean of the m k values ​​can be determined and rounded up or down to obtain the final k value used to cluster all text features.

[0093] It should be noted that the specific method for determining the k value for clustering is only an example and can be determined based on the actual application scenario requirements and is not limited here.

[0094] Furthermore, after determining the k value for clustering, all text features D = {x1, x2, ..., x m} select k text features as the features of k cluster centers {μ1,μ2,…,μ k}, that is, the features of the initial cluster centers when clustering starts are the k selected text features respectively. Each cluster center can be called the mean vector or centroid of the cluster corresponding to the corresponding cluster category. For the convenience of description, the cluster centers are uniformly described in the embodiments of the present application.

[0095] In each clustering process, for a text feature x i , we can determine the text feature x i and the characteristics μ of each cluster center j The similarity d of (j=1,2,…,k) ij =||x i -μ j || 2 , the one with the highest similarity (d ij The smaller the similarity, the higher the cluster category λ corresponding to the characteristics of the cluster center i Determined as the text feature x i The cluster category λ in the current clustering process i , the text feature x i Classify into cluster category λ i The corresponding cluster C λi =C λi ∪{x i Based on the above implementation, it can be determined that all text features D = {x1, x2, ..., x m} corresponding to the clustering category.

[0096] See also Figure 5 , Figure 5 It is a schematic diagram of a scenario for determining clustering categories provided in an embodiment of the present application. Figure 5 The number of clusters in is 3, that is, there are cluster categories 1, 2, and 3. In a clustering process, for Figure 5 For the text feature in, the distances d1, d2 and d3 between the text feature and the features of each cluster center can be determined respectively. Among them, d3 is much smaller than d1 and d2, indicating that the similarity between the text feature and the features of the cluster center corresponding to cluster category 3 is the highest. Therefore, the cluster category of the text feature can be determined as cluster category 3, and the text feature can be classified into the corresponding cluster.

[0097] Furthermore, after each clustering process is completed, for each cluster category corresponding to the cluster C j , it is necessary to update the characteristics of the cluster center corresponding to the cluster category, which can be done by x is realized, where |C j | is cluster C jThe number of text features in the cluster. That is, the mean vector of all text features in the cluster corresponding to the cluster category is used as the new cluster center to perform clustering based on the new cluster center in the next clustering process.

[0098] During the clustering process, the loss value can be determined based on the distance (similarity) of each text feature to the feature of the cluster center corresponding to the distance, and each text feature is iteratively clustered according to the clustering loss value until the clustering loss value meets the clustering end condition. The clustering ends and the text to be evaluated in the cluster corresponding to each clustering category after the clustering ends is determined as a text set.

[0099] Among them, the above-mentioned clustering end condition can be that the above-mentioned clustering loss value is not less than the loss threshold, or that the difference between multiple consecutive clustering loss values ​​is less than the difference threshold, that is, the clustering loss value tends to be stable, and no restriction is made here.

[0100] Among them, the above clustering loss value can be expressed as: That is, the above clustering loss value is the sum of the distances between each text feature and the feature of the corresponding cluster center. The clustering loss value represents the closeness of the text features in the clusters corresponding to each cluster category around the features of the cluster center. The smaller the clustering loss value, the higher the similarity between the text features in the cluster. Based on the above clustering method, the distance between the text features in the clusters corresponding to each cluster category can be made smaller and smaller (the similarity is getting higher and higher), and the distance between clusters can be made larger and larger (the similarity between the text features of different clusters is getting smaller and smaller), thereby achieving the classification of the text to be evaluated.

[0101] Optionally, during the clustering process, the above clustering end condition may also be that the number of iterative clustering times reaches a preset number, at which time clustering may be stopped. The specific selection of the clustering end condition may be determined based on the actual application scenario requirements and is not limited here.

[0102] In the daily operation of computer equipment, the number of alarm logs is often very large, and there are many log texts that contain false alarms or have no effect on computer operation. The embodiment of the present application can filter most of the false alarms or log texts with low impact in a short time by clustering by determining the text features of each log text, thereby reducing the processing volume of log texts.

[0103] Step S23: determining a target text set among the multiple text sets based on the number of texts to be evaluated contained in each text set.

[0104] In some feasible implementation manners, because the similarity between the text contents of the texts to be evaluated in each text set is higher, the texts to be evaluated that are similar in importance and threat belong to the same text set.For example, if the risk of the text to be evaluated needs to be evaluated, usually only a small number of texts to be evaluated contain risk information, and the similarity between the texts to be evaluated that contain risk information is relatively close.Therefore, by clustering each text to be evaluated, the text to be evaluated that contains risk information can be divided into the same class, thereby the quantity of the text to be evaluated included by each text set can be determined, and the target text set is determined from a plurality of text sets based on the quantity of the text to be evaluated included by each text set.If the threat of the text to be evaluated needs to be evaluated, the text to be evaluated that contains threat information and importance information often only accounts for the very few quantity of all texts to be evaluated, therefore one or several text sets that the number of the text to be evaluated that contains is less can be used as the target text set, thereby the text set is screened to obtain a text set with high threat, high importance and high risk.

[0105] Optionally, when determining a target text set from multiple text sets, a text set whose number of texts to be evaluated does not exceed a quantity threshold can be used as the target text set, or a text set whose number of texts to be evaluated exceeds a quantity threshold can be used as the target text set. The specific determination can be based on actual evaluation requirements and is not limited here.

[0106] Step S24: for each to-be-evaluated text in the target text set, determining an evaluation result of the to-be-evaluated text based on a matching degree between the to-be-evaluated text and a plurality of text evaluation features.

[0107] In some feasible implementations, when evaluating the texts to be evaluated in the target text set, the matching degree between each text to be evaluated and the obtained multiple text evaluation features can be determined respectively, so as to determine the evaluation result of the text to be evaluated according to the matching degree corresponding to each text to be evaluated.

[0108] Specifically, the above-mentioned text evaluation feature includes a keyword library, which includes multiple evaluation keywords. The matching degree between the text to be evaluated and the text evaluation feature is determined based on the evaluation keywords hit by the text to be evaluated, the number of evaluation keywords hit by the text to be evaluated, and the proportion of the number of evaluation keywords hit by the text to be evaluated to the total number of evaluation keywords in the above-mentioned keyword library.

[0109] For example, if the text to be evaluated hits an evaluation keyword corresponding to a certain information category, the matching degree corresponding to the evaluation keyword hit by the text to be evaluated can be assigned a value, such as assigning a matching degree corresponding to the number of evaluation keywords hit by the text to be evaluated, etc., to mathematically reflect the matching degree of the text to be evaluated and multiple text evaluation features.

[0110] Specifically, the above-mentioned text evaluation feature includes at least one information category, wherein one evaluation keyword in the keyword library may correspond to one information category. The matching degree between the text to be evaluated and the text evaluation feature may be determined based on the information category hit by the text to be evaluated, the number of categories of the information category hit by the text to be evaluated, and the proportion of the total text length of the evaluation keyword corresponding to the information category hit by the text to be evaluated to the total text length of all evaluation keywords in the keyword library.

[0111] Similarly, the matching degrees corresponding to the information category hit by the text to be evaluated, the number of information categories hit by the text to be evaluated, and the proportion of the total text length of the evaluation keywords corresponding to the information category hit by the text to be evaluated to the total text length of all evaluation keywords in the keyword library can also be reflected through assignment.

[0112] When determining the information category hit by the text to be evaluated, the evaluation keywords hit by the text to be evaluated in the keyword library may be determined first, and the information category corresponding to the hit evaluation keywords is used as the information category hit by the text to be evaluated.

[0113] Specifically, the above text evaluation feature includes a text format. The matching degree between the text to be evaluated and the text evaluation feature can be determined based on the specific text format of the text to be evaluated. For example, if the text format of the text to be evaluated is text, the corresponding matching degree can be determined to be 1.

[0114] Furthermore, the evaluation weights corresponding to the matching degrees between the text to be evaluated and the multiple text evaluation features may be obtained, that is, the evaluation result of the text to be evaluated may be determined based on the matching degrees between the text to be evaluated and the multiple text evaluation features and the corresponding evaluation weights.

[0115] Among them, an evaluation weight is used to indicate the degree of application of the corresponding matching degree to the evaluation result. For example, the influence of the number of evaluation keywords hit by the text to be evaluated on the evaluation result is far greater than the influence of the text format of the text to be evaluated on the evaluation result. The evaluation weights corresponding to different matching degrees can be determined based on the actual application scenario requirements and are not limited here.

[0116] For example, the text to be evaluated hits evaluation keyword 1 and evaluation keyword 2 (the matching degree corresponding to the hit evaluation keyword 1 is 1, and the matching degree corresponding to the hit evaluation keyword 2 is 1), and the total number of evaluation keywords 1 and evaluation keywords 2 hit by the text to be evaluated is 2 (the corresponding matching degree is 2). If there are 12 evaluation keywords in the keyword library, the proportion of the number of evaluation keywords hit by the text to be evaluated to the total number of evaluation keywords in the keyword library is 0.25 (this proportion is used as the corresponding matching degree). In this case, the weighted sum can be performed based on the matching degrees corresponding to the evaluation text and the corresponding evaluation weights to obtain the final evaluation result.

[0117] Optionally, due to the large numerical differences between the different matching degrees of the text to be evaluated and multiple text evaluation features, such as the matching degree corresponding to the number of hit evaluation keywords is often greater than the corresponding proportion of the hit evaluation keywords, the objectivity of the final evaluation result may be reduced. Based on this, the matching degrees of the text to be evaluated and each text evaluation feature can be normalized first, so that each matching degree is in the same quantitative dimension, and then the evaluation result of the text to be evaluated is determined based on the normalized matching degree and the corresponding evaluation weight.

[0118] Among them, the above-mentioned evaluation results can be used to determine the risk, importance and threat of the text to be evaluated, etc., which can be determined based on the actual evaluation needs and application scenario needs, and are not limited here. For example, based on the number of texts to be evaluated contained in each text set, a target text set with high threat is determined from multiple text sets. For any text to be evaluated in the target text set, the threat level of the text to be evaluated can be rated based on the final value obtained by matching the degree of match with the corresponding evaluation weight, that is, based on the corresponding relationship between the final value and the threat level, the threat level corresponding to the text to be evaluated is determined, and the threat level is used as the evaluation result of the text to be evaluated.

[0119] For example, when the threat level of a text to be evaluated needs to be evaluated, the corresponding relationship between the matching degree and the evaluation weight of the text to be evaluated can be shown in Table 1:

[0120] Table 1: Evaluation weight table

[0121] Match Evaluation weight Number of categories of hit information categories 2 Proportion of hits with sensitive information 3 Response return type Text:2; Json:3; jpg / png:2; Others:1 Number of hit evaluation keywords 2 Proportion of hit evaluation keywords 3 Whether the financial evaluation keywords are hit 3 Whether the identity evaluation keywords are hit 3 Whether the position evaluation keyword is hit 3 Whether the password evaluation keywords are matched 3 Whether the file evaluation keyword is matched 3 Whether the user profile evaluation keywords are hit 2 Whether the log evaluation keyword is matched 2 Whether the device evaluation keywords are hit 2 Whether the business evaluation keywords are hit 1 Whether the communication evaluation keywords are hit 1

[0122] Among them, the evaluation keywords in the above keyword library can be financial evaluation keywords, identity evaluation keywords, location evaluation keywords, password evaluation keywords, file evaluation keywords, user information evaluation keywords, log evaluation keywords, device evaluation keywords, business evaluation keywords and communication evaluation keywords. Correspondingly, for a text to be evaluated, the information categories that can be hit may include financial, identity, location, password, file, user information, log, device, business and communication.

[0123] Among them, the percentage of sensitive information hits in Table 1 is the percentage of the total text length of the hit evaluation keywords to the total text length of all evaluation keywords in the keyword library; the response return type is the text format of the text to be evaluated. If the evaluation keywords hit by the text to be evaluated are financial evaluation keywords, identity evaluation keywords, and password evaluation keywords, and the number of words that hit the financial evaluation keywords is 2, the number of words that hit the identity evaluation keywords is 4, and the number of words that hit the password evaluation keywords is 6. It can be seen that the number of categories of information hit by the text to be evaluated is 3, and the corresponding evaluation weight is 2, and the number of hit evaluation keywords is 12, and the corresponding evaluation weight is 2.

[0124] Furthermore, assuming that the total number of keywords to be evaluated in the keyword library is 24, the total text length is 80, and the total text length of the evaluation keywords hit by the text information to be evaluated is 20, then the proportion of sensitive information hit by the text information to be evaluated is 0.25, and the corresponding evaluation weight is 3, and the proportion of evaluation keywords hit is 0.5, and the corresponding evaluation weight is 3. If the text format (response return type) hit by the text to be evaluated is Text, the corresponding evaluation weight is 2. The matching degree corresponding to the text to be evaluated and each text feature (such as a matching degree of 1 if a keyword of an information category is hit) can be normalized, and the threat score of the text to be evaluated is determined based on the normalized matching degree and the corresponding evaluation weight, and the threat level of the text to be evaluated (such as high risk, low risk) is determined based on the threat score.

[0125] It should be noted that when rating each text to be evaluated, the specific level of classification can be determined based on the actual application scenario requirements, and there is no restriction here. For example, for an enterprise or an organization, the corresponding texts to be evaluated may include high-value information such as customer information, technical information, major decision-making information, major meeting minutes, financial budget information and various financial statements. Therefore, different levels of importance can be divided according to the value of information, content sensitivity, impact and distribution scope. For example, general enterprise data is divided into five levels: Top Secret, if the text to be evaluated corresponding to this level is damaged or leaked, it may put the organization at serious financial or legal risks, such as financial information, system or personal authentication information. Confidential, if the text to be evaluated corresponding to this level is damaged or leaked, it may put the organization at financial or legal risks, such as credit card information, personal health information or trade secrets. Secret, the data of the text to be evaluated corresponding to this level that is damaged or leaked may have a negative impact on operations, such as contract texts with partners and suppliers, employee review information texts, etc. Internal Public, the text to be evaluated corresponding to this level is information that is not publicly disclosed, such as sales manuals, organizational charts, employee information, etc. External disclosure: The text to be evaluated corresponding to this level can be freely disclosed publicly, such as marketing materials, contact information, price lists, etc.

[0126] Combine the following Figure 6 The text processing method provided in the embodiment of the present application is further described. Figure 6 As shown, Figure 6 It is a flow chart of evaluating the text to be evaluated provided by an embodiment of the present application. For each text to be evaluated in the set of texts to be evaluated, the text to be evaluated can be subjected to text preprocessing such as word segmentation, removal of stop words, punctuation marks, dirty data, etc., to obtain each word of the preprocessed text to be evaluated. Further, each word in the preprocessed text to be evaluated is encoded to obtain the encoding features of each word, and through a vector extraction model, a word vector of each word is obtained based on the encoding features of each word, and then the text features of the text to be evaluated are determined based on the word vector of each word, so as to obtain the text features of each text to be evaluated in the set of texts to be evaluated.

[0127] Furthermore, the text features are classified based on the clustering algorithm to obtain multiple text sets, and the target text set is determined based on the number of texts to be evaluated contained in each text set. Thus, for each text to be evaluated in the target text set, the evaluation result of the text to be evaluated is determined according to the matching degree between the text to be evaluated and the multiple text evaluation features, so as to determine the evaluation results of all the texts to be evaluated in the target text set.

[0128] In some feasible implementations, after determining the evaluation results of each text to be evaluated in the target text set, the evaluation results of each text to be evaluated in the target text set can be displayed to the user through the evaluation result display interface, such as determining the risk level of each text to be evaluated based on the matching degree between each text to be evaluated and each text evaluation feature and the corresponding evaluation weight, so that the risk level of each text to be evaluated can be displayed to the user as an evaluation result.

[0129] Optionally, the evaluation results of some texts to be evaluated can be displayed to the user according to the needs of actual application scenarios. For example, the importance level of each text to be evaluated (such as the importance level of scientific literature) can be determined based on the matching degree between each text to be evaluated and the evaluation features of each text and the corresponding evaluation weight, and the texts to be evaluated with high importance levels can be displayed to the user as evaluation results.

[0130] Optionally, the number of texts to be evaluated with the same evaluation result may be counted, and each evaluation result and the corresponding number of texts to be evaluated may be displayed to the user together, or the storage location of each text to be evaluated may be displayed to the user while displaying the evaluation result to the user. The specific display method is not limited here.

[0131] See also Figure 7 , Figure 7 It is a schematic diagram of a display scenario of the evaluation results provided in an embodiment of the present application. Figure 7 The following is an evaluation result display interface. Figure 7 In the evaluation result display interface, the number of to-be-evaluated texts of different risk levels can be displayed to the user, such as 20 high-risk level texts to be evaluated, 10 medium-risk level texts to be evaluated, and 40 low-risk level texts to be evaluated. At the same time, detailed viewing instruction information can be provided to the user while displaying the above evaluation results, so as to display detailed text information of the to-be-evaluated texts corresponding to each risk level to the user in response to the user's viewing operation.

[0132] Optionally, after the evaluation result is displayed to the user based on the evaluation result display interface, user operation information received through the evaluation result display interface may be obtained, and the corresponding text to be evaluated may be processed accordingly based on the processing method corresponding to the user operation information.

[0133] Among them, the processing method corresponding to the user operation information can be determined based on the actual application scenario, and is not limited here. For example, based on the evaluation result display interface, the high-importance text to be evaluated is displayed to the user, and based on the user operation information, the high-importance text to be evaluated can be encrypted. For another example, the text to be evaluated is a log text. After the number of high-risk log texts is displayed to the user based on the evaluation result display interface, the high-risk log text can be cleared based on the user's operation.

[0134] In the embodiment of the present application, multiple text sets are obtained by classifying the texts to be evaluated, and the target text set is determined according to the number of texts to be evaluated contained in each text set, so that the texts to be evaluated can be filtered, the processing amount of the texts to be evaluated can be reduced, and the text processing efficiency can be improved. On the other hand, each text to be evaluated in the target text set can be accurately evaluated through multiple text evaluation features, and then corresponding processing measures can be taken for the texts to be evaluated corresponding to different evaluation results, which is beneficial to text management and improving the security of information, and has high applicability.

[0135] See also Figure 8 , Figure 8 1 is a schematic diagram of the structure of a text processing device provided in an embodiment of the present application. The text processing device 1 provided in an embodiment of the present application comprises:

[0136] An acquisition module 11 is used to acquire a set of texts to be evaluated and a plurality of text evaluation features for performing text evaluation, wherein the set of texts to be evaluated includes a plurality of texts to be evaluated;

[0137] A classification module 12 is used to classify the multiple texts to be evaluated to obtain multiple text sets;

[0138] A determination module 13, configured to determine a target text set in the plurality of text sets based on the number of texts to be evaluated contained in each of the text sets;

[0139] The evaluation module 14 is used to determine the evaluation result of each to-be-evaluated text in the target text set based on the matching degree between the to-be-evaluated text and the plurality of text evaluation features.

[0140] In some feasible implementations, for each to-be-evaluated text in the target text set, the evaluation module 14 is used to:

[0141] Obtaining the evaluation weight corresponding to the matching degree between the text to be evaluated and each text evaluation feature;

[0142] Based on the matching degree between the text to be evaluated and the above-mentioned multiple text evaluation features and the corresponding evaluation weights, an evaluation result of the text to be evaluated is determined.

[0143] In some feasible implementations, the above text evaluation features include at least one of the following:

[0144] at least one information category;

[0145] Text format;

[0146] The keyword library includes a plurality of evaluation keywords.

[0147] In some feasible implementations, the text evaluation feature includes multiple information categories. For each text to be evaluated in the target text set, the evaluation module 14 is further used to:

[0148] Determine the information category that the text to be evaluated matches among the above multiple information categories;

[0149] Based on the information category hit by the text to be evaluated, the matching degree between the text to be evaluated and the above-mentioned multiple information categories is determined.

[0150] In some feasible implementations, the text evaluation feature includes a keyword library, the keyword library includes a plurality of evaluation keywords, and for each text to be evaluated in the target text set, the evaluation module 14 is further used to:

[0151] Determine the evaluation keywords hit by the text to be evaluated in the above keyword library;

[0152] Based on the evaluation keywords hit by the text to be evaluated, the matching degree between the text to be evaluated and the plurality of evaluation keywords is determined.

[0153] In some feasible implementations, the determination module 13 is used to:

[0154] Obtaining a sample text set, wherein the sample text set includes a plurality of sample texts;

[0155] Based on the appearance of each candidate word contained in the plurality of sample texts, an evaluation keyword is determined from the candidate words.

[0156] In some feasible implementations, the classification module 12 is used to:

[0157] Determining the text features of each of the above texts to be evaluated;

[0158] Based on the text features of each of the above texts to be evaluated, the text features of the above multiple texts to be evaluated are clustered, and multiple text sets are obtained based on the clustering results.

[0159] In some feasible implementations, the classification module 12 is used to:

[0160] For each text to be evaluated, each word in the text to be evaluated is encoded to obtain encoding features of each word in the text to be evaluated;

[0161] Determine the word vector of each of the above words in the text to be evaluated based on the encoding features of each word in the text to be evaluated;

[0162] Based on the word vectors of the above words in the text to be evaluated, the text features of the text to be evaluated are determined.

[0163] In some feasible implementations, for each text to be evaluated, determining the word vector of each word in the text to be evaluated based on the encoding features of each word in the text to be evaluated is implemented by a vector extraction model;

[0164] The above vector extraction model is trained in the following way:

[0165] Obtain a training data set, wherein the training data set includes a plurality of training texts;

[0166] Encoding each word in each of the above training texts to obtain encoding features of each word in each of the above training texts;

[0167] Inputting the encoding features of each word in each of the training texts into the neural network model, for each word, using the neural network model, based on the encoding features of the words adjacent to the word, determining the word vector of the adjacent word;

[0168] Determine the word vector distribution corresponding to the word based on the word vectors of the adjacent words, and determine the predicted word corresponding to the word based on the word vector distribution;

[0169] Based on each word in the above training text and the corresponding predicted word, a training loss value is determined, and the above neural network model is iteratively trained according to the above training loss value and the above training data set until the above training loss value meets the preset training end condition, and the model after the training is determined as the above vector extraction model.

[0170] In some feasible implementations, the evaluation module 14 is further used to:

[0171] The evaluation result of each to-be-evaluated text in the target text set is displayed to the user through the evaluation result display interface;

[0172] The user operation information received through the evaluation result display interface is obtained, and at least one to-be-evaluated text in the target text set is processed accordingly based on the user operation information.

[0173] In some feasible implementations, the acquisition module 11 is used to:

[0174] Obtaining a set of texts to be processed, wherein the set of texts to be processed includes a plurality of texts to be processed;

[0175] Acquire multiple text type prediction models, each text type prediction model corresponds to a text type;

[0176] For each text to be processed, based on each of the above text type prediction models, determine the prediction probability that the text type of the text to be processed is the text type corresponding to each of the above text type prediction models, and determine the text type corresponding to the text type prediction model with the highest prediction probability as the text type of the text to be processed;

[0177] The to-be-processed texts of the same text type are determined as a to-be-evaluated text set, and any to-be-evaluated text set is obtained.

[0178] In a specific implementation, the above-mentioned device 1 can execute the above-mentioned functions through its built-in functional modules. Figure 2 For the implementation methods provided in each step, please refer to the implementation methods provided in the above steps for details, which will not be repeated here.

[0179] In some feasible implementations, the above-mentioned text processing device can be a computer program (including program code) running in a computer device, for example, the text processing device is an application software; the device can be used to execute the corresponding steps in the method provided in the embodiment of the present application.

[0180] In some feasible implementations, the text processing device provided in the embodiments of the present application can be implemented in a combination of software and hardware. As an example, the text processing device provided in the embodiments of the present application can be a processor in the form of a hardware decoding processor, which is programmed to execute the text processing method provided in the embodiments of the present application. For example, the processor in the form of a hardware decoding processor can adopt one or more application-specific integrated circuits (ASICs), DSPs, programmable logic devices (PLDs), complex programmable logic devices (CPLDs), field programmable gate arrays (FPGAs), or other electronic components.

[0181] In some feasible implementations, the text processing device provided in the embodiments of the present application may be implemented in software. Figure 8 The text processing device shown can be software in the form of programs and plug-ins, and includes a series of modules, including an acquisition module 11, a classification module 12, a determination module 13 and an evaluation module 14, for implementing the text processing method provided in the embodiment of the present application.

[0182] See also Fig. 9 , Fig. 9 Schematic diagram of the structure of the electronic device provided in the embodiment of the present application. Fig. 9As shown, the electronic device 1000 in this embodiment may include: a processor 1001, a network interface 1004 and a memory 1005. In addition, the above-mentioned electronic device 1000 may also include: a user interface 1003, and at least one communication bus 1002. Among them, the communication bus 1002 is used to realize the connection and communication between these components. Among them, the user interface 1003 may include a display screen (Display), a keyboard (Keyboard), and the user interface 1003 may optionally include a standard wired interface and a wireless interface. The network interface 1004 may optionally include a standard wired interface and a wireless interface (such as a WI-FI interface). The memory 1004 may be a high-speed RAM memory, or it may be a non-volatile memory (non-volatile memory), such as at least one disk storage. The memory 1005 may optionally also be at least one storage device located away from the aforementioned processor 1001. As Fig. 9 As shown, the memory 1005 as a computer-readable storage medium may include an operating system, a network communication module, a user interface module, and a device control application program.

[0183] exist Fig. 9 In the electronic device 1000 shown, the network interface 1004 can provide network communication functions; the user interface 1003 is mainly used to provide an input interface for the user; and the processor 1001 can be used to call the device control application stored in the memory 1005 to implement the text processing method provided in the embodiment of the present application.

[0184] It should be understood that in some feasible implementations, the processor 1001 may be a central processing unit (CPU), and the processor may also be 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. A general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc. The memory may include a read-only memory and a random access memory, and provide instructions and data to the processor. A portion of the memory may also include a non-volatile random access memory. For example, the memory may also store information about the device type.

[0185] In a specific implementation, the electronic device 1000 can execute the above-mentioned functions through its built-in functional modules. Figure 2For the implementation methods provided in each step, please refer to the implementation methods provided in the above steps for details, which will not be repeated here.

[0186] The present application also provides a computer-readable storage medium, which stores a computer program and is executed by a processor to implement Figure 2 For the methods provided in each step, please refer to the implementation methods provided in the above steps for details, which will not be repeated here.

[0187] The computer-readable storage medium may be an internal storage unit of the text processing device or electronic device provided in any of the aforementioned embodiments, such as a hard disk or memory of the electronic device. The computer-readable storage medium may also be an external storage device of the electronic device, such as a plug-in hard disk, a smart memory card (smart media card, SMC), a secure digital (secure digital, SD) card, a flash card (flash card), etc. equipped on the electronic device. The computer-readable storage medium may also include a magnetic disk, an optical disk, a read-only memory (read-only memory, ROM) or a random access memory (random access memory, RAM), etc. Further, the computer-readable storage medium may also include both an internal storage unit of the electronic device and an external storage device. The computer-readable storage medium is used to store the computer program and other programs and data required by the electronic device. The computer-readable storage medium may also be used to temporarily store data that has been output or is to be output.

[0188] The embodiment of the present application provides a computer program product or a computer program, the computer program product or the computer program includes computer instructions, the computer instructions are stored in a computer-readable storage medium. A processor of an electronic device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes Figure 2 The methods provided in each step.

[0189] The terms "first", "second", etc. in the claims, specification and drawings of the present application are used to distinguish different objects, rather than to describe a specific order. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions. For example, a process, method, system, product or electronic device that includes a series of steps or units is not limited to the listed steps or units, but optionally includes steps or units that are not listed, or optionally includes other steps or units inherent to these processes, methods, products or electronic devices. Mentioning "embodiment" in this article means that the specific features, structures or characteristics described in conjunction with the embodiment may be included in at least one embodiment of the present application. Displaying the phrase at various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments. The term "and / or" used in the present application specification and the attached claims refers to any combination of one or more of the items listed in association and all possible combinations, and includes these combinations.

[0190] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented by electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in terms of function in the above description. Professional and technical personnel may use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0191] The above disclosure is only the preferred embodiment of the present application, which cannot be used to limit the scope of rights of the present application. Therefore, equivalent changes made according to the claims of the present application are still within the scope covered by the present application.

Claims

1. A text processing method, characterized in that: The method comprises: Acquire a text set to be evaluated and a plurality of text evaluation features for performing text evaluation, wherein the text set to be evaluated includes a plurality of texts to be evaluated; For each text to be evaluated, each word in the text to be evaluated is encoded to obtain encoding features of each word; a word vector of each word is determined based on the encoding features of each word; a text feature of the text to be evaluated is determined based on the word vector of each word; based on the text features of each of the texts to be evaluated, the text features of the multiple texts to be evaluated are clustered, and multiple text sets are obtained based on the clustering results; Determining a target text set among the multiple text sets based on the number of texts to be evaluated contained in each of the text sets; For each to-be-evaluated text in the target text set, determining an evaluation result of the to-be-evaluated text based on a matching degree between the to-be-evaluated text and the plurality of text evaluation features; Wherein, for each text to be evaluated, the word vector of each word is determined based on the encoding features of each word by a vector extraction model; the vector extraction model is trained in the following way: Acquire a training data set, the training data set comprising a plurality of training texts; encode each word in each of the training texts to obtain encoding features of each word in each of the training texts; Inputting the encoding features of each word in each of the training texts into a neural network model, for each word, determining the word vector of the adjacent word based on the encoding features of the adjacent words through the neural network model; determining the word vector distribution corresponding to the word based on the word vectors of the adjacent words, and determining the predicted word corresponding to the word based on the word vector distribution; Based on each word in the training text and the corresponding predicted word, a training loss value is determined, and the neural network model is iteratively trained according to the training loss value and the training data set until the training loss value meets a preset training end condition, and the model after the training is determined as the vector extraction model.

2. The method according to claim 1, characterized in that For each to-be-evaluated text in the target text set, determining an evaluation result of the to-be-evaluated text based on a matching degree between the to-be-evaluated text and the plurality of text evaluation features includes: Obtaining the evaluation weight corresponding to the matching degree between the text to be evaluated and each text evaluation feature; Based on the matching degree between the text to be evaluated and the plurality of text evaluation features and the corresponding evaluation weights, an evaluation result of the text to be evaluated is determined.

3. The method according to claim 1 or 2, characterized in that: The text evaluation feature includes at least one of the following: at least one information category; Text format; A keyword library includes a plurality of evaluation keywords.

4. The method according to claim 3, characterized in that The text evaluation feature includes a plurality of information categories, and for each text to be evaluated in the target text set, the method further includes: Determining the information category that the text to be evaluated hits among the multiple information categories; Based on the information category hit by the text to be evaluated, the matching degree between the text to be evaluated and the multiple information categories is determined.

5. The method according to claim 3, characterized in that: The text evaluation feature includes a keyword library, the keyword library includes a plurality of evaluation keywords, and for each text to be evaluated in the target text set, the method further includes: Determine the evaluation keywords hit by the text to be evaluated in the keyword library; Based on the evaluation keywords hit by the text to be evaluated, the matching degree between the text to be evaluated and the plurality of evaluation keywords is determined.

6. The method according to claim 3, characterized in that At least part of the evaluation keywords in the keyword library are determined by: Acquire a sample text set, wherein the sample text set includes a plurality of sample texts; Based on the appearance of each candidate word contained in the plurality of sample texts in the plurality of sample texts, an evaluation keyword is determined from the candidate words.

7. The method according to claim 1, characterized in that The method further comprises: The evaluation result of each to-be-evaluated text in the target text set is displayed to the user through the evaluation result display interface; The user operation information received through the evaluation result display interface is acquired, and at least one to-be-evaluated text in the target text set is processed accordingly based on the user operation information.

8. The method according to claim 1, characterized in that: The step of obtaining a text set to be evaluated includes: Acquire a set of texts to be processed, wherein the set of texts to be processed includes a plurality of texts to be processed; Acquire multiple text type prediction models, each text type prediction model corresponds to a text type; For each text to be processed, determining the prediction probability that the text type of the text to be processed is the text type corresponding to each text type prediction model based on each of the text type prediction models, and determining the text type corresponding to the text type prediction model with the highest prediction probability as the text type of the text to be processed; The to-be-processed texts of the same text type are determined as a to-be-evaluated text set, and any to-be-evaluated text set is obtained.

9. A text processing device, characterized in that: The device comprises: An acquisition module, used for acquiring a set of texts to be evaluated and a plurality of text evaluation features for performing text evaluation, wherein the set of texts to be evaluated includes a plurality of texts to be evaluated; A classification module is used for encoding each word in each text to be evaluated to obtain encoding features of each word; determining a word vector of each word based on the encoding features of each word; determining a text feature of the text to be evaluated based on the word vector of each word; clustering the text features of the multiple texts to be evaluated based on the text features of each of the texts to be evaluated, and obtaining multiple text sets based on the clustering results; A determination module, configured to determine a target text set among the plurality of text sets based on the number of texts to be evaluated contained in each of the text sets; An evaluation module, configured to determine, for each to-be-evaluated text in the target text set, an evaluation result of the to-be-evaluated text based on a matching degree between the to-be-evaluated text and the plurality of text evaluation features; Wherein, for each text to be evaluated, the word vector of each word is determined based on the encoding features of each word by a vector extraction model; the vector extraction model is trained in the following way: Acquire a training data set, the training data set comprising a plurality of training texts; encode each word in each of the training texts to obtain encoding features of each word in each of the training texts; Inputting the encoding features of each word in each of the training texts into a neural network model, for each word, determining the word vector of the adjacent word based on the encoding features of the adjacent words through the neural network model; determining the word vector distribution corresponding to the word based on the word vectors of the adjacent words, and determining the predicted word corresponding to the word based on the word vector distribution; Based on each word in the training text and the corresponding predicted word, a training loss value is determined, and the neural network model is iteratively trained according to the training loss value and the training data set until the training loss value meets a preset training end condition, and the model after the training is determined as the vector extraction model.

10. The device according to claim 9, characterized in that For each to-be-evaluated text in the target text set, the evaluation module is used to: Obtaining the evaluation weight corresponding to the matching degree between the text to be evaluated and each text evaluation feature; Based on the matching degree between the text to be evaluated and the plurality of text evaluation features and the corresponding evaluation weights, an evaluation result of the text to be evaluated is determined.

11. An electronic device, characterized in that: comprising a processor and a memory, wherein the processor and the memory are connected to each other; The memory is used to store computer programs; The processor is configured to execute the method according to any one of claims 1 to 8 when calling the computer program.

12. 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 method according to any one of claims 1 to 8.

Citation Information

Patent Citations

  • Text data classification method, device, equipment and storage medium

    CN108875067A

  • Text detection method and device and storage medium

    CN111222316A