What are text embeddings?

Google Cloud Tech · Intermediate ·📐 ML Fundamentals ·1y ago

Key Takeaways

This video explores the concept of embeddings in machine learning, specifically text embeddings, and how they can be used to represent complex data as numerical representations. The video covers the basics of embeddings, including how they are generated, their properties, and their applications, including searching and retrieving relevant information from unstructured data.

Full Transcript

so Jason what are we going to break down in this video well AA let's go for embeddings great because sometimes I get asked what the heck is an embedding and the really simple answer is that it's a way to represent something interesting like text or an image or video as a big AR R of numbers and we call those raised vectors because math but why use those numbers what do they actually represent well let's say you're making a vector for a cat and a vector for a dog the vector encodes attributes of things like does it have legs and does it have fur but if you added another Vector for a house it would not have fur or legs but it would have a roof each Vector has Dimensions which are essentially the number of numeric components in the vector representing those attributes if we imagine our vectors is only two numbers we can also plot them on a graph and you could see that similar things like dog and cat are closer together and house is far away from both of them in reality embedding vectors can have thousands of numbers and embeddings are generated using a model usually by calling an API and different models return different embeddings and work on different kinds of data which one you should use depends on your data oh and one important note embeddings are deterministic for a given input embedding model will always return the same output it sometimes helps to think of them as hashes this is different from the inference models you may be more familiar with like Gemini that are non-deterministic if you supply the same prompt to an inference model you aren't guaranteed to get the same response back every time it gets even cooler when you think about multimodal embeddings so we talked about data science for a while but how do I convert images and pixels into vectors and capture their meaning based on content and not just the pixels in it this is the power of embedding algorithms they can organize unstructured data into what we call a semantic space so great we've established that embedding are simple arrays of numbers that represent something they're often very very large arrays but at their core they're just arrays of numbers but what are they actually good for well think about searching through unstructured data if you've encoded the meaning of a thing into the embedding you can find all of the pictures of dogs or even the pictures of a specific breed of dog this process allows you to view unstructured elements in a structured way enabling you to search within what we call that semantic space and it works because all of them use the same model for embedding I didn't fully Gra this concept until I built out a rag system for the first time and I started retrieving relevant information from a vector database to help the llm generate more relevant responses you can use your embedding code to generate an embedding of the user's input and then use that embedding to find similar items in your database and the similarity is not just based on pixels or words but can also be based on meeting depending on your embedding model all own up to the fact that when I did my first app that needed embeddings I went and found the first tutorial that looked like it would work and followed the instructions uh I think it used gecko however there are many embedding models and choosing the right one involves several factors such as how you will break up or chunk your input these decisions are crucial it's funny because a lot of the questions would boil down to what are you actually trying to achieve and come back to the use case if you're using something like llama index it offers a number of chunking strategies that you can choose from and I like to think of embeddings here as layers of information so imagine you're going to break down a book you might have embeddings at the sentence level at the paragraph level and even the chapter level analyzing the chapter might yield very different insights compared to analyzing individual sentences and this is where the manage search is valuable however you still really have to understand your data and what it impacts your data and also your goals your data chunks need to be useful for the specific application let's look at some code to demonstrate how you can create embeddings there are many ways to create embeddings and one of the cool ones is to use PG vector and alloy DB to create embeddings directly from the database here's a simple SQL oneliner to do just that you can also create embeddings in a language like python here's an example of creating a multimodal embedding with python and then showing the vector that it returns if you want to learn more about embeddings you can check out a great blog post on the Google Cloud blog that breaks down the concepts even more than we did here there's also a code lab on creating embeddings with gecko that you can check out to get a walkthr of creating your first embeddings for text Data check out the links below with that signing off this is AA and Jason in real terms for AI thanks for joining

Original Description

Code lab → https://goo.gle/48fmoxj Vector embeddings → https://goo.gle/3Y0XNY6 This video explores the world of embeddings in machine learning, explaining how they transform complex data like text and images into numerical representations. Watch along as Aja and Jason from Google delve into real-world use cases and demonstrate the power of embeddings. Chapters: 0:00 - Intro 0:31 - What are vectors? 1:57 - Practical applications of embeddings 2:52 - Creating embeddings 3:47 - Demo 4:12 - Learn more Watch more Real Terms for AI → https://goo.gle/AIwordsExplained Subscribe to Google Cloud Tech → https://goo.gle/GoogleCloudTech #GenerativeAI #GoogleCloud Speakers: Aja Hammerly, Jason Davenport Products Mentioned: Cloud - AI and Machine Learning - Vertex AI
Watch on YouTube ↗ (saves to browser)
Sign in to unlock AI tutor explanation · ⚡30

