View a markdown version of this page

Membuat titik akhir inferensi untuk kueri - Amazon Neptune

Terjemahan disediakan oleh mesin penerjemah. Jika konten terjemahan yang diberikan bertentangan dengan versi bahasa Inggris aslinya, utamakan versi bahasa Inggris.

Membuat titik akhir inferensi untuk kueri

Titik akhir inferensi memungkinkan Anda mengkueri satu model tertentu yang dibangun oleh proses pelatihan model. Titik akhir menempel pada model dengan performa terbaik dari jenis yang diberikan yang dihasilkan proses pelatihan. Endpoint ini kemudian dapat menerima kueri Gremlin dari Neptune dan mengembalikan prediksi model tersebut untuk input dalam kueri. Setelah Anda membuat titik akhir inferensi, itu tetap aktif sampai Anda menghapusnya.

Mengelola endpoint inferensi untuk Neptune ML

Setelah Anda menyelesaikan pelatihan model pada data yang Anda ekspor dari Neptunus, Anda dapat membuat titik akhir inferensi menggunakan perintah seperti berikut:

AWS CLI
aws neptunedata create-ml-endpoint \ --endpoint-url https://your-neptune-endpoint:port \ --id "(a unique ID for the new endpoint)" \ --ml-model-training-job-id "(the model-training job-id of a completed job)"

Untuk informasi selengkapnya, lihat create-ml-endpointdi Referensi AWS CLI Perintah.

SDK
import boto3 from botocore.config import Config client = boto3.client( 'neptunedata', endpoint_url='https://your-neptune-endpoint:port', config=Config(read_timeout=None, retries={'total_max_attempts': 1}) ) response = client.create_ml_endpoint( id='(a unique ID for the new endpoint)', mlModelTrainingJobId='(the model-training job-id of a completed job)' ) print(response)
awscurl
awscurl https://your-neptune-endpoint:port/ml/endpoints \ --region us-east-1 \ --service neptune-db \ -X POST \ -H 'Content-Type: application/json' \ -d '{ "id" : "(a unique ID for the new endpoint)", "mlModelTrainingJobId": "(the model-training job-id of a completed job)" }'
catatan

Contoh ini mengasumsikan bahwa AWS kredenal Anda dikonfigurasi di lingkungan Anda. Ganti us-east-1 dengan Wilayah cluster Neptunus Anda.

curl
curl \ -X POST https://your-neptune-endpoint:port/ml/endpoints \ -H 'Content-Type: application/json' \ -d '{ "id" : "(a unique ID for the new endpoint)", "mlModelTrainingJobId": "(the model-training job-id of a completed job)" }'

Anda juga dapat membuat titik akhir inferensi dari model yang dibuat oleh pekerjaan transformasi model yang telah selesai, dengan cara yang hampir sama:

AWS CLI
aws neptunedata create-ml-endpoint \ --endpoint-url https://your-neptune-endpoint:port \ --id "(a unique ID for the new endpoint)" \ --ml-model-transform-job-id "(the model-transform job-id of a completed job)"

Untuk informasi selengkapnya, lihat create-ml-endpointdi Referensi AWS CLI Perintah.

SDK
import boto3 from botocore.config import Config client = boto3.client( 'neptunedata', endpoint_url='https://your-neptune-endpoint:port', config=Config(read_timeout=None, retries={'total_max_attempts': 1}) ) response = client.create_ml_endpoint( id='(a unique ID for the new endpoint)', mlModelTransformJobId='(the model-transform job-id of a completed job)' ) print(response)
awscurl
awscurl https://your-neptune-endpoint:port/ml/endpoints \ --region us-east-1 \ --service neptune-db \ -X POST \ -H 'Content-Type: application/json' \ -d '{ "id" : "(a unique ID for the new endpoint)", "mlModelTransformJobId": "(the model-transform job-id of a completed job)" }'
catatan

Contoh ini mengasumsikan bahwa AWS kredenal Anda dikonfigurasi di lingkungan Anda. Ganti us-east-1 dengan Wilayah cluster Neptunus Anda.

curl
curl \ -X POST https://your-neptune-endpoint:port/ml/endpoints \ -H 'Content-Type: application/json' \ -d '{ "id" : "(a unique ID for the new endpoint)", "mlModelTransformJobId": "(the model-transform job-id of a completed job)" }'

Rincian tentang cara menggunakan perintah ini dijelaskan dalamPerintah titik akhir, bersama dengan informasi tentang cara mendapatkan status titik akhir, cara menghapus titik akhir, dan cara membuat daftar semua titik akhir inferensi.