Mail processing method, device and storage medium

By training the XGBoost model to predict the importance level of pending emails, the problem of insufficient intelligence in the existing technology of email classification is solved, intelligent classification and timely processing of emails are realized, and the efficiency of email processing is improved.

CN113706115BActive Publication Date: 2025-04-29PING AN BANK CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111016447.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-08-31
Publication Date
2025-04-29
Estimated Expiration
2041-08-31

AI Technical Summary

Technical Problem

The existing technology is difficult to implement intelligent classification and processing of normal emails, which leads to insufficient intelligence in email classification and easily leads to the failure to process or omit important emails in a timely manner.

Method used

By obtaining the email data of processed emails, training the XGBoost model, predicting the target variable value of pending emails, and determining their importance level, thereby improving the intelligence of email classification.

Benefits of technology

It realizes intelligent classification of mail to be processed, improves the efficiency of mail processing, ensures timely processing of important mails, and reduces the risk of missing important mails.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113706115B_ABST
    Figure CN113706115B_ABST
Patent Text Reader

Abstract

The present application relates to the field of artificial intelligence technology, and discloses a mail processing method, device and storage medium, the method comprising: obtaining processed mails in a user's email mailbox, mail data corresponding to a target variable of the processed mails, and mail data corresponding to a key feature variable; training an XGBoost model to be trained based on the mail data corresponding to the target variable of the processed mails and the mail data corresponding to the key feature variable, and obtaining a trained XGBoost model; obtaining mails to be processed in a user's email mailbox and mail data corresponding to the key feature variables of the mails to be processed; inputting mail data corresponding to the key feature variables of the mails to be processed into the trained XGBoost model, and obtaining a predicted value of the target variable of the mails to be processed; and determining the importance level of the mails to be processed based on the predicted value of the target variable of the mails to be processed. The present application can improve the intelligence of mail classification.
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 technology, and in particular to a mail processing method, device and storage medium. Background Art

[0002] We often receive a large number of emails at work. If we do not classify the emails, problems may easily arise when processing them, such as not processing them in time or missing important emails, which may lead to complaints. Therefore, it is very important to classify emails properly. Currently, email classification includes manual classification and intelligent classification. Manual classification can be achieved by manually adding classification labels to emails, customizing inbox rules, etc., but these methods are time-consuming and not timely enough. Intelligent classification mainly refers to spam classification, which makes it difficult to classify normal emails. Therefore, it is worth studying how to improve the intelligence of email classification. Summary of the invention

[0003] The embodiments of the present application provide an email processing method, device and storage medium, which performs model training by acquiring email data of processed emails, obtains a trained XGBoost model, and uses the model to predict the value of the target variable of the email to be processed, thereby determining the importance level of the email to be processed, thereby improving the intelligence of email classification.

[0004] In a first aspect, an embodiment of the present application provides an email processing method, including:

[0005] Obtain processed emails in the user's email mailbox, where the processed emails are emails that have been received and replied to;

[0006] Obtaining mail data corresponding to a target variable of the processed mail and mail data corresponding to a key feature variable, wherein the mail data corresponding to the target variable is related to the processing importance of the processed mail, and the key feature variable is used to represent mail attributes that affect the processing importance of the processed mail;

[0007] Based on the email data corresponding to the target variable of the processed email and the email data corresponding to the key feature variable, the XGBoost model to be trained is trained to obtain a trained XGBoost model;

[0008] Obtaining the pending emails in the user's email mailbox and the email data corresponding to the key characteristic variables of the pending emails, wherein the pending emails are emails that have been received but not replied;

[0009] Inputting the email data corresponding to the key feature variable of the email to be processed into the trained XGBoost model to obtain the predicted value of the target variable of the email to be processed;

[0010] The importance level of the email to be processed is determined based on the predicted value of the target variable of the email to be processed.

[0011] In a possible implementation, obtaining processed emails in a user's email mailbox includes:

[0012] Obtaining received emails and sent emails in the user's email mailbox, and obtaining attribute data of the received emails and the sent emails;

[0013] When it is determined that the attribute data of a received first email and a sent second email meet corresponding conditions, the first email is determined as the processed email, and the second email is determined as the email corresponding to the processed email; the first email is any one of the received emails, and the second email is any one of the sent emails, and the corresponding conditions include: the recipient of the second email includes the sender of the first email, the sending time of the second email is greater than the receiving time of the first email, the similarity between the subject of the second email and the first email is greater than a first threshold, and the similarity between the body of the second email and the first email is greater than a second threshold.

[0014] In a possible implementation, obtaining the email data corresponding to the target variable of the processed email and the email data corresponding to the key feature variable includes:

[0015] Determine the time difference between the sending time of the email corresponding to the processed email and the receiving time of the processed email as the email data corresponding to the target variable of the processed email;

[0016] Acquire mail data corresponding to each basic feature variable of at least two basic feature variables of the processed mail, wherein the basic feature variables are used to represent mail attributes of the processed mail;

[0017] Based on the mail data corresponding to each of the at least two basic feature variables of the processed mail, the at least two basic feature variables are screened to obtain the key feature variable, and the mail data corresponding to the key feature variable of the processed mail is obtained.

[0018] In a possible implementation, the at least two basic feature variables include a text feature variable, and obtaining the email data corresponding to each of the at least two basic feature variables of the processed email includes:

[0019] Performing word segmentation processing on the body of the processed email to obtain keywords contained in the body;

