Using Sagemaker clarify shap value for token level explanation
Is it possible to use Sagemaker clarify to generate shap explanations like inthis exampleorthisI can’t find any examples specific to huggingface transformers, but from the documentation it looks like it may just be a  matter of passing text_config with granularity = “token”?
2022-05-11T06:42:02Z
Let me check with the AWS Team. I haven’t used SageMaker Clarify yet.
2022-05-11T17:02:09Z
@MaximusDecimusMeridithe AWS team shared with me this example:github.comaws/amazon-sagemaker-examples/blob/main/sagemaker_processing/fairness_and_explainability/text_explainability/text_explainability.ipynb{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Explaining text sentiment analysis using SageMaker Clarify"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    " 1. [Overview](#Overview)\n",
    " 1. [Prerequisites and Data](#Prerequisites-and-Data)\n",
    "     1. [Initialize SageMaker](#Initialize-SageMaker)\n",
    "     1. [Loading the data: Women's Ecommerce clothing reviews Dataset](#Loading-the-data:-Women's-ecommerce-clothing-reviews-dataset) \n",
    "     1. [Data preparation for model training](#Data-preparation-for-model-training) \n",
    " 1. [Train and Deploy Hugging Face Model](#Train-and-Deploy-Hugging-Face-Model)\n",
    "     1. [Train model with Hugging Face estimator](#Train-model-with-Hugging-Face-estimator)\n",This file has been truncated.show originali haven’t looked at it. So would be nice if you could report back on this and the experience
2022-05-11T19:57:56Z
Great thanks
2022-05-12T01:09:59Z
@philschmidIt looks great, haven’t gone through in detail yet but this is the output from running itimage1920×1023 244 KBAre there any native HF tools for explainability? I know there’sexBERTbut it looks more like a UI tool for now. Is there anything for getting token level explanation programatically? I’ve found a few independently made tools:LinkLinkLinkBut is there anything directly in HF to do this?Thanks
2022-05-12T06:47:15Z
Nice!And no we currently have nothing from HF directly.