oruccakir
Back to Projects

Multi-Agent XAI Text Classifier

A multi-agent system for explainable text classification combining traditional ML and transformer models with LIME/SHAP interpretability and LLM-generated natural language explanations.

Overview

A multi-agent explainable AI text classification system built for the BİL 443/564 Pattern Recognition course at TOBB ETÜ. The system features a three-agent architecture: an Intent Classifier Agent that automatically detects the input language and context (movie review, product review, news article) and routes to the appropriate model; a Classification Agent that performs text classification using one of six methods (Naive Bayes, SVM, Random Forest, KNN, Logistic Regression, Transformer); and an XAI Agent that provides triple explainability through LIME for local interpretable explanations, SHAP for global feature importance, and LLM-powered natural language explanations. Supports bilingual classification across English and Turkish with four datasets (IMDB, Turkish Sentiment, AG News, Turkish News). Includes a Streamlit web application for interactive training, evaluation with k-fold cross-validation, classification, and XAI visualization. Features TF-IDF and Sentence-BERT feature extraction, comprehensive text preprocessing pipelines, and model benchmarking capabilities.

Key Features

1

Three-Agent Architecture: Intent Classifier automatically routes to the correct model based on detected language and context

2

Six Classification Methods: Naive Bayes, SVM, Random Forest, KNN, Logistic Regression, and Transformer (BERT/DistilBERT)

3

Triple Explainability: LIME for local explanations, SHAP for global feature importance, and LLM for human-readable natural language explanations

4

Bilingual Support: Native handling of both Turkish and English text with dedicated preprocessing pipelines

5

Four Datasets: IMDB (EN sentiment), Turkish Sentiment, AG News (EN multi-class), and Turkish News (TTC4900)

6

Interactive Streamlit Web App: Pages for training, evaluation, classification, and XAI visualization

7

K-Fold Cross-Validation: Rigorous model evaluation and benchmarking across all six methods

8

Dual Feature Extraction: TF-IDF vectorization and Sentence-BERT transformer embeddings

Technologies

Pythonscikit-learnTransformersBERTSentence-BERTLIMESHAPLangChainStreamlitTF-IDFNLPExplainable AI