빠른 시작: Natural Language API 설정

이 안내서는 Natural Language 사용을 시작하기 위해 필요한 모든 설정 단계를 제공합니다.

Google Cloud 콘솔 정보

Google Cloud 콘솔은 Google Cloud 제품을 사용하는 시스템을 프로비저닝, 구성, 관리, 모니터링하는 데 사용되는 웹 UI입니다. Google Cloud 콘솔을 사용하여 Natural Language 리소스를 설정하고 관리합니다.

프로젝트 만들기

Google Cloud에서 제공하는 서비스를 사용하려면 프로젝트를 만들어야 합니다.

프로젝트는 모든 Google Cloud 리소스를 구성합니다. 프로젝트는 다음 구성요소로 구성됩니다.

  • 공동작업자 그룹
  • 사용 설정된 API 및 기타 도구
  • 모니터링 도구
  • 결제 정보
  • 인증 및 액세스 제어

프로젝트를 하나 또는 여러 개 만들 수 있으며 이를 사용하여 Google Cloud 리소스를 리소스 계층 구조로 구성할 수도 있습니다. 프로젝트에 대한 자세한 내용은 Resource Manager 문서를 참조하세요.

In the Google Cloud console, on the project selector page, select or create a Google Cloud project.

Go to project selector

결제 사용 설정

결제 계정은 지정된 리소스 모음의 결제자를 정의하는 데 사용되며 하나 이상의 프로젝트에 연결할 수 있습니다. 프로젝트 사용량이 연결된 결제 계정으로 청구됩니다. 대부분의 경우 프로젝트를 만들 때 결제를 구성합니다. 자세한 내용은 결제 문서를 참조하세요.

Make sure that billing is enabled for your Google Cloud project.

API 사용 설정

프로젝트에 Cloud Natural Language API를 사용 설정해야 합니다. API 사용 설정에 대한 자세한 내용은 서비스 사용 문서를 참조하세요.

Enable the Cloud Natural Language API.

Enable the API

gcloud CLI 설치 및 초기화

Natural Language API를 사용하려면 gcloud CLI를 설치하고 초기화해야 합니다. gcloud CLI는 Google Cloud에서 호스팅되는 리소스와 애플리케이션을 관리하는 데 사용할 수 있는 도구 집합입니다. 여기에는 gcloud CLI가 포함됩니다. 다음 링크에서 안내를 제공합니다.

After installing the Google Cloud CLI, initialize it by running the following command:

gcloud init

If you're using an external identity provider (IdP), you must first sign in to the gcloud CLI with your federated identity.

인증 설정

API를 사용하는 모든 클라이언트 애플리케이션은 인증되어야 하며 요청된 리소스에 대한 액세스 권한을 받아야 합니다. 인증 설정 방법은 로컬 개발 환경에서 작업 중인지 아니면 프로덕션 환경을 설정 중인지에 따라 다릅니다. 자세한 내용은 애플리케이션 기본 사용자 인증 정보 설정을 참조하세요.

Select the tabs for how you plan to access the API:

gcloud

After installing the Google Cloud CLI, initialize it by running the following command:

gcloud init

If you're using an external identity provider (IdP), you must first sign in to the gcloud CLI with your federated identity.

C#

로컬 개발 환경에서 이 페이지의 .NET 샘플을 사용하려면 gcloud CLI를 설치 및 초기화한 다음 사용자 인증 정보로 애플리케이션 기본 사용자 인증 정보를 설정하세요.

  1. Install the Google Cloud CLI.

  2. If you're using an external identity provider (IdP), you must first sign in to the gcloud CLI with your federated identity.

  3. To initialize the gcloud CLI, run the following command:

    gcloud init
  4. If you're using a local shell, then create local authentication credentials for your user account:

    gcloud auth application-default login

    You don't need to do this if you're using Cloud Shell.

    If an authentication error is returned, and you are using an external identity provider (IdP), confirm that you have signed in to the gcloud CLI with your federated identity.

  5. 자세한 내용은 Google Cloud 인증 문서의 로컬 개발 환경의 ADC 설정을 참조하세요.

Go

로컬 개발 환경에서 이 페이지의 Go 샘플을 사용하려면 gcloud CLI를 설치 및 초기화한 다음 사용자 인증 정보로 애플리케이션 기본 사용자 인증 정보를 설정하세요.

  1. Install the Google Cloud CLI.

  2. If you're using an external identity provider (IdP), you must first sign in to the gcloud CLI with your federated identity.

  3. To initialize the gcloud CLI, run the following command:

    gcloud init
  4. If you're using a local shell, then create local authentication credentials for your user account:

    gcloud auth application-default login

    You don't need to do this if you're using Cloud Shell.

    If an authentication error is returned, and you are using an external identity provider (IdP), confirm that you have signed in to the gcloud CLI with your federated identity.

  5. 자세한 내용은 Google Cloud 인증 문서의 로컬 개발 환경의 ADC 설정을 참조하세요.

Java

