Giter VIP home page Giter VIP logo

rnn_recsys's Introduction

rnn_recsys

Our implementation of one research paper "Embedding-based News Recommendation for Millions of Users" https://dl.acm.org/citation.cfm?id=3098108 Shumpei Okura, Yukihiro Tagami, Shingo Ono, and Akira Tajima. 2017. In Proceedings of the 23rd ACM SIGKDD International Conference on Knowledge Discovery and Data Mining (KDD '17).

I provide a toy demo dataset to demonstrate the file format. On this dataset, model AVG has an AUC of 0.76, and model RNN has an AUC of 0.92. You can reproduce this simply by running 'python train.py' . Sorry that I cannot upload my own real-world dataset (Bing News).

Overall, this recommender system has two steps: (1) train an autoencoder for articles ; (2) train RNN base on user-item interactions.

training autoencoder

The raw article has a format of "article_id \t category \t title". I will first build a word dictionary to hash the word to ids and count the TF-IDF statistics. The input for training autoencoder is the TF-IDF values of each article (title). Below is a result of my trained CDAE. (scripts can be found in helper/demo.py): alt text Analysis: I am really surprised by the great power of autoencoder. News titles are usually very short, but autoencoder can recover their intent. For example, for the first news, the input content is 'Travel tips for thanksgiving', our decoded words are (ordered by importance) 'tips, travel, holidays, thanksgiving, enjoy, shopping, period'. Note that the words 'holidays' and 'shopping' do not appear in the original title, but there are captured as strongly related words.

training curve of error:

alt text

training curve of loss:

alt text

training autoencoder

After training the autoencoder, you need to encode each raw article to get their embeddings:

encode_articles(...)

Finally, train your RNN recsys:

train_RS()

data description:

data/articles.txt: each line is an article, in the form of word_id:word_tf_idf_value

data/articles_CDAE.txt: each line is 3 articles, splited by tab, article_01 and article_02 belong to a same category, while article_03 belongs to a different category

data/RS/articles_embeddings.txt: each line is an article, in the form of article_ID \t embedding_vector (D float numbers, where D denotes the dimension of embedding)

data/RS/train.txt: each line is a training instance, in the form of user_history \t target_item_id \t label. user_history is a sequence of item_id, splited by space.

articles_TFIDF_norm_3w.txt format: each line is one document, such as 14 17513:1.00 27510:0.81 , representing article_id \TAB word_id01:value \ SPACE word_id02:value \SPACE ....

rnn_recsys's People

Contributors

leavingseason avatar

Watchers

Shubham Pachori 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.