Playlist

Uploads from Google Cloud Tech · Google Cloud Tech · 0 of 60

← Previous Next →
1 I’m going for it #GoogleCloudCertified
I’m going for it #GoogleCloudCertified
Google Cloud Tech
2 I had to get #GoogleCloudCertified
I had to get #GoogleCloudCertified
Google Cloud Tech
3 Be better overall at what you do #GoogleCloudCertified
Be better overall at what you do #GoogleCloudCertified
Google Cloud Tech
4 Cloud Monitoring on our radar #Analysis #Uptime
Cloud Monitoring on our radar #Analysis #Uptime
Google Cloud Tech
5 Introduction to Generative AI Studio
Introduction to Generative AI Studio
Google Cloud Tech
6 How to use Github Actions with Google's Workload Identity Federation
How to use Github Actions with Google's Workload Identity Federation
Google Cloud Tech
7 Introduction to Responsible AI
Introduction to Responsible AI
Google Cloud Tech
8 Networking updates and CDMC-certified architecture
Networking updates and CDMC-certified architecture
Google Cloud Tech
9 Create and use a Cloud Storage bucket
Create and use a Cloud Storage bucket
Google Cloud Tech
10 How to digitize text from documents
How to digitize text from documents
Google Cloud Tech
11 Faster analytical queries with AlloyDB
Faster analytical queries with AlloyDB
Google Cloud Tech
12 Next ‘23 sessions and FaaS Wave
Next ‘23 sessions and FaaS Wave
Google Cloud Tech
13 Introduction to Assured Open Source Software
Introduction to Assured Open Source Software
Google Cloud Tech
14 BigQuery Cost Optimization: Storage
BigQuery Cost Optimization: Storage
Google Cloud Tech
15 BigQuery Cost Optimization: Compute
BigQuery Cost Optimization: Compute
Google Cloud Tech
16 BigQuery Cost Optimization: Select Queries
BigQuery Cost Optimization: Select Queries
Google Cloud Tech
17 Remote Field Equipment Management with Manufacturing Data Engine
Remote Field Equipment Management with Manufacturing Data Engine
Google Cloud Tech
18 Supercharging your applications with Cloud SQL Enterprise Plus
Supercharging your applications with Cloud SQL Enterprise Plus
Google Cloud Tech
19 Vector Support on our radar #GenAI
Vector Support on our radar #GenAI
Google Cloud Tech
20 Architecting a blockchain startup with Google Cloud
Architecting a blockchain startup with Google Cloud
Google Cloud Tech
21 Kubernetes and multitasking updates!
Kubernetes and multitasking updates!
Google Cloud Tech
22 GKE: Using Kubernetes Events
GKE: Using Kubernetes Events
Google Cloud Tech
23 How to configure firewall rules for Cloud Composer
How to configure firewall rules for Cloud Composer
Google Cloud Tech
24 Vertex AI Embeddings API + Matching Engine: Grounding LLMs made easy
Vertex AI Embeddings API + Matching Engine: Grounding LLMs made easy
Google Cloud Tech
25 Geospatial analytics on our radar #EarthEngine #BigQuery
Geospatial analytics on our radar #EarthEngine #BigQuery
Google Cloud Tech
26 Ensuring requests are set in Kubernetes
Ensuring requests are set in Kubernetes
Google Cloud Tech
27 Cloud Next 2023, Google research program, and more!
Cloud Next 2023, Google research program, and more!
Google Cloud Tech
28 How to migrate projects between organizations with Resource Manager
How to migrate projects between organizations with Resource Manager
Google Cloud Tech
29 How to run #MySQL in Google Cloud
How to run #MySQL in Google Cloud
Google Cloud Tech
30 #GenerativeAI for enterprises and #Next2023
#GenerativeAI for enterprises and #Next2023
Google Cloud Tech
31 How Google Photos scales to store 4 trillion photos and videos
How Google Photos scales to store 4 trillion photos and videos
Google Cloud Tech
32 Google Cross-Cloud Interconnect (Demo 2)
Google Cross-Cloud Interconnect (Demo 2)
Google Cloud Tech
33 GKE Cost Optimization Golden Signals: Introduction
GKE Cost Optimization Golden Signals: Introduction
Google Cloud Tech
34 GKE Cost Optimization Golden Signals: Workload Rightsizing
GKE Cost Optimization Golden Signals: Workload Rightsizing
Google Cloud Tech
35 GKE Load Balancing: Overview
GKE Load Balancing: Overview
Google Cloud Tech
36 GKE Load Balancing: Best Practices
GKE Load Balancing: Best Practices
Google Cloud Tech
37 Disaster Recovery in GKE
Disaster Recovery in GKE
Google Cloud Tech
38 How to configure IP masquerade agent in GKE Standard clusters
How to configure IP masquerade agent in GKE Standard clusters
Google Cloud Tech
39 Enable and use GKE Control plane logs
Enable and use GKE Control plane logs
Google Cloud Tech
40 Compliance in Australia with Assured Workloads
Compliance in Australia with Assured Workloads
Google Cloud Tech
41 Creating budgets and budget alerts in Google Cloud #FinOps
Creating budgets and budget alerts in Google Cloud #FinOps
Google Cloud Tech
42 Cloud SQL Enterprise Plus on our radar #mySQL
Cloud SQL Enterprise Plus on our radar #mySQL
Google Cloud Tech
43 What's Next for Google Cloud?
What's Next for Google Cloud?
Google Cloud Tech
44 How Loveholidays scaled with Contact Center AI
How Loveholidays scaled with Contact Center AI
Google Cloud Tech
45 What is fleet team management in GKE?
What is fleet team management in GKE?
Google Cloud Tech
46 Troubleshoot VPC Network Peering
Troubleshoot VPC Network Peering
Google Cloud Tech
47 Introduction to DocAI and Contact Center AI
Introduction to DocAI and Contact Center AI
Google Cloud Tech
48 Cloud Run Direct VPC egress explained
Cloud Run Direct VPC egress explained
Google Cloud Tech
49 Database deployment options in GKE
Database deployment options in GKE
Google Cloud Tech
50 Analyze cloud billing data with #BigQuery
Analyze cloud billing data with #BigQuery
Google Cloud Tech
51 Tips to becoming a world-class Prompt Engineer
Tips to becoming a world-class Prompt Engineer
Google Cloud Tech
52 Serverless is simple. Do I need CI/CD?
Serverless is simple. Do I need CI/CD?
Google Cloud Tech
53 Accelerating model deployment with MLOps
Accelerating model deployment with MLOps
Google Cloud Tech
54 How Hawaii's Department of Human Services scaled with CCAI
How Hawaii's Department of Human Services scaled with CCAI
Google Cloud Tech
55 Pricing API on our #Radar
Pricing API on our #Radar
Google Cloud Tech
56 How Recommendations AI for Media can boost customer retention
How Recommendations AI for Media can boost customer retention
Google Cloud Tech
57 Troubleshooting: Node Not Ready Status
Troubleshooting: Node Not Ready Status
Google Cloud Tech
58 One weekend until Cloud Next 2023!
One weekend until Cloud Next 2023!
Google Cloud Tech
59 #GoogleCloudNext starts tomorrow!
#GoogleCloudNext starts tomorrow!
Google Cloud Tech
60 #GoogleCloudNext will be demand!
#GoogleCloudNext will be demand!
Google Cloud Tech

