# A Multi-Model Approach for User Portrait
## 3 The Multi-Stage User Portrait Model
### User Portrait Based on CNN+LSTM  
A convolutional neural network (CNN) is a feedforward neural network widely used in time-series data and in image data processing. CNN is a special deep neural network model and, due to its incomplete connection and weight-sharing network structure, is similar to the biological neural network that can reduce the number of weights and the complexity of the network model, as shown in Figure 5.  
Convolution operation can improve machine learning performance in three aspects: sparse connection, weight sharing, and equivalent representation. According to the relevant features of CNN, a two-layer parallel convolutional neural network is proposed, as shown in Figure 6. The features of the short text can then be extracted and represented. The specific design is described below. 1. Embedded layer sentence representation  
First, the users' short text data is parsed by using the stutter participle tool to obtain the set of words. Then, Word2 vec is used to form a word vector. Since the text has the features of being short and concise, the length of the sentence, i.e., the number of words, is limited to 50. Each sentence can be embedded into the layer so that each word is placed into a 256-word vector to eventually form the output layer that has a two-dimensional matrix of the size 50*256. Each sentence would then form a two-dimensional matrix of the size n*m \(Z=[w_{1},\ldots,w_{i},\ldots,w_{n}]\) where \(w_{i}=[x_{i1},\ldots,x_{i  
Figure 4: Structure of PV-DM training sentence vector. Figure 5: Schematic diagram of CNN local connection. Figure 6: User portrait model based on CNN + LSTM. Convolution layer feature extraction  
The function of the convolution layer is to extract the semantic features of sentences in which each convolution kernel corresponds to some extract features. Our model sets the number of convolution kernels to 128. For each sentence matrix Z of the embedding layer, the convolution operation is carried out using Formula (5). \[S=f(W*Z+b) \tag{5}\]  
where \(S\) represents the feature matrix extracted from the convolution computation, and the weight matrix \(W\) and bias vector b are the criteria for network learning. To facilitate the calculation, non-linear mapping is required for the convolution results of each convolution kernel, which is based on Formula (6). \[f=relu=\max(0,x) \tag{6}\]  
To extract features in a more comprehensive way, binary and ternary features of sentences are extracted using convolution windows of 2 and 3, respectively. 3. K-max pooling feature dimensionality reduction  
The extracted features are shifted to the pooling layer after the convolution calculation. In this method, we used K-max pooling, which selects the top K-maximum values of each filter to express the semantic information of the filter. The value K is determined using Formula (7). \[K=\left\lfloor\frac{\text{len}-f_{S}+1}{2}\right\rfloor \tag{7}\]  
where \(Len\) is the length of the sentence vector, which is 50, and fs is the size of the convolution window. After the pooling operation, the number of feature vectors extracted from each convolution kernel is significantly reduced and the core semantic information of the sentence is retained. As the convolution number is set to 128, after pooling, the sentence representation matrix thus generated is \(W\)\(\in\)\(RK\)*128. The convolution and the pooling layers of the CNN extract the features of short sentences through convolution and pooling operations, respectively, and the generalized binary eigenvector and ternary eigenvector are obtained as the result. The fusion layer then combines the two eigenvectors to form the input matrix to the LSTM model. The LSTM neural network is a special cyclic neural network that has the ability to learn long-term dependencies, which can achieve especially good results in text processing. In the language model, a series of contextual information can be used to predict the probability of the next word to solve the gradient disappearance problem of traditional RNN in processing long sequences.