## 3 The Proposed Approach
### Explaining the Model  
As far as the generation of interpretable explanations is concerned, we have elected to employ three XAI models. For the clustering component, a _SHAP_ and a _LIME_ model are employed. The basic principle behind these models is that there exists a simpler approximation of the original model that can be utilized to calculate the importance of each feature (i.e., word). _SHAP_ relies on additive feature attribution methods, which dictates that  
\[g(z^{\prime})=\phi_{0}+\sum_{j=1}^{M}\phi_{j}\cdot z^{\prime}_{j} \tag{2}\]  
where \(g\) is the explanation model \(z^{\prime}\in\{0,1\}^{M}\), \(M\) is the number of simplified input features, and \(\phi_{j}\in\mathbb{R}\) is the Shapley value that denotes the effect of each feature. The Shapley values are calculated as follows:\[\phi_{i}=\sum_{S\subseteq N\setminus\{i\}}\frac{|S|!(|N|-|S|-1)!}{|N|!}[v(S\cup\{i \})-v(S)] \tag{3}\]  
where \(N\) is the set of all features (i.e., word/sentence tokens), \(S\) is a subset of the features that does not include feature \(i\), the value (prediction) of the model with only features in subset \(S\) is \(v(S)\), and \(|S|!\) is the factorial of the size of \(S\). The aim of _SHAP_ is to find an explanation model that incorporates three characteristics. The first one is local accuracy, in the sense that the explanation model must approximate the original model for the simplified input \(x^{\prime}\). This is assured by the following equation:  
\[f(x)=g(z^{\prime})=\phi_{0}+\sum_{i=1}^{M}\phi_{i}\cdot z^{\prime}_{i} \tag{4}\]  
where \(f(x)\) is the original model, \(g(z^{\prime})\) is the explanation model, \(z^{\prime}\) is a binary vector representing the presence or absence of features, and \(\phi_{0}\) denotes the baseline prediction. Moreover, the output model must also remain unaffected in the absence of a feature:  
\[x^{\prime}_{j}=0\Rightarrow\phi_{j}=0 \tag{5}\]  
Finally, the output model must be consistent, in the sense that if the model changes so that the importance of a feature increases or at least remains unchanged then the input's importance should not decrease:  
\[f^{\prime}_{x}(z^{\prime})-f^{\prime}_{x}(z^{\prime}\setminus i)\geq f_{x}(z^ {\prime})-f_{x}(z^{\prime}\setminus i)\Rightarrow\phi_{i}(f^{\prime},x)\geq \phi_{i}(f,x) \tag{6}\]  
where \(f^{\prime}\) is the new model, \(f\) is the original model, \(\phi_{i}(f^{\prime})\) is the Shapley value for feature \(i\) in the new model, and \(\phi_{i}(f)\) is the Shapley value for feature \(i\) in the original model. _LIME_, on the other hand, operates as a local surrogate model considering the ML model as a black box. To find an explanation model, _LIME_ generates variations of the input to test the behavior of the model output. The explanation model should approximately generate the same output as the original model locally, without any such restrictions applying globally. The aim of _LIME_ is to extract the model that minimizes \(\mathcal{L}(f,g,\pi_{x})\). A proximity score is denoted by \(\pi_{x}\), so that we can define the concept of locality around an instance \(x\). The explanation produced by LIME is as follows:  
\[g(x)=arg\min_{g\in G}\mathcal{L}(f,g,\pi_{x})+\Omega(g) \tag{7}\]  
However, both models require a supervised ML model, in order to produce explanations. Both models consider the ML model at hand as a black box, and they create perturbations to the input features, to induce changes in the model's output. Nevertheless, current implementations assume that a label is provided for each instance. To overcome this barrier, we simulate the clustering process with a supervised Neural Network (NN) architecture, utilizing cluster_id generated via the clustering process as the label for each data point. The NN consists of three fully connected layers. For the output layer, a Softmax activation function is employed. Both XAI models utilize this supervised NN network to gain insights about the clustering process.