File size: 2,987 Bytes
51fe9d2
33f32e6
51fe9d2
33f32e6
 
 
 
51fe9d2
 
 
 
 
 
 
 
 
 
33f32e6
 
 
 
 
51fe9d2
33f32e6
 
 
51fe9d2
33f32e6
 
 
51fe9d2
51a7497
 
 
 
d391cb2
51a7497
33f32e6
 
51a7497
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
d391cb2
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
import streamlit as st
st.set_page_config(layout="wide", page_title="2023 FS Hackathon")

st.markdown(
    "<h1 style='text-align: center;'>Founder's Studio AI Sandbox 🕹️</h1>", 
    unsafe_allow_html=True
)
expander = st.expander("Click here to close this intro", expanded=True)
expander.write(
    """
    This web app allows you to perform common Natural Language Processing tasks, select a task below to get started.
    These tasks are intended to help you validate your intuition and build a proof of concept for your idea.

    If a task you deem useful is not listed here, feel free to get in touch with Founder's Studio team at [email protected]. 
    Happy hackathon!
    """
)
st.header("About this app")
st.write("""
    Some wording on the app and the tasks it can perform :)
""")
st.subheader(":point_left: Select a task from the left to get started!")

with st.sidebar:
    st.write("Welcome! :wave:")
    st.write("Select a task to supercharge your productivity from the ones below :point_down:")

    OPTION1="Chat with a file 💬📖 - *Upload a file and ask questions about it*"
    OPTION2="Text summarization 🔎 - *Upload a file and get it summarized*"
    OPTION_N="Make a suggestion 🤔 - *Let the team know what task would you like to have at disposal*"

    option = st.radio(
        "Please select a task 🤖",
        options=[OPTION1, OPTION2, OPTION_N],
        key="task_selection"
        )

    confirm =  st.button("Confirm", key="task_selection_confirm")
    if confirm:
        st.session_state["task_confirmed"] = True

if st.session_state.get("task_confirmed"):
    # only execute the actual app code when the user confirms the task selection
    if st.session_state.get("task_selection") == OPTION1:
        from qa import qa_main 
        with st.container(): 
            qa_main()

    elif st.session_state.get("task_selection") == OPTION2:
        from summarization import summarization_main
        with st.container():
            summarization_main()

    elif st.session_state.get("task_selection") == OPTION_N:
        from mailing import mailing_main
        with st.container():
            user_suggestion = st.text_input(
                "What other task would you like to perform?", 
                placeholder="Transform meeting transcripts into rainbow-colored unicorns"
            )
            if user_suggestion:
                st.write("""
                Thanks for contributing with your suggestion! We are carefully reviewing every suggestion. 
                If you wish to further discuss your task suggestion, consider reaching out to [email protected].
                We will get back to you as soon as possible!
                """)

            mailing_main(
                subject="**NEW TASK SUGGESTION** - Automatic email.",
                body=f"User suggestion\n: {user_suggestion}",
                to_address="[email protected]"
            )
            st.stop()