Skip to content

Commit

Permalink
mk_mm_markdown2中span_type分类更新
Browse files Browse the repository at this point in the history
  • Loading branch information
myhloli committed Mar 15, 2024
1 parent 25a0fd0 commit 195998a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions magic_pdf/dict2md/ocr_mkcontent.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,13 @@ def mk_mm_markdown2(pdf_info_dict:dict):
for line in para:
for span in line['spans']:
span_type = span.get('type')
if span_type == 'text':
if span_type == ContentType.Text:
para_text += span['content']
elif span_type == 'inline_equation':
elif span_type == ContentType.InlineEquation:
para_text += f" ${span['content']}$ "
elif span_type == 'displayed_equation':
elif span_type == ContentType.InterlineEquation:
para_text += f"$$\n{span['content']}\n$$ "
elif span_type == 'image':
elif span_type == ContentType.Image:
para_text += f"![](s3://mllm-raw-media/pdf2md_img/{span['image_path']}) "
markdown.append(para_text)

Expand Down

0 comments on commit 195998a

Please sign in to comment.