> ## Documentation Index
> Fetch the complete documentation index at: https://docs.maia.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Classify

Production use of this feature is only available on specific Maia plans. [Contact our Sales team](https://www.maia.ai/contact-us) for more information.

\<table><tbody><tr><td>Project Availability</td>
            \<td /></tr>
          \<tr><td>Component Type</td>
            \<td>Transformation</td></tr>
          \<tr><td>Connection Inputs</td>
            \<td>One</td></tr>
          \<tr><td>Connection Outputs</td>
            \<td>Unlimited</td></tr></tbody></table>

The **Classify** transformation component uses the Google BigQuery [AI.CLASSIFY](https://docs.cloud.google.com/bigquery/docs/reference/standard-sql/bigqueryml-syntax-ai-classify) function and a Google Gemini model to assign each row of your input data to one or more categories that you define.The component takes text from a single input column and adds a column to the output that contains the category, or categories, assigned to each row.### Use caseThis component lets you sort unstructured text into categories in your transformation pipeline. For example, you can use it to:* Classify customer reviews or survey comments by sentiment or theme.
* Route support tickets or emails by topic.
* Tag articles or descriptions with every topic that applies, using the **Multi** output mode.> [!NOTE]
>
> The component calls the model once for each input row, so running it on large tables can incur significant inference costs. Usage is also subject to Google BigQuery's [generative AI quotas](https://docs.cloud.google.com/bigquery/quotas#generative_ai_functions). To view these charges, read [Track costs](https://docs.cloud.google.com/bigquery/docs/generative-ai-overview#track_costs).***## PrerequisitesThe Google Cloud service account that calls the Gemini model must have the [Agent Platform User](https://docs.cloud.google.com/iam/docs/roles-permissions/aiplatform#aiplatform.user) role (`roles/aiplatform.user`). Which service account this is depends on the **Agent platform connection** property:- **Agent platform connection left blank:** Google BigQuery calls the model as the Google Cloud service account that your Maia environment uses to access Google BigQuery. This is the service account in the [cloud provider credentials](https://docs.maia.ai/docs/guides/cloud-credentials.md) associated with the environment or, for a [Hybrid SaaS](https://docs.maia.ai/docs/guides/hybrid-saas-bigquery.md) environment with no associated credentials, the Maia runner's own service account.
- **Agent platform connection set:** Google BigQuery calls the model as the service account of the Google BigQuery connection. To create a connection and grant its service account the required role, read [Run generative AI queries with a Google BigQuery Connection](https://docs.cloud.google.com/bigquery/docs/permissions-for-ai-functions#run-connect).***## Properties**Name** `string` *required*A human-readable name for the component.**Model** `drop-down` *required*Select the Gemini model to use. The following options are currently available:- `gemini-3.5-flash`
- `gemini-3.1-flash-lite`
- `[Custom]`: Use a Gemini model that isn't listed here, which you name in **Custom model**.Google serves `gemini-3.5-flash` and `gemini-3.1-flash-lite` only from multi-regional endpoints. Read the [AI.CLASSIFY](https://docs.cloud.google.com/bigquery/docs/reference/standard-sql/bigqueryml-syntax-ai-classify#arguments) documentation to learn which endpoint Google BigQuery uses for the location your query runs in.**Custom model** `string` *required*The name of the Gemini model to use—for example, `gemini-3.7-flash`. Read the [AI.CLASSIFY](https://docs.cloud.google.com/bigquery/docs/reference/standard-sql/bigqueryml-syntax-ai-classify#arguments) documentation for the Gemini models that Google BigQuery supports.This property is only available when **Model** is set to **\[Custom]**.**Input column** `drop-down` *required*Select the input column that contains the text to classify. Only text (`STRING`) columns are listed.**Categories** `column editor` *required*The categories that the model can assign to each row. For each category, enter:- **Label:** The name of the category. Every category must have a label, and each label must be unique. Labels that differ only in case count as the same label.
- **Description:** An optional description that tells the model what the category means. You can describe some categories and leave others without a description.Enter at least two categories and no more than 100. To handle input that doesn't closely match any category, consider adding an `Other` category.Toggle **Text mode** on at the bottom of the dialog to open a multi-line editor that lets you add items in a single block. For more information, read [Text mode](https://docs.maia.ai/docs/guides/components-overview.md#text-mode).To use grid variables, toggle **Use Grid Variable** on. For more information, read [Grid variables](https://docs.maia.ai/docs/guides/grid-variables.md).**Output mode** `drop-down` *required*- **Single:** Assigns each row exactly one category, as a `STRING` value. This is the default setting.
- **Multi:** Assigns each row every category that applies, as an `ARRAY<STRING>` value. The array is empty when no category applies.**Agent platform connection** `string`The Google BigQuery connection to use to call the model, in the format `<project_id>.<location>.<connection_id>`—for example, `myproject.us.myconnection`. Leave this blank to call the model as the Google Cloud service account that your environment uses to access Google BigQuery.**Include input columns** `boolean` *required*- **Yes:** Outputs both your source input columns *and* the new category column. This also includes input columns that aren't selected in **Input column**. This is the default setting.
- **No:** Only outputs the new category column.**Result column name** `string` *required*The name of the column that holds the category or categories for each row. The default is `category`.When **Include input columns** is set to **Yes**, the name must be different from the names of the input columns, ignoring case.## Explanation of outputThe output contains the input columns (if **Include input columns** is set to **Yes**), followed by the category column, named by **Result column name**. The category column's contents depend on **Output mode**:- **Single:** A `STRING` value containing the category that best fits the row.
- **Multi:** An `ARRAY<STRING>` value containing every category that applies to the row, or an empty array if no category applies.A row whose model call fails doesn't stop the run. Its category is NULL, and the output doesn't show why the call failed. The run fails only if the model call fails for every row.> [!WARNING]
>
> In **Multi** mode, a failed row's `NULL` becomes an empty array when sampled or written to a table, so it looks the same as a row that matches no category. Check your output for rows with an empty array before you rely on the results.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.