Skip to content

Commit

Permalink
feat: [google-cloud-documentai] A new message `FoundationModelTuningO…
Browse files Browse the repository at this point in the history
…ptions` is added (#12585)

- [ ] Regenerate this pull request now.

BEGIN_COMMIT_OVERRIDE
feat: A new message `FoundationModelTuningOptions` is added
feat: A new field `foundation_model_tuning_options` is added to message
`TrainProcessorVersionRequest`
docs: updated comments
END_COMMIT_OVERRIDE


PiperOrigin-RevId: 625415406

Source-Link:
googleapis/googleapis@caa099d

Source-Link:
googleapis/googleapis-gen@9168448
Copy-Tag:
eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWRvY3VtZW50YWkvLk93bEJvdC55YW1sIiwiaCI6IjkxNjg0NDg2Y2M4NTBjODU2NDc5MjcyMDY5NGEyMGI4YzA0YzUwNjEifQ==

---------

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
Co-authored-by: Anthonios Partheniou <partheniou@google.com>
  • Loading branch information
3 people committed Apr 17, 2024
1 parent 1392da5 commit 69cfd79
Show file tree
Hide file tree
Showing 10 changed files with 49 additions and 10 deletions.
Expand Up @@ -13,4 +13,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
__version__ = "2.25.0" # {x-release-please-version}
__version__ = "0.0.0" # {x-release-please-version}
Expand Up @@ -13,4 +13,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
__version__ = "2.25.0" # {x-release-please-version}
__version__ = "0.0.0" # {x-release-please-version}
Expand Up @@ -611,8 +611,7 @@ class StyleInfo(proto.Message):
pixel_font_size (float):
Font size in pixels, equal to *unrounded
[font_size][google.cloud.documentai.v1.Document.Page.Token.StyleInfo.font_size]*
- *resolution* ÷ ``72.0``.
\* *resolution* ÷ ``72.0``.
letter_spacing (float):
Letter spacing in points.
font_type (str):
Expand Down
Expand Up @@ -1155,6 +1155,10 @@ class TrainProcessorVersionRequest(proto.Message):
[TrainProcessorVersion][google.cloud.documentai.v1.DocumentProcessorService.TrainProcessorVersion]
method.
This message has `oneof`_ fields (mutually exclusive fields).
For each oneof, at most one member field can be set at the same time.
Setting any member of the oneof automatically clears all other
members.
.. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields
Expand All @@ -1163,6 +1167,11 @@ class TrainProcessorVersionRequest(proto.Message):
Options to control Custom Document Extraction
(CDE) Processor.
This field is a member of `oneof`_ ``processor_flags``.
foundation_model_tuning_options (google.cloud.documentai_v1.types.TrainProcessorVersionRequest.FoundationModelTuningOptions):
Options to control foundation model tuning of
a processor.
This field is a member of `oneof`_ ``processor_flags``.
parent (str):
Required. The parent (project, location and processor) to
Expand Down Expand Up @@ -1239,12 +1248,43 @@ class TrainingMethod(proto.Enum):
enum="TrainProcessorVersionRequest.CustomDocumentExtractionOptions.TrainingMethod",
)

class FoundationModelTuningOptions(proto.Message):
r"""Options to control foundation model tuning of the processor.
Attributes:
train_steps (int):
Optional. The number of steps to run for
model tuning. Valid values are between 1 and
400. If not provided, recommended steps will be
used.
learning_rate_multiplier (float):
Optional. The multiplier to apply to the
recommended learning rate. Valid values are
between 0.1 and 10. If not provided, recommended
learning rate will be used.
"""

train_steps: int = proto.Field(
proto.INT32,
number=2,
)
learning_rate_multiplier: float = proto.Field(
proto.FLOAT,
number=3,
)

custom_document_extraction_options: CustomDocumentExtractionOptions = proto.Field(
proto.MESSAGE,
number=5,
oneof="processor_flags",
message=CustomDocumentExtractionOptions,
)
foundation_model_tuning_options: FoundationModelTuningOptions = proto.Field(
proto.MESSAGE,
number=12,
oneof="processor_flags",
message=FoundationModelTuningOptions,
)
parent: str = proto.Field(
proto.STRING,
number=1,
Expand Down
Expand Up @@ -13,4 +13,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
__version__ = "2.25.0" # {x-release-please-version}
__version__ = "0.0.0" # {x-release-please-version}
Expand Up @@ -13,4 +13,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
__version__ = "2.25.0" # {x-release-please-version}
__version__ = "0.0.0" # {x-release-please-version}
Expand Up @@ -8,7 +8,7 @@
],
"language": "PYTHON",
"name": "google-cloud-documentai",
"version": "2.25.0"
"version": "0.1.0"
},
"snippets": [
{
Expand Down
Expand Up @@ -8,7 +8,7 @@
],
"language": "PYTHON",
"name": "google-cloud-documentai",
"version": "2.25.0"
"version": "0.1.0"
},
"snippets": [
{
Expand Down
Expand Up @@ -8,7 +8,7 @@
],
"language": "PYTHON",
"name": "google-cloud-documentai",
"version": "2.25.0"
"version": "0.1.0"
},
"snippets": [
{
Expand Down
Expand Up @@ -59,7 +59,7 @@ class documentaiCallTransformer(cst.CSTTransformer):
'process_document': ('name', 'inline_document', 'raw_document', 'gcs_document', 'skip_human_review', 'field_mask', 'process_options', 'labels', ),
'review_document': ('human_review_config', 'inline_document', 'enable_schema_validation', 'priority', 'document_schema', ),
'set_default_processor_version': ('processor', 'default_processor_version', ),
'train_processor_version': ('parent', 'processor_version', 'custom_document_extraction_options', 'document_schema', 'input_data', 'base_processor_version', ),
'train_processor_version': ('parent', 'processor_version', 'custom_document_extraction_options', 'foundation_model_tuning_options', 'document_schema', 'input_data', 'base_processor_version', ),
'undeploy_processor_version': ('name', ),
}

Expand Down

0 comments on commit 69cfd79

Please sign in to comment.