Skip to content

Commit

Permalink
ESL-167 extract only words bboxes for tabby reader
Browse files Browse the repository at this point in the history
  • Loading branch information
NastyBoget committed Oct 20, 2023
1 parent 3c6756b commit 2916086
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -199,10 +199,12 @@ def __get_lines_with_location(self, page: dict, file_hash: str) -> List[LineWith
if annotation["metadata"] == "LINK":
annotations.append(LinkedTextAnnotation(start, end, annotation["url"]))

bbox = BBox(x_top_left=int(block["x_top_left"]), y_top_left=int(block["y_top_left"]), width=int(block["width"]), height=int(block["height"]))
if self.config.get("labeling_mode", False):
annotations.append(BBoxAnnotation(0, len_block, bbox, page_width=page_width, page_height=page_height))

meta = block["metadata"].lower()
uid = f"txt_{file_hash}_{order}"
bbox = BBox(x_top_left=int(block["x_top_left"]), y_top_left=int(block["y_top_left"]), width=int(block["width"]), height=int(block["height"]))
annotations.append(BBoxAnnotation(0, len_block, bbox, page_width=page_width, page_height=page_height))

metadata = LineMetadata(page_id=page_number, line_id=order)
line_with_location = LineWithLocation(line=block_text,
Expand Down

0 comments on commit 2916086

Please sign in to comment.