multi-domain-sentiment
multi-domain-sentiment copied to clipboard
Code for the paper Learning Domain-specific Representations for Multi-Domain Sentiment Classification
multi-domain-sentiment
A framework for multi-domain sentiment analysis by learning domain-specific representations of input sentences using neural network.
Prerequisite
- Tensorflow
- Google News Embeddings (https://code.google.com/archive/p/word2vec/) (rename it to 'vectors.gz' and put it under the main folder)
- Gensim
Data Preparation
-
Download datasets (e.g. laptops). We assume the datasets are preprocessed into the following format:
The unit does everything it promises . I 've only used it once so far , but i 'm happy with it ||| 1
-
Randomly split each dataset into training (e.g. laptops/trn), development (e.g. laptops/dev) and testing datasets (e.g. laptops/tst). Put all datasets into a folder named 'dataset'. Thus, the directory structure looks like dataset/laptops/trn.
Preprocessing and Run the Demo
-
Run
python preprocessing.py
. This program will iterate through the 'dataset' folder and generate files like dictionaries, embeddings and transformed datasets. -
Run
python multi_view_domain_embedding_memory_adversarial.py dataset_name1 dataset_name2 ...
for running the algorithm.