Commit Graph
810 Commits
Author SHA1 Message Date
myhloli 0d3ef89fb9 fix(pdf_parse): Move the logic for filling text content into spans before the discarded_block recognition to fix the issue of empty text blocks in discarded_block. 2024-11-25 17:55:15 +08:00
myhloli 9d6be7c95b Update version.py with new version 2024-11-25 03:38:51 +00:00
icecraft e9ace3ebb6 fix: remove unused file 2024-11-24 16:10:23 +08:00
icecraft b1adde8e66 fix: rewrite projects/ and demos with new data api 2024-11-24 16:06:55 +08: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 6b296ee2b5 fix(pdf_parse): improve OCR result handling
- Add null check for OCR results to prevent errors on empty lists
- Enhance robustness of OCR text processing in the magic-pdf project
2024-11-22 17:45:14 +08:00
myhloli f1e2f08467 refactor(model): move page total time logging to custom model analysis
- Move page total time logging to doc_analyze_by_custom_model.py
- Remove page total time logging from pdf_extract_kit.py
- Add page_start timing variable to custom model analysis
- Update logger output format for page total time
2024-11-22 17:34:10 +08:00
myhloli 18aa1a20bf fix(table): add null check for OCR result in rapid table prediction
- Add a null check for OCR result in the predict method
- Return None values if OCR result is None to prevent further processing
2024-11-22 17:21:47 +08:00
myhloli 5d6cbcb123 refactor(para): improve line stop flag and remove unused debug mode
- Add '-' and '–' to LINE_STOP_FLAG in pdf_parse_union_core_v2.py
- Remove unused debug_mode parameter from para_split function in para_split_v3.py
2024-11-22 14:59:25 +08:00
myhloli ae3b0a1e60 fix(pdf_parse): improve line stop flag detection accuracy
- Add an additional condition to the line stop flag check
- Ensure character is to the right of the span's left boundary
- This change helps reduce false positives in line stop detection
2024-11-22 00:01:18 +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
myhloli e52bd023f7 Merge remote-tracking branch 'origin/dev' into dev
# Conflicts:
#	magic_pdf/model/pdf_extract_kit.py
2024-11-21 17:58:31 +08:00
myhloli b2e37a2d1b feat(ocr): improve text detection and OCR accuracy
- Update OCR utils to handle different box formats and improve angle calculation
- Modify PDF extraction kit to support OCR option and optimize processing flow
- Enhance PPOCR model to sort and filter detection boxes, improving text splitting accuracy
2024-11-21 17:54:56 +08:00
Xiaomeng Zhao ea2f8ea0fd Merge branch 'dev' into dev 2024-11-21 17:52:55 +08:00
myhloli e4810cee17 fix(remove_overlaps_min_spans): optimize overlap detection in OCR span list modification
- Improve logic to skip dropped spans in overlap detection
- Enhance efficiency by avoiding unnecessary comparisons
2024-11-21 17:50:41 +08:00
Xiaomeng Zhao 23c8436ef9 Merge pull request #1047 from myhloli/dev
fix(ocr_mkcontent): improve hyphen handling at line ends
2024-11-21 17:50:05 +08:00
myhloli a07007e5e1 fix(ocr_mkcontent): improve hyphen handling at line ends
- fix the bug where hyphens in the middle of a line are being discarded
2024-11-21 17:49:14 +08:00
Xiaomeng Zhao a8ea5d4aa1 Merge pull request #1046 from myhloli/dev
refactor(ocr_dict_merge): add threshold parameter for line merging
2024-11-21 17:48:03 +08:00
myhloli b9f78c9ba1 refactor(ocr_dict_merge): add threshold parameter for line merging
- Add threshold parameter to merge_spans_to_line function
- Make threshold configurable for y-axis overlap check
- Improve flexibility and accuracy of line merging algorithm
2024-11-21 17:47:08 +08:00
Xiaomeng Zhao 9c8d995ed2 Merge pull request #1045 from myhloli/dev
fix(tools): handle empty language string in common.py
2024-11-21 17:46:41 +08:00
myhloli 20ed0cd5fb fix(tools): handle empty language string in common.py
- Check if language string is empty and set it to None
- This prevents potential errors when an empty language string is passed
2024-11-21 17:45:46 +08:00
icecraft 22008b8222 fix: remove test code 2024-11-20 16:01:52 +08:00
icecraft b492c19c4c refactor: move some constants or enums defs to config folder 2024-11-19 16:56:53 +08:00
Alex Liu bc992433d0 delete unused pipeline file (#1024) 2024-11-19 15:44:15 +08:00
Xiaomeng Zhao 8442ed3917 Merge pull request #1006 from icecraft/fix/data_compatiable
fix: using new data api replace old rw api
2024-11-19 15:09:01 +08:00
myhloli 69805f4ba9 refactor(para): adjust right margin threshold based on block width
- Introduce a variable threshold for right margin based on block width
- Use 0.26 * block_weight for wider blocks (block_weight_radio >= 0.5)
- Use 0.36 * block_weight for narrower blocks- This change aims to improve paragraph splitting accuracy for different block widths
2024-11-19 02:04:27 +08:00
myhloli 517fbe5bf4 refactor(para): improve paragraph splitting logic
- Add page size information to blocks
- Calculate block width ratio relative to page width
- Adjust threshold for determining right side indentation
- Implement additional checks for merging blocks across pages
- Improve logic for identifying list structures
2024-11-18 20:44:30 +08:00
myhloli 4fd966eb35 feat(ocr): improve handling of angled text boxes
- Add calculate_is_angle function to detect angled text boxes
- Update update_det_boxes and merge_det_boxes functions to handle angled text boxes
- Modify angle detection logic in various parts of the code
2024-11-18 18:14:39 +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 08f46125a0 refactor(model): rename and restructure model modules 2024-11-15 18:50:05 +08:00
myhloli 918ed65bd5 fix(parse_pipeline): Resolve post-processing exceptions caused by partial PDFs due to file corruption or non-standard format by forcing a re-print. 2024-11-14 17:55:04 +08:00
myhloli 2de1d0ef05 fix(ocr_mkcontent): improve handling of single-character content
- Add digit check for single-character content to avoid adding unnecessary spaces
2024-11-13 16:29:16 +08:00
hyastar 220a24cd4c 更新 para_split_v3.py 2024-11-11 07:12:11 +00:00
myhloli fe2c2c0d8e feat(table): add RapidOCR support for RapidTable model
- Integrate RapidOCR with RapidTable model for table recognition
- Improve memory management for devices with <= 8GB VRAM
- Update table recognition process to use RapidOCR for RapidTable
- Add rapidocr-paddle dependency in setup.py
2024-11-09 00:59:59 +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 5936684fd8 refactor(pdf_parse): adjust line count threshold for layoutreader
- Lower the line count threshold from 316 to 200 to ensure compatibility
- This change aims to prevent potential issues with layoutreader's maximum line support
2024-11-08 12:06:15 +08:00
myhloli 5468e56fba refactor(pdf_parse): adjust line count limit for layoutreader
- Decrease the maximum line count from 512 to 316 for layoutreader
2024-11-08 11:38:47 +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
Xiaomeng Zhao 3fd024da8b Merge pull request #883 from opendatalab/release-0.9.2
Release 0.9.2
2024-11-06 16:56:36 +08:00
myhloli 4b0f11769d refactor(model): remove unused code and simplify OCR model initialization
- Remove unused code for copying detection and recognition models
- Simplify OCR model initialization using atom_model_manager
- Delete unnecessary comments and empty lines
2024-11-06 16:52:18 +08:00
myhloli 699b589b23 Update version.py with new version 2024-11-06 04:05:04 +00:00
myhloli 401dfa4e4f fix(table): improve table image processing
- Replace np.array with np.asarray for better performance
- Add image color conversion from RGB to BGR using OpenCV
2024-11-05 16:10:19 +08:00
myhloli bd75596219 fix(merge_text): add ligature replacement functionality
- Implement __replace_ligatures function to split ligature characters- Integrate ligature replacement into the merge_para_with_text function
- Handle common ligatures such as fi, fl, ff, ffi, and ffl
2024-11-04 18:44:58 +08:00
myhloli b5117e72d3 feat(model): add HTML minification to StructTableModel
- Import 're' module for regular expression operations
- Implement HTML minification for 'output_format=html'
- Add 'minify_html' method to remove unnecessary whitespace and format HTML
2024-11-04 18:07:36 +08:00
myhloli 5ee02a99b1 refactor(model): comment out unused code in ppTableModel
- Comment out an unused code block in the ppTableModel.py file
- Improve code readability and maintainability by removing unnecessary code
2024-11-04 17:10:06 +08:00