Git Product home page Git Product logo

recommendation_system_kred's Introduction

KRED: Considerations over Attention and Embeddings

License: MIT

Digital news are arguably ones of the most consumed products by millions of people every day and the importance of a proper recommendation system has always been fundamental for news and press websites. KRED deals with a knowledge graph system, taking in account information from entity’s neighborhood, and refines the entity embedding with dynamic insights depending on the context of the news. This repository proposes two main improvements to the original model: a Multi-Head Attention module and an enrichment of side information encodings, such as category. The dataset used is MIND dataset, created on a huge amount of Microsoft News interactions between users and news.


Table of content


Description

KRED is a knowledge enhanced framework which enhance a document embedding with knowledge information for multiple news recommendation tasks. The framework mainly contains two part: representation enhancement part and multi-task training part.

Two extensions to this model have been implemented:

  1. in the context embedding layer, we enriched the entity emdedding with the news category, consisting of a first general category and a second more specific category
  2. in the information distillation layer, we replaced the self-attention module with a multi-head attention module

The backbone resources of this project are listed in this table, including papers and corresponding GitHub repos.

Paper Title Implementation source
1910.11494 KRED: Knowledge-Aware Document Representation for News Recommendations KRED
2020.acl-main.331 MIND: A Large-scale Dataset for News Recommendation MIND

Setup

Requirements

  1. The code has been tested using the Google Colab environment, running under Python 3.8.10
  2. Multiple NVIDIA GPUs are mandatory to run the model in feasible time but, if you use smaller version of the dataset (MINDsmall), the number of GPUs needed can be reduced; we could run the model with Colab's GPU (Tesla T4 16GB) using MINDsmall

Enviroment

Once the repo is cloned, some python libraries are required to properly setup your (virtual) enviroment.

They can be installed via pip:

    pip install -r requirements.txt

or via conda:

    conda create --name <env_name> --file requirements.txt

Dataset and Features

The dataset explored by KRED is Microsoft News Dataset (MIND), a large-scale dataset collected by anonymized behavior logs of the Microsoft News website. Constructed from the user click logs, MIND contains 1 million users and more than 160k English news articles; in addition, Microsoft has released a smaller version of the original dataset, by randomly sampling 50k users and their behavior logs (MINDsmall).

Each news consists of:

  • News ID
  • Category and Sub-Category
  • Title and a brief Abstract
  • URL of the news
  • List of entities in the Title
  • List of entities in the Abstract

Each entity is characterized by:

  • Label, which the entity is associated to
  • Type of entity, such as person, object ecc.
  • WikidataId of the label
  • Confidence of label
  • Position of first char in the text
  • Entity itself

Getting started

Before running the code, you should check config.yaml and setup all the parameters correctly.

You can perfom the training and testing phases using kred_example.ipynb. If you want to use Colab, download kred_example.ipynb, then upload it on Colab, change runtime to use GPU and follow the instructions in the notebook.


Contacts

Author Mail GitHub
Lorenzo Bergadano [email protected] lolloberga
Stefano Gioda [email protected] Giost
Paolo Rizzo [email protected] polrizzo

recommendation_system_kred's People

Contributors

lolloberga avatar polrizzo avatar danyang-liu avatar giost avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.