Эх сурвалжийг харах

fix replace_equations without "score" bug

赵小蒙 1 жил өмнө
parent
commit
91f7cff826

+ 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