-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
80 lines (63 loc) · 2.58 KB
/
main.py
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
import streamlit as st
from streamlit_option_menu import option_menu
st.set_page_config(layout="wide", page_title="Chatbot_Hub",page_icon="🤖",)
import home , Chatbot_Hub.rule_based_chatbot as rule_based_chatbot, Chatbot_Hub.keyword_based_chatbot as keyword_based_chatbot, Chatbot_Hub.api_based_chatbot as api_based_chatbot, Chatbot_Hub.multi_lingual_chatbot as multi_lingual_chatbot, Chatbot_Hub.data_analysis_chatbot as data_analysis_chatbot, Chatbot_Hub.rag_chatbot as rag_chatbot, Chatbot_Hub.voice_chatbot as voice_chatbot, Chatbot_Hub.multi_modal_chatbot as multi_modal_chatbot
# Reducing whitespace on the top of the page
st.markdown("""
<style>
.block-container
{
padding-top: 1rem;
padding-bottom: 0rem;
margin-top: 1rem;
}
</style>
""", unsafe_allow_html=True)
class MultiApp:
def __init__(self):
self.app = []
def add_app(self, title, func):
self.app.append({
"title": title,
"function": func
})
def run(self):
with st.sidebar:
st.markdown("""
<style>
.gradient-text {
margin-top: -20px;
}
</style>
""", unsafe_allow_html=True)
typing_animation = """
<h3 style="text-align: left;">
<img src="https://readme-typing-svg.herokuapp.com/?font=Righteous&size=30&Left=true&vLeft=true&width=250&height=80&lines=The Chatbot Hub" alt="Typing Animation" />
</h3>
"""
st.markdown(typing_animation, unsafe_allow_html=True)
st.sidebar.write("")
app = option_menu(
menu_title='Sections',
options=['Home','Keyword-Based Chatbot','Rule-Based Chatbot','API-Based Chatbot','Analytical-Chatbot','RAG-Chatbot','MultiLingual Chatbot','Voice-Chatbot', 'MultiModal-Chatbot'],
default_index=0,
)
if app == "Home":
home.app()
elif app == "Keyword-Based Chatbot":
keyword_based_chatbot.app()
elif app == "Rule-Based Chatbot":
rule_based_chatbot.app()
elif app == "API-Based Chatbot":
api_based_chatbot.app()
elif app == "Analytical-Chatbot":
data_analysis_chatbot.app()
elif app == "RAG-Chatbot":
rag_chatbot.app()
elif app == "MultiLingual Chatbot":
multi_lingual_chatbot.app()
elif app == "Voice-Chatbot":
voice_chatbot.app()
elif app == "MultiModal-Chatbot":
multi_modal_chatbot.app()
MultiApp().run()