## 3 Theoretical Foundations
### Latent Dirichlet Allocation (LDA)  
The LDA algorithm is a probabilistic model introduced in [6]. LDA can be used to understand the semantic meaning of the text and thus identify the main topics. This method does not necessitate pre-existing annotations on documents. The algorithm can work in two ways:  
1. Retrospective topic detection: in this case, the algorithm identifies the topics present in a set of \"never seen before\" transcriptions after having processed them all, and groups them into homogeneous clusters. 2. Online new topic detection: in this case, the algorithm processes one transcription at a time to establish whether it deals with a new topic or belongs to one of the existing clusters. The dependencies between the variables are the key that allows inferring unknown variables starting from the observed variables (the distribution per document of the words \(w\)). The two outputs of the template are the topics \(\phi_{k}\) and the respective weights (importance of the topic) for each \(\theta_{d}\) document. In the LDA method, topics are expressed as a set of distributions over a set of words. Documents, instead, are seen as a distribution over the group of different topics, thus showing multiple topics in different proportions. Finally, the LDA algorithm models the given textual dataset with document-topic and topic-term probability distributions. Let \(K\) denote the number of topics, \(N\) be the number of words, and \(M\) be the total number of documents. For each document, the Dirichlet prior to topic distribution is represented by \(\alpha\), while the Dirichlet for the word distribution, by \(\beta\). Let \(\phi_{k}\) be the word distribution for topic \(k\), and \(\theta_{m}\) denote the topic distribution for document \(m\). Let \(z_{m,n}\) be the topic assignment for the word \(n\) in document \(m\), which is denoted as \(w_{m,n}\). The aim is to learn the \(\phi\) (topic \(\times\) term) matrix and the \(\theta\) (document \(\times\) topic) matrix. \(\alpha\), \(\beta\), and \(K\) are specified by the user. Within the LDA framework, transcriptions are represented as mixtures over a finite number of topics \(K\) and topics are distributions over words from a fixed set of size \(V\). More formally, LDA is a generative process in which the topics \(\Phi=[\phi_{1},\dots,\phi_{K}]\) are sampled from a Dirichlet distribution (a family of continuous multivariate probability distributions, a generalization of the scalar beta distribution, and parameterized by a vector of positive reals) governed by parameters \(\mathbf{\beta}=[\beta_{1},\dots,\beta_{N}]\) and the topical mixtures \(\Theta=[\theta_{1},\dots,\theta_{D}]\) are sampled from a Dirichlet distribution governed by parameters \(\mathbf{\alpha}=[\alpha_{1},\dots,\alpha_{K}]\). For each transcription \(m\), word \(n\) is sampled through a two-step process: First, a topic assignment \(z_{m,n}\) is chosen from the transcription-specific topical mixture \(\theta_{m}\). Second, a word is sampled from the assigned topic \(\phi_{z_{m,n}}\). Mathematically the model is summarized as follows. \[\phi_{k} \sim Dirichlet(\mathbf{\beta}) \tag{1}\] \[\theta_{m} \sim Dirichlet(\mathbf{\alpha})\] \[z_{m,n}|\theta_{m} \sim Multinomial(\theta_{m})\] \[w_{m,n}|\phi_{z_{m,n}} \sim Multinomial(\phi_{z_{m,n}}).\]  
The multinomial distribution represents a discrete multivariate distribution (a generalization of the scalar binomial distribution); the data correspond to the observed set of words \(w_{m,n}\) within each transcription \(d\). The posterior distribution of the topic distributions \(\Phi\) and topical mixtures \(\Theta\) is given by the posterior conditional probability:  
\[P(\Phi,\Theta,\mathbf{z}|\mathbf{w},\mathbf{\alpha},\mathbf{\beta})=\frac{P(\Phi,\Theta,\mathbf{z },\mathbf{w}|\mathbf{\alpha},\mathbf{\beta})}{P(\mathbf{w}|\mathbf{\alpha},\mathbf{\beta})}, \tag{2}\]  
where \(\mathbf{z}\) and \(\mathbf{w}\) are vectors of topic assignments and words, respectively.