Commit 91f7cff8 authored by 赵小蒙's avatar 赵小蒙
Browse files

fix replace_equations without "score" bug

parent e5907296
...@@ -65,6 +65,7 @@ def txt_spans_extract(pdf_page, inline_equations, interline_equations): ...@@ -65,6 +65,7 @@ def txt_spans_extract(pdf_page, inline_equations, interline_equations):
"bbox": list(span["bbox"]), "bbox": list(span["bbox"]),
"content": span["latex"], "content": span["latex"],
"type": ContentType.InlineEquation, "type": ContentType.InlineEquation,
"score": 1.0,
} }
) )
elif span.get('type') == ContentType.InterlineEquation: elif span.get('type') == ContentType.InterlineEquation:
...@@ -73,6 +74,7 @@ def txt_spans_extract(pdf_page, inline_equations, interline_equations): ...@@ -73,6 +74,7 @@ def txt_spans_extract(pdf_page, inline_equations, interline_equations):
"bbox": list(span["bbox"]), "bbox": list(span["bbox"]),
"content": span["latex"], "content": span["latex"],
"type": ContentType.InterlineEquation, "type": ContentType.InterlineEquation,
"score": 1.0,
} }
) )
else: else:
...@@ -81,6 +83,7 @@ def txt_spans_extract(pdf_page, inline_equations, interline_equations): ...@@ -81,6 +83,7 @@ def txt_spans_extract(pdf_page, inline_equations, interline_equations):
"bbox": list(span["bbox"]), "bbox": list(span["bbox"]),
"content": span["text"], "content": span["text"],
"type": ContentType.Text, "type": ContentType.Text,
"score": 1.0,
} }
) )
return spans return spans
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment