Spaces:
Running
Running
Jin Zhu
commited on
Commit
·
683eed3
1
Parent(s):
fa5ff8a
Update app.py
Browse files- src/app.py +30 -22
src/app.py
CHANGED
|
@@ -37,7 +37,7 @@ import time
|
|
| 37 |
# Page Configuration
|
| 38 |
# -----------------
|
| 39 |
st.set_page_config(
|
| 40 |
-
page_title="Adaptive LLM Text Detection",
|
| 41 |
page_icon="🔍",
|
| 42 |
layout="wide"
|
| 43 |
)
|
|
@@ -164,8 +164,8 @@ if not model_loaded:
|
|
| 164 |
# -----------------
|
| 165 |
# Main Interface
|
| 166 |
# -----------------
|
| 167 |
-
# ---
|
| 168 |
-
col1, col2
|
| 169 |
|
| 170 |
with col1:
|
| 171 |
text_input = st.text_area(
|
|
@@ -174,23 +174,24 @@ with col1:
|
|
| 174 |
help="Your text goes here. It can be long; the longer the text, the more reliable the result.",
|
| 175 |
height=200,
|
| 176 |
)
|
|
|
|
|
|
|
| 177 |
|
| 178 |
with col2:
|
| 179 |
-
|
| 180 |
-
|
| 181 |
-
|
| 182 |
-
"<div style='height:110px;'></div>",
|
| 183 |
-
unsafe_allow_html=True
|
| 184 |
-
)
|
| 185 |
-
detect_clicked = st.button("Detect", type="primary", use_container_width=True)
|
| 186 |
-
|
| 187 |
-
with col3:
|
| 188 |
-
score_ph = col3.empty()
|
| 189 |
-
score_ph.text_input(
|
| 190 |
-
label="Results",
|
| 191 |
value="",
|
| 192 |
disabled=True,
|
| 193 |
-
help="Detection
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 194 |
)
|
| 195 |
|
| 196 |
st.markdown("---")
|
|
@@ -239,13 +240,20 @@ if detect_clicked:
|
|
| 239 |
# Clear status and show results
|
| 240 |
status_placeholder.empty()
|
| 241 |
|
| 242 |
-
# Update score
|
| 243 |
-
with
|
| 244 |
-
|
| 245 |
-
label="
|
| 246 |
-
value=f"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 247 |
disabled=True,
|
| 248 |
-
help="
|
| 249 |
)
|
| 250 |
|
| 251 |
# Show detailed results
|
|
|
|
| 37 |
# Page Configuration
|
| 38 |
# -----------------
|
| 39 |
st.set_page_config(
|
| 40 |
+
page_title="AdaDetectGPT: Adaptive LLM-generated Text Detection",
|
| 41 |
page_icon="🔍",
|
| 42 |
layout="wide"
|
| 43 |
)
|
|
|
|
| 164 |
# -----------------
|
| 165 |
# Main Interface
|
| 166 |
# -----------------
|
| 167 |
+
# --- Two columns: Input text & button | Result displays ---
|
| 168 |
+
col1, col2 = st.columns((1, 1))
|
| 169 |
|
| 170 |
with col1:
|
| 171 |
text_input = st.text_area(
|
|
|
|
| 174 |
help="Your text goes here. It can be long; the longer the text, the more reliable the result.",
|
| 175 |
height=200,
|
| 176 |
)
|
| 177 |
+
|
| 178 |
+
detect_clicked = st.button("Detect", type="primary", use_container_width=True)
|
| 179 |
|
| 180 |
with col2:
|
| 181 |
+
statistics_ph = st.empty()
|
| 182 |
+
statistics_ph.text_input(
|
| 183 |
+
label="Statistics",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 184 |
value="",
|
| 185 |
disabled=True,
|
| 186 |
+
help="Detection statistics will appear here after clicking Detect.",
|
| 187 |
+
)
|
| 188 |
+
|
| 189 |
+
pvalue_ph = st.empty()
|
| 190 |
+
pvalue_ph.text_input(
|
| 191 |
+
label="P-value",
|
| 192 |
+
value="",
|
| 193 |
+
disabled=True,
|
| 194 |
+
help="P-value will appear here after clicking Detect.",
|
| 195 |
)
|
| 196 |
|
| 197 |
st.markdown("---")
|
|
|
|
| 240 |
# Clear status and show results
|
| 241 |
status_placeholder.empty()
|
| 242 |
|
| 243 |
+
# Update score displays
|
| 244 |
+
with col2:
|
| 245 |
+
statistics_ph.text_input(
|
| 246 |
+
label="Statistics",
|
| 247 |
+
value=f"{crit:.6f}",
|
| 248 |
+
disabled=True,
|
| 249 |
+
help="Detection statistics will appear here after clicking Detect.",
|
| 250 |
+
)
|
| 251 |
+
|
| 252 |
+
pvalue_ph.text_input(
|
| 253 |
+
label="P-value",
|
| 254 |
+
value=f"{p_value:.6f}",
|
| 255 |
disabled=True,
|
| 256 |
+
help="P-value will appear here after clicking Detect.",
|
| 257 |
)
|
| 258 |
|
| 259 |
# Show detailed results
|