[0020] The keywords contained in the text are matched with preset keywords to obtain matching results, and the matching results are used as the email data corresponding to the text feature variables, wherein the preset keywords include at least one of the following types: preset keywords for indicating urgency, preset keywords for indicating time, preset keywords for indicating actions, and preset keywords for indicating punishment meanings. The matching results include whether the keywords contained in the text are successfully matched with the preset keywords, and / or the number of successful matches between the keywords contained in the text and the preset keywords.

[0021] In a possible implementation, the filtering of the at least two basic feature variables based on the email data corresponding to each basic feature variable of the processed email to obtain the key feature variable includes:

[0022] Performing WOE encoding on the email data corresponding to each of the at least two basic feature variables, and calculating the information value IV value of each of the at least two basic feature variables based on the result of the WOE encoding;

[0023] The basic characteristic variables whose IV values ​​are greater than the third threshold or the first N basic characteristic variables with the largest IV values ​​are determined as the key characteristic variables.

[0024] In a possible implementation, the training of the to-be-trained XGBoost model based on the email data corresponding to the target variable of the processed email and the email data corresponding to the key feature variable to obtain the trained XGBoost model includes:

[0025] Numerically process the mail data corresponding to the target variable of the processed mail and the mail data corresponding to the key feature variable to obtain total sample data;

[0026] Divide the total sample data into k-1 training sets and 1 test set, and train the XGBoost model to be trained on the k-1 training sets to obtain a trained XGBoost model, where k is an integer greater than 1;

[0027] Testing the trained XGBoost model on the one test set, and calculating the model evaluation index based on the test results;

[0028] If the model evaluation index does not meet the preset conditions, re-dividing k-1 training sets and 1 test set, and using the trained XGBoost model as the XGBoost model to be trained to perform model training;

[0029] If the model evaluation index meets the preset conditions, the trained XGBoost model is obtained.

[0030] In a possible implementation, after determining the importance level of the email to be processed, the method further includes:

[0031] Marking the email to be processed based on a preset mapping relationship between importance levels and marks;

[0032] The receiving time of the to-be-processed emails is obtained, and based on the receiving time and the importance level, an arrangement order of the to-be-processed emails is determined, and the to-be-processed emails are sorted according to the arrangement order.

[0033] In a second aspect, an embodiment of the present application provides a mail processing device, including:

[0034] A first acquisition module is used to acquire processed emails in the user's email mailbox, wherein the processed emails are emails that have been received and replied to;

[0035] A second acquisition module is used to acquire email data corresponding to a target variable of the processed email and email data corresponding to a key feature variable, wherein the email data corresponding to the target variable is related to the processing importance of the processed email, and the key feature variable is used to represent an email attribute that affects the processing importance of the processed email;

[0036] A model training module, used for training the XGBoost model to be trained based on the email data corresponding to the target variable of the processed email and the email data corresponding to the key feature variable, to obtain a trained XGBoost model;

[0037] A third acquisition module is used to acquire the pending emails in the user's email mailbox and the email data corresponding to the key characteristic variables of the pending emails, wherein the pending emails are received but not replied emails;

[0038] A prediction module, used for inputting the email data corresponding to the key feature variable of the email to be processed into the trained XGBoost model to obtain the predicted value of the target variable of the email to be processed;

[0039] The determination module is used to determine the importance level of the email to be processed based on the predicted value of the target variable of the email to be processed.

[0040] In a possible design, the first acquisition module is specifically used to:

[0041] Obtaining received emails and sent emails in the user's email mailbox, and obtaining attribute data of the received emails and the sent emails;

[0042] When it is determined that the attribute data of a received first email and a sent second email meet corresponding conditions, the first email is determined as the processed email, and the second email is determined as the email corresponding to the processed email; the first email is any one of the received emails, and the second email is any one of the sent emails, and the corresponding conditions include: the recipient of the second email includes the sender of the first email, the sending time of the second email is greater than the receiving time of the first email, the similarity between the subject of the second email and the first email is greater than a first threshold, and the similarity between the body of the second email and the first email is greater than a second threshold.

[0043] In a possible design, the second acquisition module is specifically used to:

[0044] Determine the time difference between the sending time of the email corresponding to the processed email and the receiving time of the processed email as the email data corresponding to the target variable of the processed email;

[0045] Acquire mail data corresponding to each basic feature variable of at least two basic feature variables of the processed mail, wherein the basic feature variables are used to represent mail attributes of the processed mail;

[0046] Based on the mail data corresponding to each of the at least two basic feature variables of the processed mail, the at least two basic feature variables are screened to obtain the key feature variable, and the mail data corresponding to the key feature variable of the processed mail is obtained.

[0047] In a possible design, the at least two basic feature variables include a text feature variable, and the second acquisition module is further used to:

[0048] Performing word segmentation processing on the body of the processed email to obtain keywords contained in the body;

[0049] The keywords contained in the text are matched with preset keywords to obtain matching results, and the matching results are used as the email data corresponding to the text feature variables, wherein the preset keywords include at least one of the following types: preset keywords for indicating urgency, preset keywords for indicating time, preset keywords for indicating actions, and preset keywords for indicating punishment meanings. The matching results include whether the keywords contained in the text are successfully matched with the preset keywords, and / or the number of successful matches between the keywords contained in the text and the preset keywords.

[0050] In a possible design, the second acquisition module is further used to:

[0051] Performing WOE encoding on the email data corresponding to each of the at least two basic feature variables, and calculating the information value IV value of each of the at least two basic feature variables based on the result of the WOE encoding;

[0052] The basic characteristic variables whose IV values ​​are greater than the third threshold or the first N basic characteristic variables with the largest IV values ​​are determined as the key characteristic variables.

[0053] In a possible design, the model training module is specifically used to:

