## 2 The Proposed Model Algorithm
### Item Representation Learning of the Conversation Layer
#### 2.2.2 Item Representation Learning for the Session Graph  
After constructing the weighted session graph as described above, we can use the graph neural network to encode the item representation vector and the item feature information representation vector and obtain the item embedding representation vector, which is a high-dimensional vector that represents the item feature information. Our model adopts the gated graph neural network (GGNN) to encode the item representation vector and the item feature information representation vector. The GGNN is a classic message passing model based on gated recurrent units (GRUs), which are specially designed for sequential problems. It can fix the number of iterations and use backpropagation algorithm directly in time to calculate the gradient. We use the standardized connection matrix \(M_{1}^{\prime}\) constructed above to obtain the information of each node in GGNN. After the memory processing of GRU unit, we fuse the node information and optimize the information propagation process of GNN for nodes. The specific learning process is as follows:  
\[a_{s,i}^{t}=M_{1}^{\prime}\left[v_{1}^{t-1},v_{2}^{t-1},\ldots,v_{n}^{t-1} \right]^{T}H+b \tag{2}\]  
\[Z_{s,i}^{t}=\sigma\Big{(}W_{z}a_{s,i}^{t}+U_{z}v_{i}^{t-1}\Big{)} \tag{3}\]  
\[R_{s,i}^{t}=\sigma\Big{(}W_{r}a_{s,i}^{t}+U_{r}v_{i}^{t-1}\Big{)} \tag{4}\]  
\[\widetilde{h}_{v_{i}}^{t}=\tanh\Big{(}W_{c}a_{s,i}^{t}+P_{c}\Big{(}R_{s,i}^{t} \odot v_{i}^{t-1}\Big{)}\Big{)} \tag{5}\]  
\[h_{v_{i}}^{t}=\big{(}1-Z_{s,i}^{t}\big{)}\odot v_{i}^{t-1}+Z_{s,i}^{t}\odot \widetilde{h}_{v_{i}}^{t} \tag{6}\]  
In Equation (2), \(a_{s,i}^{t}\) represents the generated item hidden vector and \(M_{1}^{\prime}\) is the standardized conversational connection matrix obtained above. \(Z_{s,i}^{t}\) and \(R_{s,i}^{t}\) are the reset gate and update gate in the gated graph neural network. This part divides the hidden vector information into useful and useless information, and finally decides to retain or discard it through the sigmoid activation function. In Equations (5) and (6), \(\odot\) represents multiplying elements one by one. We use the update gate and tanh function to calculate the candidate state and use the reset gate and the generated candidate state to obtain the vector representation of each node at time t, \(h_{v_{i}}^{t}\). Similarly, for the item feature graph of the conversational  
Figure 5: The standardized connection matrix \(M_{1}^{\prime}\) of the session.  
sequence, we use the same method to construct the item feature representation vector of the corresponding session graph node, \(h_{f_{i}}^{t}\). The calculation formula is as follows:  
\[Z_{s,i}^{rt}=\sigma\Big{(}W_{z}a_{s,i}^{t}+U_{z}h_{t-1}^{F}\Big{)} \tag{7}\]  
\[R_{s,i}^{t}=\sigma\Big{(}W_{r}a_{s,i}^{t}+U_{r}h_{t-1}^{F}\Big{)} \tag{8}\]  
\[h_{t}^{F}=\tanh\Big{(}W_{z}a_{s,i}^{t}+U_{h^{F}}\Big{(}r^{\prime}\,_{t}\odot h _{t-1}^{F}\Big{)}\Big{)} \tag{9}\]  
\[h_{f_{i}}^{t}=\big{(}1-z^{\prime}\,_{t}\big{)}\odot h_{f_{i}}^{t-1}+z^{\prime }\,_{t}\odot\hat{h}_{f_{i}}^{t} \tag{10}\]  
For each session graph and item feature graph, the gated graph neural network updates the nodes simultaneously. \(a_{s,i}^{t}\) is used for information propagation between different nodes under the constraints given by the item connection matrix. Specifically, it extracts the latent vectors of the neighborhood and inputs them into the graph neural network as input data. Then, using the update gates \(Z_{s,i}^{t}\), \(Z_{s,i}^{rt}\) and the reset gates \(R_{s,i}^{t}\), \(R_{s,i}^{t}\), they decide which information to retain and discard, respectively. After obtaining the representation vectors of the item \(h_{t_{i}}^{t}\) and the item feature \(h_{f_{i}}^{t}\) that we need, we concatenate \(h_{v_{i}}^{t}\) and \(h_{f_{i}}^{t}\) to obtain the final session-level item output vector \(\mathrm{h}_{v_{i}}\), as shown in Equation (11):  
\[\mathrm{h}_{v_{i}}=concat\Big{(}h_{v_{i}}^{t},h_{f_{i}}^{t}\Big{)} \tag{11}\]