Commit Graph
195 Commits
Author SHA1 Message Date
myhloli c660fdc8f0 feat(llm): add LLM-aided formula and text correction
- Add LLM-aided formula and text correction functionality
- Update config reader to include LLM-aided settings
- Create new LLM-aided processing module
- Update main processing script to incorporate LLM-aided corrections
- Modify download scripts to check for new config version
2024-12-24 14:33:35 +08:00
myhloli 391a99860d Update version.py with new version 2024-12-11 10:56:15 +00:00
myhloli ef78819aa9 refactor(draw_bbox): remove redundant '_line_sort' suffix from output filename
- Updated the filename generation logic in the draw_bbox function
- Removed the unnecessary '_line_sort' suffix from the output PDF filename
2024-12-11 18:31:51 +08:00
myhloli e1be7da644 refactor(magic_pdf): switch to pdfminer for invalid character detection
- Replace MuPDF with pdfminer for detecting invalid characters in PDFs
- Uncomment and update the detect_invalid_chars function to use pdfminer
- Update the check_invalid_chars function in pdf_meta_scan.py to use the new implementation
2024-12-11 01:41:35 +08:00
xu rui f6bd47de6a docs: add dataset method description 2024-12-03 14:06:58 +08:00
icecraft a3a720ea87 refactor: isolate inference and pipeline 2024-12-03 14:06:58 +08:00
myhloli b9f3435cb7 Update version.py with new version 2024-12-02 06:14:50 +00:00
myhloli f8828be7eb Update version.py with new version 2024-11-29 18:48:40 +00:00
myhloli d19911f113 Update version.py with new version 2024-11-29 08:03:01 +00:00
myhloli ac88815620 refactor(pdf_check): improve character detection using PyMuPDF
- Replace pdfminer with PyMuPDF for character detection
- Implement new method detect_invalid_chars_by_pymupdf
- Update check_invalid_chars in pdf_meta_scan.py to use new method
- Add __replace_0xfffd function in pdf_parse_union_core_v2.py to handle special characters
- Remove unused imports and update requirements.txt
2024-11-28 22:34:23 +08:00
myhloli 52ef1bc782 Update version.py with new version 2024-11-27 10:31:09 +00:00
myhloli 2db3c26374 refactor(libs): remove unused imports and functions
- Remove unused imports from commons.py
- Delete unused functions related to AWS and S3 operations
- Update import statements in other modules to reflect changes in commons.py
- Remove redundant code and improve code readability
2024-11-27 14:51:30 +08:00
Xiaomeng Zhao 4bc29ba366 Merge pull request #1102 from myhloli/dev
refactor: remove deprecated markdown_utils function
2024-11-26 18:45:42 +08:00
myhloli ce202d9258 refactor: remove deprecated markdown_utils function 2024-11-26 18:45:00 +08:00
Xiaomeng Zhao e6da37ddac Merge pull request #1099 from myhloli/dev
refactor(magic_pdf): remove unused functions and simplify code
2024-11-26 17:53:07 +08:00
myhloli 6a22b5ab7a refactor(magic_pdf): remove unused functions and simplify code 2024-11-26 17:52:03 +08:00
Xiaomeng Zhao 79b58a1e6a Merge pull request #1098 from myhloli/dev
refactor(magic_pdf): remove unused functions and simplify code
2024-11-26 17:37:11 +08:00
myhloli ecdaa49aee refactor(magic_pdf): remove unused functions and simplify code 2024-11-26 17:34:07 +08:00
myhloli 9d6be7c95b Update version.py with new version 2024-11-25 03:38:51 +00:00
myhloli 0624b56567 Update version.py with new version 2024-11-22 09:52:09 +00:00
Xiaomeng Zhao 158e556b47 Merge pull request #1063 from opendatalab/release-0.10.0
Release 0.10.0
2024-11-22 17:49:49 +08:00
myhloli 309be741e8 refactor(txt_parse): improve text extraction accuracy with new algorithm
- Implement new text extraction method (txt_spans_extract_v2) to enhance accuracy
- Add character filling in spans for better text reconstruction
- Introduce empty span handling using OCR for missed text
- Optimize span filtering and overlap removal
2024-11-21 18:08:23 +08:00
icecraft b492c19c4c refactor: move some constants or enums defs to config folder 2024-11-19 16:56:53 +08:00
icecraft 6a481320ea fix: using new data api replace old rw api 2024-11-18 17:03:53 +08:00
myhloli 74b389525f Update version.py with new version 2024-11-15 11:25:12 +00:00
Xiaomeng Zhao 845a3ff067 Merge pull request #969 from opendatalab/release-0.9.3
Release 0.9.3
2024-11-15 19:20:26 +08:00
myhloli e78edb193e refactor(table): update default table model to Rapid Table
- Change the default table model from TABLE_MASTER to RAPID_TABLE
2024-11-08 18:28:57 +08:00
myhloli 240fe99e3c feat(table): integrate RapidTable model for table recognition
- Add RapidTable model support for table recognition
- Update table model configuration and initialization
- Modify table recognition process to use RapidTable when specified
- Add RapidTable dependency to setup.py
2024-11-08 18:26:00 +08:00
myhloli 7d5850e3ce feat(model): add xycut algorithm for block sorting
- Implement xycut algorithm to sort blocks when layoutreader fails
- Add recursive_xy_cut function to perform the xycut algorithm- Update pdf_parse_union_core_v2.py to use xycut when layoutreader fails
- Modify draw_bbox.py to handle cases where layoutreader fails to sort blocks
2024-11-08 00:49:20 +08:00
myhloli f34fbf234e Update version.py with new version 2024-11-06 10:16:37 +00:00
myhloli 699b589b23 Update version.py with new version 2024-11-06 04:05:04 +00:00
myhloli 149132d608 feat(pdf_parse): improve span filtering and add new block types
- Refactor remove_outside_spans function to filter spans more accurately
- Add image_footnote, index, and list block types to output file documentation
- Update draw_span_bbox to use preproc_blocks instead of para_blocks
- Bump version to 0.9.0
2024-11-01 15:21:16 +08:00
liukaiwen 7d2dfc8091 Merge branch 'dev' into dev-table-model-update 2024-10-28 16:36:32 +08:00
liukaiwen a0eff3be5c feat: table model update with paddle recognition v4 2024-10-28 16:34:16 +08:00
myhloli 0e8d5893eb feat(draw_bbox): update bounding box drawing for tables and images
- Add support for drawing bounding boxes of table and image sub-blocks
- Implement sorting of table blocks based on type order
- Update bounding box drawing for text and title blocks
- Refactor code to handle different block types and their sub-blocks
2024-10-26 19:20:18 +08:00
icecraft 283b597a6e feat: add [figure | table] match [caption | footnote] match algorithm v2
feat: add Data api
2024-10-24 10:50:04 +08:00
myhloli 1279f2cd0f feat(model): add support for DocLayout-YOLO model
- Add new layout model option: DocLayout-YOLO
- Implement model initialization and prediction for DocLayout-YOLO
- Update configuration options to include new model- Modify existing code to support both LayoutLMv3 and DocLayout-YOLO models
- Update Gradio app to support more Custom Switch
2024-10-23 17:07:39 +08:00
liukaiwen 51f56aa32f feat: merge formula update 2024-10-17 17:16:28 +08:00
myhloli 0a9a6d3e53 fix(magic_pdf): include List and Index block types in processing
Add List and Index to the list of block types being processed in the draw_bbox.py file. This inclusion ensures that these block types are handled similarly to other text-containing blocks, improving the overall document processing accuracy and consistency.
2024-10-15 01:30:27 +08:00
myhloli 1f1dd3538d feat(list&index block): detect and merge list and index blocks
- Add detection for list and index blocks in OCR processing- Implement merging of list and index blocks across pages
- Update block types to include list and index categories
- Adjust text merging logic to handle new block types
- Modify layout drawing to distinguish list and index blocks
2024-10-15 00:50:48 +08:00
myhloli ded2818ac2 feat(layoutreader): support local model directory and improve model loading
- Add function to get local LayoutReader model directory- Check and use local model directory if available
- Fall back to online model if local directory not found
- Update model initialization to support local path
- Refactor model loading in singleton class
2024-10-08 18:06:52 +08:00
myhloli 564c4ce1e3 refactor(magic_pdf): improve line sorting and block indexing
- Insert lines into blocks based on median line height- Calculate block index using line indices median
- Remove virtual line information for table and image blocks
- Enhance line sorting algorithm for different block types
- Add line height calculation function
2024-09-30 03:32:57 +08:00
myhloli 4c9bf8abd5 refactor(memory management): remove unused clean_memory function
The clean_memory function has been removed from pdf_parse_union_core_v2.py due to it not being used.
This change streamlines the code and prevents potential confusion regarding its purpose.
2024-09-29 10:47:54 +08:00
myhloli 83c073875a refactor(draw_bbox): remove commented-out code and streamline bbox drawingRemoved legacy commented-out code related to layout_bbox_list from draw_bbox.py, which
was used for diagnostic purposes and was no longer necessary. This change streamlines
the codebase and clarifies the drawing process of bounding boxes on PDF pages. The update
also adjusts the order of operations slightly for improved readability without altering
the functionality.
2024-09-28 01:53:24 +08:00
myhloli b2790f6f45 refactor(drawing): simplify draw bbox functions and adjust debug config
Refactor the draw bbox functions by removing unused imports and simplifying the
code logic for drawing layout and line sorting bounding boxes. Adjust the debug
configuration to enable content list dumping and disable markdown making mode.
2024-09-28 00:45:18 +08:00
myhloli 43a57d5627 feat(draw_bbox): add option to toggle bounding box drawing
Introduce an additional argument `draw_bbox` in the `draw_bbox_with_number` function to
enable toggling the drawing of bounding boxes on or off. When set to `False`, no bounding
box will be drawn, allowing for situations where only text
2024-09-28 00:05:38 +08:00
myhloli 34f8965007 refactor(draw_bbox): add line sorting visualization
Add a new function `draw_line_sort_bbox` to visualize the sorting of lines on each page.
This includes indexing lines and handling both text and non-text elements such as tables
and images for better content organization.

Also, comment out GPU-related code for flexibility and remove overlaps in bounding box
detection, which improves the accuracy of layout splitting.
2024-09-27 23:39:17 +08:00
myhloli 36220d69d4 refactor(draw_bbox): clear cuda cache and update bbox sorting
- Added CUDA cache clearing after layoutreader prediction to free up GPU memory.
- Modified the bbox sorting logic to sort text and title blocks separately.
- Adjusted drawing colors for better distinction in debug visualizations.
2024-09-27 16:06:15 +08:00
myhloli 00cda7a6f4 refactor(draw_bbox): clear cuda cache and update bbox sorting
- Added CUDA cache clearing after layoutreader prediction to free up GPU memory.
- Modified the bbox sorting logic to sort text and title blocks separately.
- Adjusted drawing colors for better distinction in debug visualizations.
2024-09-26 19:01:17 +08:00
myhloli 270ffb020d feat(draw_bbox): add layout sorting visualization
Implement a new function `draw_layout_sort_bbox` in `draw_bbox.py` to visualize the
layout sorting results using the `LayoutLMv3ForTokenClassification` model. This function
predicts the order of layout elements and draws them in the sorted sequence on the PDF pages.
2024-09-26 15:19:43 +08:00