PINA: Leveraging Side Information in eXtreme Multi-label Classification via Predicted Instance Neighborhood Aggregation, ICML 2023
This folder contains code to train XR-Transformer+PINA models and reproduce experiments in "PINA: Leveraging Side Information in eXtreme Multi-label Classification via Predicted Instance Neighborhood Aggregation".
- Clone the repository and enter
examples/pina
directory. - First create a virtual environment and then install dependencies by running the following command:
pip install libpecos pandas gdown urllib3==1.26.6
If you're unfamiliar with Python virtual environments, check out the user guide.
- Install pyxclib
- Verify pytorch and CUDA:
python -c "import torch; print('torch={}, cuda={}'.format(torch.__version__, torch.cuda.is_available()))"
To train and evaluate PINA+XR-Transformer model, run
chmod a+x ./scripts/*
DATASET="LF-Amazon-131K"
bash scripts/run_pina.sh ${DATASET}
Recommended platform for training: AWS p3.16xlarge instance or equivalent.
[1] XC Repo: http://manikvarma.org/downloads/XC/XMLRepository.html