unstructured
e597ec7a - Fix: skip empty annotation bbox (#1665)

Commit
2 years ago
Fix: skip empty annotation bbox (#1665) Address: https://github.com/Unstructured-IO/unstructured/issues/1663 ## Summary While trying to find how overlap between a element bbox and annotation bbox, we find the intersection of two bboxes and divide it by the size of annotation bbox, this will cause a zero division error if size of annotation bbox is 0. * this PR fix the zero division error for function `check_annotations_within_element` * also fix error: `TypeError: unsupported operand type(s) for -: 'float' and 'NoneType'` by stop inserting empty word with None bbox into list of words in function `get_word_bounding_box_from_element` ## Test reproduce with code and document as the user mentioned and should see no error: ``` from unstructured.partition.auto import partition elements = partition( filename="./IZSAM8.2_221012.pdf", strategy="fast", ) ```
Author
Parents
Loading