Bhaskar2611 commited on
Commit
d9c8451
·
verified ·
1 Parent(s): 585262e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -1
app.py CHANGED
@@ -38,7 +38,12 @@ 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
- safe_text = cleaned_text.replace("{", "{{").replace("}", "}}")
 
 
 
 
 
42
 
43
  # Craft precise prompt for LLM
44
  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 = (
42
+ cleaned_text
43
+ .replace("{", "{{")
44
+ .replace("}", "}}")
45
+ .replace("%", "%%")
46
+ )
47
 
48
  # Craft precise prompt for LLM
49
  prompt = f"""