Skip to content

Commit

Permalink
handle missing paragraphs in doc-extract
Browse files Browse the repository at this point in the history
  • Loading branch information
devxpy committed Feb 13, 2024
1 parent 7f5adb9 commit 6e22901
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions daras_ai_v2/azure_doc_extract.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,9 @@ def azure_form_recognizer(url: str, model_id: str, params: dict = None):


def extract_records(result: dict, page_num: int) -> list[dict]:
if not result:
return []
table_polys = extract_tables(result, page_num)
records = []
for para in result["paragraphs"]:
for para in result.get("paragraphs", []):
try:
if para["boundingRegions"][0]["pageNumber"] != page_num:
continue
Expand Down

0 comments on commit 6e22901

Please sign in to comment.