zuminghuang commited on
Commit
9fd6419
·
verified ·
1 Parent(s): cdbbc6f

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +12 -12
README.md CHANGED
@@ -289,18 +289,18 @@ pil_image = Image.open("demo_data/demo.png").convert("RGB")
289
  min_pixels = 2048 # 32 * 64
290
  max_pixels = 16777216 # 4096 * 4096
291
  prompt = """
292
- Please output the layout information from the PDF image, including each layout element's bbox, its category, and the corresponding text content within the bbox.
293
- 1. Bbox format: [x1, y1, x2, y2]
294
- 2. Layout Categories: The possible categories are ['header', 'title', 'text', 'figure', 'table', 'formula', 'figure_caption', 'table_caption', 'formula_caption', 'figure_footnote', 'table_footnote', 'page_footnote', 'footer'].
295
- 3. Text Extraction & Formatting Rules:
296
- - Figure: For the 'figure' category, the text field should be empty string.
297
- - Formula: Format its text as LaTeX.
298
- - Table: Format its text as HTML.
299
- - All Others (Text, Title, etc.): Format their text as Markdown.
300
- 4. Constraints:
301
- - The output text must be the original text from the image, with no translation.
302
- - All layout elements must be sorted according to human reading order.
303
- 5. Final Output: The entire output must be a single JSON object.
304
  """
305
 
306
  messages = [
 
289
  min_pixels = 2048 # 32 * 64
290
  max_pixels = 16777216 # 4096 * 4096
291
  prompt = """
292
+ - Extract layout information from the provided PDF image.
293
+ - For each layout element, output its bbox, category, and the text content within the bbox.
294
+ - Bbox format: [x1, y1, x2, y2].
295
+ - Allowed layout categories: ['header', 'title', 'text', 'figure', 'table', 'formula', 'figure_caption', 'table_caption', 'formula_caption', 'figure_footnote', 'table_footnote', 'page_footnote', 'footer'].
296
+ - Text extraction and formatting:
297
+ 1) For 'figure', the text field must be an empty string.
298
+ 2) For 'formula', format text as LaTeX.
299
+ 3) For 'table', format text as HTML.
300
+ 4) For all other categories (e.g., text, title), format text as Markdown.
301
+ - The output text must be exactly the original text from the image, with no translation or rewriting.
302
+ - Sort all layout elements in human reading order.
303
+ - Final output must be a single JSON object.
304
  """
305
 
306
  messages = [