File tree 2 files changed +8
-8
lines changed 2 files changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -343,12 +343,12 @@ def ocr__ocr_async__get_job_result(
343
343
pages = []
344
344
for page in response_data ["pages" ]:
345
345
raw_text += page ["markdown" ]
346
- # markdown_lines = page["markdown"].split("\n")
347
- # lines = []
348
- # for line_text in markdown_lines:
349
- # line = Line(text=line_text, bounding_box=BoundingBox() )
350
- # lines.append(line)
351
- # pages.append(Page(lines=lines))
346
+ markdown_lines = page ["markdown" ].split ("\n " )
347
+ lines = []
348
+ for line_text in markdown_lines :
349
+ line = Line (text = line_text , confidence = 100 )
350
+ lines .append (line )
351
+ pages .append (Page (lines = lines ))
352
352
353
353
return AsyncResponseType (
354
354
original_response = response_data ,
Original file line number Diff line number Diff line change @@ -187,8 +187,8 @@ class Line(BaseModel):
187
187
188
188
text : str = Field (description = "Text detected in the line" )
189
189
words : Sequence [Word ] = Field (default_factory = list , description = "List of words" )
190
- bounding_box : BoundingBox = Field (
191
- description = "Bounding boxes of the words in the line "
190
+ bounding_box : Optional [ BoundingBox ] = Field (
191
+ default = None , description = "Bounding box of the line, can be None "
192
192
)
193
193
confidence : Optional [float ] = Field (..., description = "Confidence of the line" )
194
194
You can’t perform that action at this time.
0 commit comments