Skip to content

adlaube/XAI_scruples

Repository files navigation

Explain Scruples

https://github.com/allenai/scruples

Features

  • explain anecdotes with LIME
  • report generation with statistics on explanation features

What is where?

File features
anecdotes.py generates LIME explanations for a random anecdotes subset and creates pickled explanations as well as html report + plots
anecdotes_utils.py interface functions that call the scruples REST API, reads anecdotes data from /data/ directory
anecdotes_shap.py explanations with SHAPley values, not functional currently
anecdotes_LIME.py explanations with LIME, functional
anecdotes_anchors.py explanations with anchors, functional but slow

Findings

  • model considers connotated verbs and personal pronouns

Run scruples

Run scruples in Docker

  • clone XAI_scruples

  • create venv from requirements.txt

  • clone scruples: https://github.com/allenai/scruples

  • build and run docker container from Dockerfile

      docker build --tag scruples .
      docker run --name scruples_instance -publish 5050:8000 scruples
    

Run

  • download scruples data: https://github.com/allenai/scruples#data
  • move data to XAI_scruples/data/anecdotes and/or XAI_scruples/data/dilemmas
  • configure params in ancedotes.py
  • run ancedotes.py
  • html and pngs will be created in root dir

Runtime LIME on sample anecdote

  • single explanation with 10 pertubations: 14s CPU
  • single explanation with 5000 pertubations: 6532s CPU, 348s GPU
  • CPU i7, GPU GTX1080

Other explanation techniques

About

Explaining the allan ai norms model with LIME

Resources

Stars

Watchers

Forks

Languages