How ramishazia01/ext-shap-lime-xai works
This repository provides two RTL-language explainability paths: SHAP explanations and plots, plus LIME text explanations, with Urdu/Arabic/Persian/Hebrew text handling. The main workflow accepts text/model inputs, computes feature attributions, optionally translates or interprets them with an LLM, and presents textual analyses or RTL-aware plots. The SHAP wrapper supports model fitting and prediction; the package also exposes drop-in RTL plot variants. The LIME implementation and SHAP internals are sampled only partially, so uncertain links are omitted.
Main entry points: urdu_lime/explainer.py LIME explainer · wrapper.py Model wrapper · shap_rtl/explainer.py SHAP explainer · plots RTL plot suite
Components 13
SHAP explainability
- Model wrapper
SHAP_RTL/shap_rtl/wrapper.py - SHAP explainer
SHAP_RTL/shap_rtl/explainer.py
LIME explainability
- LIME explainer
LIME_RTL/src/urdu_lime/explainer.py
RTL rendering
- RTL plot suite
SHAP_RTL/shap_rtl/plots - RTL text utilities
SHAP_RTL/shap_rtl/rtl_utils.py - Hebrew utilities
SHAP_RTL/shap_rtl/rtl_utils_hebrew.py
External services
- SHAP library
- LIME text engine
- LLM service
Other components
- Engineer or user
- Classifier model
- Rendered plots
- Text analysis
Connections 18
- Engineer or user → Model wrapper: supplies texts
- Engineer or user → SHAP explainer: supplies SHAP values
- Model wrapper → Classifier model: fits and predicts
- Model wrapper → SHAP library: computes attributions
- Model wrapper → SHAP explainer: requests analysis
- Model wrapper → RTL plot suite: selects plot
- SHAP explainer → LLM service: requests translations
- SHAP explainer → RTL plot suite: renders explanation
- RTL plot suite → RTL text utilities: shapes RTL text
- RTL plot suite → Hebrew utilities: handles Hebrew text
- RTL plot suite → Rendered plots: draws plots
- Engineer or user → LIME explainer: supplies text
- LIME explainer → LIME text engine: generates local features
- LIME explainer → Classifier model: queries predictions
- LIME explainer → LLM service: requests analysis
- LIME explainer → Text analysis: prints analysis
- LIME explainer → Rendered plots: draws plots
- SHAP explainer → Text analysis: prints explanations