瀏覽代碼

fix replace_equations without "score" bug

赵小蒙 1 年之前
父節點
當前提交
91f7cff826
共有 1 個文件被更改,包括 3 次插入0 次删除
  1. 3 0
      magic_pdf/pdf_parse_union_core.py

+ 3 - 0
magic_pdf/pdf_parse_union_core.py

@@ -65,6 +65,7 @@ def txt_spans_extract(pdf_page, inline_equations, interline_equations):
                             "bbox": list(span["bbox"]),
                             "content": span["latex"],
                             "type": ContentType.InlineEquation,
+                            "score": 1.0,
                         }
                     )
                 elif span.get('type') == ContentType.InterlineEquation:
@@ -73,6 +74,7 @@ def txt_spans_extract(pdf_page, inline_equations, interline_equations):
                             "bbox": list(span["bbox"]),
                             "content": span["latex"],
                             "type": ContentType.InterlineEquation,
+                            "score": 1.0,
                         }
                     )
                 else:
@@ -81,6 +83,7 @@ def txt_spans_extract(pdf_page, inline_equations, interline_equations):
                             "bbox": list(span["bbox"]),
                             "content": span["text"],
                             "type": ContentType.Text,
+                            "score": 1.0,
                         }
                     )
     return spans