Spaces:
Sleeping
Sleeping
File size: 1,300 Bytes
6b4dab8 f1ac257 6b4dab8 27cb7b6 6b4dab8 a69647f 6b4dab8 f1ac257 |
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 |
import streamlit as st
from streamlit_option_menu import option_menu
from chatbotlib import (train_chatbot, demo_chatbot)
# displaying the icon image on streamlit app and set the page config.
st.set_page_config(
layout="wide",
page_title="NLP Chatbot Main Page",
page_icon="💬"
)
# Create sidebar
with st.sidebar:
# icons are located at bootstrap's website: https://icons.getbootstrap.com
page_selection = option_menu(
"NLP Chatbot App",
["Train the Chatbot Model", "Demo the Chatbot"],
icons=["gear", "chat-dots"],
menu_icon="emoji-smile",
default_index=0,
orientation="vertical",
styles={
"container": {"padding": "5!important", "background-color": "#fafafa"},
"icon": {"color": "green", "font-size": "25px"},
"nav-link": {
"font-size": "16px",
"text-align": "left",
"margin": "0px",
"--hover-color": "#eee",
},
"nav-link-selected": {"background-color": "#002D62"},
},
)
# Run the chosen app when selected from the option menu.
match page_selection:
case "Train the Chatbot Model":
train_chatbot.run_app()
case "Demo the Chatbot":
demo_chatbot.run_app()
|