File size: 1,554 Bytes
0a026c0
d9d0ab9
0a026c0
d9d0ab9
b0a3b5e
d9d0ab9
 
b0a3b5e
a1320fa
0eb1a66
d9d0ab9
 
 
 
 
 
 
 
 
 
 
 
 
 
a1320fa
d9d0ab9
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
import streamlit as st
import os

# Set up the page configuration and initial display
st.set_page_config(
    page_title="AI Explainability Demo",
    page_icon="πŸ”"
)


def check_password():
    """Function to verify the entered password."""
    # Check if the password is already verified
    if 'password_verified' in st.session_state and st.session_state['password_verified']:
        return True
    # Password input field in the sidebar with a submit button
    with st.sidebar:
        password_input = st.text_input("Enter Password:", type="password")
        if st.button('Submit'):
            if password_input == os.getenv('PASSWORD'):
                st.session_state['password_verified'] = True
                st.experimental_rerun()  # Rerun the app with the updated state
            else:
                st.error("Incorrect Password, please try again.")


# Main app function
def main():
    st.title('AI Explainability in the EU AI Act: a Case for an NLE Approach Towards Pragmatic Explanations')
    st.sidebar.success("Select a demo above.")
    st.markdown("""
    Welcome to the AI explainability demonstration. This application showcases how Natural Language Explanations (NLE) can be used to provide clear and understandable explanations, which are crucial under the EU AI Act.

    Please use the sidebar to navigate through different demonstrations once you have access.
    """)


# Entry point for the app
if __name__ == '__main__':
    if check_password():
        main()  # Load the main app if the password is verified