发布

  • Fix: partition pdf overflow error (#2054)

    frostbyte_neo 发布于 2023-11-10 19:01:46 +00:00

    Closes #2050.

    Summary

    • set zoom to 1 if zoom is less than 0 when parsing Tesseract OCR
      data
    • update determine_pdf_auto_strategy to return the hi_res strategy
      if either infer_table_structure or extract_images_in_pdf is true

    Testing

    PDF:
    getty_62-62.pdf

    Run the following code in both the main branch and the current
    branch.

    from unstructured.partition.pdf import partition_pdf
    
    elements = partition_pdf(
        filename="getty_62-62.pdf",
        extract_images_in_pdf=True,
        infer_table_structure=True,
        chunking_strategy="by_title",
        max_characters=4000,
        new_after_n_chars=3800,
        combine_text_under_n_chars=2000,
        image_output_dir_path=path,
    )
    
    下载附件