File size: 760 Bytes
f9807fc
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26

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("αŠ₯α‰£αŠ­α‹Ž αŒ₯ያቄ α‹«αˆ΅αŒˆα‰‘α’")