Customer loss prediction method and system fusing portrait and sentiment analysis
By integrating profiling and sentiment analysis methods, combined with logistic regression and random forest models, and using the BERT model to extract customer profiling and emotional features, the problem of low customer churn prediction accuracy and insufficient interpretability in the existing technology has been solved, and a better solution has been achieved. Accurate and efficient customer churn prediction helps companies retain customers who are at risk of potential churn.
Patent Information
- Application Number
- CN202410932080.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-12
- Publication Date
- 2024-10-15
AI Technical Summary
Existing customer churn prediction methods have problems of concealment, complexity and noise when processing customer historical information, resulting in low model accuracy and insufficient interpretability. They ignore the emotional information in customer communication records and cannot effectively identify and retain customers. Customers at potential risk of churn.
Using the method of merging portraits and sentiment analysis, through data collection, feature screening, data preprocessing, portrait feature extraction, emotional feature extraction and feature splicing, logistic regression and random forest models are constructed, and the BERT model and MLP model are combined to extract and stack customers. Portraits and emotional characteristics for customer churn prediction.
It improves the accuracy and interpretability of customer churn prediction, helps companies identify and retain customers at risk of churn, reduces customer acquisition costs, improves operational efficiency and user experience, and enhances corporate profitability and competitiveness.
Smart Images

