Class: Google::Cloud::AutoML::V1beta1::AutoMLClient
- Inherits:
-
Object
- Object
- Google::Cloud::AutoML::V1beta1::AutoMLClient
- Defined in:
- lib/google/cloud/automl/v1beta1/automl_client.rb,
lib/google/cloud/automl/v1beta1/automl_client_helpers.rb
Overview
AutoML Server API.
The resource names are assigned by the server. The server never reuses names that it has created after the resources with those names are deleted.
An ID of a resource is the last element of the item's resource name. For
projects/{project_id}/locations/{location_id}/datasets/{dataset_id}
, then
the id for the item is {dataset_id}
.
Currently the only supported location_id
is "us-central1".
On any input that is documented to expect a string parameter in snake_case or kebab-case, either of those cases is accepted.
Defined Under Namespace
Classes: OperationsClient
Constant Summary collapse
- SERVICE_ADDRESS =
The default address of the service.
"automl.googleapis.com".freeze
- DEFAULT_SERVICE_PORT =
The default port of the service.
443
- GRPC_INTERCEPTORS =
The default set of gRPC interceptors.
[]
- DEFAULT_TIMEOUT =
30
- ALL_SCOPES =
The scopes needed to make gRPC calls to all of the methods defined in this service.
[ "https://www.googleapis.com/auth/cloud-platform" ].freeze
Class Method Summary collapse
-
.annotation_spec_path(project, location, dataset, annotation_spec) ⇒ String
Returns a fully-qualified annotation_spec resource name string.
-
.column_spec_path(project, location, dataset, table_spec, column_spec) ⇒ String
Returns a fully-qualified column_spec resource name string.
-
.dataset_path(project, location, dataset) ⇒ String
Returns a fully-qualified dataset resource name string.
-
.location_path(project, location) ⇒ String
Returns a fully-qualified location resource name string.
-
.model_evaluation_path(project, location, model, model_evaluation) ⇒ String
Returns a fully-qualified model_evaluation resource name string.
-
.model_path(project, location, model) ⇒ String
Returns a fully-qualified model resource name string.
-
.table_spec_path(project, location, dataset, table_spec) ⇒ String
Returns a fully-qualified table_spec resource name string.
Instance Method Summary collapse
-
#create_dataset(parent, dataset, options: nil) {|result, operation| ... } ⇒ Google::Cloud::AutoML::V1beta1::Dataset
Creates a dataset.
-
#create_model(parent, model, options: nil) ⇒ Google::Gax::Operation
Creates a model.
-
#delete_dataset(name, options: nil) ⇒ Google::Gax::Operation
Deletes a dataset and all of its contents.
-
#delete_model(name, options: nil) ⇒ Google::Gax::Operation
Deletes a model.
-
#deploy_model(name, image_object_detection_model_deployment_metadata: nil, image_classification_model_deployment_metadata: nil, options: nil) ⇒ Google::Gax::Operation
Deploys a model.
-
#export_data(name, output_config, options: nil) ⇒ Google::Gax::Operation
Exports dataset's data to the provided output location.
-
#export_evaluated_examples(name, output_config, options: nil) ⇒ Google::Gax::Operation
Exports examples on which the model was evaluated (i.e. which were in the TEST set of the dataset the model was created from), together with their ground truth annotations and the annotations created (predicted) by the model.
-
#export_model(name, output_config, options: nil) ⇒ Google::Gax::Operation
Exports a trained, "export-able", model to a user specified Google Cloud Storage location.
-
#get_annotation_spec(name, options: nil) {|result, operation| ... } ⇒ Google::Cloud::AutoML::V1beta1::AnnotationSpec
Gets an annotation spec.
-
#get_column_spec(name, field_mask: nil, options: nil) {|result, operation| ... } ⇒ Google::Cloud::AutoML::V1beta1::ColumnSpec
Gets a column spec.
-
#get_dataset(name, options: nil) {|result, operation| ... } ⇒ Google::Cloud::AutoML::V1beta1::Dataset
Gets a dataset.
-
#get_model(name, options: nil) {|result, operation| ... } ⇒ Google::Cloud::AutoML::V1beta1::Model
Gets a model.
-
#get_model_evaluation(name, options: nil) {|result, operation| ... } ⇒ Google::Cloud::AutoML::V1beta1::ModelEvaluation
Gets a model evaluation.
-
#get_operation(name, options: nil) ⇒ Google::Gax::Operation
Gets the latest state of a long-running operation.
-
#get_table_spec(name, field_mask: nil, options: nil) {|result, operation| ... } ⇒ Google::Cloud::AutoML::V1beta1::TableSpec
Gets a table spec.
-
#import_data(name, input_config, options: nil) ⇒ Google::Gax::Operation
Imports data into a dataset.
-
#initialize(credentials: nil, scopes: ALL_SCOPES, client_config: {}, timeout: DEFAULT_TIMEOUT, metadata: nil, service_address: nil, service_port: nil, exception_transformer: nil, lib_name: nil, lib_version: "") ⇒ AutoMLClient
constructor
A new instance of AutoMLClient.
-
#list_column_specs(parent, field_mask: nil, filter: nil, page_size: nil, options: nil) {|result, operation| ... } ⇒ Google::Gax::PagedEnumerable<Google::Cloud::AutoML::V1beta1::ColumnSpec>
Lists column specs in a table spec.
-
#list_datasets(parent, filter: nil, page_size: nil, options: nil) {|result, operation| ... } ⇒ Google::Gax::PagedEnumerable<Google::Cloud::AutoML::V1beta1::Dataset>
Lists datasets in a project.
-
#list_model_evaluations(parent, filter: nil, page_size: nil, options: nil) {|result, operation| ... } ⇒ Google::Gax::PagedEnumerable<Google::Cloud::AutoML::V1beta1::ModelEvaluation>
Lists model evaluations.
-
#list_models(parent, filter: nil, page_size: nil, options: nil) {|result, operation| ... } ⇒ Google::Gax::PagedEnumerable<Google::Cloud::AutoML::V1beta1::Model>
Lists models.
-
#list_operations(name, filter, page_size: nil, options: nil) ⇒ Google::Gax::PagedEnumerable<Google::Gax::Operation>
Lists operations that match the specified filter in the request.
-
#list_table_specs(parent, field_mask: nil, filter: nil, page_size: nil, options: nil) {|result, operation| ... } ⇒ Google::Gax::PagedEnumerable<Google::Cloud::AutoML::V1beta1::TableSpec>
Lists table specs in a dataset.
-
#undeploy_model(name, options: nil) ⇒ Google::Gax::Operation
Undeploys a model.
-
#update_column_spec(column_spec, update_mask: nil, options: nil) {|result, operation| ... } ⇒ Google::Cloud::AutoML::V1beta1::ColumnSpec
Updates a column spec.
-
#update_dataset(dataset, update_mask: nil, options: nil) {|result, operation| ... } ⇒ Google::Cloud::AutoML::V1beta1::Dataset
Updates a dataset.
-
#update_table_spec(table_spec, update_mask: nil, options: nil) {|result, operation| ... } ⇒ Google::Cloud::AutoML::V1beta1::TableSpec
Updates a table spec.
Constructor Details
#initialize(credentials: nil, scopes: ALL_SCOPES, client_config: {}, timeout: DEFAULT_TIMEOUT, metadata: nil, service_address: nil, service_port: nil, exception_transformer: nil, lib_name: nil, lib_version: "") ⇒ AutoMLClient
Returns a new instance of AutoMLClient.
281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 |
# File 'lib/google/cloud/automl/v1beta1/automl_client.rb', line 281 def initialize \ credentials: nil, scopes: ALL_SCOPES, client_config: {}, timeout: DEFAULT_TIMEOUT, metadata: nil, service_address: nil, service_port: nil, exception_transformer: nil, lib_name: nil, lib_version: "" # These require statements are intentionally placed here to initialize # the gRPC module only when it's required. # See https://github.com/googleapis/toolkit/issues/446 require "google/gax/grpc" require "google/cloud/automl/v1beta1/service_services_pb" credentials ||= Google::Cloud::AutoML::V1beta1::Credentials.default @operations_client = OperationsClient.new( credentials: credentials, scopes: scopes, client_config: client_config, timeout: timeout, lib_name: lib_name, service_address: service_address, service_port: service_port, lib_version: lib_version, metadata: , ) if credentials.is_a?(String) || credentials.is_a?(Hash) updater_proc = Google::Cloud::AutoML::V1beta1::Credentials.new(credentials).updater_proc end if credentials.is_a?(GRPC::Core::Channel) channel = credentials end if credentials.is_a?(GRPC::Core::ChannelCredentials) chan_creds = credentials end if credentials.is_a?(Proc) updater_proc = credentials end if credentials.is_a?(Google::Auth::Credentials) updater_proc = credentials.updater_proc end package_version = Google::Cloud::AutoML::VERSION google_api_client = "gl-ruby/#{RUBY_VERSION}" google_api_client << " #{lib_name}/#{lib_version}" if lib_name google_api_client << " gapic/#{package_version} gax/#{Google::Gax::VERSION}" google_api_client << " grpc/#{GRPC::VERSION}" google_api_client.freeze headers = { :"x-goog-api-client" => google_api_client } headers.merge!() unless .nil? client_config_file = Pathname.new(__dir__).join( "automl_client_config.json" ) defaults = client_config_file.open do |f| Google::Gax.construct_settings( "google.cloud.automl.v1beta1.AutoMl", JSON.parse(f.read), client_config, Google::Gax::Grpc::STATUS_CODE_NAMES, timeout, page_descriptors: PAGE_DESCRIPTORS, errors: Google::Gax::Grpc::API_ERRORS, metadata: headers ) end # Allow overriding the service path/port in subclasses. service_path = service_address || self.class::SERVICE_ADDRESS port = service_port || self.class::DEFAULT_SERVICE_PORT interceptors = self.class::GRPC_INTERCEPTORS @automl_stub = Google::Gax::Grpc.create_stub( service_path, port, chan_creds: chan_creds, channel: channel, updater_proc: updater_proc, scopes: scopes, interceptors: interceptors, &Google::Cloud::AutoML::V1beta1::AutoML::Stub.method(:new) ) @create_dataset = Google::Gax.create_api_call( @automl_stub.method(:create_dataset), defaults["create_dataset"], exception_transformer: exception_transformer, params_extractor: proc do |request| {'parent' => request.parent} end ) @update_dataset = Google::Gax.create_api_call( @automl_stub.method(:update_dataset), defaults["update_dataset"], exception_transformer: exception_transformer, params_extractor: proc do |request| {'dataset.name' => request.dataset.name} end ) @get_dataset = Google::Gax.create_api_call( @automl_stub.method(:get_dataset), defaults["get_dataset"], exception_transformer: exception_transformer, params_extractor: proc do |request| {'name' => request.name} end ) @list_datasets = Google::Gax.create_api_call( @automl_stub.method(:list_datasets), defaults["list_datasets"], exception_transformer: exception_transformer, params_extractor: proc do |request| {'parent' => request.parent} end ) @delete_dataset = Google::Gax.create_api_call( @automl_stub.method(:delete_dataset), defaults["delete_dataset"], exception_transformer: exception_transformer, params_extractor: proc do |request| {'name' => request.name} end ) @import_data = Google::Gax.create_api_call( @automl_stub.method(:import_data), defaults["import_data"], exception_transformer: exception_transformer, params_extractor: proc do |request| {'name' => request.name} end ) @export_data = Google::Gax.create_api_call( @automl_stub.method(:export_data), defaults["export_data"], exception_transformer: exception_transformer, params_extractor: proc do |request| {'name' => request.name} end ) @create_model = Google::Gax.create_api_call( @automl_stub.method(:create_model), defaults["create_model"], exception_transformer: exception_transformer, params_extractor: proc do |request| {'parent' => request.parent} end ) @get_model = Google::Gax.create_api_call( @automl_stub.method(:get_model), defaults["get_model"], exception_transformer: exception_transformer, params_extractor: proc do |request| {'name' => request.name} end ) @list_models = Google::Gax.create_api_call( @automl_stub.method(:list_models), defaults["list_models"], exception_transformer: exception_transformer, params_extractor: proc do |request| {'parent' => request.parent} end ) @delete_model = Google::Gax.create_api_call( @automl_stub.method(:delete_model), defaults["delete_model"], exception_transformer: exception_transformer, params_extractor: proc do |request| {'name' => request.name} end ) @deploy_model = Google::Gax.create_api_call( @automl_stub.method(:deploy_model), defaults["deploy_model"], exception_transformer: exception_transformer, params_extractor: proc do |request| {'name' => request.name} end ) @undeploy_model = Google::Gax.create_api_call( @automl_stub.method(:undeploy_model), defaults["undeploy_model"], exception_transformer: exception_transformer, params_extractor: proc do |request| {'name' => request.name} end ) @get_model_evaluation = Google::Gax.create_api_call( @automl_stub.method(:get_model_evaluation), defaults["get_model_evaluation"], exception_transformer: exception_transformer, params_extractor: proc do |request| {'name' => request.name} end ) @export_model = Google::Gax.create_api_call( @automl_stub.method(:export_model), defaults["export_model"], exception_transformer: exception_transformer, params_extractor: proc do |request| {'name' => request.name} end ) @export_evaluated_examples = Google::Gax.create_api_call( @automl_stub.method(:export_evaluated_examples), defaults["export_evaluated_examples"], exception_transformer: exception_transformer, params_extractor: proc do |request| {'name' => request.name} end ) @list_model_evaluations = Google::Gax.create_api_call( @automl_stub.method(:list_model_evaluations), defaults["list_model_evaluations"], exception_transformer: exception_transformer, params_extractor: proc do |request| {'parent' => request.parent} end ) @get_annotation_spec = Google::Gax.create_api_call( @automl_stub.method(:get_annotation_spec), defaults["get_annotation_spec"], exception_transformer: exception_transformer, params_extractor: proc do |request| {'name' => request.name} end ) @get_table_spec = Google::Gax.create_api_call( @automl_stub.method(:get_table_spec), defaults["get_table_spec"], exception_transformer: exception_transformer, params_extractor: proc do |request| {'name' => request.name} end ) @list_table_specs = Google::Gax.create_api_call( @automl_stub.method(:list_table_specs), defaults["list_table_specs"], exception_transformer: exception_transformer, params_extractor: proc do |request| {'parent' => request.parent} end ) @update_table_spec = Google::Gax.create_api_call( @automl_stub.method(:update_table_spec), defaults["update_table_spec"], exception_transformer: exception_transformer, params_extractor: proc do |request| {'table_spec.name' => request.table_spec.name} end ) @get_column_spec = Google::Gax.create_api_call( @automl_stub.method(:get_column_spec), defaults["get_column_spec"], exception_transformer: exception_transformer, params_extractor: proc do |request| {'name' => request.name} end ) @list_column_specs = Google::Gax.create_api_call( @automl_stub.method(:list_column_specs), defaults["list_column_specs"], exception_transformer: exception_transformer, params_extractor: proc do |request| {'parent' => request.parent} end ) @update_column_spec = Google::Gax.create_api_call( @automl_stub.method(:update_column_spec), defaults["update_column_spec"], exception_transformer: exception_transformer, params_extractor: proc do |request| {'column_spec.name' => request.column_spec.name} end ) end |
Class Method Details
.annotation_spec_path(project, location, dataset, annotation_spec) ⇒ String
Returns a fully-qualified annotation_spec resource name string.
155 156 157 158 159 160 161 162 |
# File 'lib/google/cloud/automl/v1beta1/automl_client.rb', line 155 def self.annotation_spec_path project, location, dataset, annotation_spec ANNOTATION_SPEC_PATH_TEMPLATE.render( :"project" => project, :"location" => location, :"dataset" => dataset, :"annotation_spec" => annotation_spec ) end |
.column_spec_path(project, location, dataset, table_spec, column_spec) ⇒ String
Returns a fully-qualified column_spec resource name string.
171 172 173 174 175 176 177 178 179 |
# File 'lib/google/cloud/automl/v1beta1/automl_client.rb', line 171 def self.column_spec_path project, location, dataset, table_spec, column_spec COLUMN_SPEC_PATH_TEMPLATE.render( :"project" => project, :"location" => location, :"dataset" => dataset, :"table_spec" => table_spec, :"column_spec" => column_spec ) end |
.dataset_path(project, location, dataset) ⇒ String
Returns a fully-qualified dataset resource name string.
186 187 188 189 190 191 192 |
# File 'lib/google/cloud/automl/v1beta1/automl_client.rb', line 186 def self.dataset_path project, location, dataset DATASET_PATH_TEMPLATE.render( :"project" => project, :"location" => location, :"dataset" => dataset ) end |
.location_path(project, location) ⇒ String
Returns a fully-qualified location resource name string.
198 199 200 201 202 203 |
# File 'lib/google/cloud/automl/v1beta1/automl_client.rb', line 198 def self.location_path project, location LOCATION_PATH_TEMPLATE.render( :"project" => project, :"location" => location ) end |
.model_evaluation_path(project, location, model, model_evaluation) ⇒ String
Returns a fully-qualified model_evaluation resource name string.
224 225 226 227 228 229 230 231 |
# File 'lib/google/cloud/automl/v1beta1/automl_client.rb', line 224 def self.model_evaluation_path project, location, model, model_evaluation MODEL_EVALUATION_PATH_TEMPLATE.render( :"project" => project, :"location" => location, :"model" => model, :"model_evaluation" => model_evaluation ) end |
.model_path(project, location, model) ⇒ String
Returns a fully-qualified model resource name string.
210 211 212 213 214 215 216 |
# File 'lib/google/cloud/automl/v1beta1/automl_client.rb', line 210 def self.model_path project, location, model MODEL_PATH_TEMPLATE.render( :"project" => project, :"location" => location, :"model" => model ) end |
.table_spec_path(project, location, dataset, table_spec) ⇒ String
Returns a fully-qualified table_spec resource name string.
239 240 241 242 243 244 245 246 |
# File 'lib/google/cloud/automl/v1beta1/automl_client.rb', line 239 def self.table_spec_path project, location, dataset, table_spec TABLE_SPEC_PATH_TEMPLATE.render( :"project" => project, :"location" => location, :"dataset" => dataset, :"table_spec" => table_spec ) end |
Instance Method Details
#create_dataset(parent, dataset, options: nil) {|result, operation| ... } ⇒ Google::Cloud::AutoML::V1beta1::Dataset
Creates a dataset.
591 592 593 594 595 596 597 598 599 600 601 602 |
# File 'lib/google/cloud/automl/v1beta1/automl_client.rb', line 591 def create_dataset \ parent, dataset, options: nil, &block req = { parent: parent, dataset: dataset }.delete_if { |_, v| v.nil? } req = Google::Gax::to_proto(req, Google::Cloud::AutoML::V1beta1::CreateDatasetRequest) @create_dataset.call(req, , &block) end |
#create_model(parent, model, options: nil) ⇒ Google::Gax::Operation
Creates a model. Returns a Model in the response field when it completes. When you create a model, several model evaluations are created for it: a global evaluation, and one evaluation for each annotation spec.
1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 |
# File 'lib/google/cloud/automl/v1beta1/automl_client.rb', line 1005 def create_model \ parent, model, options: nil req = { parent: parent, model: model }.delete_if { |_, v| v.nil? } req = Google::Gax::to_proto(req, Google::Cloud::AutoML::V1beta1::CreateModelRequest) operation = Google::Gax::Operation.new( @create_model.call(req, ), @operations_client, Google::Cloud::AutoML::V1beta1::Model, Google::Cloud::AutoML::V1beta1::OperationMetadata, call_options: ) operation.on_done { |operation| yield(operation) } if block_given? operation end |
#delete_dataset(name, options: nil) ⇒ Google::Gax::Operation
784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 |
# File 'lib/google/cloud/automl/v1beta1/automl_client.rb', line 784 def delete_dataset \ name, options: nil req = { name: name }.delete_if { |_, v| v.nil? } req = Google::Gax::to_proto(req, Google::Cloud::AutoML::V1beta1::DeleteDatasetRequest) operation = Google::Gax::Operation.new( @delete_dataset.call(req, ), @operations_client, Google::Protobuf::Empty, Google::Cloud::AutoML::V1beta1::OperationMetadata, call_options: ) operation.on_done { |operation| yield(operation) } if block_given? operation end |
#delete_model(name, options: nil) ⇒ Google::Gax::Operation
1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 |
# File 'lib/google/cloud/automl/v1beta1/automl_client.rb', line 1167 def delete_model \ name, options: nil req = { name: name }.delete_if { |_, v| v.nil? } req = Google::Gax::to_proto(req, Google::Cloud::AutoML::V1beta1::DeleteModelRequest) operation = Google::Gax::Operation.new( @delete_model.call(req, ), @operations_client, Google::Protobuf::Empty, Google::Cloud::AutoML::V1beta1::OperationMetadata, call_options: ) operation.on_done { |operation| yield(operation) } if block_given? operation end |
#deploy_model(name, image_object_detection_model_deployment_metadata: nil, image_classification_model_deployment_metadata: nil, options: nil) ⇒ Google::Gax::Operation
Deploys a model. If a model is already deployed, deploying it with the same parameters has no effect. Deploying with different parametrs (as e.g. changing
node_number) will reset the deployment state without pausing the model's availability.
Only applicable for Text Classification, Image Object Detection and Tables; all other domains manage deployment automatically.
Returns an empty response in the response field when it completes.
1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 |
# File 'lib/google/cloud/automl/v1beta1/automl_client.rb', line 1245 def deploy_model \ name, image_object_detection_model_deployment_metadata: nil, image_classification_model_deployment_metadata: nil, options: nil req = { name: name, image_object_detection_model_deployment_metadata: , image_classification_model_deployment_metadata: }.delete_if { |_, v| v.nil? } req = Google::Gax::to_proto(req, Google::Cloud::AutoML::V1beta1::DeployModelRequest) operation = Google::Gax::Operation.new( @deploy_model.call(req, ), @operations_client, Google::Protobuf::Empty, Google::Cloud::AutoML::V1beta1::OperationMetadata, call_options: ) operation.on_done { |operation| yield(operation) } if block_given? operation end |
#export_data(name, output_config, options: nil) ⇒ Google::Gax::Operation
Exports dataset's data to the provided output location. Returns an empty response in the response field when it completes.
932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 |
# File 'lib/google/cloud/automl/v1beta1/automl_client.rb', line 932 def export_data \ name, output_config, options: nil req = { name: name, output_config: output_config }.delete_if { |_, v| v.nil? } req = Google::Gax::to_proto(req, Google::Cloud::AutoML::V1beta1::ExportDataRequest) operation = Google::Gax::Operation.new( @export_data.call(req, ), @operations_client, Google::Protobuf::Empty, Google::Cloud::AutoML::V1beta1::OperationMetadata, call_options: ) operation.on_done { |operation| yield(operation) } if block_given? operation end |
#export_evaluated_examples(name, output_config, options: nil) ⇒ Google::Gax::Operation
Exports examples on which the model was evaluated (i.e. which were in the TEST set of the dataset the model was created from), together with their ground truth annotations and the annotations created (predicted) by the model. The examples, ground truth and predictions are exported in the state they were at the moment the model was evaluated.
This export is available only for 30 days since the model evaluation is created.
Currently only available for Tables.
Returns an empty response in the response field when it completes.
1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 |
# File 'lib/google/cloud/automl/v1beta1/automl_client.rb', line 1502 def export_evaluated_examples \ name, output_config, options: nil req = { name: name, output_config: output_config }.delete_if { |_, v| v.nil? } req = Google::Gax::to_proto(req, Google::Cloud::AutoML::V1beta1::ExportEvaluatedExamplesRequest) operation = Google::Gax::Operation.new( @export_evaluated_examples.call(req, ), @operations_client, Google::Protobuf::Empty, Google::Cloud::AutoML::V1beta1::OperationMetadata, call_options: ) operation.on_done { |operation| yield(operation) } if block_given? operation end |
#export_model(name, output_config, options: nil) ⇒ Google::Gax::Operation
Exports a trained, "export-able", model to a user specified Google Cloud Storage location. A model is considered export-able if and only if it has an export format defined for it in
Returns an empty response in the response field when it completes.
1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 |
# File 'lib/google/cloud/automl/v1beta1/automl_client.rb', line 1419 def export_model \ name, output_config, options: nil req = { name: name, output_config: output_config }.delete_if { |_, v| v.nil? } req = Google::Gax::to_proto(req, Google::Cloud::AutoML::V1beta1::ExportModelRequest) operation = Google::Gax::Operation.new( @export_model.call(req, ), @operations_client, Google::Protobuf::Empty, Google::Cloud::AutoML::V1beta1::OperationMetadata, call_options: ) operation.on_done { |operation| yield(operation) } if block_given? operation end |
#get_annotation_spec(name, options: nil) {|result, operation| ... } ⇒ Google::Cloud::AutoML::V1beta1::AnnotationSpec
Gets an annotation spec.
1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 |
# File 'lib/google/cloud/automl/v1beta1/automl_client.rb', line 1611 def get_annotation_spec \ name, options: nil, &block req = { name: name }.delete_if { |_, v| v.nil? } req = Google::Gax::to_proto(req, Google::Cloud::AutoML::V1beta1::GetAnnotationSpecRequest) @get_annotation_spec.call(req, , &block) end |
#get_column_spec(name, field_mask: nil, options: nil) {|result, operation| ... } ⇒ Google::Cloud::AutoML::V1beta1::ColumnSpec
Gets a column spec.
1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 |
# File 'lib/google/cloud/automl/v1beta1/automl_client.rb', line 1785 def get_column_spec \ name, field_mask: nil, options: nil, &block req = { name: name, field_mask: field_mask }.delete_if { |_, v| v.nil? } req = Google::Gax::to_proto(req, Google::Cloud::AutoML::V1beta1::GetColumnSpecRequest) @get_column_spec.call(req, , &block) end |
#get_dataset(name, options: nil) {|result, operation| ... } ⇒ Google::Cloud::AutoML::V1beta1::Dataset
Gets a dataset.
663 664 665 666 667 668 669 670 671 672 |
# File 'lib/google/cloud/automl/v1beta1/automl_client.rb', line 663 def get_dataset \ name, options: nil, &block req = { name: name }.delete_if { |_, v| v.nil? } req = Google::Gax::to_proto(req, Google::Cloud::AutoML::V1beta1::GetDatasetRequest) @get_dataset.call(req, , &block) end |
#get_model(name, options: nil) {|result, operation| ... } ⇒ Google::Cloud::AutoML::V1beta1::Model
Gets a model.
1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 |
# File 'lib/google/cloud/automl/v1beta1/automl_client.rb', line 1044 def get_model \ name, options: nil, &block req = { name: name }.delete_if { |_, v| v.nil? } req = Google::Gax::to_proto(req, Google::Cloud::AutoML::V1beta1::GetModelRequest) @get_model.call(req, , &block) end |
#get_model_evaluation(name, options: nil) {|result, operation| ... } ⇒ Google::Cloud::AutoML::V1beta1::ModelEvaluation
Gets a model evaluation.
1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 |
# File 'lib/google/cloud/automl/v1beta1/automl_client.rb', line 1352 def get_model_evaluation \ name, options: nil, &block req = { name: name }.delete_if { |_, v| v.nil? } req = Google::Gax::to_proto(req, Google::Cloud::AutoML::V1beta1::GetModelEvaluationRequest) @get_model_evaluation.call(req, , &block) end |
#get_operation(name, options: nil) ⇒ Google::Gax::Operation
Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service.
47 48 49 50 51 52 53 54 55 56 57 |
# File 'lib/google/cloud/automl/v1beta1/automl_client_helpers.rb', line 47 def get_operation name, options: nil proto_op = @operations_client.get_operation name, options: Google::Gax::Operation.new( proto_op, @operations_client, nil, nil, call_options: ) end |
#get_table_spec(name, field_mask: nil, options: nil) {|result, operation| ... } ⇒ Google::Cloud::AutoML::V1beta1::TableSpec
Gets a table spec.
1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 |
# File 'lib/google/cloud/automl/v1beta1/automl_client.rb', line 1645 def get_table_spec \ name, field_mask: nil, options: nil, &block req = { name: name, field_mask: field_mask }.delete_if { |_, v| v.nil? } req = Google::Gax::to_proto(req, Google::Cloud::AutoML::V1beta1::GetTableSpecRequest) @get_table_spec.call(req, , &block) end |
#import_data(name, input_config, options: nil) ⇒ Google::Gax::Operation
Imports data into a dataset. For Tables this method can only be called on an empty Dataset.
For Tables:
- A schema_inference_version parameter must be explicitly set. Returns an empty response in the response field when it completes.
861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 |
# File 'lib/google/cloud/automl/v1beta1/automl_client.rb', line 861 def import_data \ name, input_config, options: nil req = { name: name, input_config: input_config }.delete_if { |_, v| v.nil? } req = Google::Gax::to_proto(req, Google::Cloud::AutoML::V1beta1::ImportDataRequest) operation = Google::Gax::Operation.new( @import_data.call(req, ), @operations_client, Google::Protobuf::Empty, Google::Cloud::AutoML::V1beta1::OperationMetadata, call_options: ) operation.on_done { |operation| yield(operation) } if block_given? operation end |
#list_column_specs(parent, field_mask: nil, filter: nil, page_size: nil, options: nil) {|result, operation| ... } ⇒ Google::Gax::PagedEnumerable<Google::Cloud::AutoML::V1beta1::ColumnSpec>
Lists column specs in a table spec.
1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 |
# File 'lib/google/cloud/automl/v1beta1/automl_client.rb', line 1845 def list_column_specs \ parent, field_mask: nil, filter: nil, page_size: nil, options: nil, &block req = { parent: parent, field_mask: field_mask, filter: filter, page_size: page_size }.delete_if { |_, v| v.nil? } req = Google::Gax::to_proto(req, Google::Cloud::AutoML::V1beta1::ListColumnSpecsRequest) @list_column_specs.call(req, , &block) end |
#list_datasets(parent, filter: nil, page_size: nil, options: nil) {|result, operation| ... } ⇒ Google::Gax::PagedEnumerable<Google::Cloud::AutoML::V1beta1::Dataset>
Lists datasets in a project.
723 724 725 726 727 728 729 730 731 732 733 734 735 736 |
# File 'lib/google/cloud/automl/v1beta1/automl_client.rb', line 723 def list_datasets \ parent, filter: nil, page_size: nil, options: nil, &block req = { parent: parent, filter: filter, page_size: page_size }.delete_if { |_, v| v.nil? } req = Google::Gax::to_proto(req, Google::Cloud::AutoML::V1beta1::ListDatasetsRequest) @list_datasets.call(req, , &block) end |
#list_model_evaluations(parent, filter: nil, page_size: nil, options: nil) {|result, operation| ... } ⇒ Google::Gax::PagedEnumerable<Google::Cloud::AutoML::V1beta1::ModelEvaluation>
Lists model evaluations.
1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 |
# File 'lib/google/cloud/automl/v1beta1/automl_client.rb', line 1577 def list_model_evaluations \ parent, filter: nil, page_size: nil, options: nil, &block req = { parent: parent, filter: filter, page_size: page_size }.delete_if { |_, v| v.nil? } req = Google::Gax::to_proto(req, Google::Cloud::AutoML::V1beta1::ListModelEvaluationsRequest) @list_model_evaluations.call(req, , &block) end |
#list_models(parent, filter: nil, page_size: nil, options: nil) {|result, operation| ... } ⇒ Google::Gax::PagedEnumerable<Google::Cloud::AutoML::V1beta1::Model>
Lists models.
1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 |
# File 'lib/google/cloud/automl/v1beta1/automl_client.rb', line 1106 def list_models \ parent, filter: nil, page_size: nil, options: nil, &block req = { parent: parent, filter: filter, page_size: page_size }.delete_if { |_, v| v.nil? } req = Google::Gax::to_proto(req, Google::Cloud::AutoML::V1beta1::ListModelsRequest) @list_models.call(req, , &block) end |
#list_operations(name, filter, page_size: nil, options: nil) ⇒ Google::Gax::PagedEnumerable<Google::Gax::Operation>
Lists operations that match the specified filter in the request.
88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 |
# File 'lib/google/cloud/automl/v1beta1/automl_client_helpers.rb', line 88 def list_operations name, filter, page_size: nil, options: nil paged_operations = @operations_client.list_operations name, filter, page_size: page_size, options: # Monkey-patch PagedEnumerable#each to yield Google::Gax::Operation instead of # Google::Longrunning::Operation. def paged_operations.each return enum_for :each unless block_given? super do |proto_op| yield Google::Gax::Operation.new( proto_op, @operations_client, nil, nil ) end end paged_operations end |
#list_table_specs(parent, field_mask: nil, filter: nil, page_size: nil, options: nil) {|result, operation| ... } ⇒ Google::Gax::PagedEnumerable<Google::Cloud::AutoML::V1beta1::TableSpec>
Lists table specs in a dataset.
1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 |
# File 'lib/google/cloud/automl/v1beta1/automl_client.rb', line 1705 def list_table_specs \ parent, field_mask: nil, filter: nil, page_size: nil, options: nil, &block req = { parent: parent, field_mask: field_mask, filter: filter, page_size: page_size }.delete_if { |_, v| v.nil? } req = Google::Gax::to_proto(req, Google::Cloud::AutoML::V1beta1::ListTableSpecsRequest) @list_table_specs.call(req, , &block) end |
#undeploy_model(name, options: nil) ⇒ Google::Gax::Operation
Undeploys a model. If the model is not deployed this method has no effect.
Only applicable for Text Classification, Image Object Detection and Tables; all other domains manage deployment automatically.
Returns an empty response in the response field when it completes.
1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 |
# File 'lib/google/cloud/automl/v1beta1/automl_client.rb', line 1315 def undeploy_model \ name, options: nil req = { name: name }.delete_if { |_, v| v.nil? } req = Google::Gax::to_proto(req, Google::Cloud::AutoML::V1beta1::UndeployModelRequest) operation = Google::Gax::Operation.new( @undeploy_model.call(req, ), @operations_client, Google::Protobuf::Empty, Google::Cloud::AutoML::V1beta1::OperationMetadata, call_options: ) operation.on_done { |operation| yield(operation) } if block_given? operation end |
#update_column_spec(column_spec, update_mask: nil, options: nil) {|result, operation| ... } ⇒ Google::Cloud::AutoML::V1beta1::ColumnSpec
Updates a column spec.
1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 |
# File 'lib/google/cloud/automl/v1beta1/automl_client.rb', line 1889 def update_column_spec \ column_spec, update_mask: nil, options: nil, &block req = { column_spec: column_spec, update_mask: update_mask }.delete_if { |_, v| v.nil? } req = Google::Gax::to_proto(req, Google::Cloud::AutoML::V1beta1::UpdateColumnSpecRequest) @update_column_spec.call(req, , &block) end |
#update_dataset(dataset, update_mask: nil, options: nil) {|result, operation| ... } ⇒ Google::Cloud::AutoML::V1beta1::Dataset
Updates a dataset.
631 632 633 634 635 636 637 638 639 640 641 642 |
# File 'lib/google/cloud/automl/v1beta1/automl_client.rb', line 631 def update_dataset \ dataset, update_mask: nil, options: nil, &block req = { dataset: dataset, update_mask: update_mask }.delete_if { |_, v| v.nil? } req = Google::Gax::to_proto(req, Google::Cloud::AutoML::V1beta1::UpdateDatasetRequest) @update_dataset.call(req, , &block) end |
#update_table_spec(table_spec, update_mask: nil, options: nil) {|result, operation| ... } ⇒ Google::Cloud::AutoML::V1beta1::TableSpec
Updates a table spec.
1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 |
# File 'lib/google/cloud/automl/v1beta1/automl_client.rb', line 1749 def update_table_spec \ table_spec, update_mask: nil, options: nil, &block req = { table_spec: table_spec, update_mask: update_mask }.delete_if { |_, v| v.nil? } req = Google::Gax::to_proto(req, Google::Cloud::AutoML::V1beta1::UpdateTableSpecRequest) @update_table_spec.call(req, , &block) end |