로컬 개발 환경에서 이 페이지의 Java 샘플을 사용하려면 gcloud CLI를 설치 및 초기화한 다음 사용자 인증 정보로 애플리케이션 기본 사용자 인증 정보를 설정하세요.

  1. Install the Google Cloud CLI.

  2. If you're using an external identity provider (IdP), you must first sign in to the gcloud CLI with your federated identity.

  3. To initialize the gcloud CLI, run the following command:

    gcloud init
  4. If you're using a local shell, then create local authentication credentials for your user account:

    gcloud auth application-default login

    You don't need to do this if you're using Cloud Shell.

    If an authentication error is returned, and you are using an external identity provider (IdP), confirm that you have signed in to the gcloud CLI with your federated identity.

  5. 자세한 내용은 Google Cloud 인증 문서의 로컬 개발 환경의 ADC 설정을 참조하세요.

Node.js

로컬 개발 환경에서 이 페이지의 Node.js 샘플을 사용하려면 gcloud CLI를 설치 및 초기화한 다음 사용자 인증 정보로 애플리케이션 기본 사용자 인증 정보를 설정하세요.

  1. Install the Google Cloud CLI.

  2. If you're using an external identity provider (IdP), you must first sign in to the gcloud CLI with your federated identity.

  3. To initialize the gcloud CLI, run the following command:

    gcloud init
  4. If you're using a local shell, then create local authentication credentials for your user account:

    gcloud auth application-default login

    You don't need to do this if you're using Cloud Shell.

    If an authentication error is returned, and you are using an external identity provider (IdP), confirm that you have signed in to the gcloud CLI with your federated identity.

  5. 자세한 내용은 Google Cloud 인증 문서의 로컬 개발 환경의 ADC 설정을 참조하세요.

PHP

로컬 개발 환경에서 이 페이지의 PHP 샘플을 사용하려면 gcloud CLI를 설치 및 초기화한 다음 사용자 인증 정보로 애플리케이션 기본 사용자 인증 정보를 설정하세요.

  1. Install the Google Cloud CLI.

  2. If you're using an external identity provider (IdP), you must first sign in to the gcloud CLI with your federated identity.

  3. To initialize the gcloud CLI, run the following command:

    gcloud init
  4. If you're using a local shell, then create local authentication credentials for your user account:

    gcloud auth application-default login

    You don't need to do this if you're using Cloud Shell.

    If an authentication error is returned, and you are using an external identity provider (IdP), confirm that you have signed in to the gcloud CLI with your federated identity.

  5. 자세한 내용은 Google Cloud 인증 문서의 로컬 개발 환경의 ADC 설정을 참조하세요.

Python

로컬 개발 환경에서 이 페이지의 Python 샘플을 사용하려면 gcloud CLI를 설치 및 초기화한 다음 사용자 인증 정보로 애플리케이션 기본 사용자 인증 정보를 설정하세요.

  1. Install the Google Cloud CLI.

  2. If you're using an external identity provider (IdP), you must first sign in to the gcloud CLI with your federated identity.

  3. To initialize the gcloud CLI, run the following command:

    gcloud init
  4. If you're using a local shell, then create local authentication credentials for your user account:

    gcloud auth application-default login

    You don't need to do this if you're using Cloud Shell.

    If an authentication error is returned, and you are using an external identity provider (IdP), confirm that you have signed in to the gcloud CLI with your federated identity.

  5. 자세한 내용은 Google Cloud 인증 문서의 로컬 개발 환경의 ADC 설정을 참조하세요.

Ruby

로컬 개발 환경에서 이 페이지의 Ruby 샘플을 사용하려면 gcloud CLI를 설치 및 초기화한 다음 사용자 인증 정보로 애플리케이션 기본 사용자 인증 정보를 설정하세요.

  1. Install the Google Cloud CLI.

  2. If you're using an external identity provider (IdP), you must first sign in to the gcloud CLI with your federated identity.

  3. To initialize the gcloud CLI, run the following command:

    gcloud init
  4. If you're using a local shell, then create local authentication credentials for your user account:

    gcloud auth application-default login

    You don't need to do this if you're using Cloud Shell.

    If an authentication error is returned, and you are using an external identity provider (IdP), confirm that you have signed in to the gcloud CLI with your federated identity.

  5. 자세한 내용은 Google Cloud 인증 문서의 로컬 개발 환경의 ADC 설정을 참조하세요.

REST

로컬 개발 환경에서 이 페이지의 REST API 샘플을 사용하려면 gcloud CLI에 제공한 사용자 인증 정보를 사용합니다.

    After installing the Google Cloud CLI, initialize it by running the following command:

    gcloud init

    If you're using an external identity provider (IdP), you must first sign in to the gcloud CLI with your federated identity.

자세한 내용은 Google Cloud 인증 문서의 REST 사용을 위한 인증을 참조하세요.

Natural Language API 클라이언트 라이브러리 설치

Natural Language API 호출에는 다음 세 가지 옵션이 있습니다.

클라이언트 라이브러리는 널리 사용되는 여러 언어로 제공됩니다. 클라이언트 라이브러리 설치에 대한 자세한 내용은 Cloud Natural Language 클라이언트 라이브러리를 참조하세요.

역할 정보

Cloud Natural Language API에 액세스해야 할 역할이 없습니다. 인증된 사용자 또는 애플리케이션은 권한에 관계없이 API를 호출할 수 있습니다.