github-actions[bot] commited on
Commit
dd98afc
·
1 Parent(s): ba99b21

Sync from GitHub: 2086b6f3d02fad428eb1d39009f63d0130a06a64

Browse files
Files changed (1) hide show
  1. inference.py +28 -19
inference.py CHANGED
@@ -65,28 +65,37 @@ Output rules:
65
 
66
  # Two-step Chain of Thought prompts (reasoning mode) - OPTIMIZED FOR SPEED
67
  REASONING_PROMPT = """
68
- Analyze this Indian tractor invoice. Observe WITHOUT extracting:
 
 
 
 
69
 
70
- 1. DEALER: Location, language, exact text
71
- 2. MODEL: Location, format (checkbox/text), selected option, exact text
72
- 3. HP: Location, format, selected value if checkbox, exact text
73
- 4. TOTAL: Location, label, final amount with currency
74
- 5. CHECKBOXES: Present? Which marked?
75
- 6. CHALLENGES: Unclear handwriting or ambiguities?
76
 
77
- Return ONLY valid JSON:
78
- {
79
- "dealer_text": string,
80
- "model_text": string,
81
- "model_is_checkbox": boolean,
82
- "hp_text": string,
83
- "hp_is_checkbox": boolean,
84
- "amount_text": string,
85
- "checkboxes_present": boolean,
86
- "notes": string
87
- }
 
 
 
 
 
 
 
 
 
 
88
 
89
- Preserve original language. Be concise.
90
  """
91
 
92
 
 
65
 
66
  # Two-step Chain of Thought prompts (reasoning mode) - OPTIMIZED FOR SPEED
67
  REASONING_PROMPT = """
68
+ Analyze this Indian tractor invoice and share your observations about extracting these 4 fields:
69
+ 1. dealer_name
70
+ 2. model_name
71
+ 3. horse_power
72
+ 4. asset_cost
73
 
74
+ Think through each field:
 
 
 
 
 
75
 
76
+ DEALER NAME:
77
+ - Where do you see the dealer/company name? Describe location and appearance,generally it is at top middle
78
+ - What language is it in? Any spelling issues?
79
+ - Write what you observe exactly as you see it
80
+
81
+ MODEL NAME:
82
+ - How is the model presented? (checkbox list, handwritten field, printed text)
83
+ - If checkboxes exist, which one is marked/selected?
84
+ - What exact text do you see for the model?
85
+ - Is it in English or regional language?
86
+
87
+ HORSE POWER:
88
+ - Where do you see HP mentioned?
89
+ - Is it explicit (like "49 HP") or in a checkbox list?
90
+ - If checkboxes, which HP value is selected?
91
+ - What exact text shows the HP?
92
+
93
+ ASSET COST:
94
+ - Where is the final total amount located?
95
+ - Which number is the final amount after all taxes?
96
+ - What is the exact amount with currency symbol as shown?
97
 
98
+ Express your observations naturally. Be specific about what you see and any uncertainties.
99
  """
100
 
101