Skip to content

Commit f3867f6

Browse files
author
Daniel Lorch
committed
Revert "chore: print inference_result using idp_common packages"
This reverts commit 4071d2c.
1 parent cc31659 commit f3867f6

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

notebooks/misc/e2e-example-with-multimodal-page-classification-few-shot-prompting.ipynb

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -364,21 +364,20 @@
364364
"metadata": {},
365365
"outputs": [],
366366
"source": [
367-
"from idp_common.s3 import get_json_content\n",
368-
"\n",
369367
"print(\"\\nShow extraction results...\\n\")\n",
370368
"\n",
371369
"document_dict = document.to_dict()\n",
372370
"sections_json = json.dumps(document_dict[\"sections\"][:n], indent=2)\n",
373-
"print(sections_json)\n",
371+
"print(f\"{sections_json}...\")\n",
374372
"\n",
375373
"for section in document.sections[:n]:\n",
376374
" print(f\"\\nSection {section.section_id} extraction result:\")\n",
377375
" extraction_result_uri = section.extraction_result_uri\n",
378-
" if extraction_result_uri:\n",
379-
" result = get_json_content(extraction_result_uri)\n",
380-
" result_json = json.dumps(result[\"inference_result\"], indent=2)\n",
381-
" print(result_json)"
376+
" bucket, key = parse_s3_uri(extraction_result_uri)\n",
377+
" response = s3_client.get_object(Bucket=bucket, Key=key)\n",
378+
" content = response['Body'].read().decode('utf-8')\n",
379+
" result = json.loads(content)\n",
380+
" pprint.pp(result[\"inference_result\"])"
382381
]
383382
},
384383
{

0 commit comments

Comments
 (0)