As we can see, the model with the highest validation accuracy score is the one in the 5th epoch, so this is the one we save. The validation accuracy across all epochs is significantly high, and as we would expect, the train loss is getting smaller in each epoch. The validation metrics on the test set which can be seen in the following table, indicate that our model can make qualitative predictions and has generalization capabilities.
| Test Set | |
|----------|--|
| Accuracy | 0.94 |
| Precision | 0.77 |
| Recall | 0.82 |
| F1 Score | 0.79 |
## System Evaluation
In this segment we simulate a conversation between a user and the xai-chatbot in order to validate its performane and make sure that everything works as intended. Through this conversation example we demonstrate every one of the system's capabilities.
---
**User:** Hello!
**Chatbot:** Hey! You can ask me to classify a sequence as sexist or not, request explanations and information about the prediction, get the most important features for each class, see misclassified examples and get similar examples to the one you gave me!
**User:** I want you to classify something for me please
**Chatbot:** Sure, what do you want me to classify? Type ’Classify this:’ and then your desired sentence!
**User:** Classify this:I really dislike working with women.
**Chatbot:** This is a sexist sentence.
**User:** Why is that sexist?
**Chatbot:** Here you can see the Layer Integrated Gradients score for each of the sentence’s tokens that contributed the most towards the predicted class in descending order of importance:
women - 0.8189663312822042
working - 0.3277983707620475
dislike - 0.30928092045674316
really - 0.029478847212869478
You can also see a visualization of the token’s attributions for the predicted class here :
**User:** What about the other class?
**Chatbot:** Here you can see the Layer Integrated Gradients score for each of the sentence’s tokens that contributed the most towards the non-predicted class in descending order of importance:
i - 0.34612113201900013
with - 0.06024101199335626
. - 0.04347261901756854
**User:** How certain are you about the prediction?
**Chatbot:** I am 77.61% sure that the prediction is right!
**User:** Show me some similar examples
**Chatbot:** The anchors for this sentence are:women AND dislike AND with
Here you can see similar examples where the anchors apply and the model still predicts sexist:
I really dislike UNK with women UNK
I UNK dislike UNK with women UNK
UNK UNK dislike UNK with women .
**User:** Which are the most important features for each class?
**Chatbot:** Based on the SHAP values, the most important features for the ’sexism’ category are the following:
female, sister, ladies, women, girl, fe, woman, wife, men, man