This repository contains the code for the CausalTAD paper.
- Python 3.9+
- numpy
- pandas
- scipy
- scikit-learn
- causallearn
- openai
- torch
- transformers
- datasets
- peft
- wandb
- tqdm
- pyod
- deepod
- modelscope
- gensim
- inflect
- feature_engine
- ucimlrepo
Create a fresh environment and install all dependencies in one go:
conda create -n causalTAD python=3.10 -y && conda activate causalTAD && pip install -r requirements.txt- Run
python CausalTAD/graph_gen/main.pyto generate the graph. - Based on the algorithm type used in the previous step, select the corresponding code under
CausalTAD/use_graphto perform graph-based ranking and weight generation. - In
CausalTAD/AnoLLM, use the results from the previous step to inject causal knowledge into the language model for training and inference.