An automatic modeling system based on word embedding and deep temporal model
The automatic modeling system based on word embedding and deep time series models solves the high cost problem of traditional manual modeling methods in high-dimensional features and massive data, and improves the expression efficiency of buried behavior sequences through small-dimensional vectors, achieving It provides fast similarity calculation and improves the recognition ability of the model.
Patent Information
- Application Number
- CN202110564485.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-05-24
- Publication Date
- 2024-09-03
- Estimated Expiration
- 2041-05-24
AI Technical Summary
The traditional manual modeling method requires a lot of manpower investment when faced with high-dimensional features and massive data. Moreover, the existing technology has large vector dimensions when processing buried behavior sequences, and the expression efficiency is not high, making it difficult to calculate similarities.
An automatic modeling system based on word embedding and deep time series models is adopted, including a buried point mining module, a data reading module, a data preprocessing module and a model training module. The user behavior sequence is represented as multiple fixed-dimensional vectors through word embedding technology. Use LSTM and GRU algorithms for sequence mining and generate small-dimensional vectors to improve expression efficiency.
The vector dimension is small, the expression efficiency is high, and the similarity can be calculated quickly. Experiments have proved that using this vector is better than a model trained with a single prediction probability mixed with other feature modules.
Smart Images

Figure CN113177644B
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of machine learning, and more specifically, to an automatic modeling system based on word embedding and deep temporal model. Background Art
[0002] Traditional manual modeling methods require professional modelers and developers to invest a lot of manpower and time to complete data extraction, model algorithm selection, model parameter configuration, and subsequent tuning and launch. When faced with high-dimensional features and massive data, data sampling and feature screening are required, which reduces the use of data and makes the modeling cost very high.
[0003] In addition, when facing a sequence of embedded behavior, the existing technical route is to represent each user behavior with a vector and then use the vector to describe the entire behavior sequence. The direct method to measure each behavior is one-hot encoding, but the vector dimension obtained in this way is large, the expression efficiency is not high, and it is difficult to calculate similarity. Summary of the invention
[0004] In view of the problems of the prior art, the present invention proposes an automatic modeling system based on word embedding and deep time series model, including: a buried point mining module, a data reading module, a data preprocessing module and a model training module, the mining module performs mining based on word embedding and deep time series model to generate big data cluster reading data; the data reading module reads data from the big data cluster; the data preprocessing module processes the read data, and the data preprocessing module performs the following operations: sample sampling, sample partitioning, feature screening, missing value filling and feature value mapping; the model training module uses different models to train the training set data to obtain model prediction results of the training set and the validation set.
[0005] Optionally, the tracking point mining module performs the following operations: format conversion, organizing the user behaviors obtained by tracking points by users to obtain the behavior sequence of each user; information mapping, using word embedding technology to process each click behavior in the user behavior sequence into a vector, and representing the entire behavior sequence as a wide table of time series features of multiple fixed-dimensional vectors; and sequence mining, processing sequence information that changes dynamically over time, and predicting future behaviors based on current trends.
[0006] Optionally, the mining module performs information mapping based on GloVe and performs sequence mining based on LSTM algorithm and GRU algorithm.
[0007] Optionally, the hidden layer vectors and output layer probabilities after sequence mining are stored in a wide table and concatenated with other feature tables.
[0008] Optionally, the input data of the mining module are user behaviors and user labels obtained by embedding points, and the output is the corresponding vector mined from the user's behavior sequence and the predicted probability of the label using the behavior.
[0009] Optionally, the system includes a model evaluation module, and the indicators output by the model evaluation module for evaluating the model effect include: accuracy, recall, precision, Gini coefficient, F1 statistic, confusion matrix, ROC curve graph, AUC, KS curve graph, lift curve graph, recall rate curve graph and response rate curve graph; MSE, RMSE, R2, adjusted R2, SMAPE, EVS, Median absolute error, MAE, feature residual graph, predicted value and actual value comparison graph, quantile-quantile graph and predicted value residual distribution graph; the sum of squares of distances from points in the cluster to the center point; correct rate, confusion matrix, accuracy and recall rate.
[0010] Optionally, the data preprocessing module processes the read data, and the data preprocessing module includes: a sample sampling module and a sample partitioning module, wherein the sample sampling module performs random sampling or stratified sampling on the samples according to a set sampling ratio, and the sample partitioning module divides the samples into a training set and a validation set according to a set sample partitioning ratio.
[0011] Optionally, the data preprocessing module also includes a sample matching module and a probability correction module. The sample matching module can sample negative samples and adjust the proportion of positive samples in the total samples. The probability correction module adjusts the probability of the modeling results and uses the prior probability for correction.
[0012] Optionally, the data preprocessing module also includes a feature analysis module, which combines sample labels to count the KS index, IV index and PSI index of each dimension of features.
[0013] Optionally, the data preprocessing module further includes a missing value filling module, which processes missing values in the data, and the model training module further includes a feature value mapping module, which performs feature value mapping on the training set.
[0014] The system vector of the present invention has a small dimension, high expression efficiency, and can quickly calculate similarity. The present invention experiments prove that the use of vectors is better than a single sub-division mixed with other feature modules to train the model of identification tags. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] In order to make the present invention more easily understood, the present invention will be described in more detail by referring to the specific embodiments shown in the accompanying drawings. These drawings only depict typical embodiments of the present invention and should not be considered as limiting the scope of protection of the present invention.
[0016] Figure 1A schematic diagram of an embodiment of the system of the present invention.
[0017] Figure 2 A schematic diagram of an embodiment of the system of the present invention. DETAILED DESCRIPTION
[0018] The following describes the embodiments of the present invention with reference to the accompanying drawings, wherein the same components are denoted by the same reference numerals. In the absence of conflict, the following embodiments and the technical features in the embodiments may be combined with each other.
[0019] The model algorithm of the present invention can be divided into two parts: traditional machine learning and deep learning. Traditional machine learning uses Spark as the computing engine. Through the RDD (Resilient Distributed Datasets) distributed memory design, computing resources can be allocated according to the size of the data set. It can easily process massive data and build models, such as logistic regression, random forest, XGBoost, LightGBM, etc. Deep learning uses the TensorFlow framework, uses large-scale data to update the model structure in batches, and completes model training, such as FM, DeepFM, and GloVe, LSTM, GRU, etc. used in buried point mining. Both parts finally call Python scripts to evaluate the results.
[0020] like Figure 1 As shown, the system of the present invention includes: a buried point mining module, a data reading module, a data preprocessing module, a feature analysis module, a model training module and a model online module, which reduces the possibility of manual operation errors in a large number of processes. It also provides process logs for each module to facilitate business personnel to understand the progress.
[0021] Refer to the following Figure 1 To describe the working principle of the present invention.
[0022] like Figure 2 As shown in the figure, the embedding mining module performs mining based on word embedding and deep time series model, solving the problem of insufficient mining of embedding sequence data in various fields. Since the embedding data needs to be mined, format conversion, information mapping, and sequence mining are required to finally generate a wide table of user features.
[0023] Format conversion is to organize the acquired user behaviors by user to obtain the behavior sequence of each user.
[0024] Information mapping uses word embedding technology to process each click behavior in the user behavior sequence into a vector, and then represents the entire behavior sequence as a time-series feature wide table of multiple fixed-dimensional vectors. In one embodiment, the information mapping module uses the highly practical word vector Word2Vec that achieves the expected effect using only a local content window, and the GloVe (Global Vectors for Word Representation) method that assumes that the word vector and the co-occurrence matrix are consistent and fully utilizes statistical information to complete the model training process of mapping click behaviors into fixed-dimensional vectors.
[0025] When performing sequence mining, since the buried behavior has a strong sequential correlation, the unsupervised matrix operation combined word embedding to obtain sentence embedding is not applicable. The sequence mining of the present invention uses a supervised deep time series model LSTM (Long Short Term Memory) that considers the change of data in the time dimension and its variant parameters are reduced but the effect is the same GRU (Gated Recurrent Unit) to process the sequence information that changes dynamically over time, based on the current trend, predicting future behavior. LSTM and GRU are both composed of an input layer, a hidden layer, and an output layer. The output of the previous layer is the input of the next layer. Since the result of the last output layer is the predicted probability of the label, the result of this model can be directly evaluated. In addition, the input of the output layer is also the output of the hidden layer, which is a vector with a long embedding dimension, which reflects the information mined from the user sequence. This information can be used as a feature to train a new model for identifying labels. The evaluation result reflects that the user sequence mining information has a certain recognition ability for user labels, and experiments have shown that using this vector is better than a single prediction probability mixed with other feature modules to train the model effect of identifying labels.
[0026] In one embodiment, taking the tracking of an app as an example, the input is a tracking record table of time, user, and user's behavior in the app, as shown in the following example:
[0027] 2021-04-25 18:00, User A, clicks page 1
[0028] 2021-04-25 18:02, User A, clicks page 2
[0029] 2021-04-25 18:20, User A, clicks page 3
[0030] …
[0031] And the user's label table, for example, user A, 1 (purchased item B). First, before the data reading module reads the data, the embedded point record is formatted to obtain the behavior sequence of each user, for example, user A, (clicked page 1, clicked page 2, clicked page 3), and then GloVe is used to process the user behavior unit into a vector, such as clicking page 1 corresponds to the vector [0.1 0.1 0.1], and the format of the vector mapped to the user and user behavior sequence is obtained. It is spliced with the user's label table into a wide table containing user behavior sequence features and labels, which is used as the input of the deep time series model for model training. The hidden layer vectors and output layer probabilities of the deep time series model can be stored in the table, and you can choose whether to splice with other feature tables. After that, you can proceed with subsequent processes such as risk control modeling. The result can be compared with the results of a single embedded point and the original feature table to facilitate viewing the mining gain.
[0032] Then, if Figure 1 As shown, the data reading module reads data from the big data cluster for data training and testing. The read data is a wide table containing various feature columns, and by judging the type of each column in the input data and combining the user's input, the index information ID column (used to distinguish samples, not for training models), label column and date column in the data are identified for use in the feature analysis module. The table can be in multiple file formats and multiple types of databases, including txt, csv and other commonly used format file uploads or docking with commonly used databases, including Greenplum, MySQL, etc.
[0033] The data preprocessing module processes the data read by the data reading module and provides data for input into the model. The data preprocessing module includes: sample sampling module, sample partitioning module, feature screening module, missing value filling module and feature value mapping module.
[0034] Preferably, for binary classification, sample matching and probability correction can also be performed. In the binary classification problem of credit risk control, the proportion of positive samples in actual scenarios is often small. Sample matching supports sampling of negative samples, adjusting the proportion of positive samples in the total samples, and reducing the impact of sample ratio imbalance on the risk control model. Probability correction is to adjust the probability of modeling results. After sampling, in order to ensure that the improvement of evaluation indicators and response rate are not affected by changes in the ratio of positive and negative samples, the prior probability is used for correction, and the corrected prediction probability is added to the results of model training as described below.
[0035] The sample sampling module performs random sampling or stratified sampling on samples according to the set sampling ratio. This includes random sampling and stratified sampling in the database to reduce the size of the modeling sample, which can reduce costs and increase the speed of subsequent model training. In addition, for label-imbalanced data sets, the module also provides a sampling method for users to customize the positive and negative label ratios to provide subsequent model training effects. In an implementation example, a custom positive and negative label ratio sampling method is used to sample a data set with a positive and negative label ratio of 1:100 to 1:10 to avoid biased learning of subsequent models.
[0036] The sample partitioning module divides the sample into a training set and a validation set according to the set sample partitioning ratio. The validation set can be used to adjust the hyperparameters of the model and to make a preliminary assessment of the ability of the same distribution training set to construct a model. In one embodiment, random partitioning according to the input ratio or sequential partitioning according to the time column is used.
[0037] The feature analysis module is used to perform statistical analysis on each feature of the data. This module can be used to analyze each feature wide table of the data flow, but the impact of the analyzed data on the model and the execution time in this process are weighed, and the feature analysis is selected between sample partitioning and feature screening. In particular, the feature analysis module automatically determines whether the feature is a continuous feature, a categorical feature, a character feature, or a date feature based on the ratio of the number of unique values of each dimension feature to the total number of samples and the value type of the feature. Different indicators are counted for numerical continuous features, numerical categorical features, and character features (the latter two are collectively referred to as categorical types below), and can be visualized to facilitate business personnel to understand data distribution. Specifically, the statistical analysis includes: statistical null value rate, zero value rate, maximum value, minimum value, mean, median, 1 / 4 site, 3 / 4 site, standard deviation, variance, skewness, kurtosis of numerical continuous features, and drawing histograms, box plots, and density curves of feature distribution. The category-type features are statistically counted for the number of categories, the null value rate, the category with the highest proportion, the category with the lowest proportion, and a pie chart of the feature distribution to facilitate the user to analyze a single feature. In particular, for applications in the field of credit risk control, the feature analysis module combines sample labels to count the KS (Kolmogorov Smirnov) and IV (Information Value) indicators of each dimension of features. Both of these indicators are necessary indicators of concern in the field of credit risk control modeling, where KS reflects the degree of distinction between the feature for positive and negative samples, and the larger the KS, the better the distinction; the IV indicator reflects the correlation between the feature and the label, and the larger the IV, the greater the relationship between the feature and the label. In addition, the present invention will also count the PSI (Population Stability Index) indicator of each dimensional feature, which is also a commonly used indicator in feature screening in the field of credit risk control modeling. It reflects the stability of the feature. The larger the PSI, the more unstable the feature is. Generally, features with a PSI greater than 0.2 will be deleted during the modeling process.
[0038] The data preprocessing module may also include a feature screening module, which screens the samples in the validation set and the training set to select the features to be input into the model. Specifically, it includes: counting the numerical features and the categorical feature lists according to the data type of the feature column, and then screening the feature list. If the number of categorical feature values exceeds the set number (such as 100), or the missing rate of the numerical variable reaches the set value (such as 0.8), the feature is considered invalid and deleted. Preferably, in addition to allowing business personnel to use sample analysis results for manual screening and providing a feature list through interaction, the present invention also provides a function for screening according to the feature missing rate and discrete feature value level, and this commonly used screening can be quickly performed using a threshold.
[0039] The data preprocessing module can also include a missing value filling module, which processes missing values in the data to ensure that the model that does not accept missing values can also run normally. For numerical features, you can choose to use the mean, median and user-specified value to fill, and categorical variables can be filled with user-specified values or default values. Optionally, the training set and validation set can be filled with missing values using training set statistics or fixed values.
[0040] The data preprocessing module may also include a feature value mapping module. The feature value mapping module performs feature value mapping on the training set and uses the same mapping dictionary to process the validation set. Optionally, the feature value mapping module encodes categorical features. Considering that OneHotEncoder (unique encoding) increases the depth of the tree for a large number of tree-like methods on the platform, it is preferred to use LabelEncoder (label encoding) to map categorical features into ordinal values starting from 0. For categorical variables with a large number of values, a method derived from WOE (Weight of Evidence) can be used to convert them into continuous variables.
[0041] Reference Figure 1 After data preprocessing, the model training module can be used to train the training set data using different models to obtain the model prediction results of the training set and the validation set. The model training module is used to train the adopted algorithm.
[0042] Reference Figure 1 The model evaluation module is used to calculate the model evaluation indicators to reflect the model effect. The model evaluation module uses the validation set to evaluate the effect of the trained model based on the model prediction results and outputs a model report.
[0043] During testing, the same functions as the feature screening, missing value filling, and feature value mapping modules in data preprocessing are used to process the test data, and the model is used for prediction to obtain the training results consisting of the predicted values and actual values of the model on the test data. The model is then reused for evaluation to obtain the evaluation effect of the test.
[0044] Reference Figure 1 In the model launch module, users can select the optimal model for launch operation based on the model evaluation results. For the models that have been launched, users can request them through API calls, and the present invention will return the corresponding model results, which can meet the needs of real-time prediction in the business. At the same time, the models that have been launched can also be updated, offline, etc. to ensure the validity of the online models.
[0045] The embodiments described above are only preferred specific implementations of the present invention. Common changes and substitutions made by those skilled in the art within the scope of the technical solution of the present invention should be included in the protection scope of the present invention.
Claims
1. An automatic modeling system based on word embedding and deep temporal model, characterized in that: include: Mining module, data reading module, data preprocessing module and model training module, The mining module performs the following operations: Format conversion: organize the acquired user behaviors by user to obtain the behavior sequence of each user; Information mapping: Using the GloVe method, each click behavior in the user behavior sequence is processed into a vector, and then the entire behavior sequence is represented as a wide table of time series features of multiple fixed-dimensional vectors; Sequence mining is performed based on the LSTM algorithm and the GRU algorithm to generate a big data cluster to read data. Among them, LSTM and GRU are composed of an input layer, a hidden layer, and an output layer. The output of the previous layer is the input of the next layer. The result of the last output layer is the predicted probability of the label. The input of the output layer is also the output of the hidden layer, which is a vector with a long embedding dimension. Sequence mining processes sequence information that changes dynamically over time and predicts future behavior based on current trends; The data reading module reads data from the big data cluster; The data preprocessing module processes the read data. The data preprocessing module performs the following operations: sample sampling; sample partitioning; feature screening statistics of KS and IV indicators of each dimension feature; missing value filling; feature value mapping; sample matching and probability correction; The model training module uses different models to train the training set data and obtains the model prediction results of the training set and the validation set.
2. The automatic modeling system according to claim 1, characterized in that: The hidden layer vectors and output layer probabilities after sequence mining are stored in a wide table and concatenated with other feature tables.
3. The automatic modeling system according to claim 1, characterized in that: The input data of the mining module are user behaviors and user labels obtained through embedding, and the output is the corresponding vector mined from the user's behavior sequence and the predicted probability of the label using the behavior.
4. The automatic modeling system according to claim 1, characterized in that: It also includes a model evaluation module. The output indicators of the model evaluation module for evaluating the model effect include: accuracy, recall, precision, Gini coefficient, F1 statistic, confusion matrix, ROC curve, AUC, KS curve, lift curve, recall curve and response rate curve; MSE, RMSE, R2, adjusted R2, SMAPE, EVS, Median absolute error, MAE, feature residual graph, predicted value and actual value comparison graph, quantile-quantile graph and predicted value residual distribution graph; the sum of squares of distances from points in the cluster to the center point; correct rate, confusion matrix, accuracy and recall rate.
5. The automatic modeling system according to claim 1, characterized in that: Sample sampling is the random sampling or stratified sampling of samples according to the set sampling ratio, and sample partitioning is the division of samples into training set and validation set according to the set sample division ratio.
6. The automatic modeling system according to claim 5, characterized in that: Sample matching is to sample negative samples and adjust the proportion of positive samples in the total samples. Probability correction is to adjust the probability of modeling results and use prior probability for correction.
7. The automatic modeling system according to claim 1, characterized in that: Feature analysis combines sample labels to count the KS, IV, and PSI indicators of each dimension of features.
8. The automatic modeling system according to claim 1, characterized in that: Missing value filling is to process missing values in the data. The model training module also includes a feature value mapping module, which performs feature value mapping on the training set.
Citation Information
Patent Citations
E-commerce platform user repeated purchase behavior prediction method
CN110956497A
Interactive code searching method and device based on structured embedding
CN111159223A
User risk model generation method and device and electronic equipment
CN111210336A
TextCNN-based co-distribution text data selection method and system, and storage medium
CN111782804A
Navy comment detection system and method based on attention mechanism and bidirectional GRU network
CN112200638A
Cited By
Techniques for recommending next commands using recurrent neural networks and hidden state clustering
US12783266B2
Techniques for recommending next commands using recurrent neural networks and hidden state clustering
US20250110759A1
