Choose a natural language processing function
This document provides a comparison of the natural language processing functions
available in BigQuery ML, which are ML.GENERATE_TEXT
, ML.TRANSLATE
,
and ML.UNDERSTAND_TEXT
.
You can use the information in this document to help you decide which function
to use in cases where the functions have overlapping capabilities.
At a high level, the difference between these functions is as follows:
-
ML.GENERATE_TEXTis a good choice for performing customized natural language processing (NLP) tasks at a lower cost. This function offers more language support, faster throughput, and model tuning capability, and also works with multimodal models. -
ML.TRANSLATEis a good choice for performing translation-specific NLP tasks where you need to support a high rate of queries per minute. -
ML.UNDERSTAND_TEXTis a good choice for performing NLP tasks that are supported by the Cloud Natural Language API.
Function comparison
Use the following table to compare the ML.GENERATE_TEXT
, ML.TRANSLATE
, and ML.UNDERSTAND_TEXT
functions:
ML.GENERATE_TEXT
ML.TRANSLATE
ML.UNDERSTAND_TEXT
Perform any NLP task by passing a prompt to a Gemini or partner model or to an open model .
For
example, to perform a question answering task, you could provide a prompt
similar to CONCAT("What are the key concepts in the following article?: ", article_text)
.
Incurs BigQuery ML charges for data processed. For more information, see BigQuery ML pricing .
Incurs Vertex AI charges for calls to the model. If you are using a Gemini 2.0 or greater model, the call is billed at the batch API rate. For more information, see Cost of building and deploying AI models in Vertex AI .
Incurs charges for calls to the Cloud Translation API. For more information, see Cloud Translation API pricing .
Incurs BigQuery ML charges for data processed. For more information, see BigQuery ML pricing .
Incurs charges for calls to the Cloud Natural Language API. For more information, see Cloud Natural Language API pricing .
EU
and US
multi-regions.EU
and US
multi-regions.
