Data and source code for our AAAI'18 paper "Hierarchical Attention Transfer Network for Cross-domain Sentiment Classification"
-
Python 2.7.5
-
Tensorflow-gpu 1.2.1
-
numpy 1.13.3
-
nltk 3.2.1
- OS: CentOS Linux release 7.5.1804
- GPU: NVIDIA TITAN Xp
- CUDA: 8.0
Before you get started, please make sure to add the following to your ~/.bashrc:
Linux:
export PYTHONPATH=/path/to/HATN:$PYTHONPATH
Centos:
setenv PYTHONPATH /path/to/HATN
python extract_pivots.py --train --test -s dvd [source_domain] -t electronics [target_domain] -v [verbose]
python train_hatn.py --train --test -s dvd [source_domain] -t electronics [target_domain] -v [verbose]
./all_train_hatn.sh
If the code is useful for your research, please cite our paper as follows:
@inproceedings{li2018hatn,
author = {Zheng Li and Ying Wei and Yu Zhang and Qiang Yang},
title = {Hierarchical Attention Transfer Network for Cross-Domain Sentiment Classification},
conference = {AAAI Conference on Artificial Intelligence},
year = {2018},
}