﻿Follow the steps below to run the code
1. Installation
First, clone this repository and navigate to the project directory. Install the necessary dependencies from the requirements.txt file:
pip install -r requirements.txt


2. Running the Code
To execute the attribution analysis, you can run the Python script directly:
python copy_of_codebase_for_aieg.py


Alternatively, you can follow the instructions in the Jupyter notebook (copy_of_codebase_for_aieg.ipynb), which walks you through the process step by step. The notebook includes the following steps:
* Loading the GPT-2 model and tokenizer.
* Generating summaries for text data (IMDb reviews or Xsum dataset).
* Applying IG and AIEG attribution methods.
* Visualizing the attributions.
3. Using the Jupyter Notebook
Open the notebook (copy_of_codebase_for_aieg.ipynb) to interactively explore the code and run experiments. The notebook is well-documented and contains clear instructions for:
* Loading the pretrained GPT-2 model and dataset.
* Preprocessing text for summarization.
* Running the attribution methods.
* Interpreting the output and visualization.
To open the notebook:
jupyter notebook copy_of_codebase_for_aieg.ipynb


This will launch Jupyter in your browser. You can then execute the cells step by step, following the instructions in the notebook.