ankanghosh commited on
Commit
44aa4da
·
verified ·
1 Parent(s): d84ac7f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +14 -16
app.py CHANGED
@@ -103,7 +103,7 @@ atexit.register(cleanup_resources)
103
  # App title and description
104
  st.title("🔍 AskVeracity")
105
  st.markdown("""
106
- This is a simple AI-powered tool - a fact-checking system that analyzes claims to determine
107
  their truthfulness by gathering and analyzing evidence from various sources, such as Wikipedia,
108
  news outlets, and academic repositories.
109
  """)
@@ -113,7 +113,8 @@ with st.sidebar:
113
  st.header("About")
114
  st.info(
115
  "This system uses a combination of NLP techniques and LLMs to "
116
- "extract claims, gather evidence, and classify the truthfulness of statements."
 
117
  )
118
 
119
  # Application information
@@ -197,6 +198,9 @@ if 'total_time' not in st.session_state:
197
  st.session_state.total_time = 0
198
  if 'fresh_state' not in st.session_state:
199
  st.session_state.fresh_state = True
 
 
 
200
 
201
  # Main interface
202
  st.markdown("### Enter a claim to verify")
@@ -225,20 +229,15 @@ st.caption("""
225
 
226
  st.warning("⏱️ **Note:** Processing times may vary from 10 seconds to 2 minutes depending on query complexity, available evidence, and current API response times.")
227
 
228
- # Button for verifying claim
229
- # Note: Button styling will differ between local environment and Hugging Face Spaces
230
- # due to Hugging Face's theme overrides. This is expected behavior.
231
- verify_button = st.button(
232
- "Verify Claim",
233
- type="primary",
234
- disabled=st.session_state.processing,
235
- key="verify_btn"
236
- )
237
-
238
- # Create a clean interface
239
  if st.session_state.fresh_state:
240
- # Show a clean interface for the first query or when we need to reset
241
- analysis_placeholder = st.empty()
 
 
 
 
 
242
 
243
  # When button is clicked and not already processing
244
  if verify_button and not st.session_state.processing:
@@ -506,7 +505,6 @@ else:
506
 
507
  # Button to start a new verification
508
  if st.button("Verify Another Claim", type="primary", key="new_verify_btn"):
509
- # Reset to fresh state for a new verification
510
  st.session_state.fresh_state = True
511
  st.session_state.has_result = False
512
  st.session_state.result = None
 
103
  # App title and description
104
  st.title("🔍 AskVeracity")
105
  st.markdown("""
106
+ This is a simple AI-powered agentic tool - a fact-checking system that analyzes claims to determine
107
  their truthfulness by gathering and analyzing evidence from various sources, such as Wikipedia,
108
  news outlets, and academic repositories.
109
  """)
 
113
  st.header("About")
114
  st.info(
115
  "This system uses a combination of NLP techniques and LLMs to "
116
+ "extract claims, gather evidence, and classify the truthfulness of statements.\n\n"
117
+ "**Technical:** Built with Python, Streamlit, LangGraph, and OpenAI, leveraging spaCy for NLP and various APIs for retrieving evidence from diverse sources."
118
  )
119
 
120
  # Application information
 
198
  st.session_state.total_time = 0
199
  if 'fresh_state' not in st.session_state:
200
  st.session_state.fresh_state = True
201
+ # Initialize verify button disabled state
202
+ if 'verify_btn_disabled' not in st.session_state:
203
+ st.session_state.verify_btn_disabled = False
204
 
205
  # Main interface
206
  st.markdown("### Enter a claim to verify")
 
229
 
230
  st.warning("⏱️ **Note:** Processing times may vary from 10 seconds to 2 minutes depending on query complexity, available evidence, and current API response times.")
231
 
232
+ # Create a clean interface based on state
 
 
 
 
 
 
 
 
 
 
233
  if st.session_state.fresh_state:
234
+ # Only show the verify button in fresh state
235
+ verify_button = st.button(
236
+ "Verify Claim",
237
+ type="primary",
238
+ disabled=st.session_state.processing,
239
+ key="verify_btn"
240
+ )
241
 
242
  # When button is clicked and not already processing
243
  if verify_button and not st.session_state.processing:
 
505
 
506
  # Button to start a new verification
507
  if st.button("Verify Another Claim", type="primary", key="new_verify_btn"):
 
508
  st.session_state.fresh_state = True
509
  st.session_state.has_result = False
510
  st.session_state.result = None