[0054] Numerically process the mail data corresponding to the target variable of the processed mail and the mail data corresponding to the key feature variable to obtain total sample data;

[0055] Divide the total sample data into k-1 training sets and 1 test set, and train the XGBoost model to be trained on the k-1 training sets to obtain a trained XGBoost model, where k is an integer greater than 1;

[0056] Testing the trained XGBoost model on the one test set, and calculating the model evaluation index based on the test results;

[0057] If the model evaluation index does not meet the preset conditions, re-dividing k-1 training sets and 1 test set, and using the trained XGBoost model as the XGBoost model to be trained to perform model training;

[0058] If the model evaluation index meets the preset conditions, the trained XGBoost model is obtained.

[0059] In one possible design, the device further includes:

[0060] A marking module, used for marking the to-be-processed emails based on a preset mapping relationship between importance levels and marks;

[0061] The sorting module is used to obtain the receiving time of the mails to be processed, determine the arrangement order of the mails to be processed based on the receiving time and the importance level, and sort the mails to be processed according to the arrangement order.

[0062] In a third aspect, an embodiment of the present application provides an email processing device, which includes a processor, a memory, and a communication interface, wherein the processor, memory, and communication interface are interconnected, wherein the communication interface is used to receive and send data, the memory is used to store program code, and the processor is used to call the program code to execute the method described in the first aspect.

[0063] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and the computer program is executed by a processor to implement the method described in the first aspect above.

[0064] In an embodiment of the present application, the email data corresponding to the target variable of the processed emails and the email data corresponding to the key feature variables are used to train the XGBoost model to obtain a trained XGBoost model, and the model is used to predict the value of the target variable of the email to be processed. The importance level of the email to be processed is determined based on the predicted value of the target variable, which can improve the intelligence of email classification, mark and sort emails according to their importance levels, and prompt users to process important emails in a timely manner, thereby improving email processing efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0065] In order to illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art are briefly introduced below.

[0066] Figure 1 A flowchart of an email processing method provided in an embodiment of the present application;

[0067] Figure 2 A schematic diagram of the structure of a mail processing device provided in an embodiment of the present application;

[0068] Figure 3 A schematic diagram of the structure of another mail processing device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0069] The present application is described in further detail below in conjunction with the accompanying drawings.

[0070] The terms used in the following embodiments of the present application are only for the purpose of describing specific embodiments, and are not intended to be used as limitations on the present application. As used in the specification and appended claims of the present application, the singular expressions "a", "a", "said", "above", "the" and "this" are intended to also include plural expressions, unless there is a clear indication to the contrary in the context.

[0071] In the present application, "at least one (item)" means one or more, "more than one" means two or more, "at least two (items)" means two or three and more than three, and "and / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" can mean: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally indicates that the previous and next associated objects are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items. For example, at least one of a, b or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c".

[0072] The embodiments of the present application can acquire and process relevant data based on artificial intelligence technology. Among them, artificial intelligence (AI) 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.

[0073] AI basic technologies generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing technology, operation / interaction systems, mechatronics, etc. AI software technologies mainly include computer vision technology, robotics technology, biometrics technology, speech processing technology, natural language processing technology, and machine learning / deep learning.

[0074] The embodiment of the present application provides a mail processing method. In order to more clearly describe the solution of the present application, some drawings involved in the present application are further introduced below.

[0075] See also Figure 1 , Figure 1 The following is a flow chart of a mail processing method provided in an embodiment of the present application. Figure 1 As shown, the method may include the following steps 110 to 160.

[0076] Step 110, obtaining processed emails in the user's email mailbox, wherein the processed emails are emails that have been received and replied.

[0077] In one embodiment, the received mails and sent mails in the user's email mailbox can be obtained first, and the attribute data of the received mails and the sent mails can be obtained; according to the degree of correlation between the attribute data of the received mails and the sent mails, it is determined which mails in the user's email mailbox are processed mails. The attribute data of the mail may include data such as the recipient, the sender, the receiving time, the sending time, the subject, and the body. If the received mail and the sent mail are corresponding mails, that is, the sent mail is a reply to the received mail, then the degree of correlation between the attribute data of the two is relatively high. It is understandable that at this time, the attribute data of the two meet the preset corresponding conditions. Therefore, for each mail in the received mail, it is determined whether there is a mail in the sent mail that corresponds to the received mail. If so, it is determined that the received mail is a processed mail. Specifically, when it is determined that the attribute data of the received first email and the sent second email meet the corresponding conditions, the first email is determined as the processed email, and the second email is determined as the email corresponding to the processed email; the first email is any of the received emails, and the second email is any of the sent emails, and the corresponding conditions include: the recipient of the second email includes the sender of the first email, the sending time of the second email is greater than the receiving time of the first email, the similarity between the subject of the second email and the first email is greater than a first threshold, and the similarity between the body of the second email and the first email is greater than a second threshold. Wherein, the process of calculating the similarity of the subject / body of the two emails includes: firstly segmenting the subject / body of each email; after obtaining multiple words, respectively vectorizing the multiple words included in the subject / body of each email, for example, the words can be vectorized by using a one-hot encoding method; then, calculating the distance between the two vectors corresponding to the two emails, which can be a Euclidean distance or a cosine distance, etc., and calculating the similarity of the subject / body of the two emails according to the distance. The first threshold and the second threshold can be determined in advance based on the sent email samples and the received email samples with corresponding relationships. The first threshold and the second threshold can be fixed, or they can be continuously updated and adjusted as the number of email samples with corresponding relationships increases, so as to ensure the authenticity of the samples and the accuracy of email classification. Optionally, it is also possible to determine whether the received email is a replied email based on whether the received email has a "replied" mark, and then determine whether the email is a processed email.

