chandini2595 commited on
Commit
68c2783
·
1 Parent(s): 8c81f89

Remove post-training TensorBoard log charts

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -88,8 +88,8 @@ def extract_fields(image_path):
88
  return results
89
 
90
  def extract_products(text):
91
- # Example regex: product name (letters/numbers/spaces), then price (float)
92
- product_pattern = r"([A-Z0-9 ]+)\s+([0-9]+\.[0-9]{2})"
93
  matches = re.findall(product_pattern, text)
94
  products = [{"name": name.strip(), "price": float(price)} for name, price in matches]
95
  return products
 
88
  return results
89
 
90
  def extract_products(text):
91
+ # This pattern matches lines like: "1076903 PISTACHIO 14.49"
92
+ product_pattern = r"\d{6,} ([A-Z0-9 ]+) (\d+\.\d{2})"
93
  matches = re.findall(product_pattern, text)
94
  products = [{"name": name.strip(), "price": float(price)} for name, price in matches]
95
  return products