Mike Limcaco, Analytics Specialist / Customer Engineer at Google
Measure trends in a particular topic or search term across Google Search across the US down to the city-level. Integrate these data signals into analytic pipelines to drive product, retail, media (video, audio, digital content) recommendations tailored to your audience segment. We'll discuss how Google unique datasets can be used with Google Cloud smart analytic services to process, enrich and surface the most relevant product or content that matches the ever-changing interests of your local customer segment.
Data Con LA 2022 - Using Google trends data to build product recommendations
1.
2. Presented by: Mike Limcaco
Contributions: Lexi Flynn & Bryan Rutkowski
2022 August 13
DataCon LA 2022
Trends To Recommendations
Using Google trends data to build product recommendations
5. How can we tap into what’s trending &
continuously promote new, interesting and
relevant content?
1. Aggregate trending search interest
2. Turn these into smart searches against our product catalog(s)
3. Filter, sort and rank to further refine results
6. Leverage Google-Unique Data & APIs
To Drive Personalized Discovery
Data Signals
Aggregated search trend data across
geographic focus areas
Retail Search
Power your ecommerce site or
application with Google-quality
search capabilities
Vertex AI Matching Engine
Use innovative semantic matching
features to improve search results
7. Data Signals
Aggregated search trend data across
geographic focus areas
Retail Search
Power your ecommerce site or
application with Google-quality
search capabilities
Vertex AI Matching Engine
Use innovative semantic matching
features to improve search results
Leverage Google-Unique Data & APIs
To Drive Personalized Discovery
8. What is BigQuery Data Signals?
Google Trends
Data Signals
BigQuery Public
Datasets
Program
Insights for Everyone
Marketing
How do I optimize my paid media spend
when it comes to search term bidding?
Merchandising & Demand Forecasting
How can I understand demand trends to
make better assortment planning decisions?
Executives
How is the business performing across all of
our markets? Against competitors?
Supply Chain
How do I manage supply chain logistics and
distribute inventory better?
10. Data Signals
Aggregated search trend data across
geographic focus areas
Retail Search
Power your ecommerce site or
application with Google-quality
search capabilities
Vertex AI Matching Engine
Use innovative semantic matching
features to improve search results
Leverage Google-Unique Data & APIs
To Drive Personalized Discovery
11. Assistant
Text search
Google Cloud Retail Search
High-Quality Product Search Results as a Service
Typeahead
Product Catalog
User Events, Logs
Custom LTR Models
Query Understanding
Web + Structured Index
Pricing Updates
Business / Config Rules
Your
Team
Retail
Search
12. Data Signals
Aggregated search trend data across
geographic focus areas
Retail Search
Power your ecommerce site or
application with Google-quality
search capabilities
Vertex AI Matching Engine
Use innovative semantic matching
features to improve search results
Leverage Google-Unique Data & APIs
To Drive Personalized Discovery
13. Google Cloud Vertex AI: Matching Engine
Scalable & cost-effective Vector similarity matching service
Low Latency
Find nearest neighbors in milliseconds
Scalable
Scales to billions of vectors
Cost Effective
Requires fewer VMs to serve the same workload
● 1/4th the CPU consumption of faiss
● 1/3rd the memory consumption of nmslib Google’s technology (labelled ScaNN) compared
with popular ANN services
Scalable Nearest Neighbors
https://ai.googleblog.com/2020/07/announcing-scann-efficient-vector.html
16. Putting it all together
Signal
Gather trending search
data (Trends) via Google
Cloud BigQuery
Enrich
Leverage AI / NLP
services to enrich the
term (entity processing)
Search
Search your product
catalog with enriched
terms
Refine
Refine results by scoring
against additional
semantic relevance
17. Putting it all together
Signal
Gather trending search
data (Trends) via Google
Cloud BigQuery
Enrich
Leverage AI / NLP
services to enrich the
term (entity processing)
Search
Search your product
catalog with enriched
terms
Refine
Refine results by scoring
against additional
semantic relevance
BigQuery Vertex AI / Retail Search Vertex AI
Natural Language
18. Google Data Signals (BQ)
Search Term 1 | Location | DateTime
Search Term 2 | Location | DateTime
Search Term ...
Extract entities
Salience
Wikipedia / KG
BigQuery
Filter &
Enrichment
Refine
End User or
App Experience
Product Catalog
1B 3
Catalog-ID 1 | Title | Description
Catalog-ID 2 | Title | Description
. ..
Terms
Enriched
Terms
Enriched Search (Example Only):
select Catalog-ID from Catalog where
Metadata like ‘<Search Term>’ and
Genre = “<Genre>”
Semantically Relevant
Video Watch List
Search
Retail AI
Search
2
Natural
Language API
Vertex AI
Vector Similarity
1A
Putting it all together
20. Example: Man United
Wikipedia: Manchester United Football Club, commonly referred to as Man United, or
simply United, is a professional football club based in the Old Trafford area of
Manchester, England. The club competes in the Premier League, the top division in
the English football league system.
https://trends.google.com/trends/explore?geo=US-CA-803&q=man%20united
https://en.wikipedia.org/wiki/Manchester_United_F.C.
21. Trending in Los Angeles
“Manchester United”
Retail
Ticketing & Live Events
Video / OTT Streaming
You might like …
22. Video / OTT: Trends Influencing Top Shelf
1. Respond to community search trends / interest in “Man United”
○ Sports team touring and visiting Los Angeles
2. Generate search candidates against sample Catalog
(movielens.org)
○ Return Movies & Products involving Manchester United FC
3. Create a tailored “Recommended / Hot” Shelf on App Landing page
○ Filter to include Products that are thematically related (sports,
football / soccer, documentary, action etc)
34. {
"id": "103661",
"title": "United",
"description": "United is based on the true story of Manchester United's
legendary Busby Babes, the youngest side ever to win the
Football League and the 1958 Munich Air Crash that claimed
eight of the their number. …."
"tags": [... "football (soccer)", "manchester united",
"historical event", "sports documentary"]
. . ..
}
Example catalog (extract)
https://movielens.org/
https://www.themoviedb.org/
39. ”Man United” related video
content & movies where core
metadata matches (token
match) but there is content
here that is potentially
thematically “distant”
https://console.cloud.google.com/ai/retail
42. "United is based on the true story of Manchester
United's legendary Busby Babes”
"Iron Man and Captain America battle to keep the
Red Skull and his triggerman, Taskmaster, from
unleashing an army”
"The Invincible Iron Man and the Incredible Hulk
must join forces to save the Earth from its
greatest threat yet”
Encoder
https://github.com/GoogleCloudPlatform/vertex-ai-samples/tree/main/notebooks/official/matching_engine
[-2.70270444e-02, -3.13250013e-02, 6.68615196e-03 …]
[8.240270444e-03, -5.11250213e-02, 7.68615196e-03 …]
[-7.60240444e-01, 4.28360013e-03, 7.68615196e-03 …]
43. "United is based on the true story of Manchester
United's legendary Busby Babes”
"Iron Man and Captain America battle to keep the
Red Skull and his triggerman, Taskmaster, from
unleashing an army”
"The Invincible Iron Man and the Incredible Hulk
must join forces to save the Earth from its
greatest threat yet”
Encoder
https://github.com/GoogleCloudPlatform/vertex-ai-samples/tree/main/notebooks/official/matching_engine
Input: Catalog Text Fragments (60K)
● Movie Title
● Movie Description
● Genres
● Tags
1
44. "United is based on the true story of Manchester
United's legendary Busby Babes”
"Iron Man and Captain America battle to keep the
Red Skull and his triggerman, Taskmaster, from
unleashing an army”
"The Invincible Iron Man and the Incredible Hulk
must join forces to save the Earth from its
greatest threat yet”
Encoder
https://github.com/GoogleCloudPlatform/vertex-ai-samples/tree/main/notebooks/official/matching_engine
Input: Catalog Text Fragments (60K)
● Movie Title
● Movie Description
● Genres
● Tags
[-2.70270444e-02, -3.13250013e-02, 6.68615196e-03 …]
[8.240270444e-03, -5.11250213e-02, 7.68615196e-03 …]
[-7.60240444e-01, 4.28360013e-03, 7.68615196e-03 …]
Output: Embeddings (Vectors)
● Example: Leverage sentence-t5-base
● 60K Vectors @ 768 Dimensions
NLP Model (Transformer)
Prebuilt (HuggingFace, TFHub)
Custom (Two Tower, Swivel)
1 2
45. "United is based on the true story of Manchester
United's legendary Busby Babes”
"Iron Man and Captain America battle to keep the
Red Skull and his triggerman, Taskmaster, from
unleashing an army”
"The Invincible Iron Man and the Incredible Hulk
must join forces to save the Earth from its
greatest threat yet”
Encoder
https://github.com/GoogleCloudPlatform/vertex-ai-samples/tree/main/notebooks/official/matching_engine
Input: Catalog Text Fragments (60K)
● Movie Title
● Movie Description
● Genres
● Tags
[-2.70270444e-02, -3.13250013e-02, 6.68615196e-03 …]
[8.240270444e-03, -5.11250213e-02, 7.68615196e-03 …]
[-7.60240444e-01, 4.28360013e-03, 7.68615196e-03 …]
Output: Embeddings (Vectors)
● Example: Leverage sentence-t5-base
● 60K Vectors @ 768 Dimensions
NLP Model (Transformer)
Prebuilt (HuggingFace, TFHub)
Custom (Two Tower, Swivel)
1 2
3
Vertex AI
Matching
Engine
Index & Deploy!
46.
47. from google.cloud import aiplatform
aiplatform.init()
my_index_endpoint = aiplatform.MatchingEngineIndexEndpoint(index_endpoint_name=<ID Here>)
from sentence_transformers import SentenceTransformer
NLP_MODEL = 'sentence-transformers/sentence-t5-base'
model = SentenceTransformer(NLP_MODEL)
search_term = 'Man United' # OPTIONAL: add text data from Enrichment Phase
query_sentences = [search_term]
embedding = model.encode(query_sentences)
DEPLOYED_INDEX_ID = "my_movielens_ndx_001"
response = my_index_endpoint.match(deployed_index_id=DEPLOYED_INDEX_ID,
queries=embedding,
num_neighbors=10)
print(response)
https://github.com/GoogleCloudPlatform/vertex-ai-samples/tree/main/notebooks/official/matching_engine
Python >= 3.6
48. from google.cloud import aiplatform
aiplatform.init()
my_index_endpoint = aiplatform.MatchingEngineIndexEndpoint(index_endpoint_name=<ID Here>)
from sentence_transformers import SentenceTransformer
NLP_MODEL = 'sentence-transformers/sentence-t5-base'
model = SentenceTransformer(NLP_MODEL)
search_term = 'Man United' # OPTIONAL: add text data from Enrichment Phase
query_sentences = [search_term]
embedding = model.encode(query_sentences)
DEPLOYED_INDEX_ID = "my_movielens_ndx_001"
response = my_index_endpoint.match(deployed_index_id=DEPLOYED_INDEX_ID,
queries=embedding,
num_neighbors=10)
print(response)
https://github.com/GoogleCloudPlatform/vertex-ai-samples/tree/main/notebooks/official/matching_engine
Python >= 3.6
49. from google.cloud import aiplatform
aiplatform.init()
my_index_endpoint = aiplatform.MatchingEngineIndexEndpoint(index_endpoint_name=<ID Here>)
from sentence_transformers import SentenceTransformer
NLP_MODEL = 'sentence-transformers/sentence-t5-base'
model = SentenceTransformer(NLP_MODEL)
search_term = 'Man United' # OPTIONAL: add text data from Enrichment Phase
query_sentences = [search_term]
embedding = model.encode(query_sentences)
DEPLOYED_INDEX_ID = "my_movielens_ndx_001"
response = my_index_endpoint.match(deployed_index_id=DEPLOYED_INDEX_ID,
queries=embedding,
num_neighbors=10)
print(response)
https://github.com/GoogleCloudPlatform/vertex-ai-samples/tree/main/notebooks/official/matching_engine
Python >= 3.6
50. from google.cloud import aiplatform
aiplatform.init()
my_index_endpoint = aiplatform.MatchingEngineIndexEndpoint(index_endpoint_name=<ID Here>)
from sentence_transformers import SentenceTransformer
NLP_MODEL = 'sentence-transformers/sentence-t5-base'
model = SentenceTransformer(NLP_MODEL)
search_term = 'Man United' # OPTIONAL: add text data from Enrichment Phase
query_sentences = [search_term]
embedding = model.encode(query_sentences)
DEPLOYED_INDEX_ID = "my_movielens_ndx_001"
response = my_index_endpoint.match(deployed_index_id=DEPLOYED_INDEX_ID,
queries=embedding,
num_neighbors=10)
print(response)
https://github.com/GoogleCloudPlatform/vertex-ai-samples/tree/main/notebooks/official/matching_engine
Python >= 3.6
51. [[MatchNeighbor(id='movielens-68194', distance=0.16755491495132446),
MatchNeighbor(id='movielens-185867', distance=0.16838324069976807),
MatchNeighbor(id='movielens-195337', distance=0.1685701608657837),
MatchNeighbor(id='movielens-145921', distance=0.17106527090072632),
MatchNeighbor(id='movielens-81676', distance=0.17208701372146606),
MatchNeighbor(id='movielens-103661', distance=0.17541170120239258),
MatchNeighbor(id='movielens-183153', distance=0.18686127662658691),
MatchNeighbor(id='movielens-147436', distance=0.1904624104499817),
MatchNeighbor(id='movielens-176405', distance=0.1911325454711914),
MatchNeighbor(id='movielens-6618', distance=0.1932288408279419)]]
Cosine Distance = 1 — Cosine Similarity
Man United
Iron Men
56. Commentary & Summary
1. Overall Strategy
a. Trending Data Signals (Search) to “seed” Content Recommendations
b. Search Engine (Google Cloud Retail Search AI) to gather candidates
c. Vector Similarity (Google Cloud Vertex AI) to rank sort candidates
2. Part of larger solution!
a. Ex: Use collaborative filtering (or other) to gauge user interest / engagement
b. Good for cold-start or content-heavy approach
3. More details available
a. https://console.cloud.google.com/marketplace/product/bigquery-public-datasets/google-search-trends
b. https://cloud.google.com/solutions/retail-product-discovery
c. https://cloud.google.com/vertex-ai/docs/matching-engine/overview