From 1ac860cae8be5b8fdae39f77640fe1c3a46b580b Mon Sep 17 00:00:00 2001 From: Luca Foppiano Date: Sun, 31 Aug 2025 07:34:38 +0100 Subject: [PATCH] add more verbosity --- grobid_client/grobid_client.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/grobid_client/grobid_client.py b/grobid_client/grobid_client.py index 6524cd7..c4d4d98 100644 --- a/grobid_client/grobid_client.py +++ b/grobid_client/grobid_client.py @@ -424,6 +424,7 @@ def process_batch( verbose=False, flavor=None ): + batch_start_time = time.time() if verbose: self.logger.info(f"{len(input_files)} files to process in current batch") @@ -494,6 +495,14 @@ def process_batch( except OSError as e: self.logger.error(f"Failed to write TEI XML file {filename}: {str(e)}") + # Calculate batch statistics + batch_runtime = time.time() - batch_start_time + batch_docs_per_second = processed_count / batch_runtime if batch_runtime > 0 else 0 + + if verbose: + self.logger.info(f"⏱️ Runtime: {batch_runtime:.2f} seconds") + self.logger.info(f"🚀 Speed: {batch_docs_per_second:.2f} documents/second") + return processed_count def process_pdf(