Before you can use AutoML Translation, you must enable it for your project. Open the AutoML Translation UI and select your project from the drop-down list in the upper right of the title bar. The application walks you through the necessary steps, which are also described below.
Set up your project
- Sign in to your Google Cloud account. If you're new to Google Cloud, create an account to evaluate how our products perform in real-world scenarios. New customers also get $300 in free credits to run, test, and deploy workloads.
-
In the Google Cloud console, on the project selector page, select or create a Google Cloud project.
-
Make sure that billing is enabled for your Cloud project. Learn how to check if billing is enabled on a project.
-
Enable the AutoML and Cloud Storage APIs.
-
In the Google Cloud console, on the project selector page, select or create a Google Cloud project.
-
Make sure that billing is enabled for your Cloud project. Learn how to check if billing is enabled on a project.
-
Enable the AutoML and Cloud Storage APIs.
- Install the
gcloud
command line tool. - Follow the instructions to create a service account and download a key file for that account.
- Set the
GOOGLE_APPLICATION_CREDENTIALS
environment variable to the path to the service account key file that you downloaded when you created the service account.export GOOGLE_APPLICATION_CREDENTIALS=KEY_FILE
- Set the
PROJECT_ID
environment variable to your Project ID.export PROJECT_ID=PROJECT_ID
The AutoML API calls and resource names include your Project ID in them. ThePROJECT_ID
environment variable provides a convenient way to specify the ID. - If you are an owner for your project, add your service account to the AutoML Editor
IAM role, replacing SERVICE_ACCOUNT_NAME with the name of
your new service account. For example,
service-account1@myproject.iam.gserviceaccount.com
.gcloud auth login gcloud projects add-iam-policy-binding $PROJECT_ID \ --member="serviceAccount:SERVICE_ACCOUNT_NAME" \ --role="roles/automl.editor"
- Otherwise (if you are not a project owner), ask a project owner to add both your user ID and your service account to the AutoML Editor IAM role.
Create a Cloud Storage bucket
Create a Google Cloud Storage bucket to store the sentence pairs that you
will use to train your custom model. The bucket name must be in the format:
project-id-vcm
.
The following command creates a storage bucket
in the us-central1
region named
project-id-vcm
.
gsutil mb -p project-id -c regional -l us-central1 gs://project-id-vcm/We recommend the following file structure for your Cloud Storage files:
gs://project-id-vcm/dataset-name/documents/document-name.txt