Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix fetch_column_info function #159

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

oussemabenhassena5
Copy link

Root Cause:

The list comprehension inside the max() function generates a list of column widths for items in layout_res where item['category'] == 'sub column'. If there are no items with the 'sub column' category in layout_res, the list will be empty, causing max() to raise the ValueError: max() arg is an empty sequence.

This issue arises only for PDFs where the layout detection does not identify any items with the 'sub column' category. This could happen if:

  1. The PDF has a non-standard structure or layout.
  2. The model struggles to classify the elements correctly.
  3. The detection pipeline filters out all potential 'sub column' items for some reason.

Captddure

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant