Walelign's picture
Upload app.py
f9807fc verified
raw
history blame
760 Bytes
import streamlit as st
from chatbot_utils import AmharicChatbot
st.set_page_config(page_title="Amharic SRH Chatbot", layout="centered")
st.title("πŸ€– αŠ αˆ›αˆ­αŠ› αŒ€αŠ“ ቻቡቦቡ")
st.markdown("ሡለ α‹ˆαˆŠα‹΅αŠ“ ሡነ αˆαŒ…αŠα‰΅ αŒ€αŠ“ αŒ₯ያቄ αŠ αˆŽα‰΅? αŠ₯α‰£αŠ­α‹Ž α‹«α‰€αˆ­α‰‘α’")
@st.cache_resource
def load_bot():
return AmharicChatbot("amharic_srh_qa.csv")
bot = load_bot()
query = st.text_input("πŸ’¬ αŒ₯α‹«α‰„α‹ŽαŠ• α‹«αˆ΅αŒˆα‰‘:", "")
if st.button("መልሡ αŠ α‹αŒ£"):
if query:
results = bot.get_answer(query)
for i, (q, a) in enumerate(results):
st.write(f"**Q{i+1}:** {q}")
st.success(f"**A{i+1}:** {a}")
else:
st.warning("αŠ₯α‰£αŠ­α‹Ž αŒ₯ያቄ α‹«αˆ΅αŒˆα‰‘α’")