agalma / app.py
Mark7549's picture
Migrated from gradio to streamlit
0d0f07a
raw
history blame
1.37 kB
import streamlit as st
from streamlit_option_menu import option_menu
from word2vec import *
st.set_page_config(page_title="Ancient Greek Word2Vec", layout="centered")
# Horizontal menu
active_tab = option_menu(None, ["Nearest neighbours", "Cosine similarity", "3D graph", 'Dictionary'],
menu_icon="cast", default_index=0, orientation="horizontal")
# Nearest neighbours tab
if active_tab == "Nearest neighbours":
st.write("### TO DO: add description of function")
col1, col2 = st.columns(2)
with st.container():
with col1:
word = st.text_input("Enter a word", placeholder="ἀνήρ")
with col2:
time_slice = st.multiselect("Time slice", ["Archaic", "Classical", "Hellenistic", "Early Roman", "Late Roman"])
st.slider("Number of neighbours", 1, 50, 15)
nearest_neighbours_button = st.button("Find nearest neighbours")
if nearest_neighbours_button:
st.write("button pressed")
# Cosine similarity tab
elif active_tab == "Cosine similarity":
with st.container():
st.write("Cosine similarity tab")
# 3D graph tab
elif active_tab == "3D graph":
with st.container():
st.write("3D graph tab")
# Dictionary tab
elif active_tab == "Dictionary":
with st.container():
st.write("Dictionary tab")