Figure CN118780852A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of artificial intelligence and big data analysis technology, and specifically to a customer churn prediction method and system integrating portrait and sentiment analysis. Background Art
[0002] With the rapid development of technology and the continuous expansion of demand, a large number of peer companies have entered the cloud computing market, and the phenomenon of product and service homogeneity has become increasingly serious, leading to intensified industry competition and increasing customer mobility. Surveys show that the cost of attracting new customers in mature markets is several times that of preventing old customers from stopping purchasing services, so improving customer retention is of great significance to improving corporate profitability and competitiveness. Customer churn prediction models can help companies locate and retain customers with potential churn risks, thereby reducing customer acquisition costs, improving operational efficiency, enhancing user experience, and enhancing brand reputation.
[0003] Customer churn prediction methods aim to predict future trends by analyzing historical data and finding potential rules and patterns between variables. However, building a reliable customer churn prediction system is very challenging because historical information about customers is hidden, complex, and noisy. Existing methods are mostly based on customer attributes and behaviors, ignoring the large amount of information contained in communication records that can reflect customer needs and reveal customer satisfaction. Insufficient feature mining leads to low model accuracy and poor interpretability. Summary of the invention
[0004] The technical task of the present invention is to address the above shortcomings and provide a customer churn prediction method and system that integrates portrait and sentiment analysis, which can improve the accuracy and explainability of customer churn prediction, help enterprises identify and retain customers at risk of churn, improve operational efficiency, enhance user experience, and thereby improve profitability and competitiveness.
[0005] The technical solution adopted by the present invention to solve its technical problem is:
[0006] A customer churn prediction method integrating portrait and sentiment analysis includes data collection, feature screening, data preprocessing, portrait feature extraction, sentiment feature extraction, feature splicing and customer churn prediction. The specific implementation of the method includes the following steps:
[0007] Step 1: Collect data related to customer churn, including attributes and communication records;
[0008] Step 2: Delete the attribute features with small variance to improve prediction accuracy and reduce the amount of calculation;
[0009] Step 3: Fill in missing values / normalize attribute data and perform text preprocessing on unstructured data;
[0010] Step 4: Build a logistic regression model and screen significant attributes through hypothesis testing to form portrait features;
[0011] Step 5: Build a BERT model to vectorize text and obtain the emotional features of communication through the classifier;
[0012] Step 6: Stack the customer's portrait features and sentiment features in the channel dimension to obtain the final features;
[0013] Step 7: Build a random forest model to output the customer churn probability.
[0014] Furthermore, the data collection determines the variables related to customer churn, labels the customers as to whether they have churned, and collects the company's internal customer historical data to form a multi-feature binary classification data set D = {(x i ,y i )|i=1,…n}, where the independent variable y i =1 represents customer churn, y i =0 means that the customer has not been lost;
[0015] Variables related to customer churn include customer attributes and communication records, where customer attributes are structured data and communication records are unstructured text data; for corporate users, customer attributes include the industry to which the enterprise belongs, whether the enterprise is a state-owned enterprise, the size of the enterprise, consumption amount, etc.; for individual customers, customer attributes include age, gender, income, consumption amount, etc.
[0016] Furthermore, the feature screening deletes the attribute features with smaller variance, wherein the calculation formula of the variance is as follows:
[0017]
[0018] in is the sample mean of the jth feature.
[0019] Furthermore, in the data preprocessing, for structured data, the data preprocessing module uses the average of the features Fill in missing values and then perform Z-Score normalization; the formula for Z-Score is as follows:
[0020]
[0021] Because communication records contain a lot of irrelevant content, the premise of text vectorization is to clean up dirty data. The data preprocessing operations include:
[0022] Remove irrelevant content from text data, including punctuation, emoticons, URLs, HTML tags, phone numbers, etc. These contents are irrelevant to emotional information and affect training efficiency and accuracy;
[0023] Unify the format of numbers and letters in the text, and unify the upper and lower case of numbers and letters;
[0024] Convert all texts into simplified Chinese characters; convert full-width letters and numbers into half-width characters.
[0025] Furthermore, the image feature extraction first constructs a logistic regression model:
[0026]
[0027] Where x is limited to customer attribute variables, w and b are model parameters; the logistic regression model is trained using data set D, with the goal of minimizing the loss function (equivalent to maximizing the likelihood function):
[0028]
[0029] Through multiple rounds of iterative training, the optimal parameter combination (w * ,b * ); calculate the p-value of the parameter significance test (F test / t test), and select the attributes with significant coefficients (i.e., p-value less than or equal to the threshold α, generally set α = 0.05) as the image features
[0030] The sentiment feature extraction first vectorizes the text information through the BERT model, then obtains the sentiment classification result through the MLP model, and finally calculates the proportion of negative sentiment sentences in the customer communication record as the sentiment feature.
[0031] The above features are spliced to form the customer's portrait features and emotional characteristics Stacking on the channel dimension to get the final feature This feature combines both the customer profile and the emotions reflected in the communication process.
[0032] Furthermore, the BERT model is a bidirectional encoder model based on Transformer, which learns language representation from large-scale unlabeled text, captures multi-level information such as vocabulary, syntax and semantics, and uses the model as a text feature extractor to convert the input text into a high-dimensional vector representation as the input of the subsequent layer. The specific steps of its function are as follows:
[0033] 1) Split each word in the text into one or more subword units, and then query a fixed-dimensional word vector for each subword unit;
[0034] 2) Add two additional vectors, the text vector and the position vector, to each input word vector;
[0035] 3) The summed word vectors are input into a multi-layer Transformer network. Through the self-attention mechanism and the fully connected layer, each word vector is fused with the semantic information of the context to obtain the final word vector;
[0036] The word vector output by the BERT model is input into the MLP layer to perform sentiment classification on the text sequence. The sentiment feature is further defined as the number of negative sentences in the communication record / the total number of sentences in the communication record.
[0037] Furthermore, the customer churn prediction uses a random forest algorithm to predict the customer churn probability based on the features that integrate customer portraits and emotions. The specific implementation includes:
[0038] 1) Read the data in the data set and distinguish the independent variables from the dependent variables. The independent variables are the customer's portrait and emotional characteristics, and the dependent variable is the customer churn result;
[0039] 2) Then, the data of the independent variable and the dependent variable are segmented in the random forest, and the parameters selected at this time are test_size=0.2, random_state=0;
[0040] 3) Call the scoring mechanism to evaluate the degree of fit of the independent variable to the dependent variable. By changing the parameters, including the number of trees and the depth of the tree, the accuracy of the random forest model is maximized. The data to be predicted is read and written into the document to obtain the final prediction parameters, and finally the prediction model with the highest accuracy is obtained.
[0041] The present invention also claims a customer churn prediction system integrating profiling and sentiment analysis, comprising:
[0042] The data collection module is used to determine variables related to customer churn, including customer attributes and communication records, and collect historical customer data within the company to form a multi-feature binary classification data set;
[0043] Feature screening module, used to remove attribute features with small variance, improve prediction accuracy and reduce calculation amount;
[0044] The data preprocessing module uses the average of the features to fill in missing values and then performs Z-Score normalization;
[0045] The portrait feature extraction module is used to build a logistic regression model, using only customer attributes to predict whether or not a customer will churn, and selecting attributes with significant coefficients as portrait features;
[0046] The sentiment feature extraction module is used to convert the communication record text into vectors using the BERT model, and input it into the MLP model to obtain the sentiment classification results of each sentence, and select the proportion of negative sentences as the sentiment feature;
[0047] Feature splicing module, used to stack customer portrait features and sentiment features in the channel dimension;
[0048] The customer churn prediction module uses the random forest algorithm to predict the customer churn probability.
[0049] The present invention also claims a customer churn prediction device integrating portrait and sentiment analysis, comprising: at least one memory and at least one processor;
[0050] The at least one memory is used to store a machine-readable program;
[0051] The at least one processor is used to call the machine-readable program to implement the above method.
[0052] The present invention also claims protection for a computer-readable medium having computer instructions stored thereon, which, when executed by a processor, cause the processor to perform the above-mentioned method.
[0053] Compared with the prior art, the customer churn prediction method and system of the present invention that integrates portrait and sentiment analysis has the following beneficial effects:
[0054] The present invention constructs a customer churn prediction model that integrates portrait and sentiment analysis, wherein the portrait feature extraction uses a logistic regression model and a hypothesis testing method to screen out significant features, which on the one hand avoids the dimensionality disaster, improves the training speed, and reduces the computational overhead, and on the other hand reduces interference noise, reduces the risk of overfitting, and improves the model effect; the sentiment feature extraction introduces an advanced large language model to extract the potential emotional characteristics in the massive communication records of customers. This solution solves the problem that the basis for existing model identification is not comprehensive enough, and the obtained results are poorly stable and have low accuracy. Combined with the algorithm, operators can accurately identify customers who need to be focused on and have potential churn risks, formulate different retention strategies based on customer needs and contributions to the company, reduce customer churn rates, improve operational efficiency, increase user satisfaction and loyalty, reduce customer acquisition costs, and increase corporate profits and competitiveness. BRIEF DESCRIPTION OF THE DRAWINGS
[0055] Figure 1This is a diagram showing the architecture of a customer churn prediction method that integrates profiling and sentiment analysis provided by an embodiment of the present invention;
[0056] Figure 2 It is a framework diagram of the emotion feature extraction module provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0057] The present invention will be further described below in conjunction with the accompanying drawings and specific embodiments.
[0058] The embodiment of the present invention provides a customer churn prediction method integrating portrait and sentiment analysis, comprising data collection, feature screening, data preprocessing, portrait feature extraction, sentiment feature extraction, feature splicing and customer churn prediction; the data collection determines variables related to customer churn, including customer attributes and communication records, and collects historical customer data within the company to form a multi-feature binary classification data set; the feature screening deletes attribute features with small variance to improve prediction accuracy and reduce calculation amount; the data preprocessing uses the average of the features to fill missing values, and then performs Z-Score normalization processing; the portrait feature extraction constructs a logistic regression model, only uses customer attributes to predict whether churn occurs, and selects attributes with significant coefficients as portrait features; the sentiment feature extraction uses the BERT model to convert the communication record text into a vector, and inputs it into the MLP model to obtain the sentiment classification result of each sentence, and selects the proportion of negative sentences as the sentiment feature; the feature splicing stacks the customer's portrait features and sentiment features on the channel dimension; the customer churn prediction uses a random forest algorithm to predict the customer's churn probability.
[0059] The specific implementation of this method includes the following steps:
[0060] Step 1: Collect data related to customer churn, including attributes and communication records;
[0061] Step 2: Delete the attribute features with small variance to improve prediction accuracy and reduce the amount of calculation;
[0062] Step 3: Fill in missing values / normalize attribute data and perform text preprocessing on unstructured data;
[0063] Step 4: Build a logistic regression model and screen significant attributes through hypothesis testing to form portrait features;
[0064] Step 5: Build a BERT model to vectorize text and obtain the emotional features of communication through the classifier;
[0065] Step 6: Stack the customer's portrait features and sentiment features in the channel dimension to obtain the final features;
[0066] Step 7: Build a random forest model to output the customer churn probability.
[0067] The data collection determines the variables related to customer churn, labels the customers as to whether they have churned, and collects the historical customer data within the company to form a multi-feature binary classification data set D = {(x i ,y i )|i=1,…n}, where the independent variable y i =1 represents customer churn, y i =0 means that the customer has not been lost;
[0068] Variables related to customer churn include customer attributes and communication records, where customer attributes are structured data and communication records are unstructured text data; for corporate users, customer attributes include the industry to which the enterprise belongs, whether the enterprise is a state-owned enterprise, the size of the enterprise, consumption amount, etc.; for individual customers, customer attributes include age, gender, income, consumption amount, etc.
[0069] The feature screening removes attribute features with small variance. Discrete features with small variance are almost useless for prediction algorithms, and will generate a large amount of sparse data after preprocessing, which will increase the amount of calculation and affect the prediction effect. The feature screening module performs feature selection on the customer's historical data, removes attribute features with small variance, improves prediction accuracy and reduces the amount of calculation. The calculation formula for variance is as follows:
[0070]
[0071] in is the sample mean of the jth feature.
[0072] The data preprocessing, for structured data, uses the average of the features Fill in missing values and then perform Z-Score normalization; the formula for Z-Score is as follows:
[0073]
[0074] In addition, because the communication records contain a lot of irrelevant content, the premise of text vectorization is to clean up dirty data. The data preprocessing operations include:
[0075] (1) Remove irrelevant content from text data, including punctuation, emoticons, URLs, HTML tags, phone numbers, etc. These contents are irrelevant to emotional information and affect training efficiency and accuracy;
[0076] (2) Unify the format of numbers and letters in the text and make the numbers and letters uniform in capitalization;
[0077] (3) Convert all texts into simplified Chinese characters; convert full-width letters and numbers into half-width characters, etc.
[0078] The image feature extraction first constructs a logistic regression model:
[0079]
[0080] Where x is limited to customer attribute variables, w and b are model parameters; the logistic regression model is trained using data set D, with the goal of minimizing the loss function (equivalent to maximizing the likelihood function):
[0081]
[0082] Through multiple rounds of iterative training, the optimal parameter combination (w * ,b * ); calculate parameter significance test (F test / t test)
[0083] H0:w=0,H1:w≠0
[0084] The p-value is used to select attributes with significant coefficients (i.e., p-value is less than or equal to the threshold α, generally set α = 0.05) as the image features.
[0085] The sentiment feature extraction first vectorizes the text information through the BERT model, then obtains the sentiment classification result through the MLP model, and finally calculates the proportion of negative sentiment sentences in the customer communication record as the sentiment feature.
[0086] The BERT model is a bidirectional encoder model based on Transformer. It can learn language representation from large-scale unlabeled text and capture multi-level information such as vocabulary, syntax, and semantics. The model is used as a text feature extractor to convert the input text into a high-dimensional vector representation as the input of the subsequent layer. The specific steps of its function are as follows:
[0087] (1) Each word in the text is divided into one or more subword units, and then a fixed-dimensional word vector is queried for each subword unit;
[0088] (2) Add two additional vectors, the text vector and the position vector, to each input word vector;
[0089] (3) The summed word vectors are input into a multi-layer Transformer network. Through the self-attention mechanism and the fully connected layer, each word vector is fused with the semantic information of the context to obtain the final word vector.
[0090] The word vector output by the BERT model is input into the MLP layer to perform sentiment classification on the text sequence. The sentiment feature is further defined as the number of negative sentences in the communication record / the total number of sentences in the communication record.
[0091] The above features are spliced to form the customer's portrait features and emotional characteristics Stacking on the channel dimension to get the final feature This feature combines both the customer profile and the emotions reflected in the communication process.
[0092] The customer churn prediction is based on the characteristics of integrating customer portraits and emotions, and uses a random forest algorithm to predict the probability of customer churn. The specific implementation includes:
[0093] (1) Read the data in the dataset and distinguish the independent variables from the dependent variables. The independent variables are the customer’s profile and emotional characteristics X. * , the dependent variable is the customer churn outcome;
[0094] (2) Next, the data of the independent variable and the dependent variable are segmented in the random forest, and the parameters selected at this time are test_size=0.2, random_state=0;
[0095] (3) The scoring mechanism is called to evaluate the degree of fit of the independent variable to the dependent variable. By changing parameters such as the number of trees and the depth of the trees, the accuracy of the random forest model is maximized. The data to be predicted is read and written into a document to obtain the final prediction parameters, and finally the prediction model with the highest accuracy is obtained.
[0096] This method is fully functional, based on theoretically sound statistical methods and advanced large language models, combined with structured data and text information, with excellent results and robustness. It can help companies identify and retain customers at risk of churn, improve operational efficiency, enhance user experience, and thereby increase profitability and competitiveness.
[0097] The embodiment of the present invention further provides a customer churn prediction system integrating portrait and sentiment analysis, including:
[0098] The data collection module is used to determine variables related to customer churn, including customer attributes and communication records, and collect historical customer data within the company to form a multi-feature binary classification data set;
[0099] Feature screening module, used to remove attribute features with small variance, improve prediction accuracy and reduce calculation amount;
[0100] The data preprocessing module uses the average of the features to fill in missing values and then performs Z-Score normalization;
[0101] The portrait feature extraction module is used to build a logistic regression model, using only customer attributes to predict whether or not a customer will churn, and selecting attributes with significant coefficients as portrait features;
[0102] The sentiment feature extraction module is used to convert the communication record text into vectors using the BERT model, and input it into the MLP model to obtain the sentiment classification results of each sentence, and select the proportion of negative sentences as the sentiment feature;
[0103] Feature splicing module, used to stack customer portrait features and sentiment features in the channel dimension;
[0104] The customer churn prediction module uses the random forest algorithm to predict the customer churn probability.
[0105] The process of implementing customer churn prediction in this system is as follows:
[0106] Step 1: The data collection module determines the variables related to customer churn, labels the customers as churned, and collects the company's internal customer history data to form a multi-feature binary classification data set D = {(x i ,y i )|i=1,…n}, where the independent variable y i =1 represents customer churn, y i =0 means that the customer has not been lost.
[0107] Variables related to customer churn include customer attributes and communication records, where customer attributes are structured data and communication records are unstructured text data; for corporate users, customer attributes include the industry to which the enterprise belongs, whether the enterprise is a state-owned enterprise, the size of the enterprise, consumption amount, etc.; for individual customers, customer attributes include age, gender, income, consumption amount, etc.
[0108] Step 2: Discrete features with small variance are almost useless for prediction algorithms, and will generate a large amount of sparse data after preprocessing, which will increase the amount of calculation and affect the prediction effect. The feature screening module performs feature selection on the customer's historical data, deletes attribute features with small variance, improves prediction accuracy and reduces the amount of calculation. The calculation formula for variance is as follows:
[0109]
[0110] in is the sample mean of the jth feature.
[0111] Step 3: For structured data, the data preprocessing module uses the average of the features Fill in missing values and then perform Z-Score normalization; the formula for Z-Score is as follows:
[0112]
[0113] In addition, because the communication records contain a lot of irrelevant content, the premise of text vectorization is to clean up dirty data. The operations of the data preprocessing module include:
[0114] (1) Remove irrelevant content from text data, including punctuation, emoticons, URLs, HTML tags, phone numbers, etc. These contents are irrelevant to emotional information and affect training efficiency and accuracy;
[0115] (2) Unify the format of numbers and letters in the text and make the numbers and letters uniform in capitalization;
[0116] (3) Convert all texts into simplified Chinese characters; convert full-width letters and numbers into half-width characters, etc.
[0117] Step 4: The image feature extraction module first builds a logistic regression model:
[0118]
[0119] Where x is limited to customer attribute variables, w and b are model parameters; the logistic regression model is trained using data set D, with the goal of minimizing the loss function (equivalent to maximizing the likelihood function):
[0120]
[0121] Through multiple rounds of iterative training, the optimal parameter combination (w * ,b * ); calculate parameter significance test (F test / t test)
[0122] H0:w=0,H1:w≠0
[0123] The p-value is used to select attributes with significant coefficients (i.e., p-value is less than or equal to the threshold α, generally set α = 0.05) as the image features.
[0124] Step 5: Figure 2 As shown in the figure, the sentiment feature extraction module first vectorizes the text information through the BERT model, then obtains the sentiment classification result through the MLP model, and finally calculates the proportion of negative sentiment sentences in the customer communication record as the sentiment feature.
[0125] The BERT model is a bidirectional encoder model based on Transformer. It can learn language representation from large-scale unlabeled text and capture multi-level information such as vocabulary, syntax, and semantics. The model is used as a text feature extractor to convert the input text into a high-dimensional vector representation as the input of the subsequent layer. The specific steps of its function are as follows:
[0126] (1) Each word in the text is divided into one or more subword units, and then a fixed-dimensional word vector is queried for each subword unit;
[0127] (2) Add two additional vectors, the text vector and the position vector, to each input word vector;
[0128] (3) The summed word vectors are input into a multi-layer Transformer network. Through the self-attention mechanism and the fully connected layer, each word vector is fused with the semantic information of the context to obtain the final word vector.
[0129] The word vector output by the BERT model is input into the MLP layer to perform sentiment classification on the text sequence. The sentiment feature is further defined as the number of negative sentences in the communication record / the total number of sentences in the communication record.
[0130] Step 6: The feature splicing module combines the customer's portrait features and emotional characteristics Stacking on the channel dimension to get the final feature This feature combines both the customer profile and the emotions reflected in the communication process.
[0131] Step 7: The customer churn prediction module uses the random forest algorithm to predict the customer churn probability based on the features that combine customer portraits and emotions. The specific implementation includes:
[0132] (1) Read the data in the dataset and distinguish the independent variables from the dependent variables. The independent variables are the customer’s profile and emotional characteristics X. * , the dependent variable is the customer churn outcome;
[0133] (2) Next, the data of the independent variable and the dependent variable are segmented in the random forest, and the parameters selected at this time are test_size=0.2, random_state=0;
[0134] (3) The scoring mechanism is called to evaluate the degree of fit of the independent variable to the dependent variable. By changing parameters such as the number of trees and the depth of the trees, the accuracy of the random forest model is maximized. The data to be predicted is read and written into a document to obtain the final prediction parameters, and finally the prediction model with the highest accuracy is obtained.
[0135] In this system, in order to solve the problem of high noise in customer historical information, the feature screening module deletes redundant variables, and the data preprocessing module fills in missing values and standardizes data, which jointly improves prediction accuracy and reduces the amount of calculation; in order to solve the problem of insufficient feature mining, the portrait feature extraction module builds a logistic regression model to screen portrait features, the sentiment feature extraction module uses the BERT model and the MLP model to build sentiment features, and the feature splicing module stacks the two to achieve the combination of portrait and sentiment analysis; in order to solve the problem of weak model interpretability, the customer churn prediction module uses the random forest algorithm to predict the probability of customer churn, which can not only better handle class balance, but also has good interpretability. For operators, by observing the predicted probability and change trend of customer churn, users who may be about to leave or have lost interest in the service can be identified in advance, so that timely measures can be taken to retain them, reduce customer churn rate, improve operational efficiency, improve user satisfaction and loyalty, reduce customer acquisition costs, and increase corporate profitability and competitiveness.
[0136] An embodiment of the present invention also provides a customer churn prediction device integrating portrait and sentiment analysis, comprising: at least one memory and at least one processor;
[0137] The at least one memory is used to store a machine-readable program;
[0138] The at least one processor is used to call the machine-readable program to implement the customer churn prediction method that integrates portrait and sentiment analysis as described in the above embodiment.
[0139] The embodiment of the present invention further provides a computer-readable medium, on which computer instructions are stored, and when the computer instructions are executed by a processor, the processor executes the customer churn prediction method of integrating portrait and sentiment analysis described in the above embodiment. Specifically, a system or device equipped with a storage medium can be provided, on which software program codes for implementing the functions of any of the above embodiments are stored, and a computer (or CPU or MPU) of the system or device reads and executes the program code stored in the storage medium.
[0140] In this case, the program code itself read from the storage medium can realize the function of any one of the above-mentioned embodiments, and thus the program code and the storage medium storing the program code constitute a part of the present invention.
[0141] The storage medium embodiments for providing the program code include a floppy disk, a hard disk, a magneto-optical disk, an optical disk (such as CD-ROM, CD-R, CD-RW, DVD-ROM, DVD-RAM, DVD-RW, DVD+RW), a magnetic tape, a non-volatile memory card, and a ROM. Alternatively, the program code can be downloaded from a server computer by a communication network.
[0142] In addition, it should be clear that the functions of any of the above embodiments can be implemented not only by executing the program code read by the computer, but also by enabling an operating system operating on the computer to complete part or all of the actual operations based on instructions from the program code.
[0143] In addition, it can be understood that the program code read from the storage medium is written to a memory provided in an expansion board inserted into the computer or written to a memory provided in an expansion unit connected to the computer, and then based on the instructions of the program code, a CPU installed on the expansion board or the expansion unit is enabled to perform part or all of the actual operations, thereby realizing the functions of any of the above-mentioned embodiments.
[0144] The present invention is shown and described in detail above through the accompanying drawings and preferred embodiments. However, the present invention is not limited to these disclosed embodiments. Based on the above multiple embodiments, those skilled in the art can know that the code review methods in the above different embodiments can be combined to obtain more embodiments of the present invention, and these embodiments are also within the protection scope of the present invention.
Claims
1. A customer churn prediction method integrating portrait and sentiment analysis, characterized in that: Including data collection, feature screening, data preprocessing, image feature extraction, sentiment feature extraction, feature splicing and customer churn prediction, the specific implementation of this method includes the following steps: Step 1: Collect data related to customer churn, including attributes and communication records; Step 2: Delete the attribute features with small variance to improve prediction accuracy and reduce the amount of calculation; Step 3: Fill in missing values / normalize attribute data and perform text preprocessing on unstructured data; Step 4: Build a logistic regression model and screen significant attributes through hypothesis testing to form portrait features; Step 5: Build a BERT model to vectorize text and obtain the emotional features of communication through the classifier; Step 6: Stack the customer's portrait features and sentiment features in the channel dimension to obtain the final features; Step 7: Build a random forest model to output the customer churn probability.
2. According to claim 1, a customer churn prediction method integrating portrait and sentiment analysis is characterized in that: The data collection determines the variables related to customer churn, labels the customers as churned, and collects the company's internal customer history data to form a multi-feature binary classification data set D = {(x i ,y i )|i=1,…n}, where the independent variable y i =1 represents customer churn, y i =0 means that the customer has not been lost; Variables related to customer churn include customer attributes and communication records, where customer attributes are structured data and communication records are unstructured text data.
3. The customer churn prediction method integrating portrait and sentiment analysis according to claim 1 is characterized in that: The feature screening deletes attribute features with small variance, where the variance is calculated as follows: in is the sample mean of the jth feature.
4. The customer churn prediction method integrating portrait and sentiment analysis according to claim 3 is characterized in that: The data preprocessing, for structured data, uses the average of the features Fill in missing values and then perform Z-Score normalization; the formula for Z-Score is as follows: Data preprocessing operations include: Remove irrelevant content from text data, including punctuation, emoticons, URLs, HTML tags, and phone numbers; Unify the format of numbers and letters in the text, and unify the upper and lower case of numbers and letters; Convert all texts into simplified Chinese characters; convert full-width letters and numbers into half-width characters.
5. The customer churn prediction method integrating portrait and sentiment analysis according to claim 1, characterized in that: The image feature extraction first constructs a logistic regression model: Where x is limited to customer attribute variables, w and b are model parameters; the logistic regression model is trained using the data set, with the goal of minimizing the loss function: Through multiple rounds of iterative training, the optimal parameter combination (w * ,b * ) ; Calculate the p-value of the parameter significance test and select the attribute with significant coefficient as the image feature The sentiment feature extraction first vectorizes the text information through the BERT model, then obtains the sentiment classification result through the MLP model, and finally calculates the proportion of negative sentiment sentences in the customer communication record as the sentiment feature. The above features are spliced to form the customer's portrait features and emotional characteristics Stacking on the channel dimension to get the final feature This feature combines both the customer profile and the emotions reflected in the communication process.
6. The customer churn prediction method integrating portrait and sentiment analysis according to claim 1, characterized in that: The BERT model is a bidirectional encoder model based on Transformer. It learns language representation from large-scale unlabeled text, captures multi-level information of vocabulary, syntax and semantics, and uses the model as a feature extractor for text to convert the input text into a high-dimensional vector representation as the input of the subsequent layer. The specific steps of its function are as follows: 1) Split each word in the text into one or more subword units, and then query a fixed-dimensional word vector for each subword unit; 2) Add two additional vectors, the text vector and the position vector, to each input word vector; 3) The summed word vectors are input into a multi-layer Transformer network. Through the self-attention mechanism and the fully connected layer, each word vector is fused with the semantic information of the context to obtain the final word vector; The word vector output by the BERT model is input into the MLP layer to perform sentiment classification on the text sequence. The sentiment feature is further defined as the number of negative sentences in the communication record / the total number of sentences in the communication record.
7. The customer churn prediction method integrating portrait and sentiment analysis according to claim 1, characterized in that: The customer churn prediction is based on the characteristics of integrating customer portraits and emotions, and uses a random forest algorithm to predict the probability of customer churn. The specific implementation includes: 1) Read the data in the data set and distinguish the independent variables from the dependent variables. The independent variables are the customer's portrait and emotional characteristics, and the dependent variable is the customer churn result; 2) Then, the data of the independent variable and the dependent variable are segmented in the random forest, and the parameters selected at this time are test_size=0.2, random_state=0; 3) Call the scoring mechanism to evaluate the degree of fit of the independent variable to the dependent variable. By changing the parameters, including the number of trees and the depth of the tree, the accuracy of the random forest model is maximized. The data to be predicted is read and written into the document to obtain the final prediction parameters, and finally the prediction model with the highest accuracy is obtained.
8. A customer churn prediction system integrating portrait and sentiment analysis, characterized in that: include: The data collection module is used to determine the variables related to customer churn, including customer attributes and communication records, and collect the company's internal customer historical data to form a multi-feature binary classification data set; Feature screening module, used to remove attribute features with small variance, improve prediction accuracy and reduce calculation amount; The data preprocessing module uses the average of the features to fill in missing values and then performs Z-Score normalization; The portrait feature extraction module is used to build a logistic regression model, using only customer attributes to predict whether or not a customer will churn, and selecting attributes with significant coefficients as portrait features; The sentiment feature extraction module is used to convert the communication record text into a vector using the BERT model, and input it into the MLP model to obtain the sentiment classification result of each sentence, and select the proportion of negative sentences as the sentiment feature; Feature splicing module, used to stack customer portrait features and sentiment features in the channel dimension; The customer churn prediction module uses the random forest algorithm to predict the customer churn probability.
9. A customer churn prediction device integrating portrait and sentiment analysis, characterized in that: include: at least one memory and at least one processor; The at least one memory is used to store a machine-readable program; The at least one processor is used to call the machine-readable program to implement the method described in any one of claims 1 to 7.
10. A computer readable medium, characterized in that The computer readable medium stores computer instructions, which, when executed by a processor, cause the processor to execute the method according to any one of claims 1 to 7.