[0078] Step 120, obtaining email data corresponding to the target variable of the processed email and email data corresponding to the key feature variable, wherein the email data corresponding to the target variable is related to the processing importance of the processed email, and the key feature variable is used to represent email attributes that affect the processing importance of the processed email.

[0079] In one embodiment, the time difference between the sending time of the processed email and the receiving time of the processed email can be determined as the email data corresponding to the target variable of the processed email; it can be understood that the target variable is the reply time interval of the processed email, which represents the time spent from receiving the processed email to replying to the processed email, and the email data corresponding to the target variable is the specific value of the reply time interval of the processed email. Generally speaking, the shorter the reply time interval of the email, the more timely the email is processed, which can reflect the higher importance of processing the email to a certain extent. Therefore, the email data corresponding to the target variable is related to the processing importance of the processed email.

[0080] The processing importance of the processed email has a certain correlation with the email attribute of the email, so the processing importance of the email can be determined based on the email attribute of the email. Specifically, the process of obtaining email attributes can include the following two methods: method 1, obtaining multiple email attributes of the email; method 2, after obtaining multiple email attributes of the email, selecting the more important email attributes from them, and the more important email attributes may have a greater impact on the processing importance of the email compared with other email attributes. In this application, the key feature variable may refer to the more important email attribute.

[0081] Taking method 2 as an example, the following describes the process of obtaining email data corresponding to key feature variables:

[0082] Acquire mail data corresponding to each basic feature variable of at least two basic feature variables of the processed mail, wherein the basic feature variables are used to represent mail attributes of the processed mail;

[0083] Based on the mail data corresponding to each of the at least two basic feature variables of the processed mail, the at least two basic feature variables are screened to obtain the key feature variable, and the mail data corresponding to the key feature variable of the processed mail is obtained.

[0084] Among them, the above basic feature variables can include the following email attributes: whether it contains attachments, whether it has been viewed, whether it has been replied, the folder where the email is located, the filtering rules for the folder where the email is located, the category to which the email belongs, whether there is a follow-up mark, whether there is an added reminder, the importance of the email identified by the sender, etc. The above basic feature variables can be directly obtained from the relevant data of the processed email; further, the basic feature variables can also include more other email attributes, such as whether the sender and the user are in the same department, whether the sender and the user are in a superior-subordinate relationship, whether the subject includes specific keywords, whether the text includes specific keywords, etc. These basic feature variables can be obtained by processing and analyzing the email. Not limited to the above email attributes, the basic feature variables can also include other email attributes, and this application does not limit this.

[0085] The following uses the example of whether the body of the email contains specific keywords to introduce the process of obtaining the basic feature variables of the processed email:

[0086] Whether the text contains specific keywords is a feature variable related to the text, and therefore can be called a text feature variable. Specifically, the text of the processed email can be first segmented to obtain the keywords contained in the text; then the keywords contained in the text are matched with preset keywords to obtain matching results, and the matching results are used as email data corresponding to the text feature variable, wherein the preset keywords include at least one of the following types: preset keywords for indicating urgency, preset keywords for indicating time, preset keywords for indicating actions, and preset keywords for indicating punishment meanings, and the matching results include whether the keywords contained in the text successfully match the preset keywords, and / or the number of successful matches between the keywords contained in the text and the preset keywords.

[0087] Exemplarily, you can first use a word segmentation tool, such as the Jieba word segmentation tool, to segment the email body, and remove stop words, punctuation marks, etc. to obtain multiple words; if the number of words is not large, you can directly use the multiple words as the keywords contained in the email body; if the number of words is too large, you can further select representative keywords from them as the keywords contained in the email body, for example, use the TF-IDF (term frequency-inverse document frequency, a statistical method) method to select representative keywords; further, match the keywords contained in the email body with the following types of preset keywords: A keywords indicating urgency such as urgent, must, important, etc.; B words indicating a shorter time such as afternoon, tomorrow, etc.; C words indicating actions such as review, confirm, check, etc.; D keywords indicating punishment meanings such as overdue, deduction, complaint, etc.; not limited to the above types, the preset keywords can also include other types of keywords. After matching, a matching result is obtained, which may correspond to the following possible basic feature variables: 1) whether the email body contains preset keywords; 2) the number of preset keywords contained in the email body; 3) whether the email body contains type A preset keywords, whether it contains type B preset keywords, etc.; 4) the number of type A preset keywords contained in the email body, the number of type B preset keywords contained, etc.; specifically, 1), 2) or 3), 4), etc. can be selected as the basic feature variables, and this application does not impose any restrictions on this.

[0088] Furthermore, after obtaining the email data corresponding to the basic feature variables of the processed emails, the key feature variables are determined from the basic feature variables through screening. The email data corresponding to the key feature variables can be used to train the model later to find the connection between the key feature variables and the target variable. By screening the basic feature variables and selecting the relevant feature variables that are beneficial to the machine learning algorithm, the running time of the machine learning algorithm can be reduced and the interpretability of the model can be increased. The methods for screening the basic feature variables include but are not limited to: correlation coefficient, Gini coefficient, information gain and information value (IV), etc. Exemplarily, the present application can be screened according to the information value. Information value is usually used to indicate the degree of contribution of the feature to the target prediction, that is, to indicate the predictive ability of the feature. Generally speaking, the higher the IV value, the stronger the predictive ability of the feature and the higher the degree of information contribution. Specifically, the process of screening out key feature variables from the basic feature variables includes the following steps:

