Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -38,6 +38,7 @@ def extract_text_from_pdf(pdf_path, is_scanned=False):
|
|
| 38 |
def parse_bank_statement(text):
|
| 39 |
"""Parse bank statement using LLM with fallback to rule-based parser"""
|
| 40 |
cleaned_text = re.sub(r'[\x00-\x08\x0b\x0c\x0e-\x1f\x7f]', '', text)
|
|
|
|
| 41 |
|
| 42 |
# Craft precise prompt for LLM
|
| 43 |
prompt = f"""
|
|
|
|
| 38 |
def parse_bank_statement(text):
|
| 39 |
"""Parse bank statement using LLM with fallback to rule-based parser"""
|
| 40 |
cleaned_text = re.sub(r'[\x00-\x08\x0b\x0c\x0e-\x1f\x7f]', '', text)
|
| 41 |
+
safe_text = cleaned_text.replace("{", "{{").replace("}", "}}")
|
| 42 |
|
| 43 |
# Craft precise prompt for LLM
|
| 44 |
prompt = f"""
|