Transforms complex documents like PDFs and Office docs into LLM-ready markdown/JSON for your Agentic workflows.
Python ai4sciencedocument-analysisdocxextract-datalayout-analysisocrparserpdfpdf-converterpdf-extractor-llmpdf-extractor-pretrainpdf-extractor-ragpdf-parserpptxpythonxlsx
重构目录结构
赵小蒙7f0371da0e20
diff --git a/check_inline_formula.py b/othoers/check_inline_formula.pysimilarity index 100%rename from check_inline_formula.pyrename to othoers/check_inline_formula.pydiff --git a/pdf2json_infer.py b/othoers/pdf2json_infer.pysimilarity index 99%rename from pdf2json_infer.pyrename to othoers/pdf2json_infer.pyindex 1ade9089..889e425a 100644--- a/pdf2json_infer.py+++ b/othoers/pdf2json_infer.py@@ -24,10 +24,10 @@ from validation import cal_edit_distance, format_gt_bbox, label_match, detect_vafrom layout.bbox_sort import bbox_sort, CONTENT_IDX, CONTENT_TYPE_IDXfrom pre_proc.detect_images import parse_images # 获取figures的bbox-from pdf2text_recogTable import parse_tables # 获取tables的bbox+from pre_proc.detect_tables import parse_tables # 获取tables的bboxfrom pre_proc.detect_equation import parse_equations # 获取equations的bbox# from pdf2text_recogFootnote import parse_footnotes # 获取footnotes的bbox-from pdf2text_recogPara import process_blocks_per_page+from post_proc.detect_para import process_blocks_per_pagefrom libs.commons import parse_aws_param, parse_bucket_key, read_file, join_pathdiff --git a/pdf2text_evaluatePdfLayout.py b/othoers/pdf2text_evaluatePdfLayout.pysimilarity index 100%rename from pdf2text_evaluatePdfLayout.pyrename to othoers/pdf2text_evaluatePdfLayout.pydiff --git a/pdf2text_getNumberOfColumn.py b/othoers/pdf2text_getNumberOfColumn.pysimilarity index 100%rename from pdf2text_getNumberOfColumn.pyrename to othoers/pdf2text_getNumberOfColumn.pydiff --git a/pdf2text_recogFootnoteLine.py b/othoers/pdf2text_recogFootnoteLine.pysimilarity index 100%rename from pdf2text_recogFootnoteLine.pyrename to othoers/pdf2text_recogFootnoteLine.pydiff --git a/pdf2text_recogPara_v2.py b/othoers/pdf2text_recogPara_v2.pysimilarity index 99%rename from pdf2text_recogPara_v2.pyrename to othoers/pdf2text_recogPara_v2.pyindex aa3d0914..afc210ef 100644--- a/pdf2text_recogPara_v2.py+++ b/othoers/pdf2text_recogPara_v2.py@@ -3469,7 +3469,7 @@ class ParaProcessPipeline:"""Run this script to test the function with Command:-python pdf2text_recogPara.py [pdf_path] [output_pdf_path]+python detect_para.py [pdf_path] [output_pdf_path]Params:- pdf_path: the path of the pdf filediff --git a/pdf2text_recogTitle.py b/othoers/pdf2text_recogTitle.pysimilarity index 100%rename from pdf2text_recogTitle.pyrename to othoers/pdf2text_recogTitle.pydiff --git a/vali_bbox_sort.py b/othoers/vali_bbox_sort.pysimilarity index 100%rename from vali_bbox_sort.pyrename to othoers/vali_bbox_sort.pydiff --git a/validation.py b/othoers/validation.pysimilarity index 100%rename from validation.pyrename to othoers/validation.pydiff --git a/pipeline/pdf_parse_by_model.py b/pipeline/pdf_parse_by_model.pyindex 0bd7eafc..da973444 100644--- a/pipeline/pdf_parse_by_model.py+++ b/pipeline/pdf_parse_by_model.py@@ -16,14 +16,14 @@ from libs.markdown_utils import escape_special_markdown_charfrom libs.safe_filename import sanitize_filenamefrom libs.vis_utils import draw_bbox_on_page, draw_layout_bbox_on_pagefrom pre_proc.detect_images import parse_images-from pdf2text_recogTable import parse_tables # 获取tables的bbox+from pre_proc.detect_tables import parse_tables # 获取tables的bboxfrom pre_proc.detect_equation import parse_equations # 获取equations的bbox-from pdf2text_recogHeader import parse_headers # 获取headers的bbox-from pdf2text_recogPageNo import parse_pageNos # 获取pageNos的bbox+from pre_proc.detect_header import parse_headers # 获取headers的bbox+from pre_proc.detect_page_number import parse_pageNos # 获取pageNos的bboxfrom pre_proc.detect_footnote import parse_footnotes_by_model, parse_footnotes_by_rule # 获取footnotes的bboxfrom pre_proc.detect_footer_by_model import parse_footers # 获取footers的bbox-from pdf2text_recogPara import (+from post_proc.detect_para import (ParaProcessPipeline,TitleDetectionException,TitleLevelException,diff --git a/pdf2text_recogPara.py b/post_proc/detect_para.pysimilarity index 99%rename from pdf2text_recogPara.pyrename to post_proc/detect_para.pyindex ddabde89..5aa67300 100644--- a/pdf2text_recogPara.py+++ b/post_proc/detect_para.py@@ -3395,7 +3395,7 @@ class ParaProcessPipeline:"""Run this script to test the function with Command:-python pdf2text_recogPara.py [pdf_path] [output_pdf_path]+python detect_para.py [pdf_path] [output_pdf_path]Params:- pdf_path: the path of the pdf filediff --git a/pdf2text_recogHeader.py b/pre_proc/detect_header.pysimilarity index 100%rename from pdf2text_recogHeader.pyrename to pre_proc/detect_header.pydiff --git a/pdf2text_recogPageNo.py b/pre_proc/detect_page_number.pysimilarity index 100%rename from pdf2text_recogPageNo.pyrename to pre_proc/detect_page_number.pydiff --git a/pdf2text_recogTable.py b/pre_proc/detect_tables.pysimilarity index 100%rename from pdf2text_recogTable.pyrename to pre_proc/detect_tables.pydiff --git a/test/test_para/test_pdf2text_recogPara_BlockContinuationProcessor.py b/test/test_para/test_pdf2text_recogPara_BlockContinuationProcessor.pyindex 08cce0e6..91bff3f5 100644--- a/test/test_para/test_pdf2text_recogPara_BlockContinuationProcessor.py+++ b/test/test_para/test_pdf2text_recogPara_BlockContinuationProcessor.py@@ -1,6 +1,6 @@import unittest-from pdf2text_recogPara import BlockContinuationProcessor+from post_proc.detect_para import BlockContinuationProcessor# from ... pdf2text_recogPara import BlockContinuationProcessor # another way to importdiff --git a/test/test_para/test_pdf2text_recogPara_BlockInnerParasProcessor.py b/test/test_para/test_pdf2text_recogPara_BlockInnerParasProcessor.pyindex 676bd183..209c4a53 100644--- a/test/test_para/test_pdf2text_recogPara_BlockInnerParasProcessor.py+++ b/test/test_para/test_pdf2text_recogPara_BlockInnerParasProcessor.py@@ -1,6 +1,6 @@import unittest-from pdf2text_recogPara import BlockTerminationProcessor+from post_proc.detect_para import BlockTerminationProcessor# from ... pdf2text_recogPara import BlockInnerParasProcessor # another way to importdiff --git a/test/test_para/test_pdf2text_recogPara_Common.py b/test/test_para/test_pdf2text_recogPara_Common.pyindex 6fa43219..a7e38848 100644--- a/test/test_para/test_pdf2text_recogPara_Common.py+++ b/test/test_para/test_pdf2text_recogPara_Common.py@@ -1,6 +1,6 @@import unittest-from pdf2text_recogPara import (+from post_proc.detect_para import (is_bbox_overlap,is_in_bbox,is_line_right_aligned_from_neighbors,diff --git a/test/test_para/test_pdf2text_recogPara_TitleProcessor.py b/test/test_para/test_pdf2text_recogPara_TitleProcessor.pyindex f5e59d8b..01afdca5 100644--- a/test/test_para/test_pdf2text_recogPara_TitleProcessor.py+++ b/test/test_para/test_pdf2text_recogPara_TitleProcessor.py@@ -2,7 +2,7 @@ import jsonimport unittestfrom utils_for_test_para import UtilsForTestPara-from pdf2text_recogPara import TitleProcessor+from post_proc.detect_para import TitleProcessor# from ... pdf2text_recogPara import * # another way to import