Skip to content

Transforms complex documents like PDFs and Office docs into LLM-ready markdown/JSON for your Agentic workflows.

fix replace_equations without "score" bug

赵小蒙91f7cff82642
diff --git a/magic_pdf/pdf_parse_union_core.py b/magic_pdf/pdf_parse_union_core.py
index 78a119e9..16e2fc81 100644
--- a/magic_pdf/pdf_parse_union_core.py
+++ b/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