SkyNait commited on
Commit
ee099e1
·
1 Parent(s): bc4eaf5

Correct prompt

Browse files
Files changed (1) hide show
  1. topic_extraction.py +16 -2
topic_extraction.py CHANGED
@@ -267,8 +267,22 @@ def call_gemini_for_table_classification(image_data: bytes, api_key: str) -> str
267
  except Exception as e:
268
  logger.warning(f"shrink_image_to_jpeg error: {e}")
269
 
270
- prompt = """You are given an image. Determine if it shows a table that has exactly 2 or 3 columns.
271
- Return only one label:
 
 
 
 
 
 
 
 
 
 
 
 
 
 
272
  TWO_COLUMN
273
  THREE_COLUMN
274
  NO_TABLE
 
267
  except Exception as e:
268
  logger.warning(f"shrink_image_to_jpeg error: {e}")
269
 
270
+ prompt = """You are given an image. Determine if it shows a table that has exactly 2 or 3 columns.
271
+ The three-column 'table' image include such key features:
272
+ - Three columns header columns
273
+ - Headers like 'Topics', 'Content', 'Guidelines'
274
+ - Numbered sections (e.g., 8.4, 9.1)
275
+ - Educational curriculum-style structure
276
+ The two-column 'table' image include such key features:
277
+ - Two columns header columns
278
+ - Headers like 'Subject content' and 'Additional information'
279
+ - Numbered sections (e.g., 2.1, 3.4)
280
+ - Educational curriculum-style structure
281
+ - Bullet description in 'Additional information'
282
+ If the image is a relevant table with 2 columns, respond with 'TWO_COLUMN'.
283
+ If the image is a relevant table with 3 columns, respond with 'THREE_COLUMN'.
284
+ If the image does not show a table at all, respond with 'NO_TABLE'.
285
+ Return only one of these exact labels as your entire response:
286
  TWO_COLUMN
287
  THREE_COLUMN
288
  NO_TABLE