Use Google BigQuery & Gemini AI For Data Analytics

Google Cloud Tech · Beginner ·🧠 Large Language Models ·2y ago

Key Takeaways

This video demonstrates how to use Google BigQuery and Gemini AI for data analytics, showcasing the integration of BigQuery with Vertex AI and the Gemini large language model family to analyze unstructured, semi-structured, and structured data using SQL.

Full Transcript

by now you've probably had more than one aha or magical moments thanks to a large language model or llm whether it was chatting with Google Gemini on a browser or mobile app or calling the Gemini API with a prompt What If instead of asking Gemini one question at a time you could prompt it to help you analyze your big query data row by row and at scale in this video you'll see how you can use bigquery's integration with vertex Ai and Google's large language model family Gemini to analyze your unstructured semi-structured and structured data to gain new insights and enable novel analytical applications Gemini can help you analyze your data in several ways including text summarization rephrasing of text feature extraction and sentiment analysis it can also help generate new content for data enhancement such as turning a zip code into a city the Gemini family of models also has options that handle multimodal input meaning a combination of text and image or video this unlocks additional use cases such as object recognition captioning or description of images and videos digital content understanding and for information seeking by combining World Knowledge with information extracted from images or videos however applying these use cases to a large data set say thousands of product images or customer reviews would be a complex task requiring code and infrastructure management luckily bigquery's integration with the Gemini models through vertex AI solves these challenges allowing you to interact with Gemini using SQL and taking advantage of the scale of big query getting started with Gemini follows two highl steps first you'll create a model in big query ml that references the model endpoint once the model is created you can call the model On Demand with a SQL select statement using the ml. generate text function this example shows creating a model that references Gemini Pro which handles text input and generates text as a response if you're planning to use a multimodal model that handles both Visual and text input such as Gemini Pro Vision you'll first make your visual data such as videos or images available as a big query object table object tables are readon tables that reference unstructured data objects residing and cloud storage once created each row of the object table corresponds to an object and the table columns correspond to the object metadata generated by cloud storage including any custom metadata creating the multimodal model is similar to the text model as you only need to update the options to reference the multimodal endpoint calling the model with ml. generate text does have slightly different requirements for multimodal models the text prompt moves out of the select statement and into the struct itself and the same prompt is applied to each row of the referenced object table okay let's go to a demo to see this in action in this demo I'll be analyzing a set of movie poster images to understand more about the movies they represent the multimodal Gemini Pro Vision model will accept the image as an input and will be prompted to identify the movie represented by the poster and its year of release then the Gemini pro model will take that movie title in year as text input and will be prompted to provide a text summary I'm working inside of an embedded notebook directly in bigquery Studio which is an environment where we can combine python SQL and even command line tools like g-cloud and BQ to perform analysis there are a few setup steps for working with vertex AI models in bigquery these include enabling the vertex Ai and bigquery connection apis creating a cloud resource connection and then granting the vertex AI user role to the service account used by the cloud resource connection next I'll add our movie poster images to an object table first first I'm creating a data set to hold the new table and then I'm using the create external table statement to create a table linked to the Google Cloud Storage bucket that houses the images now I'll create the Gemini remote models in bigquery ml firstly I'm creating a remote model pointing to the Gemini pro model endpoint which I'll save in my new data set and name Gemini Pro I'll do the same thing with a second model this time pointing to the Gemini provision model inpoint and I'll name it Gemini provision now if I go to the Explorer pane in the big query console and refresh the contents you can see I now have the new data set with the movie posters object table as well as the Gemini Pro and Gemini Prov vision remote models let's use them to do some analysis the first thing I'll do is use the Gemini provision model to help understand the images I can send requests to the model by using the ml. generate text function referencing the model in the parameters the function syntax when used with the vision model expects an object table in the table parameter I'll provide a text prompt within the function struct in this case I'm asking the model to determine the movie represented in the poster and to provide the movie title in year of release specifying that that response must be returned in Json format once the execution is complete I can take a look at a few sample responses and their structure I'll use sequal to pull out the movie title and release year from these responses into new columns what if I wanted a bit more information about each of these movies say a tech summary of the movie This content generation use case is perfect for the Gemini pro model again I'm using the ml. generate text function this time referencing the Gemini Pro remote model the table parameter will be a select statement that pulls the movie title and year into a prompt and ask the Gemini model to provide a movie summary note that the prompt for Gemini Pro can be unique to each row and incorporate data from The Columns of the table as I'm doing here with the title in columns it also requires the prompt to be provided in its own column named prompt and contained within the table parameter this is slightly different syntax from the previous query to the Gemini provision model where the prompt was provided in the struct in the results I now have the image URI title year and movie summary provided by the Gemini pro model this data could be saved to a table or used in further Downstream analysis say joining it with other data such as movie reviews for sentiment analysis Gemini's ability to turn unstructured data into a structured format enables you to draw novel insights and join that data with your structured data for even more possibilities accessing Gemini via bigquery ml means you can do this at scale without complex code needing ml expertise or ever leaving your data warehouse try it for yourself check out the documentation and more resources Linked In the description below

