##Authors:
jf3030, yp2419
##Team ID:
201612-37
##Instruction:
Make the recommendation using the ratings given by previous costumers. Datasets and trained models are too big, so they are not listed here. Using Flask to build a webserver to show the result of recommendtation.
##Architecture and explanations:
Book_Recommender/
├── BookRecommend.py
├── my_recommend.py
├── personalRatings.txt
├── prepare_data.py
├── rate_books.py
├── server.py
└── templates/
├── index.html
├── start.html
└── rate.html
BooksRecommend.py
: Import datasets, train model then save it.my_recommend.py
: Load trained model and personal ratings to get recommendtation.personalRatings.txt
: A text file to save personal ratings.prepare_data.py
: Pre-process datasets to adjust the model.rate_books.py
: GeneratepersonalRatings.txt
according to users's ratings.server.py
: Webserver to show the result of recommendation.templates/
: The folder to store html files, which are used to build the web page.
##Requirements:
- pyspark
- python2 or python3
- flask
- numpy
##Usage:
- Set path of spark home. E.g.
export SPARK_HOME=/path/to/spark/home
- run webserver by
python server.py
- If the trained model is needed, you can run
BooksRecommend.py
inpyspark
using the commandsubprocess.call(['/path/to/BookRecommend.py','/path/to/books.csv and ratings.csv','/path/to/personalRatigns.txt'])