mlbench123 commited on
Commit
28247e7
ยท
verified ยท
1 Parent(s): 4fb58e8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -10
app.py CHANGED
@@ -18,6 +18,7 @@ def process_pdf(pdf_file):
18
  for page in pages:
19
  text = page["text"]
20
 
 
21
  if "ืฉื ื”ื—ืœืง ื‘ื”ืœื•ื•ืื”" not in text:
22
  continue
23
 
@@ -58,7 +59,7 @@ def load_sample():
58
  with gr.Blocks() as interface:
59
  gr.Markdown(
60
  """
61
- <div style="font-size:32px; font-weight:800; margin-bottom:10px;">
62
  Mortgage OCR
63
  </div>
64
  <div style="font-size:16px; opacity:0.85; margin-bottom:20px;">
@@ -69,22 +70,24 @@ with gr.Blocks() as interface:
69
 
70
  with gr.Row():
71
 
72
- # LEFT COLUMN โ€” SAMPLE
73
  with gr.Column(scale=1):
74
- gr.Markdown("### Sample Mortgage PDF")
 
 
 
 
 
 
75
 
76
  gr.Image(
77
  SAMPLE_PREVIEW_IMAGE,
78
- label="Sample document preview",
79
- show_label=True
80
  )
81
 
82
- load_sample_btn = gr.Button("Use this sample PDF")
83
-
84
- # RIGHT COLUMN โ€” MAIN APP
85
  with gr.Column(scale=2):
86
- pdf_input = gr.File(label="Upload Mortgage PDF")
87
-
88
  extract_btn = gr.Button("Extract Data")
89
 
90
  json_output = gr.Textbox(
 
18
  for page in pages:
19
  text = page["text"]
20
 
21
+ # HARD FILTER โ€” real loan pages only
22
  if "ืฉื ื”ื—ืœืง ื‘ื”ืœื•ื•ืื”" not in text:
23
  continue
24
 
 
59
  with gr.Blocks() as interface:
60
  gr.Markdown(
61
  """
62
+ <div style="font-size:32px; font-weight:800; margin-bottom:6px;">
63
  Mortgage OCR
64
  </div>
65
  <div style="font-size:16px; opacity:0.85; margin-bottom:20px;">
 
70
 
71
  with gr.Row():
72
 
73
+ # LEFT COLUMN
74
  with gr.Column(scale=1):
75
+ pdf_input = gr.File(label="Upload Mortgage PDF")
76
+
77
+ load_sample_btn = gr.Button("Use sample PDF")
78
+
79
+ gr.Markdown(
80
+ "<div style='margin-top:12px; font-weight:600;'>Sample preview</div>"
81
+ )
82
 
83
  gr.Image(
84
  SAMPLE_PREVIEW_IMAGE,
85
+ show_label=False,
86
+ height=220 # ๐Ÿ”’ force small thumbnail
87
  )
88
 
89
+ # RIGHT COLUMN
 
 
90
  with gr.Column(scale=2):
 
 
91
  extract_btn = gr.Button("Extract Data")
92
 
93
  json_output = gr.Textbox(