This video teaches the basics of embeddings, including how they are generated, their properties, and their applications. It also covers how to create embeddings using different models and APIs, and how to integrate them into a machine learning pipeline.

Key Takeaways
  1. Understand the concept of embeddings and their properties
  2. Choose an embedding model and API
  3. Create embeddings using the chosen model and API
  4. Integrate embeddings into a machine learning pipeline
  5. Apply embeddings to represent complex data
  6. Use embeddings as input features for supervised learning models
💡 Embeddings can be used to represent complex data as numerical representations, enabling efficient searching and retrieval of relevant information from unstructured data.

Related Reads

📰
If You Learn Slowly Enough, You Won’t Need to Learn Anything—Applying the TabFM Prediction Framework to Quantitative Trading
Apply the TabFM prediction framework to quantitative trading by leveraging its ability to make predictions in context, reducing the need for complex feature engineering and hyperparameter tuning
Dev.to AI
📰
Python Functions : A Beginner-Friendly Guide
Learn to write reusable and efficient Python functions with this beginner-friendly guide
Medium · Python
📰
"Hallucination" Is Three Different Bugs. We Keep Filing Them as One.
Learn to identify and address three distinct bugs related to hallucination in AI models, improving overall model reliability and performance
Dev.to · Whetlan
📰
Your Computer Doesn’t Understand Python. Here’s What Actually Happens When You Hit “Run”
Discover how computers execute Python code despite not understanding it, and why this matters for programming
Medium · Machine Learning

Chapters (6)

Intro
0:31 What are vectors?
1:57 Practical applications of embeddings
2:52 Creating embeddings
3:47 Demo
4:12 Learn more
Up next
Arrays vs Lists: What AI Actually Prefers | Common Tech Interview Questions
SCALER
Watch →