News Recommender System with Online Reinforcement Learning

Table of Content

General Info

We implemented a News Recommender System with an Online Reinforcement Learning approach, based on MIND dataset. Our first challenge was how to extract information from news texts and categories that represent precisely the data. Second challenge was how to formulate problem in a RL literature. Finally, we had to figure out how to train the model in offline manner.

Features

  • Designed a Deep Q-Network model using Pytorch
  • Deployed and tracked the model using the MLFlow tool
  • Developed a very straightforward back-end using FastAPI
  • Wrote a Dockerfile and dockerized the whole project

Technologies

  • python = 3.9
  • pandas = 1.4.1
  • numpy = 1.22.2
  • nltk = 3.7
  • fastapi = 0.75.0
  • uvicorn = 0.17.5
  • mlflow = 1.24.0
  • torch = 1.11.0

Setup

Dataset

  • Download MIND large dataset
  • Create 'dataset' directory
  • Create 'train', 'dev', and 'test' directories inside 'dataset' directory
  • Copy Training Set, paste it in 'train' directory
  • Copy Validation Set, paste it in 'dev' directory
  • Copy Test Set, paste it in 'test' directory

Dependencies

  • Install Poetry -> pip install poetry
  • Remove 'poetry.lock' file
  • Install dependencies -> poetry install

Features

  • Run 'features.py' -> python src/features.py

Server

  • Run 'run.py' -> uvicorn run:app

Front-End

  • Open 'front/code.html' in Chrome

MLFlow

  • Run mlflow -> mlflow ui

Screenshots

Project Front-End Sample


Reward Cumulative Sum Metric Chart

About Us

We are RecBrain, four data science enthusiasts:

Gather together in Rahnema College Machine Learning Internship Program with mentorship of Matin Zivdar.

Acknowledgement

Special thanks to Matin Zivdar for his sincerely guidance and mentorship.
Many thanks to Rahnema College for their fantastic internship program, Azin Azarkar, Yasin Orouskhani, and everyone else who helped us through this project.