mirror of
https://github.com/opendatalab/MinerU.git
synced 2026-09-24 23:10:23 +08:00
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
This commit is contained in:
@@ -121,8 +121,12 @@ def __is_list_or_index_block(block):
|
||||
right_close_num += 1
|
||||
else:
|
||||
# 右侧不顶格情况下是否有一段距离,拍脑袋用0.3block宽度做阈值
|
||||
# 0.26
|
||||
closed_area = 0.35 * block_weight
|
||||
# block宽的阈值可以小些,block窄的阈值要大
|
||||
|
||||
if block_weight_radio >= 0.5:
|
||||
closed_area = 0.26 * block_weight
|
||||
else:
|
||||
closed_area = 0.36 * block_weight
|
||||
if block['bbox_fs'][2] - line['bbox'][2] > closed_area:
|
||||
right_not_close_num += 1
|
||||
|
||||
|
||||
Reference in New Issue
Block a user