[0089] First, the email data corresponding to the target variable is binarized, that is, the numerical data is converted into binary classification data according to the preset threshold. If the reply time interval is less than the preset threshold, the corresponding label is 1; if the reply time interval is not less than the preset threshold, the corresponding label is 0.

[0090] Then, all processed emails are taken as samples, and the email data corresponding to each of the at least two basic characteristic variables are respectively encoded with the weight of proof WOE, and the IV value of each of the at least two basic characteristic variables is calculated based on the result of the WOE encoding; specifically, the email data corresponding to each basic characteristic variable is grouped, and the following formula (1) is used to calculate the weight of proof WOE of each group included in the basic characteristic variable, and further, the IV value of the basic characteristic variable is calculated using formula (2):

[0091]

[0092]

[0093] In formula (1), i represents the group number of the group in the basic feature variable, good represents a response, that is, the label of the target variable is 1, #good(i) represents the number of email samples with the target variable label of 1 in the group; bad represents no response, that is, the label of the target variable is 0, #bad(i) represents the number of email samples with the target variable label of 0 in the group. #good(T) represents the total number of email samples with the target variable label of 1 in all groups of the basic feature variable, and #bad(T) represents the total number of email samples with the target variable label of 0 in all groups of the basic feature variable. The result value of this formula reflects the difference between the response and non-response of the group and the overall situation. In formula (2), k represents the total number of groups included in the basic feature variable, and IV can be regarded as the weighted average of the WOE of multiple groups of the basic feature variable.

[0094] Then, the basic characteristic variables with IV values ​​greater than the third threshold or the first N basic characteristic variables with the largest IV values ​​are determined as the key characteristic variables. The third threshold or the value of N can be set according to actual conditions.

[0095] Step 130: Based on the email data corresponding to the target variable of the processed email and the email data corresponding to the key feature variable, the XGBoost model to be trained is trained to obtain a trained XGBoost model.

[0096] XGBoost is one of the Boosting methods in machine learning. The Boosting method integrates multiple weak learners to form a strong learner. The XGBoost model is a boosted tree model, which is essentially an integration of multiple classification and regression trees (CART), that is, multiple CART trees are used for prediction, and the predicted values ​​of each tree are added to obtain the final predicted value of the model. The XGBoost model can be used to solve regression problems. In one embodiment, the model training process may include the following steps:

[0097] The email data corresponding to the target variable of the processed email and the email data corresponding to the key feature variable are numerically processed to obtain the total sample data. Specifically, numerical processing refers to converting the data of the classification type into the data of the numerical type. In addition, the abnormal data can be cleaned up. The email data corresponding to the target variable of the processed email is actually the true value of the target variable of the email, which can be used as the label of the sample, and the email data corresponding to the key feature variable of the processed email can be used as the feature of the sample.

[0098] According to the k-fold cross validation method, the total sample data is divided into k-1 training sets and 1 test set, and the XGBoost model to be trained is trained on the k-1 training sets to obtain the trained XGBoost model, where k is an integer greater than 1; specifically, k can be 10, that is, the 10-fold cross validation method is used to divide the data set. That is, m CART regression trees are established on the training set for prediction: each CART regression tree is a weak learner, and by adding new weak learners step by step, efforts are made to correct the residuals of all previous weak learners. Therefore, in the end, the sum of these m learners can be used to predict the value of the target variable of the email to be processed. Wherein, m is an integer greater than 1.

[0099] The trained XGBoost model is tested on the one test set, and a model evaluation index is calculated based on the test result; specifically, the model evaluation index may include one of mean absolute error, mean square error, root mean square error, and mean absolute percentage error.

[0100] If the model evaluation index does not meet the preset condition, re-divide k-1 training sets and 1 test set, and use the trained XGBoost model as the XGBoost model to be trained to continue model training; the preset condition can be set according to the actual situation. For example, the preset condition can be set as: the root mean square error is less than the index threshold.

[0101] If the model evaluation index meets the preset conditions, the trained XGBoost model is obtained.

[0102] Step 140, obtaining the pending emails in the user's email mailbox and the email data corresponding to the key characteristic variables of the pending emails, wherein the pending emails are received but not replied emails.

[0103] It is understandable that the processed emails and pending emails in this application refer to normal emails other than spam. Among the emails received in the user's email mailbox, except for the processed emails, other emails can be regarded as pending emails. Considering that emails are generally time-sensitive, among the previously received emails, the replied emails can be considered processed, and the unreplied but viewed emails can also be considered processed. Therefore, the received and unreplied emails within the preset time period can be limited to pending emails. The preset time period can be set to within the last month, the last week, the last three days, etc., and this application does not limit this.

[0104] It is understandable that when the model is trained, the input of the model is the email data corresponding to the key feature variables of the processed emails. Therefore, when the trained model is used for prediction, the input of the model includes the email data corresponding to the same feature variables of the emails to be processed. In other words, when the model is applied, the email data corresponding to the key feature variables of the emails to be processed need to be obtained. For example, if it has been determined that the key feature variables include: whether the email contains attachments, then the specific data of whether the email to be processed contains attachments is obtained as the email data corresponding to the key feature variables of the processed emails.

[0105] Step 150: input the email data corresponding to the key feature variable of the email to be processed into the trained XGBoost model to obtain the predicted value of the target variable of the email to be processed.

[0106] The trained XGBoost model is used to predict the value of the target variable of the email based on the email data corresponding to the key feature variables input, that is, to predict the reply time interval of the email to be processed. Therefore, the email data corresponding to the key feature variables of the email to be processed is obtained, and the trained XGBoost model is input to obtain the output of the model, and the output is used as the predicted value of the target variable of the email to be processed. The predicted value is related to the processing importance of the email to be processed.

