Update app.py
Browse files
app.py
CHANGED
|
@@ -791,23 +791,7 @@ class InvoiceProcessor:
|
|
| 791 |
r'([0-9,]+\.?\d*)\s*[\$₹£€]?\s*$', # ✅ Added $ for end of line
|
| 792 |
]
|
| 793 |
|
| 794 |
-
|
| 795 |
-
for i, pattern in enumerate(amount_patterns):
|
| 796 |
-
matches = re.findall(pattern, text.lower(), re.IGNORECASE | re.MULTILINE)
|
| 797 |
-
if matches:
|
| 798 |
-
st.write(f"Pattern {i+1}: {matches}")
|
| 799 |
-
for match in matches:
|
| 800 |
-
try:
|
| 801 |
-
amount_val = float(match.replace(',', ''))
|
| 802 |
-
amounts_found.append(amount_val)
|
| 803 |
-
except:
|
| 804 |
-
pass
|
| 805 |
-
|
| 806 |
-
if amounts_found:
|
| 807 |
-
st.success(f"✅ Found amounts: {amounts_found}")
|
| 808 |
-
else:
|
| 809 |
-
st.warning("⚠️ No amounts detected in text")
|
| 810 |
-
|
| 811 |
# Extract invoice data
|
| 812 |
st.info("🤖 Extracting invoice data using AI/Regex...")
|
| 813 |
invoice_data = self.ai_extractor.extract_with_ai(text)
|
|
|
|
| 791 |
r'([0-9,]+\.?\d*)\s*[\$₹£€]?\s*$', # ✅ Added $ for end of line
|
| 792 |
]
|
| 793 |
|
| 794 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 795 |
# Extract invoice data
|
| 796 |
st.info("🤖 Extracting invoice data using AI/Regex...")
|
| 797 |
invoice_data = self.ai_extractor.extract_with_ai(text)
|