Original Description

Experience the magic of Large Language Models (LLMs) like Gemini, applied to your Google BigQuery data at scale! BigQuery Vertex AI integration empowers you to use the Gemini models to analyze unstructured, semi-structured, and structured data - using just SQL. Try AI vector search and Gemini embedding to analyze data at scale. In this video, you'll learn how Gemini models can help you generate new insights, enrich your datasets, and even analyze multimodal content including images, videos, and text. You'll see an end-to-end demo in BigQuery Studio that analyzes a dataset of images, generating structured content and fusing in world knowledge to augment data understanding. Ready to transform your analysis? Dive into the world of Gemini models for your BigQuery exploration and use Gemini AI for data analytics. Resources: Try Gemini in Vertex AI → https://goo.gle/4bKd193 Upload the notebook to try for yourself → https://goo.gle/bq-gemini-demo Learn more in the documentation → https://goo.gle/bqml-generate-text Read the blog on BigQuery integration with Gemini 1.0 Pro → https://goo.gle/bqml-gemini-pro-blog Read the blog on BigQuery integration with Gemini 1.0 Pro Vision → https://goo.gle/bqml-gemini-pro-vision-blog Subscribe to Google Cloud Tech → https://goo.gle/GoogleCloudTech #gemini #googlecloud
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 how to use Google BigQuery and Gemini AI for data analytics, demonstrating the integration of BigQuery with Vertex AI and the Gemini large language model family to analyze unstructured, semi-structured, and structured data using SQL. The video showcases the potential of LLMs in data analytics and provides a step-by-step guide on how to get started with Gemini. By watching this video, viewers can learn how to apply LLMs to data analytics, craft effective prompts, and integrate

Key Takeaways
  1. Create a model in BigQuery ML that references the Gemini model endpoint
  2. Call the model on demand with a SQL select statement using the ml.generate_text function
  3. Create an object table to store visual data such as images or videos
  4. Use the ml.generate_text function to prompt the Gemini model to analyze the visual data
  5. Use the Gemini Pro model to generate text summaries of the analyzed data
💡 The integration of BigQuery with Vertex AI and the Gemini large language model family enables users to analyze unstructured, semi-structured, and structured data using SQL, making it possible to apply LLMs to data analytics at scale without complex code or ML expertise.

Related Reads

📰
How Pulse matches you with the right provider — semantic AI search vs keyword lookup. BizNode Pulse uses embedding-based...
Learn how BizNode Pulse uses semantic AI search to match clients with the right service providers, outperforming traditional keyword-based systems
Dev.to AI
📰
Prompt Chaining: How to Break Down Complex Tasks Into Simple Steps
Learn to break down complex tasks into simple steps using prompt chaining for LLMs, improving model performance and output quality
Dev.to AI
📰
High-Performance MoE Inference: Qwen3.6–35B-A3B on an AI PC with OpenVINO
Run high-performance MoE inference with Qwen3.6–35B-A3B on an AI PC using OpenVINO and INT4 quantization
Medium · Machine Learning
📰
The Use Of Ai In Today’s World
Discover how AI is transforming industries and daily life in today's world
Medium · Deep Learning
Up next
5 Levels of AI Agents - From Simple LLM Calls to Multi-Agent Systems
Dave Ebbelaar (LLM Eng)
Watch →