Yash Kumar Lal commited on
Commit
582bb30
·
unverified ·
2 Parent(s): 33d9201 07133b1

Merge pull request #7 from umbc-scify/version_0.1_setup

Browse files
Files changed (1) hide show
  1. app.py +7 -7
app.py CHANGED
@@ -2,9 +2,9 @@ import streamlit as st
2
  import random
3
  import time
4
 
5
- st.header(" VERIFYING SCIENTIFIC CLAIMS ")
6
 
7
- st.caption("Version 0.1")
8
 
9
  # Initialize chat history
10
  if "messages" not in st.session_state:
@@ -20,7 +20,7 @@ def retriever(query: str):
20
  with st.chat_message("assistant"):
21
  placeholder = st.empty()
22
  text=""
23
- message = "Retriving the documents related to the claim..."
24
  for chunk in message.split():
25
  text += chunk + " "
26
  time.sleep(0.05)
@@ -30,7 +30,7 @@ def retriever(query: str):
30
  # You could return retrieved info here.
31
  return message
32
 
33
- def reasoner(info: str):
34
  """Simulate a 'reasoner' step, thinking about how to answer."""
35
  with st.chat_message("assistant"):
36
  placeholder = st.empty()
@@ -46,7 +46,7 @@ def reasoner(info: str):
46
  return message
47
 
48
  # Accept user input
49
- if prompt := st.chat_input("40mg/day dosage of folic acid and 2mg/day dosage of vitamin B12 does not affect chronic kidney disease (CKD) progression."):
50
  # Add user message to chat history
51
  st.session_state.messages.append({"role": "user", "content": prompt})
52
  # Display user message in chat message container
@@ -54,10 +54,10 @@ if prompt := st.chat_input("40mg/day dosage of folic acid and 2mg/day dosage of
54
  st.markdown(prompt)
55
 
56
  #Calling retriever
57
- retriever(prompt)
58
 
59
  #Calling reasoner
60
- reasoner(prompt)
61
 
62
  # Display assistant response in chat message container
63
  with st.chat_message("assistant"):
 
2
  import random
3
  import time
4
 
5
+ st.header(" Scientific Claim Verification ")
6
 
7
+ st.caption("Team UMBC-SBU-UT")
8
 
9
  # Initialize chat history
10
  if "messages" not in st.session_state:
 
20
  with st.chat_message("assistant"):
21
  placeholder = st.empty()
22
  text=""
23
+ message = "Retrieving the documents related to the claim..."
24
  for chunk in message.split():
25
  text += chunk + " "
26
  time.sleep(0.05)
 
30
  # You could return retrieved info here.
31
  return message
32
 
33
+ def reasoner(info: list[str]):
34
  """Simulate a 'reasoner' step, thinking about how to answer."""
35
  with st.chat_message("assistant"):
36
  placeholder = st.empty()
 
46
  return message
47
 
48
  # Accept user input
49
+ if prompt := st.chat_input("Type here"):
50
  # Add user message to chat history
51
  st.session_state.messages.append({"role": "user", "content": prompt})
52
  # Display user message in chat message container
 
54
  st.markdown(prompt)
55
 
56
  #Calling retriever
57
+ retrieved_documents=retriever(prompt)
58
 
59
  #Calling reasoner
60
+ reasoning = reasoner(retrieved_documents)
61
 
62
  # Display assistant response in chat message container
63
  with st.chat_message("assistant"):