Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions grobid_client/grobid_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Expand Down Expand Up @@ -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(
Expand Down