## 2 The Proposed Model Algorithm
### Item Representation Learning Module for the Global Domain Layer  
#### 2.3.1 Constructing the Global Graph  
We consider the global item transition by aggregating all pairwise item transitions in the conversation. First, we introduce the concept of a neighborhood set here, and use the concept of a neighborhood set to establish the item transition relationship of the global sequence. A neighborhood is a topological structure on a set, that is, a nearby area. Let there be conversational sequences \(\mathrm{S}_{\mathrm{P}}=\left\{v_{1}^{\mathrm{P}},\ v_{2}^{\mathrm{P}},\dots, \ v_{1}^{\mathrm{P}}\right\}\), \(\mathrm{S}_{\mathrm{q}}=\left\{v_{1}^{\mathrm{q}},\ v_{2}^{\mathrm{q}},\dots, \ v_{m}^{\mathrm{q}}\right\}\), where 1 and m, respectively, represent the lengths of the conversational sequences \(\mathrm{S}_{\mathrm{P}}\) and \(\mathrm{S}_{\mathrm{q}}\); then, the representation formula of the neighborhood set is as follows:  
\[\mathrm{N}\Big{(}v_{i}^{\mathrm{P}}\Big{)}=\left\{v_{i}^{\mathrm{q}}\Big{|}v_ {i}^{\mathrm{P}}=v_{i}^{\mathrm{q}},\,\in S_{\mathrm{P}}\cap\mathrm{S}_{ \mathrm{q}};v_{i}^{\mathrm{P}}\in\mathrm{S}_{\mathrm{q}};i\right\}\in\left[i^{ \prime}-\varepsilon,i^{\prime}+\varepsilon\right];S_{\mathrm{P}}\
eq S_{ \mathrm{q}}\Big{\}} \tag{12}\]  
\(i^{\prime}\) denotes the position of the item \(v_{i}\) in \(\mathrm{S}_{\mathrm{q}}\). \(\varepsilon\) is the degree of the neighborhood, and if the degree is too large, it will introduce more noise information and some irrelevant item dependency relations. Taking the following conversations \(S_{1}=\left\{v_{1},\ v_{2},\ v_{3},\ v_{4},\ v_{5},\ v_{6}\right\}\), \(S_{2}=\left\{v_{1},\ v_{3},\ v_{4},\ v_{2},\ v_{6},\ v_{1}\right\}\), and \(S_{3}=\left\{v_{6},\ v_{2},\ v_{7}\right\}\) as an example, the constructed first-degree neighborhood set and neighborhood graph are as the following Figure 6.  
Figure 6: Global graph. The global graph \(G_{g}=\big{(}V_{g}\,,E_{g}\big{)}\) consists of a node set \(V_{g}\) composed of items on all conversations, and an edge set \(E_{g}=\big{\{}\mathrm{e_{ij}}\big{|}\big{(}\mathrm{v_{i}},\mathrm{v_{j}}\big{)},\ \mathrm{v_{i}}\in\mathrm{V_{g}},\ \mathrm{v_{j}}\in\)N(\(\mathrm{v_{i}}\))] that represents the transformation relationship between the current conversational item and its adjacent items in the global graph, where N(\(\mathrm{v_{i}}\)) is the neighbor set of the item \(\mathrm{v_{i}}\). The weight generation method of the edge set E\({}_{g}\) in the global graph is as follows. For each node, the weight of its adjacent edges consists of two parts. (1) The frequency of each edge in all conversations, because within a certain period of time, the more times two items are clicked sequentially in the same conversational sequence, the higher their similarity or relevance. The frequency weight of the edge is denoted as W\({}_{\mathrm{ij}}^{\mathrm{f}}\). (2) According to the different \"gaps\" between two items, \(\mathrm{v_{i}}\) and \(\mathrm{v_{j}}\), in the conversational sequence, for example, the gap between items \(\mathrm{v_{1}}\) and \(\mathrm{v_{3}}\) in conversation \(\mathrm{v_{3}}\) is 2, while the gap between items \(\mathrm{v_{1}}\) and \(\mathrm{v_{3}}\) in conversation \(\mathrm{S_{2}}\) is 3. In the same conversational sequence, the shorter the \"gap\" between two items that are clicked sequentially, the stronger the relevance of these two interactions. Here, we use the average \"gap\" D of the edge in all sessions to represent the relevance of two items in the global graph. The \"gap\" weight of the edge is expressed as:  
\[\mathrm{W_{ij}^{as}}=\ \alpha\times\bigg{[}\frac{\mathrm{D}}{\varepsilon} \bigg{]} \tag{13}\]  
\(\alpha\) is a coefficient, \(\varepsilon\) is a distance basic coefficient. Here, we consider the nodes which have a distance is within a certain range as having the same \"gap\" as the current node, so we use the rounded result as the final gap.