File size: 2,158 Bytes
8744085
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
import streamlit as st
from src.utils import get_logo
from src import session_state
from src.pages import (
    home,
    faq,
    about,
)
from src.configs import SupportedFiles

# app configs
st.set_page_config(
    page_title="Wordify",
    layout="wide",
    page_icon="./assets/logo.png",
)

# session state
session = session_state.get(process=False, run_id=0, posdf=None, negdf=None)


# ==== SIDEBAR ==== #
# LOGO
client_logo = get_logo("./assets/logo.png")
with st.sidebar.beta_container():
    st.image(client_logo)

# NAVIGATION
PAGES = {
    "Home": home,
    "FAQ": faq,
    "About": about,
}

with st.sidebar.beta_container():
    st.sidebar.header("Navigation")
    selection = st.sidebar.radio("Go to", list(PAGES.keys()))

page = PAGES[selection]

# FILE UPLOADER
with st.sidebar.beta_container():
    st.markdown("")
    st.markdown("")
    st.header("Upload file")
    uploaded_file = st.sidebar.file_uploader("Select file", type=[i.name for i in SupportedFiles])


# FOOTER
with st.sidebar.beta_container():
    st.markdown("")
    st.markdown("")
    st.markdown(
        """
        <span style="font-size: 0.75em">Built with &hearts; by [`Pietro Lesci`](https://pietrolesci.github.io/) and [`MilaNLP`](https://twitter.com/MilaNLProc?ref_src=twsrc%5Egoogle%7Ctwcamp%5Eserp%7Ctwgr%5Eauthor)</span>
        """,
        unsafe_allow_html=True,
    )


# ==== MAIN ==== #
with st.beta_container():
    st.title("Wordify")
    st.markdown(
        """
        Wordify makes it easy to identify words that discriminate categories in textual data.

        Let's explain Wordify with an example. Imagine you are thinking about having a glass
        of wine :wine_glass: with your friends :man-man-girl-girl: and you have to buy a bottle.
        You know you like `bold`, `woody` wine but are unsure which one to choose.
        You wonder whether there are some words that describe each type of wine.
        Since you are a researcher :female-scientist: :male-scientist:, you decide to approach
        the problem scientifically :microscope:. That's where Wordify comes to the rescue!
        """
    )


page.write(session, uploaded_file)