$ show salesforce/OmniXAI
OmniXAI is a comprehensive explainable AI (XAI) library providing a unified interface for generating explanations across multiple data types (tabular, vision, text, time series, ranking, vision-language) and ML models. It implements both model-agnostic (LIME, SHAP, L2X, MACE) and model-specific (Grad-CAM, Integrated Gradients, decision tree) explanation methods. The library features a modular architecture with separate modules for data handling, preprocessing, explanation generation, visualization (Dash-based dashboard), and deployment (BentoML integration). Key design patterns include base classes for explainers and explanations, factory patterns for explainer instantiation, and composable preprocessing pipelines. The system supports end-to-end workflows from data preprocessing to explanation visualization and model serving.
The LLM identified 3 files worth highlighting for reuse:
Provides essential utility functions for framework detection (PyTorch/TensorFlow), random seed control, tensor conversion, progress tracking, and decorators. These utilities are used throughout the library to handle framework-specific code and ensure reproducibility, making them highly reusable in other ML projects.
Defines the `ExplanationBase` abstract class that standardizes the interface for explanation objects across all modalities (tabular, vision, text, etc.). It includes methods for adding explanations, retrieving explanations, plotting (matplotlib/plotly), and serialization (JSON/dill). This component encapsulates common explanation handling logic and promotes consistency.
Implements a flexible data transformation pipeline pattern with `TransformBase` abstract class and `Pipeline` composer. This mirrors scikit-learn's transformer API, allowing users to compose reusable preprocessing steps (normalization, encoding, etc.) that are framework-agnostic and easily testable.