Pontonkid commited on
Commit
c0f47fe
·
1 Parent(s): 8dd0a68

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -5
app.py CHANGED
@@ -32,6 +32,7 @@ st.sidebar.markdown("__Tool Definition__")
32
  st.sidebar.markdown("This tool helps you identify possible diseases based on the symptoms you provide.")
33
  st.sidebar.markdown("This is my project for the KaggleX program.")
34
  st.sidebar.markdown("Please note that this tool is for informational purposes only. Always consult a healthcare professional for accurate medical advice.")
 
35
 
36
  # Initialize chat history
37
  if "messages" not in st.session_state:
@@ -46,7 +47,7 @@ def preprocess_input(user_input):
46
 
47
  # Function to predict diseases based on user input
48
  def predict_diseases(user_clean_text):
49
- user_input_vector = tfidf_vectorizer.transform([user_cleaned_text]) # Vectorize the cleaned user input
50
  predictions = model.predict(user_input_vector) # Make predictions using the trained model
51
  return predictions
52
 
@@ -72,11 +73,7 @@ if st.button("Predict Disease"):
72
  else:
73
  st.warning("Please enter your symptoms before predicting.")
74
 
75
- # Display a warning message
76
- st.warning("Please note that this tool is for informational purposes only. Always consult a healthcare professional for accurate medical advice.")
77
-
78
  # Create FAQs section
79
- show_faqs = st.checkbox("Show FAQs")
80
  if show_faqs:
81
  st.markdown("## Frequently Asked Questions")
82
  st.markdown("**Q: How does this tool work?**")
@@ -90,3 +87,4 @@ if show_faqs:
90
 
91
  # Add attribution
92
  st.markdown("Created with ❤️ by Joas")
 
 
32
  st.sidebar.markdown("This tool helps you identify possible diseases based on the symptoms you provide.")
33
  st.sidebar.markdown("This is my project for the KaggleX program.")
34
  st.sidebar.markdown("Please note that this tool is for informational purposes only. Always consult a healthcare professional for accurate medical advice.")
35
+ show_faqs = st.sidebar.checkbox("Show FAQs")
36
 
37
  # Initialize chat history
38
  if "messages" not in st.session_state:
 
47
 
48
  # Function to predict diseases based on user input
49
  def predict_diseases(user_clean_text):
50
+ user_input_vector = tfidf_vectorizer.transform([user_clean_text]) # Vectorize the cleaned user input
51
  predictions = model.predict(user_input_vector) # Make predictions using the trained model
52
  return predictions
53
 
 
73
  else:
74
  st.warning("Please enter your symptoms before predicting.")
75
 
 
 
 
76
  # Create FAQs section
 
77
  if show_faqs:
78
  st.markdown("## Frequently Asked Questions")
79
  st.markdown("**Q: How does this tool work?**")
 
87
 
88
  # Add attribution
89
  st.markdown("Created with ❤️ by Joas")
90
+