您必须先为项目启用 AutoML Natural Language,然后才能使用该功能。打开 AutoML Natural Language 界面并选择项目。该应用将引导您完成必要的步骤(具体步骤也会在下文为您介绍)。
设置项目
- 登录您的 Google Cloud 帐号。如果您是 Google Cloud 新手,请创建一个帐号来评估我们的产品在实际场景中的表现。新客户还可获享 $300 赠金,用于运行、测试和部署工作负载。
- 安装 Google Cloud CLI。
-
如需初始化 gcloud CLI,请运行以下命令:
gcloud init
-
创建或选择 Google Cloud 项目。
-
创建 Google Cloud 项目:
gcloud projects create PROJECT_ID
-
选择您创建的 Google Cloud 项目:
gcloud config set project PROJECT_ID
-
-
确保您的 Google Cloud 项目已启用结算功能。了解如何检查项目是否已启用结算功能。
-
Enable the AutoML and Cloud Storage APIs:
gcloud services enable storage-component.googleapis.com
automl.googleapis.com storage-api.googleapis.com - 安装 Google Cloud CLI。
-
如需初始化 gcloud CLI,请运行以下命令:
gcloud init
-
创建或选择 Google Cloud 项目。
-
创建 Google Cloud 项目:
gcloud projects create PROJECT_ID
-
选择您创建的 Google Cloud 项目:
gcloud config set project PROJECT_ID
-
-
确保您的 Google Cloud 项目已启用结算功能。了解如何检查项目是否已启用结算功能。
-
Enable the AutoML and Cloud Storage APIs:
gcloud services enable storage-component.googleapis.com
automl.googleapis.com storage-api.googleapis.com - 将
PROJECT_ID
环境变量设置为项目 ID。export PROJECT_ID=PROJECT_ID
AutoML API 调用和资源名称中包含您的项目 ID。PROJECT_ID
环境变量提供了一种指定此 ID 的便捷方式。
创建 Cloud Storage 存储分区
创建一个 Cloud Storage 存储分区,用于执行 AutoML Natural Language 任务,例如导入训练数据。该存储分区必须位于 us-central1
区域或 eu
多区域位置。
us-central1
的存储分区要求:
- 位置类型:
Region
- 位置:
us-central1
- 存储类别:
Standard
(Cloud Storage 浏览器中有时显示为Regional
)
eu
的存储分区要求:
- 位置类型:
Multi-region
- 位置:
eu
- 存储类别:
Standard
(Cloud Storage 浏览器中有时显示为Multi-Regional
)