[0107] Step 160: Determine the importance level of the email to be processed based on the predicted value of the target variable of the email to be processed.

[0108] Specifically, the importance level of the mail to be processed can be determined according to the numerical range of the predicted value of the target variable of the mail to be processed, and each importance level corresponds to a preset numerical range. After determining the importance level of the mail to be processed, the mail to be processed can also be marked based on the mapping relationship between the preset importance level and the mark; for example, the importance level can include "very important", "important" and "ordinary", corresponding to red, yellow and blue marks respectively. In this way, the importance level of the mail to be processed can be displayed by marking, and the classification of the mail to be processed can be realized, so that the user can be prompted to process the more important mails in time. Further, the receiving time of the mail to be processed can be obtained, and the arrangement order of the mail to be processed can be determined based on the receiving time and the importance level, and the mail to be processed can be sorted according to the arrangement order. It can be understood that the higher the importance level of the mail, the higher the arrangement order of the mail to be processed, and for multiple mails with the same importance level, the earlier the mail is received, the higher the arrangement order of the mail to be processed. In this way, the mails can be classified and displayed according to the importance of the mail, so that the display order of the important mails that need to be processed first is higher, which is convenient for prompting the user to process in time and improves the processing efficiency of the mail. Optionally, you can further improve the intelligence of email processing by pinning important emails to the top, adding notes, etc., and prompt users to handle important emails in a timely manner.

[0109] Optionally, when a user uses an email mailbox, the current stock of emails in the email mailbox can be obtained according to preset rules such as preset time intervals or preset quantity intervals, and the XGBoost model can be retrained based on the stock of emails to obtain the latest XGBoost model; and the model can be applied to process and classify the emails to be processed, so that dynamic adjustment and continuous optimization can be achieved to ensure the intelligence and accuracy of email processing. It is understandable that the above email processing method can be independently deployed and implemented locally on the user terminal without using the network and without sending information to the outside, thereby ensuring the privacy and security of the user.

[0110] In an embodiment of the present application, the email data corresponding to the target variable of the processed emails and the email data corresponding to the key feature variables are used to train the XGBoost model to obtain a trained XGBoost model, and the model is used to predict the value of the target variable of the email to be processed. The importance level of the email to be processed is determined based on the predicted value of the target variable, which can improve the intelligence of email classification, mark and sort emails according to their importance levels, and prompt users to process important emails in a timely manner, thereby improving email processing efficiency.

[0111] See also Figure 2 , Figure 2 This is a schematic diagram of the structure of a mail processing device provided in an embodiment of the present application. Figure 2As shown, the mail processing device may include:

[0112] The first acquisition module 10 is used to acquire processed emails in the user's email mailbox, where the processed emails are emails that have been received and replied to;

[0113] A second acquisition module 11 is used to acquire email data corresponding to a target variable of the processed email and email data corresponding to a key feature variable, wherein the email data corresponding to the target variable is related to the processing importance of the processed email, and the key feature variable is used to represent email attributes that affect the processing importance of the processed email;

[0114] A model training module 12 is used to train the XGBoost model to be trained based on the email data corresponding to the target variable of the processed email and the email data corresponding to the key feature variable to obtain a trained XGBoost model;

[0115] The third acquisition module 13 is used to acquire the pending emails in the user's email mailbox and the email data corresponding to the key characteristic variables of the pending emails, wherein the pending emails are received but not replied emails;

[0116] A prediction module 14 is used to input the email data corresponding to the key feature variable of the email to be processed into the trained XGBoost model to obtain a predicted value of the target variable of the email to be processed;

[0117] The determination module 15 is used to determine the importance level of the email to be processed based on the predicted value of the target variable of the email to be processed.

[0118] In a possible design, the first acquisition module 10 is specifically configured to:

[0119] Obtaining received emails and sent emails in the user's email mailbox, and obtaining attribute data of the received emails and the sent emails;

[0120] When it is determined that the attribute data of a received first email and a sent second email meet corresponding conditions, the first email is determined as the processed email, and the second email is determined as the email corresponding to the processed email; the first email is any one of the received emails, and the second email is any one of the sent emails, and the corresponding conditions include: the recipient of the second email includes the sender of the first email, the sending time of the second email is greater than the receiving time of the first email, the similarity between the subject of the second email and the first email is greater than a first threshold, and the similarity between the body of the second email and the first email is greater than a second threshold.

[0121] In a possible design, the second acquisition module 11 is specifically used to:

[0122] Determine the time difference between the sending time of the email corresponding to the processed email and the receiving time of the processed email as the email data corresponding to the target variable of the processed email;

[0123] Acquire mail data corresponding to each basic feature variable of at least two basic feature variables of the processed mail, wherein the basic feature variables are used to represent mail attributes of the processed mail;

[0124] Based on the mail data corresponding to each of the at least two basic feature variables of the processed mail, the at least two basic feature variables are screened to obtain the key feature variable, and the mail data corresponding to the key feature variable of the processed mail is obtained.

[0125] In a possible design, the at least two basic feature variables include a text feature variable, and the second acquisition module 11 is further used to:

[0126] Performing word segmentation processing on the body of the processed email to obtain keywords contained in the body;

[0127] The keywords contained in the text are matched with preset keywords to obtain matching results, and the matching results are used as the email data corresponding to the text feature variables, wherein the preset keywords include at least one of the following types: preset keywords for indicating urgency, preset keywords for indicating time, preset keywords for indicating actions, and preset keywords for indicating punishment meanings. The matching results include whether the keywords contained in the text are successfully matched with the preset keywords, and / or the number of successful matches between the keywords contained in the text and the preset keywords.

