File size: 1,403 Bytes
9c398de
c59ebda
9c398de
90afd57
412c787
c64d018
5be9630
 
0558cbb
90afd57
9c398de
 
 
 
 
90afd57
 
c59ebda
 
 
c64d018
0558cbb
45f566f
90afd57
c59ebda
9c398de
 
3036e92
 
9c398de
3036e92
c59ebda
 
9c398de
3036e92
 
c59ebda
 
 
 
 
 
 
 
 
854b7af
 
 
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
import awesome_streamlit as ast
import streamlit as st

from backend.utils import get_current_ram_usage, ga

import backend.aragpt
import backend.home
import backend.processor
import backend.sa
import backend.qa

st.set_page_config(
    page_title="TEST", page_icon="📖", initial_sidebar_state="expanded", layout="wide"
)

ga(st.__file__)

PAGES = {
    "Home": backend.home,
    "Arabic Text Preprocessor": backend.processor,
    "Arabic Language Generation": backend.aragpt,
    "Arabic Sentiment Analysis": backend.sa,
    # "Arabic Sarcasm Detection": backend.sarcasm,
    "Arabic Question Answering": backend.qa,
}


st.sidebar.title("Navigation")
selection = st.sidebar.radio("Pages", list(PAGES.keys()))

page = PAGES[selection]
# with st.spinner(f"Loading {selection} ..."):
ast.shared.components.write_page(page)

st.sidebar.header("Info")
st.sidebar.write("Made by [Wissam Antoun](https://twitter.com/wissam_antoun)")
st.sidebar.write(
    "Pre-trained models are available on [HF Hub](https://huggingface.co/aubmindlab)"
)
st.sidebar.write(
    "Models source code available on [GitHub](https://github.com/aub-mind/arabert)"
)
st.sidebar.write(
    "App source code available on [GitHub](https://github.com/WissamAntoun/Arabic-NLP-app)"
)
if st.sidebar.checkbox("Show RAM usage"):
    ram = get_current_ram_usage()
    st.sidebar.write("Ram usage: {:.2f}/{:.2f} GB".format(ram[0], ram[1]))