-
Notifications
You must be signed in to change notification settings - Fork 1
Deployment Guide
Pashalis Grivas edited this page Oct 18, 2021
·
5 revisions
Instructions for setting up recommendation service on Linux OS with Python 3 installed:
-
Set up and run Apache Kafka:
- Follow Step 1 & Step 2 of Apache Kafka Quickstart Guide.
-
Download project files: Run
git clone https://github.com/p17griv/real-time-recommendation-service.git
into a directory in order to download the project. -
Create a python virtual environment inside the directory: (optional) Run
python3 -m venv venv
to create "venv" virtual environment andsource venv/bin/activate
to activate it. -
Install python dependencies:
- Move to "recommendation-service" directory:
cd recommendation-service
. - Run
pip install -r requirements.txt
.
- Move to "recommendation-service" directory:
- Change Kafka address in "kafka_connect.py" file's line 7 and line 17.
-
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".
-
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).
- Run
-
Start "recommendation server module":
python3 recommender.py
. - 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 the recommendation system).