Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -57,6 +57,7 @@ st.markdown(
|
|
| 57 |
)
|
| 58 |
|
| 59 |
# ====== SIDE-BY-SIDE LAYOUT ======
|
|
|
|
| 60 |
col_left, col_right = st.columns([1.35, 1.05])
|
| 61 |
|
| 62 |
with col_left:
|
|
@@ -96,9 +97,14 @@ with col_left:
|
|
| 96 |
accept_multiple_files=True
|
| 97 |
)
|
| 98 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 99 |
with col_right:
|
| 100 |
-
# Step
|
| 101 |
-
st.markdown("<span class='step-num'>
|
| 102 |
sample_instruction = """You are a careful, expert document validation agent for mortgage and finance workflows.
|
| 103 |
|
| 104 |
Before you answer, do this: Carefully scan the document for ANY evidence of regional/provincial or country-specific card types (such as "Ontario Health Card", "Medicare Card", "Insurance Card", "SIN", "Driver's License", "Passport", etc.)—be as specific as possible using visible card titles, authority names, or issuer logos.
|
|
@@ -114,8 +120,8 @@ Checklist for precision:
|
|
| 114 |
key="agent_instruction"
|
| 115 |
)
|
| 116 |
|
| 117 |
-
# Step
|
| 118 |
-
st.markdown("<span class='step-num'>
|
| 119 |
current_date = st.date_input(
|
| 120 |
"Current date to be used by the agent for expiry checking",
|
| 121 |
value=datetime.now().date(),
|
|
@@ -123,14 +129,10 @@ Checklist for precision:
|
|
| 123 |
)
|
| 124 |
date_str = str(current_date)
|
| 125 |
|
| 126 |
-
# Step 5: Thresholds
|
| 127 |
-
st.markdown("<span class='step-num'>5</span> <b>Configure Acceptance Thresholds</b>", unsafe_allow_html=True)
|
| 128 |
-
min_match_score = st.slider("Minimum Type Match Score (0-100)", 50, 100, 70, 1)
|
| 129 |
-
min_confidence = st.slider("Minimum LLM Confidence (0-100)", 50, 100, 70, 1)
|
| 130 |
-
|
| 131 |
# Step 6: Run button
|
| 132 |
run_btn = st.button("Run Document Validation", type="primary")
|
| 133 |
|
|
|
|
| 134 |
# ========== FUNCTIONS ==========
|
| 135 |
|
| 136 |
def get_content_type(filename):
|
|
|
|
| 57 |
)
|
| 58 |
|
| 59 |
# ====== SIDE-BY-SIDE LAYOUT ======
|
| 60 |
+
|
| 61 |
col_left, col_right = st.columns([1.35, 1.05])
|
| 62 |
|
| 63 |
with col_left:
|
|
|
|
| 97 |
accept_multiple_files=True
|
| 98 |
)
|
| 99 |
|
| 100 |
+
# Step 3: Thresholds (SLIDERS MOVED HERE)
|
| 101 |
+
st.markdown("<span class='step-num'>3</span> <b>Configure Acceptance Thresholds</b>", unsafe_allow_html=True)
|
| 102 |
+
min_match_score = st.slider("Minimum Type Match Score (0-100)", 50, 100, 70, 1)
|
| 103 |
+
min_confidence = st.slider("Minimum LLM Confidence (0-100)", 50, 100, 70, 1)
|
| 104 |
+
|
| 105 |
with col_right:
|
| 106 |
+
# Step 4: Agent instructions
|
| 107 |
+
st.markdown("<span class='step-num'>4</span> <b>Instruct Agent</b>", unsafe_allow_html=True)
|
| 108 |
sample_instruction = """You are a careful, expert document validation agent for mortgage and finance workflows.
|
| 109 |
|
| 110 |
Before you answer, do this: Carefully scan the document for ANY evidence of regional/provincial or country-specific card types (such as "Ontario Health Card", "Medicare Card", "Insurance Card", "SIN", "Driver's License", "Passport", etc.)—be as specific as possible using visible card titles, authority names, or issuer logos.
|
|
|
|
| 120 |
key="agent_instruction"
|
| 121 |
)
|
| 122 |
|
| 123 |
+
# Step 5: Current date
|
| 124 |
+
st.markdown("<span class='step-num'>5</span> <b>Set Current Date for Expiry Validation</b>", unsafe_allow_html=True)
|
| 125 |
current_date = st.date_input(
|
| 126 |
"Current date to be used by the agent for expiry checking",
|
| 127 |
value=datetime.now().date(),
|
|
|
|
| 129 |
)
|
| 130 |
date_str = str(current_date)
|
| 131 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 132 |
# Step 6: Run button
|
| 133 |
run_btn = st.button("Run Document Validation", type="primary")
|
| 134 |
|
| 135 |
+
|
| 136 |
# ========== FUNCTIONS ==========
|
| 137 |
|
| 138 |
def get_content_type(filename):
|