Domain Attention Model proposed in paper "Domain Attention Model for Multi-Domain Sentiment Classification" (link), which is accepted by Knowledge Based Systems.
Multi-Domain Sentiment Dataset (version 2.0)
The dataset we used is unprocessed.tar.gz which contains the original data.
For example, you can use the following command to test the model in the MDSD dataset:
python model.py
The parameter settings are list in SharedData which is defined in model.py.
The run-log files of 3 repeated runs (using the default parameters in the scripts) can be found in /run-logs folder, which give the following accuracy results:
| Domain | Books | DVD | Electronics | Kitchen |
|---|---|---|---|---|
| Run1 | 0.8762 | 0.8663 | 0.8663 | 0.8911 |
| Run2 | 0.8861 | 0.8614 | 0.8713 | 0.8960 |
| Run3 | 0.8960 | 0.8614 | 0.8713 | 0.8960 |
The results reported in the paper are averaged through ten runs (10-fold cross validation), which maybe slightly different from the above results.
Notice: you should first download the MDSD dataset and glove word vectors to run this code. The glove version we used is glove.6B.zip.
data_helper.pydata loader for the MDSD datasetmodel.pythe domain attention model, train and testutils.pymisc util functions
For any issues, you can contact me via yuanzg14@mails.tsinghua.edu.cn