In this talk, we present how SU has used Dato Graphlab-Create along with Apache Storm to build a minimum viable online pipeline for computing item similarity over item attributes – a key component in contextual recommendations.
5. Recommendations – Matching User With Content
1. Understand User
2. Understand Content
3. Recommend
4. Get Feedback
TELEVISON
MUSIC
TRENDING
FRIENDS
LIKEMINDED
USERS
EXPERTS
ANIMALS
DOGS
PHOTOGRAPHY
MOVIES
ARTS
HUMOR
8. • Problem:
– Recommend Items based on the topics discovered in the current
page a user is on
• Strategies:
– Find semantically similar items
– Find items that dig further into a specific topic
– Find items that dig further into a broader topic
– Others…
Problem
9. • Very quick “Ingestion to Recommendation” turn around
time (x10 seconds)
– Adopt stream processing with at-least-once processing guarantees
– Build idempotent subsystems
– Capitalize on non-linearity wherever possible
• Low latency retrieval of recs (x10 ms)
– Pre-compute recs
– Retrieve recs in θ(1) time
• Horizontally scalable design
– Utilize distributed processing systems/data stores
Constraints/SLAs
10. • (Offline) Utilize a high quality dataset to build a topic model
• (Online) For each URL ingested,
– Extract text features that summarize the documents
• Use pre-built topic models for
– Filtering noisy keywords
– Finding general topics
– Finding specific topics
– Computing topic hashes
• Compute similarity/relevance
• Store for quick retrieval
Approach Overview
12. Topic Modeling
3Blei, David M., Andrew Y. Ng, and Michael I. Jordan. "Latent dirichlet allocation." the Journal of machine Learning research 3 (2003): 993-1022.
image courtesy: http://parkcu.com/blog/latent-dirichlet-allocation/
13. • Similar to constrained clustering, LDA
can be run with topic associations4.
• Perform hierarchical/agglomerative
clustering on SU’s taxonomy to obtain
K=75 clusters of topic sets.
• Use the topic sets as possible labels
for the latent topic z
• The words themselves are not learnt
for the specific topic they have been
mapped to.
LDA with Topic Associations
4Andrzejewski, David, and Xiaojin Zhu. “Latent Dirichlet Allocation with topic-in-set knowledge.” Proceedings of the NAACL HLT 2009 Workshop on Semi-Supervised Learning for
Natural Language Processing. Association for Computational Linguistics, 2009.
15. • Choose relevant topics
– Rank/Threshold by to get
• Filtering noisy tags
– Rank/Threshold by
• Getting specific words
– Rank/Threshold by
• Getting general words
– Rank/Threshold by
Using the Topic Models
17. • Allows fast prototyping on a single machine
– Python Interface to a C++ backend
– Scalable Data Structures (Tabular and Graphs) made available
– Out-of-core implementation of standard ML algorithms
– Makes basic Data Engineering and Visualization tasks easy
• Easy to deploy micro services (predictive services) around
models built using Graphlab create/pandas/scikit-learn.
– REST-ful API hosted over a Tornado server
– Distributed cache
– Amazon Cloudwatch for monitoring (for AWS deploys)
• (Con) Debugging the service can be difficult
Graphlab-Create II
18. • Distributed Realtime Computation System
– Fault Tolerant, Scalable and Guaranteed Processing
– Master --> Zookeeper --> Worker Nodes
• Workers
– Spout Stream sources
– Bolt Computation units
• Data Flow
– Streams Unbounded sequence of Tuples
– Topologies A network of spouts and bolts
Storm Basics5
5http://www.slideshare.net/ptgoetz/cassandra-and-storm-at-health-market-sceince
19. Architecture
URLs
Webpage
Surveyor
Service
TMS*
Models
HTML
to
Text
Text
to
(Tags
,
Concepts)
Merge
1.
Topic
Model
Query
2.a.
Load
ES
2.b.
Get
Similar
Items
3.
Load
Similar
Items
for
quick
lookup
Build
Topic
Model
Fetch
Page
HTML
To
S3
SIMILAR
ITEM
TOPOLOGY
KaXa
Broker
*TMS
–
Topic
Model
Service
Get
Similar
Items
20. • Number of Storm Workers: 3
• Number of ES Nodes: 3
• Training:
– Document Size: 2M
– Vocabulary: 400K
– Time: ~8s/iteration (16 cores)
• Predictive service performance:
– Peak requests handled: 200/min
– Avg response time: 110 ms
• URL Turn around time: 10s
• Number of URLs ingested: 70/min
Some Numbers I