위치

AutoML Natural Language는 프로젝트의 리소스(데이터 세트 및 모델)가 저장되고 처리되는 위치를 제어할 수 있습니다. 특히 저장 데이터를 저장하고 EU에서만 머신러닝 처리를 수행하도록 AutoML Natural Language를 구성할 수 있습니다.

기본적으로 AutoML Natural Language는전역 위치에 리소스를 저장하고 처리하므로 AutoML Natural Language를 사용한다고 해서 리소스가 특정 위치 또는 리전 내에 유지된다고 보장되는 것은 아닙니다. EU 위치를 선택하면 Google은 EU에서만 데이터를 저장하고 머신러닝을 수행합니다. 개발자와 사용자는 어디에서든 데이터에 액세스할 수 있습니다.

AutoML Natural Language UI에서 위치 설정

새 데이터 세트를 만들 때 데이터 세트 이름을 입력하는 텍스트 상자 바로 아래에 있는 드롭다운 목록을 사용해 데이터 세트의 위치를 지정합니다. 해당 데이터 세트를 사용해 학습된 모델이 동일한 위치에 생성됩니다.

데이터 세트와 모델의 각 목록 페이지에는 선택한 위치의 모든 리소스를 표시하는 데 사용할 수 있는 위치 드롭다운 목록이 있습니다.

API를 사용하여 위치 설정

AutoML Natural Language는 전역 API 엔드포인트(automl.googleapis.com)와 EU 엔드포인트(eu-automl.googleapis.com)를 모두 지원합니다. 데이터를 EU에서만 저장하고 처리하려면 REST API 호출에 automl.googleapis.com 대신 eu-automl.googleapis.com URI를 사용하세요.

AutoML API를 사용하는 경우 위치와 고유 ID가 포함된 전체 리소스 이름을 사용하여 리소스를 식별합니다. 예를 들어 데이터 세트의 리소스 이름은 projects/{project-id}/locations/{location}/datasets/{dataset-id} 형식을 따릅니다. 전역 위치에 저장된 리소스는 {location} 변수를 us-central1 값으로 바꾸세요. EU 위치에 저장된 리소스의 경우 {location} 변수를 eu 값으로 바꿉니다.

클라이언트 라이브러리를 사용하여 위치 설정

기본적으로 AutoML 클라이언트 라이브러리는 전역 API 엔드포인트(automl.googleapis.com)에 액세스할 수 있습니다. EU에서만 데이터를 저장하고 처리하려면 엔드포인트를 명시적으로 설정해야 합니다. 아래의 코드 샘플은 이 설정을 구성하는 방법을 보여줍니다.

Python

AutoML Natural Language용 클라이언트 라이브러리를 설치하고 사용하는 방법은 AutoML Natural Language 클라이언트 라이브러리를 참조하세요. 자세한 내용은 AutoML Natural Language Python API 참조 문서를 참조하세요.

AutoML Natural Language에 인증하려면 애플리케이션 기본 사용자 인증 정보를 설정합니다. 자세한 내용은 로컬 개발 환경의 인증 설정을 참조하세요.

from google.cloud import automl_v1beta1 as automl

# You must first create a dataset, using the `eu` endpoint, before you can
# call other operations such as: list, get, import, delete, etc.
client_options = {"api_endpoint": "eu-automl.googleapis.com:443"}

# Instantiates a client
client = automl.AutoMlClient(client_options=client_options)

# A resource that represents Google Cloud Platform location.
# project_id = 'YOUR_PROJECT_ID'
project_location = f"projects/{project_id}/locations/eu"

Java

AutoML Natural Language용 클라이언트 라이브러리를 설치하고 사용하는 방법은 AutoML Natural Language 클라이언트 라이브러리를 참조하세요. 자세한 내용은 AutoML Natural Language Java API 참조 문서를 참조하세요.

AutoML Natural Language에 인증하려면 애플리케이션 기본 사용자 인증 정보를 설정합니다. 자세한 내용은 로컬 개발 환경의 인증 설정을 참조하세요.

AutoMlSettings settings =
    AutoMlSettings.newBuilder().setEndpoint("eu-automl.googleapis.com:443").build();

// Initialize client that will be used to send requests. This client only needs to be created
// once, and can be reused for multiple requests. After completing all of your requests, call
// the "close" method on the client to safely clean up any remaining background resources.
AutoMlClient client = AutoMlClient.create(settings);

// A resource that represents Google Cloud Platform location.
LocationName projectLocation = LocationName.of(projectId, "eu");

Node.js

AutoML Natural Language용 클라이언트 라이브러리를 설치하고 사용하는 방법은 AutoML Natural Language 클라이언트 라이브러리를 참조하세요. 자세한 내용은 AutoML Natural Language Node.js API 참조 문서를 참조하세요.

AutoML Natural Language에 인증하려면 애플리케이션 기본 사용자 인증 정보를 설정합니다. 자세한 내용은 로컬 개발 환경의 인증 설정을 참조하세요.

const automl = require('@google-cloud/automl').v1beta1;

// You must first create a dataset, using the `eu` endpoint, before you can
// call other operations such as: list, get, import, delete, etc.
const clientOptions = {apiEndpoint: 'eu-automl.googleapis.com'};

// Instantiates a client
const client = new automl.AutoMlClient(clientOptions);

// A resource that represents Google Cloud Platform location.
const projectLocation = client.locationPath(projectId, 'eu');