Skip to content
This repository was archived by the owner on Mar 6, 2026. It is now read-only.

feat: added confidence score and detected languages to Page classes#387

Closed
Shifat7 wants to merge 7 commits intogoogleapis:mainfrom
Shifat7:main
Closed

feat: added confidence score and detected languages to Page classes#387
Shifat7 wants to merge 7 commits intogoogleapis:mainfrom
Shifat7:main

Conversation

@Shifat7
Copy link
Copy Markdown

@Shifat7 Shifat7 commented Apr 29, 2025

  • Introduced confidence property to represent the confidence score of Token detection.
  • Added detected_languages property to provide a list of detected languages for each Token.
  • Updated unit tests to validate the new properties.

Fixes googleapis/google-cloud-python#15817 @sarath-mec 🦕

@Shifat7 Shifat7 requested a review from a team as a code owner April 29, 2025 14:04
@Shifat7 Shifat7 requested review from a team and briandorsey and removed request for a team April 29, 2025 14:04
@product-auto-label product-auto-label bot added size: m Pull request size is medium. samples Issues that are directly related to samples. labels Apr 29, 2025
@Shifat7 Shifat7 changed the title Feat: added confidence score and detected languages to Token class and tests feat[Token]: added confidence score and detected languages to Token class and tests Apr 29, 2025
@Shifat7 Shifat7 changed the title feat[Token]: added confidence score and detected languages to Token class and tests feat(Token): added confidence score and detected languages to Token class and tests Apr 29, 2025
Comment thread samples/snippets/test_token_confidence_sample.py Outdated
Comment thread google/cloud/documentai_toolbox/wrappers/page.py Outdated
@Shifat7
Copy link
Copy Markdown
Author

Shifat7 commented Apr 29, 2025

hi @holtskinner, I've moved it to the _BasePageElement, thanks for your prompt review!

Comment thread samples/snippets/test_token_confidence_sample.py Outdated
Comment thread tests/unit/test_page.py
@Shifat7
Copy link
Copy Markdown
Author

Shifat7 commented Apr 30, 2025

hi @holtskinner , Ive removed the test samples as reviewed and other changes as well. Let me know if there's anything else

Comment thread samples/snippets/token_confidence_sample.py Outdated
Comment thread samples/snippets/token_detected_languages_sample.py Outdated
@Shifat7
Copy link
Copy Markdown
Author

Shifat7 commented May 4, 2025

hi @holtskinner , all done thanks for reviewing!

holtskinner
holtskinner previously approved these changes May 5, 2025
@holtskinner holtskinner changed the title feat(Token): added confidence score and detected languages to Token class and tests feat: added confidence score and detected languages to Page classes May 5, 2025
@holtskinner holtskinner enabled auto-merge (squash) May 5, 2025 15:25
@holtskinner holtskinner disabled auto-merge May 5, 2025 15:25
@holtskinner holtskinner enabled auto-merge (squash) May 5, 2025 15:25
@holtskinner holtskinner disabled auto-merge May 5, 2025 15:25
@holtskinner
Copy link
Copy Markdown
Contributor

Closing this PR. The alternative presented in googleapis/google-cloud-python#15817 (comment) should be sufficient for this use case.

auto-merge was automatically disabled January 14, 2026 16:12

Pull request was closed

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

samples Issues that are directly related to samples. size: m Pull request size is medium.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Expose Confidence and Language Detected in Wrapper Document

3 participants