## 3 Materials and Methods
### Topic Feature Learning of User and Item
#### 3.2.2 Parameter Estimation  
It is an intractable task to exactly estimate the parameters \(\theta_{u}\), \(\varphi_{k}\). Similar to LDA, we use Gibbs sampling to approximately infer the parameters. First, we need to sample \(P\big{(}z_{qi}|w_{qi},w_{pj}\big{)}\) and \(P\big{(}z_{pj}|w_{qi},w_{pj}\big{)}\) to obtain the topic assignment \(z_{qi}\) in query documents and the topic assignment \(z_{pj}\) in webpage documents. Thus, the following conditional probability distribution is derived:  
\[P\big{(}z_{qi}=k,z_{pj}=k|z_{-qi},z_{-pj},w_{qi},w_{pj}\big{)}\] \[P\big{(}z_{qi}=k,z_{pj}=k|z_{-qi},z_{-pj},w_{qi},w_{pj}\big{)}\] \[\propto P\big{(}z_{qi}=k,z_{pj}=k,w_{qi}=t_{1},w_{pj}=t_{2}\big{|} z_{-qi},z_{-pj},w_{-qi},w_{-pj}\big{)}\] \[=\int P\big{(}z_{qi}=k,z_{pj}=k,w_{qi}=t_{1},w_{pj}=t_{2},\theta_ {u},\theta_{u},\varphi_{k}|z_{-qi},z_{-pj},w_{-qi},w_{-pj}\big{)}d\theta_{u}d \theta_{u}d\varphi_{k}\] \[=\int P\big{(}z_{qi}=k,\theta_{u}|z_{-qi},z_{-pj},w_{-qi},w_{-pj} \big{)}\cdot P\big{(}z_{pj}=k,\theta_{u}|z_{-qi},z_{-pj},w_{-qi},w_{-pj}\big{)}\] \[\cdot P\Big{(}w_{qi}=t_{1},\varphi_{k,w_{qi}}\big{|}z_{-qi},z_{- pj},w_{-qi},w_{-pj}\Big{)}\] \[\cdot P\Big{(}w_{pj}=t_{2},\varphi_{k,w_{pj}}\big{|}z_{-qi},z_{- pj},w_{-qi},w_{-pj}\Big{)}d\theta_{u}d\theta_{u}d\varphi_{k,w_{qi}}d\varphi_{k,w_{ pj}}\] \[=\int P\big{(}z_{qi}=k|\theta_{u}\big{)}P\big{(}\theta_{u}|z_{-qi },z_{-pj},w_{-qi},w_{-pj}\big{)}\] \[\cdot P\big{(}z_{pj}=k|\theta_{u}\big{)}P\big{(}\theta_{u}|z_{-qi },z_{-pj},w_{-qi},w_{-pj}\big{)}\] \[\cdot P\Big{(}w_{qi}=t_{1}|\varphi_{k,w_{qi}}\big{)}P\Big{(} \varphi_{k,w_{qi}}\big{|}z_{-qi},z_{-pj},w_{-qi},w_{-pj}\Big{)}\] \[P\big{(}z_{qi}=k,z_{pj}=k|z_{-qi},z_{-pj},w_{qi},w_{pj}\big{)}\]0 (1) \[P\big{(}z_{qi}=k,z_{pj}=k|z_{-qi},z_{-pj},w_{qi},w_{pj}\big{)}\]1 \[P\big{(}z_{qi}=k,z_{pj}=k|z_{-qi},z_{-pj},w_{qi},w_{pj}\big{)}\]2 \[P\big{(}z_{qi}=k,z_{pj}=k|z_{-qi},z_{-pj},w_{qi},w_{pj}\big{)}\]3 \[P\big{(}z_{qi}=k,z_{pj}=k|z_{-qi},z_{-pj},w_{qi},w_{pj}\big{)}\]4 \[P\big{(}z_{qi}=k,z_{pj}=k|z_{-qi},z_{-pj},w_{qi},w_{pj}\big{)}\]5 \[\cdot\varphi_{k}^{(t_{2})}Dir\big{(}\varphi_{k,w_{pj}}\big{|}n_{ k,-pj}^{(k)}+\beta\big{)}d\theta_{u}d\theta_{u}d\varphi_{k,w_{qi}}d\varphi_{k,w_Inside, \(w_{qi}=t_{1}\) denotes the \(i\)th word in the query \(q\) is \(t_{1}\). \(w_{pj}=t_{2}\) denotes the \(j\)th word in the webpage \(p\) is \(t_{2}\). \(z_{-qi}\) denotes the topic assignments to all words except the \(i\)th word in the query \(q\). \(z_{-pj}\) denotes the topic assignments to all words except \(j\)th word in the webpage \(p\). \(w_{-qi}\) denotes all words except the \(i\)th word in the query \(q\). \(w_{-pj}\) denotes all words except the \(j\)th word in the webpage \(p\). \(n_{q,-qi}^{(k)}\) denotes the number of words generated by topic \(k\) in the query \(q\) excluding the \(i\)th word in the query \(q\), \(n_{p,-pi}^{(k)}\) denotes the number of words generated by topic \(k\) in the webpage \(p\) excluding the \(j\)th word in the webpage \(p\), \(n_{q,-qi}=\left(n_{q}^{(1)},n_{q}^{(2)},\cdots,n_{q}^{(k)}-1,\ \cdots,n_{q}^{(K)}\right)\) denotes the number of words generated by topic \(k\) in the query \(q\) excluding the \(i\)th word, \(n_{p,-pi}=\left(n_{p}^{(1)},n_{p}^{(2)},\cdots,n_{p}^{(k)}-1,\ \cdots,n_{p}^{(K)}\right)\) denotes the number of words generated by topic \(k\) in the webpage \(p\) excluding the \(j\)th word. \(n_{k,-qi}^{q(t)}\) denotes the number of times the word \(t\) is assigned to the topic \(k\) excluding the \(i\)th word in the query \(q\), \(n_{k,-qi}^{q}=\left(n_{k}^{q(1)},n_{k}^{q(2)},\cdots,n_{k}^{q(t)}-1,\ \cdots,n_{k}^{q(V)}\right)\). \(n_{k,-pj}^{p(t)}\) denotes the number of times the word \(t\) is assigned to the topic \(k\) excluding the \(j\)th word in the webpage \(p\), \(n_{k,-pj}^{p}=\left(n_{k}^{p(1)},n_{k}^{p(2)},\cdots,n_{k}^{p(t)}-1,\ \cdots,n_{k}^{p(V)}\right)\). Algorithm 1 summarizes the overall procedure of Gibbs sampling to estimate the parameters \(\theta_{u}\), \(\varphi_{k}\).