- HTTP request
- Path parameters
- Request body
- Response body
- Authorization scopes
- IAM Permissions
- GcsTrainingInput
Trains a custom model.
HTTP request
POST https://discoveryengine.googleapis.com/v1/{dataStore=projects/*/locations/*/collections/*/dataStores/*}:trainCustomModel
The URL uses gRPC Transcoding syntax.
Path parameters
Parameters | |
---|---|
data |
Required. The resource name of the Data Store, such as |
Request body
The request body contains data with the following structure:
JSON representation |
---|
{ "modelType": string, "errorConfig": { object ( |
Fields | |
---|---|
model |
Model to be trained. Supported values are:
|
error |
The desired location of errors incurred during the data ingestion and training. |
model |
If not provided, a UUID will be generated. |
Union field training_input . Model training input. training_input can be only one of the following: |
|
gcs |
Cloud Storage training input. |
Response body
If successful, the response body contains an instance of Operation
.
Authorization scopes
Requires the following OAuth scope:
https://www.googleapis.com/auth/cloud-platform
For more information, see the Authentication Overview.
IAM Permissions
Requires the following IAM permission on the dataStore
resource:
discoveryengine.dataStores.trainCustomModel
For more information, see the IAM documentation.
GcsTrainingInput
Cloud Storage training data input.
JSON representation |
---|
{ "corpusDataPath": string, "queryDataPath": string, "trainDataPath": string, "testDataPath": string } |
Fields | |
---|---|
corpus |
The Cloud Storage corpus data which could be associated in train data. The data path format is For search-tuning model, each line should have the Id, title and text. Example: |
query |
The gcs query data which could be associated in train data. The data path format is For search-tuning model, each line should have the Id and text. Example: {"Id": "query1", "text": "example query"} |
train |
Cloud Storage training data path whose format should be For search-tuning model, it should have the query-id corpus-id score as tsv file header. The score should be a number in
|
test |
Cloud Storage test data. Same format as trainDataPath. If not provided, a random 80/20 train/test split will be performed on trainDataPath. |