This project explores two narrative generation pipelines for Narrative Explainable AI:
- Direct pipeline – a Small Language Model (SLM) is fine-tuned to generate narratives directly from counterfactuals.
- Multi-Narrative Refinement pipeline – two SLMs are trained for two stages: first to produce multiple draft narratives (from the direct pipeline), then to refine them into a coherent explanation (refinement step).
The datasets were synthetically generated with a Large Language Model (LLM) and then distilled into SLMs through fine-tuning.
- Python 3.11.10
- Install Required Python packages using
pip install -r requirements.txt
To fine tune the models you must run
bash finetune.shTo generate the test results you must run
bash test.shor
bash test_refiner.shTo evaluate the results type:
python src/evaluate.pyor
python src/evaluate_with_refiner.pyTo download the datasets please use this link: https://huggingface.co/datasets/Anon30241/model_kd_llm