Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Adding support for image and table annotation for DocAI#13329

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Draft
bibliofilo wants to merge10 commits intoGoogleCloudPlatform:main
base:main
Choose a base branch
Loading
frombibliofilo:main

Conversation

bibliofilo
Copy link

Description

Image Annotation is GA in DocAI Layout Parser, these changes were requested internally to update documentation and available code to match and support the offering.

Bugs: b/413675713

Fixes #

Note: Before submitting a pull request, please open an issue for discussion if you are not associated with Google.

Checklist

@google-claGoogle CLA
Copy link

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View thisfailed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@product-auto-labelproduct-auto-labelbot added samplesIssues that are directly related to samples. api: documentaiIssues related to the Document AI API. labelsApr 29, 2025
Copy link
Contributor

@gemini-code-assistgemini-code-assistbot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Hello@bibliofilo, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

Summary of Changes

This pull request adds support for image and table annotation to the DocAI Layout Parser. The changes include modifications todocumentai/snippets/handle_response_sample.py to include example code for enabling image and table annotation, updates todocumentai/snippets/handle_response_sample.py to add parameters for enabling image and table annotation, and updates todocumentai/snippets/handle_response_sample_test.py to enable image and table annotation in the test case.

Highlights

  • Feature: Adds support for image annotation in DocAI Layout Parser.
  • Feature: Adds support for table annotation in DocAI Layout Parser.
  • Documentation: Updates documentation and code to match and support the new offering.

Changelog

  • documentai/snippets/handle_response_sample.py
    • Added example code for enabling image and table annotation (lines 35-36).
    • Added parametersenable_image_annotation andenable_table_annotation to theprocess_document_layout_sample function (lines 467-468).
    • Modifiedprocess_document_layout_sample to includeenable_image_annotation andenable_table_annotation inProcessOptions (lines 476-477).
  • documentai/snippets/handle_response_sample_test.py
    • Enabled image and table annotation in thetest_process_document_layout test case (lines 232-233).
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on ourdocumentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either/gemini <command> or@gemini-code-assist <command>. Below is a summary of the supported commands.

FeatureCommandDescription
Code Review/gemini reviewPerforms a code review for the current pull request in its current state.
Pull Request Summary/gemini summaryProvides a summary of the current pull request in its current state.
Comment@gemini-code-assistResponds in comments when explicitly tagged, both in issue comments and review comments.
Help/gemini helpDisplays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a.gemini/ folder in the base of the repository. Detailed instructions can be foundhere.

Limitations & Feedback

Gemini Code Assist is currently in preview and may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on@gemini-code-assist comments to provide feedback.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with theGemini Code Assist IDE Extension.


A parser's task, to dissect,
Layouts complex, to inspect.
Images and tables,
Now part of the fables,
Annotations, we now expect.

Footnotes

  1. Review thePrivacy Notices,Generative AI Prohibited Use Policy,Terms of Service, and learn how to configure Gemini Code Assist in GitHubhere. Gemini can make mistakes, so double check it anduse code with caution.

Copy link
Contributor

@gemini-code-assistgemini-code-assistbot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Code Review

The pull request introduces support for image and table annotation in DocAI Layout Parser. The changes include updating documentation and code to support this feature. Overall, the changes seem reasonable, but there are a few areas that could be improved for clarity and consistency.

Summary of Findings

  • Inconsistent use of boolean values: The code uses string literals for boolean values in the comments but uses actual boolean values in the function definition. This inconsistency can be confusing.
  • Missing documentation for new parameters: The new parametersenable_image_annotation andenable_table_annotation in theprocess_document_layout_sample function lack docstrings, which should be added to improve readability and maintainability.

Merge Readiness

The pull request is almost ready for merging. However, the inconsistencies in boolean value usage and the missing documentation for the new parameters should be addressed before merging. Once these issues are resolved, the code should be good to go. I am unable to directly approve the pull request, and users should have others review and approve this code before merging.

bibliofiloand others added4 commitsApril 30, 2025 11:51
Co-authored-by: Holt Skinner <13262395+holtskinner@users.noreply.github.com>
Co-authored-by: Holt Skinner <13262395+holtskinner@users.noreply.github.com>
Co-authored-by: Holt Skinner <13262395+holtskinner@users.noreply.github.com>
Co-authored-by: Holt Skinner <13262395+holtskinner@users.noreply.github.com>
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@gemini-code-assistgemini-code-assist[bot]gemini-code-assist[bot] left review comments

@holtskinnerholtskinnerholtskinner requested changes

Requested changes must be addressed to merge this pull request.

Assignees
No one assigned
Labels
api: documentaiIssues related to the Document AI API.samplesIssues that are directly related to samples.
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants
@bibliofilo@holtskinner

[8]ページ先頭

©2009-2025 Movatter.jp