Source code for LOX-CDR: Towards Logically Explainable Cross-Domain Recommendation
LOX-CDR is a novel framework for cross-domain recommendation that leverages logical reasoning and large language models to provide explainable recommendations across different domains. This work addresses the cold-start problem in recommender systems by transferring knowledge between domains while maintaining interpretability through logical explanations.
- Logical Explainability: Provides transparent reasoning for cross-domain recommendations using logic-based approaches
- LLM Integration: Leverages the power of large language models for enhanced understanding of user preferences across domains
# Python 3.8 or higher required
python --version
# Install required packages
pip install -r requirements.txt# Clone the repository
git clone https://github.com/bjtu-lucas-nlp/LOX-CDR.git
cd LOX-CDR
# Install dependencies
pip install -e .Our experiments use the Amazon Review Dataset with the following domain pairs:
| Domain Pair | Source β Target | Description |
|---|---|---|
| Pair 1 | Books β Movies | Related domains with similar user interests, Book->Movie |
| Pair 2 | Books β CDs | Related domains with similar user interests, Book->CDs |
| Pair 3 | Movies β CDs | Related domains with similar user interests, Movie->CDs |
# Download and preprocessed datasets
LOX-CDR consists of two main components:
- Cross-domain sentiment-aware paradigm: a cross-domain sentiment-aware paradigm to link aspects from user review feedback and associate preferences across domains
- A logically-interpretable generator: explicitly captures cross-domain reasoning paths.
# With custom parameters
nohup python3 lox_cdr_main.py \
--model_name=Mixtral2-ncf-prefix-GAN-Tune \
--factor_num=128 \
--ncf_layer_num=3 \
--base_model=../../Mistral-7B-Instruct-v0.2 \
--batch_size=48 \
--num_epochs=4 \
--data_path=Data/Amazon/Bk2CD \
--output_dir=Model/book2cd/model \
--training_output=Model/book2cd/sft \
> training_log_Bk2CD.txt 2>&1 &
...- Rating Prediction: MAE, RMSE
- Explainability: Explanation Quality Score
Made by Kezhi Lu at AAII of the University of Technology Sydney, Prof. Jie Lu Lab
