Code Monkey home page Code Monkey logo

lda_recengine's Introduction

Latent Dirichlet Allocation Based Recommender System

This is a prototype of a "Semantics-aware" recommender system built on top of LDA, Latent Dirichelet Allocation. A high-level workflow is described in this presentation. This recommender system gives very nice results within a limited training time.

Preparation work

First of all you need to web-crawl any news website or have a corpus of documents. Each document should be like the format below:

Line Sample content Require?
1 http://www.bbc.com/news/entertainment-arts-31164553 Optional
2 Baz Luhrmann to make Netflix musical Required
3 Moulin Rouge director Baz Luhrmann is to make a 13-part musical series for streaming service Netflix.Set in 1970s New York, The Get Down traces how the city gave birth to disco, new wave and hip-hop.It will follow a group of teenagers from downtrodden, crime-ridden South Bronx who find solace in each other and their own musical abilities.Luhrmann will direct the first two episodes, echoing David Fincher's input to Netflix's hit series House Of Cards. Required

A basic corpus of web-crawled BBC News is provided in the repo directory.

Usage

Make sure you have gensim & nltk installed in your python path, this repo depeneds on these libraries.

  • Build model
python /path-to-repo/LDAModel_English.py --dir /path-to-repo/BBCNews

Model building should take minutes to run, depends on how large your corpus is.

  • After the model is generated and saved, now try to get some recommendations:
python /path-to-repo/LDAModel_English.py --shell True
  • You should see something like this image. Enter any post id (positive integer) and you'll be recommended articles based on that id. You may also type comma-separated ids e.g. 123,234,345 to get recommendations based on that combination.

Online Demo

Hee is a simple demo site I built upon using this repo and MEAN stack.


lda_recengine's People

Contributors

easonchan1213 avatar

Watchers

 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.