building a real-time recommendation engine @lyonwj william ... · building a real-time...

51
OSCON 2017 William Lyon @lyonwj Building a real-time recommendation engine with Neo4j

Upload: others

Post on 28-May-2020

12 views

Category:

Documents


0 download

TRANSCRIPT

OSCON 2017

William Lyon@lyonwj

Building a real-time recommendation engine with Neo4j

Agenda

•••

• Use cases• Recommender systems

• Hands-on!• Graph data modeling• Cypher

Neo4j

Graph Database

•••••

Graph Data Model

Labeled Property Graph Model

Labeled Property Graph Model

openCypher

(queryLanguage)-[:FOR]->(graphs)

Cypher

Use Case: Personalized Recommendations

Personalized Promotions Personalized Real-Time Recommendations

Personalized Real-Time Recommendations

Data-Model (Expressed as

a graph)

Category

Category

Product

Product

Product

Collaborative FilteringAn algorithm that considers users

interactions with products, with the assumption that other users will

behave in similar ways.

Algorithm Types

Content BasedAn algorithm that considers

similarities between products and categories of products.

Customer

Customer

Product

Product

Product

Purchases

RELATIONAL DB WIDE COLUMN STORE

Views

DOCUMENT STORE

User Review

RELATIONAL DB

In-Store Purchase

Shopping Cart

KEY VALUE STORE

Product Catalogue

DOCUMENT STORE

Category Price ConfigurationsLocation

Polyglot Persistence

Purchase ViewReviewReturn In-store PurchasesInventory LocationCategory Price ConfigurationsLocation Purchase ViewReviewReturn In-store PurchasesInventory

Products Customers / Users

Location

Data Lake

Purchases

RELATIONAL DB

Product Catalogue

DOCUMENT STORE WIDE COLUMN STORE

Views

DOCUMENT STORE

User Review

RELATIONAL DB

In-Store Purchase

Shopping Cart

KEY VALUE STORE

Recommendations require an operational workload — it’s in the moment, real-time!

Good for Analytics, BI, Map ReduceNon-Operational, Slow

Queries

Purchases

RELATIONAL DB

Product Catalogue

DOCUMENT STORE WIDE COLUMN STORE

Views

DOCUMENT STORE

User Review

RELATIONAL DB

In-Store Purchase

Shopping Cart

KEY VALUE STORE

Connector

Drivers: Java |  JavaScript |  Python |  .Net |  PHP |  Go |  Ruby

Apps and Systems

Real-Time Queries

Graph-based recommendations

Collaborative Filtering

Collaborative Filtering

Collaborative Filtering

Collaborative Filtering

In Cypher

In Cypher

Content Filtering

Content Filtering

Content Filtering w/ Cypher

Content Filtering - Concept Hierarchy

Content Filtering - Concept Hierarchy

Content Filtering - Concept Hierarchy

Content Filtering - Concept Hierarchy w/ Cypher

Content Filtering - Concept Hierarchy w/ Cypher

● →○○

● →○○

Click “Neo4j Browser”

You should see this:

Neo4j Browser● Query workbench /

visualization for Neo4j● Interactive “guides” for

our tutorial today● Embed content, queries

(you)-[:HAVE]->(?)(?)<-[:ANSWERS]-(will)