Tetap teratur dengan koleksi
Simpan dan kategorikan konten berdasarkan preferensi Anda.
Cloud Natural Language menawarkan Anda beberapa kontrol terkait lokasi pemrosesan resource untuk project Anda. Secara khusus, Anda dapat mengonfigurasi Cloud Natural Language untuk
melakukan pemrosesan machine learning pada data Anda hanya di Uni Eropa atau Amerika Serikat.
Secara default, Cloud Natural Language memproses resource di lokasi Global,
yang berarti bahwa Cloud Natural Language tidak menjamin resource Anda akan
tetap berada dalam lokasi atau region tertentu. Jika Anda memilih lokasi
Uni Eropa, Google hanya akan melakukan machine learning dengan data tersebut di Uni Eropa. Jika Anda memilih lokasi Amerika Serikat, Google akan
melakukan machine learning dengan data tersebut hanya di Amerika Serikat. Anda dan pengguna Anda dapat mengakses data dari lokasi mana pun.
Menetapkan lokasi menggunakan API
Cloud Natural Language mendukung endpoint API global (language.googleapis.com),
endpoint Uni Eropa (eu-language.googleapis.com), dan endpoint Amerika Serikat (us-language.googleapis.com).
Untuk memproses data Anda hanya di Uni Eropa, gunakan URI
eu-language.googleapis.com sebagai pengganti language.googleapis.com untuk panggilan REST API Anda.
Untuk memproses data Anda hanya di Amerika Serikat, gunakan URI
us-language.googleapis.com sebagai pengganti language.googleapis.com untuk panggilan REST API Anda.
Text Moderation API juga tersedia di Australia, yang dapat diakses dengan menggunakan URI au-language.googleapis.com sebagai pengganti language.googleapis.com untuk panggilan REST API Anda.
Menetapkan lokasi menggunakan library klien
Library klien mengakses endpoint API global (language.googleapis.com)
secara default. Untuk menyimpan dan memproses data Anda hanya di Uni Eropa atau Amerika Serikat, Anda perlu
menetapkan endpoint secara eksplisit. Contoh kode di bawah menunjukkan cara mengonfigurasi setelan ini.
# Imports the Google Cloud client libraryfromgoogle.cloudimportlanguage_v1client_options={"api_endpoint":"eu-language.googleapis.com:443"}# Instantiates a client.client=language_v1.LanguageServiceClient(client_options=client_options)
LanguageServiceSettingssettings=LanguageServiceSettings.newBuilder().setEndpoint("eu-language.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.LanguageServiceClientclient=LanguageServiceClient.create(settings);
// Imports the Google Cloud client libraryconstlanguage=require('@google-cloud/language');// Specifies the location of the api endpointconstclientOptions={apiEndpoint:'eu-language.googleapis.com'};// Instantiates a clientconstclient=newlanguage.LanguageServiceClient(clientOptions);
[[["Mudah dipahami","easyToUnderstand","thumb-up"],["Memecahkan masalah saya","solvedMyProblem","thumb-up"],["Lainnya","otherUp","thumb-up"]],[["Sulit dipahami","hardToUnderstand","thumb-down"],["Informasi atau kode contoh salah","incorrectInformationOrSampleCode","thumb-down"],["Informasi/contoh yang saya butuhkan tidak ada","missingTheInformationSamplesINeed","thumb-down"],["Masalah terjemahan","translationIssue","thumb-down"],["Lainnya","otherDown","thumb-down"]],["Terakhir diperbarui pada 2025-08-11 UTC."],[],[],null,["# Locations\n\nCloud Natural Language offers you some control over where the resources for your\nproject are processed. In particular, you can configure Cloud Natural Language to\nperform machine learning processing on your data only in the EU or the US.\n\nBy default Cloud Natural Language processes resources in a **Global** location,\nwhich means that Cloud Natural Language doesn't guarantee that your resources will\nremain within a particular location or region. If you choose the\n**European Union** location, Google will perform machine learning with it only\nin the EU. If you choose the **United States** location, Google will\nperform machine learning with it only in the US. You and your users\ncan access the data from any location.\n\nSetting the location using the API\n----------------------------------\n\nCloud Natural Language supports a global API endpoint (`language.googleapis.com`),\na European Union endpoint (`eu-language.googleapis.com`), and a United States\nendpoint (`us-language.googleapis.com`).\nTo process your data in the European Union only, use the URI\n`eu-language.googleapis.com` in place of `language.googleapis.com` for your REST API calls.\nTo process your data in the United States only, use the URI\n`us-language.googleapis.com` in place of `language.googleapis.com` for your REST API calls.\n\nThe text moderation API is also available in Australia, which can be accessed by using the URI `au-language.googleapis.com` in place of `language.googleapis.com` for your REST API calls.\n\nSetting the location using client libraries\n-------------------------------------------\n\nThe client libraries access the global API endpoint (`language.googleapis.com`)\nby default. To store and process your data in the European Union or United States only, you need to\nexplicitly set the endpoint. The code samples below show how to configure this setting. \n\n### Python\n\n\nTo learn how to install and use the client library for Natural Language, see\n[Natural Language client libraries](/natural-language/docs/reference/libraries).\n\n\nFor more information, see the\n[Natural Language Python API\nreference documentation](/python/docs/reference/language/latest).\n\n\nTo authenticate to Natural Language, set up Application Default Credentials.\nFor more information, see\n\n[Set up authentication for a local development environment](/docs/authentication/set-up-adc-local-dev-environment).\n\n # Imports the Google Cloud client library\n from google.cloud import language_v1\n\n client_options = {\"api_endpoint\": \"eu-language.googleapis.com:443\"}\n\n # Instantiates a client.\n client = language_v1.LanguageServiceClient(client_options=client_options)\n\n### Java\n\n\nTo learn how to install and use the client library for Natural Language, see\n[Natural Language client libraries](/natural-language/docs/reference/libraries).\n\n\nFor more information, see the\n[Natural Language Java API\nreference documentation](/java/docs/reference/google-cloud-language/latest/overview).\n\n\nTo authenticate to Natural Language, set up Application Default Credentials.\nFor more information, see\n\n[Set up authentication for a local development environment](/docs/authentication/set-up-adc-local-dev-environment).\n\n LanguageServiceSettings settings =\n LanguageServiceSettings.newBuilder().setEndpoint(\"eu-language.googleapis.com:443\").build();\n\n // Initialize client that will be used to send requests. This client only needs to be created\n // once, and can be reused for multiple requests. After completing all of your requests, call\n // the \"close\" method on the client to safely clean up any remaining background resources.\n LanguageServiceClient client = LanguageServiceClient.create(settings);\n\n### Node.js\n\n\nTo learn how to install and use the client library for Natural Language, see\n[Natural Language client libraries](/natural-language/docs/reference/libraries).\n\n\nFor more information, see the\n[Natural Language Node.js API\nreference documentation](/nodejs/docs/reference/language/latest).\n\n\nTo authenticate to Natural Language, set up Application Default Credentials.\nFor more information, see\n\n[Set up authentication for a local development environment](/docs/authentication/set-up-adc-local-dev-environment).\n\n // Imports the Google Cloud client library\n const language = require('https://cloud.google.com/nodejs/docs/reference/language/latest/overview.html');\n\n // Specifies the location of the api endpoint\n const clientOptions = {apiEndpoint: 'eu-language.googleapis.com'};\n\n // Instantiates a client\n const client = new language.https://cloud.google.com/nodejs/docs/reference/language/latest/overview.html(clientOptions);\n\n\u003cbr /\u003e"]]