[0128] In a possible design, the second acquisition module 11 is further used to:

[0129] Performing WOE encoding on the email data corresponding to each of the at least two basic feature variables, and calculating the information value IV value of each of the at least two basic feature variables based on the result of the WOE encoding;

[0130] The basic characteristic variables whose IV values ​​are greater than the third threshold or the first N basic characteristic variables with the largest IV values ​​are determined as the key characteristic variables.

[0131] In a possible design, the model training module 12 is specifically used for:

[0132] Numerically process the mail data corresponding to the target variable of the processed mail and the mail data corresponding to the key feature variable to obtain total sample data;

[0133] Divide the total sample data into k-1 training sets and 1 test set, and train the XGBoost model to be trained on the k-1 training sets to obtain a trained XGBoost model, where k is an integer greater than 1;

[0134] Testing the trained XGBoost model on the one test set, and calculating the model evaluation index based on the test results;

[0135] If the model evaluation index does not meet the preset conditions, re-dividing k-1 training sets and 1 test set, and using the trained XGBoost model as the XGBoost model to be trained to perform model training;

[0136] If the model evaluation index meets the preset conditions, the trained XGBoost model is obtained.

[0137] In one possible design, the device further includes:

[0138] A marking module, used for marking the to-be-processed emails based on a preset mapping relationship between importance levels and marks;

[0139] The sorting module is used to obtain the receiving time of the mails to be processed, determine the arrangement order of the mails to be processed based on the receiving time and the importance level, and sort the mails to be processed according to the arrangement order.

[0140] in, Figure 2 The detailed description of the embodiment of the device shown can refer to the aforementioned Figure 1 The specific description of the illustrated method embodiment will not be repeated here.

[0141] Please refer to Figure 3 , Figure 3 A schematic diagram of the structure of another mail processing device provided in an embodiment of the present application, such as Figure 3As shown, the device 1000 may include: at least one processor 1001, such as a CPU, at least one communication interface 1003, a memory 1004, and at least one communication bus 1002. The communication bus 1002 is used to realize the connection and communication between these components. The communication interface 1003 may optionally include a standard wired interface, a wireless interface (such as a WI-FI interface). The memory 1004 may be a high-speed RAM memory, or a non-volatile memory (non-volatile memory), such as at least one disk storage. The memory 1004 may optionally also be at least one storage device located away from the aforementioned processor 1001. As shown in FIG. Figure 3 As shown, the memory 1004 as a computer storage medium may include an operating system, a network communication module, and program instructions.

[0142] exist Figure 3 In the device 1000 shown, the processor 1001 may be used to load the program instructions stored in the memory 1004, and specifically perform the following operations:

[0143] Obtain processed emails in the user's email mailbox, where the processed emails are emails that have been received and replied to;

[0144] Obtaining mail data corresponding to a target variable of the processed mail and mail data corresponding to a key feature variable, wherein the mail data corresponding to the target variable is related to the processing importance of the processed mail, and the key feature variable is used to represent mail attributes that affect the processing importance of the processed mail;

[0145] Based on the email data corresponding to the target variable of the processed email and the email data corresponding to the key feature variable, the XGBoost model to be trained is trained to obtain a trained XGBoost model;

[0146] Obtaining the pending emails in the user's email mailbox and the email data corresponding to the key characteristic variables of the pending emails, wherein the pending emails are emails that have been received but not replied;

[0147] Inputting the email data corresponding to the key feature variable of the email to be processed into the trained XGBoost model to obtain the predicted value of the target variable of the email to be processed;

[0148] The importance level of the email to be processed is determined based on the predicted value of the target variable of the email to be processed.

[0149] It should be noted that the specific implementation process can be found in Figure 1 The specific description of the illustrated method embodiment will not be repeated here.

[0150] The specific execution steps can be found in the description of the aforementioned embodiment and will not be repeated here.

[0151] The present application also provides a computer storage medium, which can store multiple instructions, and the instructions are suitable for being loaded and executed by a processor as described above. Figure 1 The method steps of the embodiment shown in the figure can be found in the specific implementation process. Figure 1 The specific description of the illustrated embodiment will not be repeated here.

[0152] A person skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program, and the program can be stored in a computer-readable storage medium, and when the program is executed, it includes the processes of the embodiments of the above-mentioned methods. The storage medium can be a disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM), etc.

Claims

