From b891bd730c0f27d9c1e1c1c07c2d48dbe0706dcf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?ianar=C3=A9=20s=C3=A9vi?= Date: Wed, 29 May 2024 14:52:59 +0200 Subject: [PATCH] :sparkles: support printing the OCR text in the CLI tool --- mindee/cli.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/mindee/cli.py b/mindee/cli.py index 66df894f..4205d41a 100644 --- a/mindee/cli.py +++ b/mindee/cli.py @@ -361,6 +361,11 @@ def call_parse(self) -> None: else: if response.document is None: raise MindeeClientError("Something went wrong during async parsing.") + # print the OCR + if self.parsed_args.include_words: + print("#############\nDocument Text\n#############\n::\n") + print(" " + str(response.document.ocr).replace("\n", "\n ")) + # print the response as rST print(self._doc_str(self.parsed_args.output_type, response.document)) def _parse_sync(self) -> PredictResponse: