Skip to content

This is a recommender system API built using Golang

Notifications You must be signed in to change notification settings

92amartins/regommender

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Regommender

A simple recommender system API.

Usage

This project relies on Docker Compose for development and deployment.

The command below will spin up two docker containers. The first holds a Redis instance which serves as the backend for this project. The second holds the rest-api itself.

docker-compose up

The api is very simple. Currently it only supports two methods: set_recommendations and get_recommendations.

For setting a recommendation:

curl -X POST 'localhost:8080/recommendation/' -d '{
    "source": "product1",
    "target": "product2",
    "score": 0.78
}'

Then, you can get the recommendation by doing:

curl 'localhost:8080/recommendations/product1'
# ["product2"]

The recommendations are stored in sorted set objects rather than standard Redis keys, so Redis handle recommendations ordering automatically:

curl -X POST 'localhost:8080/recommendation/' -d '{
    "source": "product1",
    "target": "product2",
    "score": 0.78
}'

curl -X POST 'localhost:8080/recommendation/' -d '{
    "source": "product1",
    "target": "product3",
    "score": 0.95
}'

curl 'localhost:8080/recommendations/product1'
# ["product3","product2"]

About

This is a recommender system API built using Golang

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published