Skip to content

Deployment Guide

Pashalis Grivas edited this page Oct 17, 2021 · 5 revisions

Instructions for setting up recommendation service on Linux OS with Python 3 installed:

  1. Set up and run Apache Kafka:
  2. Download project files: Run git clone https://github.com/p17griv/real-time-recommendation-service.git into a directory in order to download the project.
  3. Create a python virtual environment inside the directory: (optional) Run python3 -m venv venv to create "venv" virtual environment and source venv/bin/activate to activate it.
  4. Install python dependencies:
  5. Change Kafka address in "kafka_connect.py" file's line 7 and line 17.
  6. Modify your application's code in order to publish user-item interactions:
    • Interactions should have the following form: "userid:itemid".
    • Interactions must be published on a topic that it's called "interactions".
  7. Run "model builder" program with the apropriate parameters: python3 modelbuilder.py [interactions_topic] [retrain_frequency] [window_length].
    • Run python3 modelbuilder.py -h for more information about the parameters (optional).
  8. Start "recommendation [server module]"(https://github.com/p17griv/real-time-recommendation-service/blob/main/recommendation-service/recommender.py): python3 recommender.py.
  9. Modify your application's code in order to send GET requests for recommendations (using server's address) with target user's id and desired number of recommended items, as parameters and receive the response (JSON formatted string).

Note Apache Kafka can be also deployed separately from the recommendation system or in cloud (as well as recommendation system).

Clone this wiki locally