# A Survey on Bug Deduplication and Triage Methods from Multiple Points of View
## 3 The Roadmap of Existing Literature
### Background Knowledge  
#### 3.2.1 Feature Extraction and Selection  
Regardless of whether using information retrieval (IR) or machine learning methods, topic modeling of bug reports is a commonly used approach for feature extraction. Such methods aim to abstract a piece of text into several keywords that can represent the entire text. Common feature extraction models for natural language processing include N-Gram, LDA, TF-IDF, and others. (1) TF-IDF  
The term frequency inverse document frequency (TF-IDF) method is used to extract textual features from bug reports. It quantifies the importance of a term within a document by calculating the frequency of the term in the document (\(TF(t,D)\)) and the number of documents that contain the term (\(IDF(t)\)). Figure 7: Overview of related work in recent years. Let \(DF(t)\) represent the terminology and t represent the number of documents in which the terminology appears at least once. Let \(|D|\) represent the total number of reports. Formula (1) represents the calculation process for \(IDF\) (inverse document frequency):  
\[IDF(t)=\log\frac{|D|}{DF(f)} \tag{1}\]  
The eigenvalue (\(w_{i}\)) belonging to \(t\) can be expressed as:  
\[TF\_IDF(t)=w_{i}=TF(t,D)*IDF(t) \tag{2}\]  
Finally, the \(TF\_IDF\) feature vector about terminology can be represented as:  
\[\vec{V}=(W_{1},W_{2},W_{3},\dots,W_{n}) \tag{3}\]  
The TF-IDF feature vectors of two different documents can be used to estimate the similarity between the texts based on cosine similarity, as Formula (4) shows. \[cosine\_similarity=\frac{(AB)}{||A||*||B||} \tag{4}\]  
where \(A\) and \(B\) represent the TF-IDF feature vectors of the two documents, - denotes the dot product, and \(||A||\) and \(||B||\) represent the Euclidean norms of the respective vectors. (2) N-Gram  
The N-Gram model is based on an N - 1 order Markov model, which assumes that the current element (word) is only dependent on the previous N - 1 elements. In practical applications, N is typically limited to 3 or 4 because larger values of N lead to a significant increase in complexity while providing limited performance improvement. The N-Gram model primarily aims to predict the probability of the current element, given that the previous N - 1 elements are known, or to evaluate the likelihood of a sentence composed of N elements. Formula (5) represents the calculation process for probability:  
\[p(W_{1},W_{2},W_{3},\dots,W_{n})=p(W_{1})\cdot p(W_{2}|W_{1})\cdot\dots\cdot p (W_{n}|W_{1},W_{2},\dots,W_{n-1}) \tag{5}\]  
where \(p(W_{n}|W_{1},W_{2},\dots,W_{n-1})\) represents the probability of the current word (\(W_{n}\)), given the previous N - 1 words ((\(W_{1}\), \(W_{2}\),..., \(W_{n-1}\)). This probability is estimated based on the frequencies of N-grams observed in a training corpus. (3) LDA  
LDA (latent Dirichlet allocation) is an unsupervised probabilistic topic modeling technology. Essentially, it aims to infer the topic distribution of a document based on its content. To achieve this, LDA requires users to provide the expected number of topics, denoted as K, for the given bug reports. LDA utilizes the Dirichlet distribution, as shown in Equation (6), as a prior distribution. It then updates the prior distribution based on the specific distribution observed in the bug reports to form the posterior probability distribution. Gibbs sampling is then employed to infer the specific probability distribution parameters of the LDA topic model. \[Dir(\vec{p}|\vec{\alpha})=\frac{\Gamma(\sum_{K}^{k-1}a_{k})}{\prod_{K}^{k-1} \Gamma(a_{k})}\prod_{K}^{k-1}\rho_{k}^{a_{k}-1} \tag{6}\]  
where \(\Gamma(n)=(n-1)!\)  
(4) Chi-square (\(\chi^{2}\)) test  
The chi-Square test can be used to assess the correlation between a particular feature and the outcome, thereby identifying redundant or irrelevant features. It calculates the deviation between the observed and expected values for a given feature. The test determineswhether the feature is independent of the outcome based on the chi-square distribution with K degrees of freedom, as shown in Equation (7).