# Multi-Task Topic Analysis Framework for Hallmarks of Cancer with Weak Supervision
## 3 Materials and Methods
### Topic Modeling
#### 3.3.3 Latent Topic Models  
In this section, we described the conventional latent based topic models LDA and PLSA used in this paper. Basically, it shows the steps in topic modeling, which include a bag of word, training of the model, and output of a topic model. We assumed that there were \(Q\) topics, \(E\) entities, and \(Z\) documents in a corpus. The bag of words (BoW) model representation is used in information retrieval and natural language processing. In BoW, it represents text by ignoring its order and grammar. As shown in Table 2, there are five entities such as low-folate, metastasis, neoplasm metastasis, decreased folic acid, tryptophanase, and five documents in a corpus. The value \(E_{ij}\) in the matrix shows the number of times term \(i\) appear in a document. For example, \(E_{13}\) = 8 means a number of times \"low-folate\" entity appear in \(D_{3}\) the document is 8. The term-document matrix was considered as a simplified representation of documents as the input to the topic model. In a bag of words, the size of the term-document matrix was huge. The goal of topic modeling is to find the concept that runs through documents by analyzing the words of the texts. Topics were discovered during the training of models. For topic models like LDA and PLSA, word term space of the documents converted into topic space as it is definitely sure that topic space is smaller than word term space. The outputs of these models contain two matrices that are the word probability distributions over topics and the second one is the topic probability distributions over documents. \begin{table}
\begin{tabular}{c c c c c c} \hline \hline
**Entity (CUI or AA)** & \(D_{1}\) & \(D_{2}\) & \(D_{3}\) & \(D_{4}\) & \(D_{5}\) \\ \hline low-folate (LF) & 1 & 2 & 8 & 0 & 7 \\ metastasis (C4255448) & 3 & 4 & 5 & 4 & 9 \\ neoplasm metastasis (C0027627) & 3 & 2 & 6 & 3 & 6 \\ decreased folic acid (C0239623) & 9 & 4 & 2 & 1 & 0 \\ tryptophanase (C0041260) & 2 & 1 & 0 & 1 & 3 \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Bag of words representation of documents. The PLSA is a statistical technique for the analysis of a collection of the document. The probabilistic latent semantic analysis is evolved from a latent semantic analysis. In PLSA, assume \(D\) denotes the label of a document i.e., \(D\) belongs to \(D_{W}=\{D_{1},D_{2},\ldots,D_{Z}\}\), and \(Z\) denotes the number of documents in the data. \(T\) is a topic, \(T\) belongs to \(T=\left\{T_{1},T_{2},\ldots,T_{Q}\right\}\), i.e., there is a \(Q\) number of topics. \(E\) represents an entity, \(E\) belongs to \(E=\{E_{1},E_{2},\ldots,E_{R}\}\), i.e., there is a \(R\) number of entities in data. Therefore, \(P(T\big{|}D)\) denotes the probability of topic \(T\) in document \(D\), and \(P(E\big{|}T)\) means the probability of entity \(E\) in topic \(T\). Then, for PLSA, the generative procedure for each word in the document is described in Algorithm 5. ```
Input: A set \(D_{W}=\{D_{1},D_{2},\ldots,D_{Z}\}\) of \(Z\) weak-labeled documents; a set \(E=\{E_{1},E_{2},\ldots,E_{R}\}\) of \(R\) entities; Output: A set \(T=\left\{T_{1},T_{2},\ldots,T_{Q}\right\}\) of \(Q\) topics for each hallmark category; begin
1 Select a document \(D_{z}\) with probability \(P(D_{z})\);
2 Randomly choose a topic \(T_{d}\) from the distribution over topics \(P(T_{d}\big{|}D_{z})\) ;
3 Randomly choose an entity \(E_{r}\) from the distribution over the topic \(P\big{(}E_{r}\big{|}T_{d}\big{)}\);

end
```  
**Algorithm 5** Probabilistic latent semantic analysis  
In LDA, a document is viewed as a combination of different topics where each document is assumed to have a group of topics that are assigned to document using LDA. This is identical to PLSA, in practice, this results in better disambiguation of words and a more precise assignment of documents to topics. LDA is a generalization of the PLSA model, which is equivalent to LDA under a uniform Dirichlet prior to distribution.