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

fix: docai_utilities.py to return Optional - #176

Merged
holtskinner merged 4 commits into
mainfrom
hocr-fixes
Oct 6, 2023
Merged

fix: docai_utilities.py to return Optional#176
holtskinner merged 4 commits into
mainfrom
hocr-fixes

Conversation

@holtskinner

@holtskinner holtskinner commented Oct 3, 2023

Copy link
Copy Markdown
Contributor

@holtskinner
holtskinner requested review from a team October 3, 2023 16:29
@conventional-commit-lint-gcf

conventional-commit-lint-gcf Bot commented Oct 3, 2023

Copy link
Copy Markdown

🤖 I detect that the PR title and the commit message differ and there's only one commit. To use the PR title for the commit history, you can use Github's automerge feature with squashing, or use automerge label. Good luck human!

-- conventional-commit-lint bot
https://conventionalcommits.org/

@product-auto-label product-auto-label Bot added the size: m Pull request size is medium. label Oct 3, 2023
- Should resolve customer reported issue in support case #47169701 relating to duplicate/inaccurate elements in hOCR output
- Followup to:
  - #161
  - #169
@holtskinner holtskinner changed the title fix: Update docai_utilities.py to return an Optional fix: docai_utilities.py to return Optional Oct 3, 2023
@holtskinner holtskinner added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Oct 3, 2023
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Oct 3, 2023
Comment thread google/cloud/documentai_toolbox/utilities/docai_utilities.py
Comment thread google/cloud/documentai_toolbox/wrappers/entity.py Outdated
Comment thread tests/unit/test_document.py Outdated
@dizcology

Copy link
Copy Markdown
Contributor

If possible, please also give some explanations about the duplicate/inaccurate elements in hOCR output in the PR description.

@holtskinner

Copy link
Copy Markdown
Contributor Author

If possible, please also give some explanations about the duplicate/inaccurate elements in hOCR output in the PR description.

I will once I get that information

@holtskinner holtskinner added kokoro:force-run Add this label to force Kokoro to re-run the tests. owlbot:run Add this label to trigger the Owlbot post processor. labels Oct 3, 2023
@gcf-owl-bot gcf-owl-bot Bot removed the owlbot:run Add this label to trigger the Owlbot post processor. label Oct 3, 2023
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Oct 3, 2023
@holtskinner

holtskinner commented Oct 6, 2023

Copy link
Copy Markdown
Contributor Author

Note: In the customers code, they use this whenever the document is blank. Not sure if this is a standard structure for blank hOCR documents, but could be good to look into.

Note - It doesn't follow the corrected structure after #169

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="unknown" lang="unknown">
<head>
<title>hocr</title>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<meta name="ocr-system" content="Document AI OCR" />
<meta name="ocr-langs" content="unknown" />
<meta name="ocr-number-of-pages" content="1" />
<meta name="ocr-capabilities" content="ocr_page ocr_carea ocr_par ocr_line ocrx_word" />
</head>
<body>
<div class='ocr_page' lang='unknown' title='bbox 0 0 0 0'>
<span class='ocr_carea' id='block_1_0' title='bbox 0 0 0 0'>
<span class='ocr_par' id='par_1_0_0' title='bbox 0 0 0 0'>
<span class='ocr_line' id='line_1_0_0_0' title='bbox 0 0 0 0'></span>
<span class='ocrx_word' id='word_1_0_0_0_0' title='bbox 0 0 0 0'></span>
</span>
</span>
</div>
</body>
</html>

@holtskinner
holtskinner merged commit 028bc37 into main Oct 6, 2023
@holtskinner
holtskinner deleted the hocr-fixes branch October 6, 2023 16:14
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

size: m Pull request size is medium.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants