| [ Web Proxy ] |
| Viewing: https://dataframes.bigquery.dev/reference/api/bigframes.bigquery.ai.html | [Back] [Original] |
Section Navigation
Integrate BigQuery built-in AI functions into your BigQuery DataFrames workflow.
The bigframes.bigquery.ai module provides a Pythonic interface to leverage BigQuery MLs
generative AI and predictive functions directly on BigQuery DataFrames and Series objects.
These functions enable you to perform advanced AI tasks at scale without moving data
out of BigQuery.
Key capabilities include:
Generative AI: Use bigframes.bigquery.ai.generate() (Gemini) to
perform text analysis, translation, or
content generation. Specialized versions like
generate_bool(),
generate_int(), and
generate_double() are available for structured
outputs.
Embeddings: Generate vector embeddings for text using
generate_embedding(), which are essential for
semantic search and retrieval-augmented generation (RAG) workflows.
Classification and Scoring: Apply machine learning models to your data for
predictive tasks with classify() and
score().
Forecasting: Predict future values in time-series data using
forecast().
Example usage:
>>> import bigframes.pandas as bpd
>>> import bigframes.bigquery as bbq
>>> df = bpd.DataFrame({
... "text_input": [
... "Is this a positive review? The food was terrible.",
... ],
... })
>>> # Assuming a Gemini model has been created in BigQuery as 'my_gemini_model'
>>> result = bq.ai.generate_text("my_gemini_model", df["text_input"])
For more information on the underlying BigQuery ML syntax, see: https://cloud.google.com/bigquery/docs/reference/standard-sql/bigqueryml-syntax-ai-generate-bool
Functions
|
Classifies a given input into one of the specified categories. |
|
Creates embeddings from text or image data in BigQuery. |
|
Forecast time series at future horizon. |
|
Returns the AI analysis based on the prompt, which can be any combination of text and unstructured data. |
|
Returns the AI analysis based on the prompt, which can be any combination of text and unstructured data. |
|
Returns the AI analysis based on the prompt, which can be any combination of text and unstructured data. |
|
Creates embeddings that describe an entityfor example, a piece of text or an image. |
|
Returns the AI analysis based on the prompt, which can be any combination of text and unstructured data. |
|
Generates a table using a BigQuery ML model. |
|
Generates text using a BigQuery ML model. |
|
Evaluates the prompt to True or False. |
|
Computes a score based on rubrics described in natural language. |
|
Returns a FLOAT64 value that represents the cosine similarity between the two inputs. |
Copyright 2019, Google.
Created using Sphinx 8.1.3.
Built with the PyData Sphinx Theme 0.19.0.
| Web Proxy Viewer | New URL | Original Page |