Skip to content

Commit bfb4da8

Browse files
yoshi-automationtseaver
authored andcommitted
Add 'ClassificationEvaluationMetrics.display_name'/'BatchPredictResult.metadata'/'TableSpec.valid_row_count' (via synth) (#9004)
1 parent 083ee9c commit bfb4da8

32 files changed

+871
-584
lines changed

automl/google/cloud/automl_v1beta1/gapic/auto_ml_client.py

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -391,11 +391,7 @@ def update_dataset(
391391
392392
If a dict is provided, it must be of the same form as the protobuf
393393
message :class:`~google.cloud.automl_v1beta1.types.Dataset`
394-
update_mask (Union[dict, ~google.cloud.automl_v1beta1.types.FieldMask]): The update mask applies to the resource. For the ``FieldMask``
395-
definition, see
396-
397-
https: //developers.google.com/protocol-buffers //
398-
/docs/reference/google.protobuf#fieldmask
394+
update_mask (Union[dict, ~google.cloud.automl_v1beta1.types.FieldMask]): The update mask applies to the resource.
399395
400396
If a dict is provided, it must be of the same form as the protobuf
401397
message :class:`~google.cloud.automl_v1beta1.types.FieldMask`
@@ -2142,11 +2138,7 @@ def update_table_spec(
21422138
21432139
If a dict is provided, it must be of the same form as the protobuf
21442140
message :class:`~google.cloud.automl_v1beta1.types.TableSpec`
2145-
update_mask (Union[dict, ~google.cloud.automl_v1beta1.types.FieldMask]): The update mask applies to the resource. For the ``FieldMask``
2146-
definition, see
2147-
2148-
https: //developers.google.com/protocol-buffers //
2149-
/docs/reference/google.protobuf#fieldmask
2141+
update_mask (Union[dict, ~google.cloud.automl_v1beta1.types.FieldMask]): The update mask applies to the resource.
21502142
21512143
If a dict is provided, it must be of the same form as the protobuf
21522144
message :class:`~google.cloud.automl_v1beta1.types.FieldMask`
@@ -2410,11 +2402,7 @@ def update_column_spec(
24102402
24112403
If a dict is provided, it must be of the same form as the protobuf
24122404
message :class:`~google.cloud.automl_v1beta1.types.ColumnSpec`
2413-
update_mask (Union[dict, ~google.cloud.automl_v1beta1.types.FieldMask]): The update mask applies to the resource. For the ``FieldMask``
2414-
definition, see
2415-
2416-
https: //developers.google.com/protocol-buffers //
2417-
/docs/reference/google.protobuf#fieldmask
2405+
update_mask (Union[dict, ~google.cloud.automl_v1beta1.types.FieldMask]): The update mask applies to the resource.
24182406
24192407
If a dict is provided, it must be of the same form as the protobuf
24202408
message :class:`~google.cloud.automl_v1beta1.types.FieldMask`

automl/google/cloud/automl_v1beta1/gapic/enums.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -52,13 +52,6 @@ class TypeCode(enum.IntEnum):
5252
"""
5353
``TypeCode`` is used as a part of ``DataType``.
5454
55-
Each legal value of a DataType can be encoded to or decoded from a JSON
56-
value, using the encodings listed below, and definitions of which can be
57-
found at
58-
59-
https: //developers.google.com/protocol-buffers //
60-
/docs/reference/google.protobuf#value.
61-
6255
Attributes:
6356
TYPE_CODE_UNSPECIFIED (int): Not specified. Should not be used.
6457
FLOAT64 (int): Encoded as ``number``, or the strings ``"NaN"``, ``"Infinity"``, or

automl/google/cloud/automl_v1beta1/gapic/prediction_service_client.py

Lines changed: 35 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,9 @@ def predict(
245245
246246
``prediction_type``.
247247
248+
- Text Sentiment - TextSnippet, content up 500 characters, UTF-8
249+
encoded.
250+
248251
Example:
249252
>>> from google.cloud import automl_v1beta1
250253
>>>
@@ -259,8 +262,7 @@ def predict(
259262
260263
Args:
261264
name (str): Name of the model requested to serve the prediction.
262-
payload (Union[dict, ~google.cloud.automl_v1beta1.types.ExamplePayload]): Required.
263-
Payload to perform a prediction on. The payload must match the
265+
payload (Union[dict, ~google.cloud.automl_v1beta1.types.ExamplePayload]): Required. Payload to perform a prediction on. The payload must match the
264266
problem type that the model was trained to solve.
265267
266268
If a dict is provided, it must be of the same form as the protobuf
@@ -274,6 +276,13 @@ def predict(
274276
makes predictions for an image, it will only produce results that
275277
have at least this confidence score. The default is 0.5.
276278
279+
- For Image Object Detection: ``score_threshold`` - (float) When Model
280+
detects objects on the image, it will only produce bounding boxes
281+
which have at least this confidence score. Value in 0 to 1 range,
282+
default is 0.5. ``max_bounding_box_count`` - (int64) No more than
283+
this number of bounding boxes will be returned in the response.
284+
Default is 100, the requested value may be limited by server.
285+
277286
- For Tables: ``feature_importance`` - (boolean) Whether
278287
279288
[feature\_importance][[google.cloud.automl.v1beta1.TablesModelColumnInfo.feature\_importance]
@@ -349,9 +358,10 @@ def batch_predict(
349358
done, ``BatchPredictResult`` is returned in the ``response`` field.
350359
Available for following ML problems:
351360
361+
- Image Classification
362+
- Image Object Detection
352363
- Video Classification
353-
- Video Object Tracking
354-
- Text Extraction
364+
- Video Object Tracking \* Text Extraction
355365
- Tables
356366
357367
Example:
@@ -392,6 +402,27 @@ def batch_predict(
392402
params (dict[str -> str]): Additional domain-specific parameters for the predictions, any string
393403
must be up to 25000 characters long.
394404
405+
- For Text Classification:
406+
407+
``score_threshold`` - (float) A value from 0.0 to 1.0. When the model
408+
makes predictions for a text snippet, it will only produce results
409+
that have at least this confidence score. The default is 0.5.
410+
411+
- For Image Classification:
412+
413+
``score_threshold`` - (float) A value from 0.0 to 1.0. When the model
414+
makes predictions for an image, it will only produce results that
415+
have at least this confidence score. The default is 0.5.
416+
417+
- For Image Object Detection:
418+
419+
``score_threshold`` - (float) When Model detects objects on the
420+
image, it will only produce bounding boxes which have at least this
421+
confidence score. Value in 0 to 1 range, default is 0.5.
422+
``max_bounding_box_count`` - (int64) No more than this number of
423+
bounding boxes will be produced per image. Default is 100, the
424+
requested value may be limited by server.
425+
395426
- For Video Classification : ``score_threshold`` - (float) A value from
396427
0.0 to 1.0. When the model makes predictions for a video, it will
397428
only produce results that have at least this confidence score. The

automl/google/cloud/automl_v1beta1/gapic/transports/prediction_service_grpc_transport.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,9 @@ def predict(self):
140140
141141
``prediction_type``.
142142
143+
- Text Sentiment - TextSnippet, content up 500 characters, UTF-8
144+
encoded.
145+
143146
Returns:
144147
Callable: A callable which accepts the appropriate
145148
deserialized request object and returns a
@@ -158,9 +161,10 @@ def batch_predict(self):
158161
done, ``BatchPredictResult`` is returned in the ``response`` field.
159162
Available for following ML problems:
160163
164+
- Image Classification
165+
- Image Object Detection
161166
- Video Classification
162-
- Video Object Tracking
163-
- Text Extraction
167+
- Video Object Tracking \* Text Extraction
164168
- Tables
165169
166170
Returns:

automl/google/cloud/automl_v1beta1/proto/classification.proto

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,15 @@ message ClassificationEvaluationMetrics {
164164
// only list of [annotation_spec_display_name-s][] is populated.
165165
repeated string annotation_spec_id = 1;
166166

167+
// Output only. Display name of the annotation specs used in the confusion
168+
// matrix, as they were at the moment of the evaluation. For Tables
169+
// CLASSIFICATION
170+
//
171+
// [prediction_type-s][google.cloud.automl.v1beta1.TablesModelMetadata.prediction_type],
172+
// distinct values of the target column at the moment of the model
173+
// evaluation are populated here.
174+
repeated string display_name = 3;
175+
167176
// Output only. Rows in the confusion matrix. The number of rows is equal to
168177
// the size of `annotation_spec_id`.
169178
// `row[i].value[j]` is the number of examples that have ground truth of the

automl/google/cloud/automl_v1beta1/proto/classification_pb2.py

Lines changed: 33 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

automl/google/cloud/automl_v1beta1/proto/column_spec.proto

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -64,12 +64,7 @@ message ColumnSpec {
6464
// for the timestamp at which these stats were last updated.
6565
DataStats data_stats = 4;
6666

67-
// Output only. Top 10 most correlated with this column columns of the table,
68-
// ordered by
69-
// [cramers_v][google.cloud.automl.v1beta1.CorrelationStats.cramers_v] metric.
70-
// This field may be stale, see the ancestor's
71-
// Dataset.tables_dataset_metadata.stats_update_time field
72-
// for the timestamp at which these stats were last updated.
67+
// Deprecated.
7368
repeated CorrelatedColumn top_correlated_columns = 5;
7469

7570
// Used to perform consistent read-modify-write updates. If not set, a blind

automl/google/cloud/automl_v1beta1/proto/column_spec_pb2.py

Lines changed: 1 addition & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

automl/google/cloud/automl_v1beta1/proto/data_items.proto

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,9 @@ message TextSnippet {
5656
// characters long.
5757
string content = 1;
5858

59-
// The format of the source text. Currently the only two allowed values are
60-
// "text/html" and "text/plain". If left blank the format is automatically
61-
// determined from the type of the uploaded content.
59+
// Optional. The format of [content][google.cloud.automl.v1beta1.TextSnippet.content]. Currently the only two allowed
60+
// values are "text/html" and "text/plain". If left blank, the format is
61+
// automatically determined from the type of the uploaded [content][google.cloud.automl.v1beta1.TextSnippet.content].
6262
string mime_type = 2;
6363

6464
// Output only. HTTP URI where you can download the content.
@@ -73,19 +73,19 @@ message Document {
7373

7474
// A representation of a row in a relational table.
7575
message Row {
76-
// Input Only.
7776
// The resource IDs of the column specs describing the columns of the row.
78-
// If set must contain, but possibly in a different order, all input feature
77+
// If set must contain, but possibly in a different order, all input
78+
// feature
7979
//
8080
// [column_spec_ids][google.cloud.automl.v1beta1.TablesModelMetadata.input_feature_column_specs]
8181
// of the Model this row is being passed to.
8282
// Note: The below `values` field must match order of this field, if this
8383
// field is set.
8484
repeated string column_spec_ids = 2;
8585

86-
// Input Only.
87-
// The values of the row cells, given in the same order as the
88-
// column_spec_ids, or, if not set, then in the same order as input feature
86+
// Required. The values of the row cells, given in the same order as the
87+
// column_spec_ids, or, if not set, then in the same order as input
88+
// feature
8989
//
9090
// [column_specs][google.cloud.automl.v1beta1.TablesModelMetadata.input_feature_column_specs]
9191
// of the Model this row is being passed to.

0 commit comments

Comments
 (0)