1. A mail processing method, characterized in that: include: Obtaining received emails and sent emails in the user's email mailbox, and obtaining attribute data of the received emails and the sent emails; When it is determined that the attribute data of the received first email and the sent second email meet corresponding conditions, the first email is determined as a processed email, and the second email is determined as an email corresponding to the processed email; The first email is any one of the received emails, the second email is any one of the sent emails, the corresponding conditions include: the recipient of the second email includes the sender of the first email, the sending time of the second email is greater than the receiving time of the first email, the similarity between the subject of the second email and the first email is greater than a first threshold, the similarity between the body of the second email and the first email is greater than a second threshold, and the processed email is an email that has been received and replied; Determine the time difference between the sending time of the email corresponding to the processed email and the receiving time of the processed email as the email data corresponding to the target variable of the processed email; If the email data corresponding to the target variable is less than the preset threshold, the corresponding label is 1; if the email data corresponding to the target variable is greater than or equal to the preset threshold, the corresponding label is 0; Obtaining mail data corresponding to each basic feature variable of at least two basic feature variables of the processed mail, wherein the basic feature variables are used to represent mail attributes of the processed mail, and the at least two basic feature variables include: whether it contains attachments, whether it has been viewed, whether it has been replied, the folder where the mail is located, the filtering rule of the folder where the mail is located, the category to which the mail belongs, whether there is a follow-up mark, whether there is a reminder to add, and the importance of the mail identified by the sender; Grouping the mail data corresponding to each basic characteristic variable of at least two basic characteristic variables of the processed mail, and calculating the weight of proof WOE of each group included in each basic characteristic variable using the following formula; i represents the group number of the group in the basic feature variable, good represents a response, that is, the label of the target variable is 1, #good(i) represents the number of email samples with the target variable label of 1 in the group; bad represents no response, that is, the label of the target variable is 0, #bad(i) represents the number of email samples with the target variable label of 0 in the group, #good(T) represents the total number of email samples with the target variable label of 1 in all groups of the basic feature variable, and #bad(T) represents the total number of email samples with the target variable label of 0 in all groups of the basic feature variable; The weighted average of WOE of multiple groups of basic feature variables is calculated using the following formula: The k represents the total number of groups included in the basic feature variable, #good(i) represents the number of email samples with the target variable label of 1 in the group, #good(T) represents the total number of email samples with the target variable label of 1 in all groups of the basic feature variable, #bad(i) represents the number of email samples with the target variable label of 0 in the group, and #bad(T) represents the total number of email samples with the target variable label of 0 in all groups of the basic feature variable; WOE i It represents the weight of proof of the ith group of the basic characteristic variable, WOE; Determine the basic characteristic variables with IV values ​​greater than the third threshold or the first N basic characteristic variables with the largest IV values ​​as key characteristic variables, and obtain the email data corresponding to the key characteristic variables of the processed emails; Based on the email data corresponding to the target variable of the processed email and the email data corresponding to the key feature variable, the XGBoost model to be trained is trained to obtain a trained XGBoost model; Obtaining the pending emails in the user's email mailbox and the email data corresponding to the key characteristic variables of the pending emails, wherein the pending emails are emails that have been received but not replied; Inputting the email data corresponding to the key feature variable of the email to be processed into the trained XGBoost model to obtain the predicted value of the target variable of the email to be processed; The importance level of the email to be processed is determined based on the predicted value of the target variable of the email to be processed.

2. The method according to claim 1, characterized in that The at least two basic feature variables include a text feature variable, and the step of obtaining the email data corresponding to each of the at least two basic feature variables of the processed email includes: Performing word segmentation processing on the body of the processed email to obtain keywords contained in the body; The keywords contained in the text are matched with preset keywords to obtain matching results, and the matching results are used as the email data corresponding to the text feature variables, wherein the preset keywords include at least one of the following types: preset keywords for indicating urgency, preset keywords for indicating time, preset keywords for indicating actions, and preset keywords for indicating punishment meanings; the matching results include whether the keywords contained in the text are successfully matched with the preset keywords, and / or the number of successful matches between the keywords contained in the text and the preset keywords.

3. The method according to claim 1 or 2, characterized in that The step of training the XGBoost model to be trained based on the email data corresponding to the target variable of the processed email and the email data corresponding to the key feature variable to obtain the trained XGBoost model includes: Numerically process the mail data corresponding to the target variable of the processed mail and the mail data corresponding to the key feature variable to obtain total sample data; Divide the total sample data into k-1 training sets and 1 test set, and train the XGBoost model to be trained on the k-1 training sets to obtain a trained XGBoost model, where k is an integer greater than 1; Testing the trained XGBoost model on the one test set, and calculating the model evaluation index based on the test results; If the model evaluation index does not meet the preset conditions, re-dividing k-1 training sets and 1 test set, and using the trained XGBoost model as the XGBoost model to be trained to perform model training; If the model evaluation index meets the preset conditions, the trained XGBoost model is obtained.

4. The method according to claim 1, characterized in that After determining the importance level of the to-be-processed email, the method further includes: Marking the email to be processed based on a preset mapping relationship between importance levels and marks; The receiving time of the to-be-processed emails is obtained, and based on the receiving time and the importance level, an arrangement order of the to-be-processed emails is determined, and the to-be-processed emails are sorted according to the arrangement order.

5. A mail processing device, characterized in that: The device is used to perform the method according to any one of claims 1 to 4, and the device comprises: A first acquisition module is used to acquire processed emails in the user's email mailbox, wherein the processed emails are emails that have been received and replied to; A second acquisition module is used to acquire email data corresponding to a target variable of the processed email and email data corresponding to a key feature variable, wherein the email data corresponding to the target variable is related to the processing importance of the processed email, and the key feature variable is used to represent an email attribute that affects the processing importance of the processed email; A model training module, used for training the XGBoost model to be trained based on the email data corresponding to the target variable of the processed email and the email data corresponding to the key feature variable, to obtain a trained XGBoost model; A third acquisition module is used to acquire the pending emails in the user's email mailbox and the email data corresponding to the key characteristic variables of the pending emails, wherein the pending emails are received but not replied emails; A prediction module, used for inputting the email data corresponding to the key feature variable of the email to be processed into the trained XGBoost model to obtain the predicted value of the target variable of the email to be processed; The determination module is used to determine the importance level of the email to be processed based on the predicted value of the target variable of the email to be processed.

6. A mail processing device, characterized in that: It includes a processor, a memory and a communication interface, wherein the processor, the memory and the communication interface are interconnected, wherein the communication interface is used to receive and send data, the memory is used to store program code, and the processor is used to call the program code to execute the method according to any one of claims 1 to 4.

7. 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 4.

Citation Information

Patent Citations

  • Mail processing method, mail processing device, and computer readable storage medium

    CN109547325A

  • Mail processing method and device based on machine learning, medium and electronic equipment

    CN110348009A