Skip to content

ylpiao-7276/Book_Recommender

 
 

Repository files navigation

BookRecommender

##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
  1. BooksRecommend.py: Import datasets, train model then save it.
  2. my_recommend.py: Load trained model and personal ratings to get recommendtation.
  3. personalRatings.txt: A text file to save personal ratings.
  4. prepare_data.py: Pre-process datasets to adjust the model.
  5. rate_books.py: Generate personalRatings.txt according to users's ratings.
  6. server.py: Webserver to show the result of recommendation.
  7. templates/: The folder to store html files, which are used to build the web page.

##Requirements:

  1. pyspark
  2. python2 or python3
  3. flask
  4. numpy

##Usage:

  1. Set path of spark home. E.g.export SPARK_HOME=/path/to/spark/home
  2. run webserver by python server.py
  3. If the trained model is needed, you can run BooksRecommend.py in pyspark using the command subprocess.call(['/path/to/BookRecommend.py','/path/to/books.csv and ratings.csv','/path/to/personalRatigns.txt'])

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 84.9%
  • HTML 15.1%