This is the repository for the code written for my Master's Thesis. It trains and evaluates an interpretable Recommender System model as described in MThesis_Michael_Buehler.pdf.
All code is stored in the folder Source/. The folder Data/Preprocessed_Data/ stores the data sets (see below). The data from the experiments described in the written part can be found in the folder Results.
The code comes together with all necessary data sets to train the model on a small data set called Wine. The data sets are stored in the folder Data/Preprocessed_Data/Wine/.
The data sets for training the categories Kindle and Magazine Subscriptions can be downloaded here. Store the downloaded and unpacked folders in Data/Preprocessed_Data/.
Please make sure that the following libraries are successfully installed on your system for running the code in 'Source/Model/':
- Theano >= 0.9
- Python 2.7
- Numpy
- Pytorch >= 0.1.12 (to run the sentence embedding model)
To run the code to prepare the data sets (optional) you additionally need:
- NLTK + the 'punkt' package from the NLTK Downloader
-
Add the folder Source/ to your python path. (E.g. run
export PYTHONPATH=$PYTHONPATH:/path/to/RRS/Source
in your terminal.) -
Go to the folder Source/Model/FLIC/ and then run the command
make
. This will construct the file _flm.so which is needed for the FLIC model. -
If you want to train the FLIC model (optional), go to the folder Source/Model/FLIC/. Then you can train the FLIC model by running
python flic.py [OPTIONS]
. We recommend that you have a look at the available options by runningpython flic.py -h
. -
If you want to train the Sentence Embeddings (optional), go to the folder Source/Model/Sentence_Embedding/. Then run
python sentence_embeddings.py [OPTIONS]
. We recommend that you have a look at the avaliable options by runningpython sentence_embeddings.py -h
. -
If you want to train the Recommender System model, go to the folder Source/Model/RRS/. There you can train and evaluate the data set Wine by running
sh run_Wine.sh
. Please have a look at the available options by runningpython rrs.py -h
.
After you have downloaded the data sets Kindle and Magazine Subscriptions (see above), you can train and evaluate the models by runningsh run_Kindle.sh
orsh run_Magazine.sh
.