File size: 1,355 Bytes
4efe144
 
 
 
 
 
 
 
 
 
 
dddf97f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
---
title: Ai Academy 2024 Gr8 Recommender Api
emoji: 📉
colorFrom: green
colorTo: pink
sdk: docker
pinned: false
license: mit
---

Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference

# ai-academy-2024-group8

A lightweight backend API for song recommender.

Dataset used in this project is public and available from [online](https://www.kaggle.com/datasets/undefinenull/million-song-dataset-spotify-lastfm)

## What's in here

- `data/`: Contains the trained `model.pkl` and related `model.csv` that has the training set in csv format
- `notebooks/`: Contains any jupyter notebooks used in the project
- `recommendation-api/`: A FastAPI app to serve user recommendations

## Running service locally

1. (Optional) Create an activate python venv
2. Install the requirements `pip install -r requirements.txt`
3. Start the service `python recommendation-api/server.py`

Then 

- `curl http://localhost:7860/users` to fetch list of supported users
- `curl http://localhost:7860/users/<id>` to fetch track history for individual user
- `curl http://localhost:7860/recommend/<id>` to recommend tracks for the specific user

## Running in Huggingface

Application is built and started on push to master.

Application is available from [here](https://schibsted-ai-academy-2024-gr8-recommender-api.hf.space/docs)