This code is written in Python 3.7
and requires the packages listed in requirements.txt
.
Clone the repository to your machine and directory of choice.
To run the code, we recommend setting up a virtual environment, e.g. using virtualenv
or conda
:
# pip install virtualenv
cd <path-to-CVDD-PyTorch-directory>
virtualenv myenv
source myenv/bin/activate
pip install -r requirements.txt
cd <path-to-CVDD-PyTorch-directory>
conda create --name myenv
source activate myenv
while read requirement; do conda install -n myenv --yes $requirement; done < requirements.txt
After installing the packages, run python -m spacy download en
to download the spaCy en
library.
You can run CVDD experiments using the main.py
script.
The following are examples on how to run experiments on
Reuters-21578
,
20 Newsgroups
, and
IMDB Movie Reviews
as reported in the paper.
cd <path-to-CVDD-PyTorch-directory>
source myenv/bin/activate # or 'source activate myenv' for conda
cd src
python3 main.py reuters cvdd_Net ../log/test_reuters ../data/reuters0.pt