Edu_App / app.py
ritampatra's picture
Create app.py
bde06ef verified
import streamlit as st
# Set the title and layout of the app
st.set_page_config(page_title="Deaf Education App", layout="wide")
# App title and introduction
st.title("Deaf Education App")
st.subheader("A comprehensive learning platform for deaf and mute students in Gujarat")
# Sidebar navigation
st.sidebar.title("Navigation")
menu = st.sidebar.radio("Go to", ["Home", "Alphabets & Numbers", "Words & Sentences", "Mathematics", "Science", "Conversion Tools", "Data Analytics"])
# Home Page
if menu == "Home":
st.write("""
Welcome to the Deaf Education App! This app is designed to help deaf and mute students in Gujarat learn basic Mathematics and Science through Gujarati Sign Language.
Use the navigation menu to explore different learning modules and tools.
""")
# Alphabets & Numbers Learning Page
if menu == "Alphabets & Numbers":
st.header("Learn Gujarati Alphabets & Numbers")
st.write("Practice writing Gujarati alphabets and numbers.")
# Display Gujarati alphabets
alphabets = ["ક", "ખ", "ગ", "ઘ", "ચ", "છ", "જ", "ઝ", "ટ", "ઠ", "ડ", "ઢ", "ણ", "ત", "થ", "દ", "ધ", "ન", "પ", "ફ", "બ", "ભ", "મ", "ય", "ર", "લ", "વ", "શ", "ષ", "સ", "હ", "ળ"]
selected_alphabet = st.selectbox("Choose an alphabet to learn:", alphabets)
st.write(f"You selected: {selected_alphabet}")
# Practice writing
st.text_area("Practice writing the selected alphabet or number here:")
# Words & Sentences Learning Page
if menu == "Words & Sentences":
st.header("Learn Words & Sentences")
st.write("Practice words and sentences in Gujarati with sign language.")
# Example word and its sign language
words = {
"ક": "કાજુ (Cashew)",
"ખ": "ખરબૂજ (Melon)",
"ગ": "ગાય (Cow)"
}
selected_letter = st.selectbox("Choose an alphabet:", list(words.keys()))
st.write(f"Word for {selected_letter}: {words[selected_letter]}")
# Practice writing the word
st.text_area(f"Practice writing the word for {selected_letter}:")
# Mathematics Learning Page
if menu == "Mathematics":
st.header("Learn Basic Mathematics")
st.write("Practice basic arithmetic in Gujarati.")
# Arithmetic operations
operation = st.selectbox("Choose an operation", ["Addition", "Subtraction", "Multiplication", "Division"])
num1 = st.number_input("Enter the first number:", min_value=0)
num2 = st.number_input("Enter the second number:", min_value=0)
if operation == "Addition":
result = num1 + num2
elif operation == "Subtraction":
result = num1 - num2
elif operation == "Multiplication":
result = num1 * num2
elif operation == "Division" and num2 != 0:
result = num1 / num2
else:
result = "Cannot divide by zero."
st.write(f"Result of {operation}: {result}")
# Science Learning Page
if menu == "Science":
st.header("Learn Basic Science")
st.write("Practice science principles with sign language.")
# Science topics
topics = {
"Physics": "Learn about gravity, motion, and forces.",
"Chemistry": "Understand chemical reactions and the periodic table.",
"Biology": "Study cells, organisms, and ecosystems."
}
selected_topic = st.selectbox("Choose a topic:", list(topics.keys()))
st.write(f"Topic: {selected_topic}")
st.write(f"Description: {topics[selected_topic]}")
# Add content related to the chosen topic
st.text_area(f"Write notes or practice exercises for {selected_topic}:")
# Conversion Tools Page
if menu == "Conversion Tools":
st.header("Conversion Tools")
st.write("Convert Gujarati text or speech to sign language.")
# Convert text to sign language
text_input = st.text_input("Enter Gujarati text to convert to sign language:")
if text_input:
st.write(f"Sign language interpretation for '{text_input}' will be shown here.")
# Placeholder for sign language video/image
st.image("https://placekitten.com/400/300", caption="Sign language interpretation (example)")
# Data Analytics Page
if menu == "Data Analytics":
st.header("Student Progress Report")
st.write("View the report card and analytics for student learning.")
# Sample report card data
student_name = st.text_input("Enter student name:")
if student_name:
st.write(f"Report Card for {student_name}:")
st.write("Math Score: 85%")
st.write("Science Score: 90%")
st.write("Overall Performance: Excellent")
# Generate a download button for the report card
report_card = f"Report Card for {student_name}\nMath Score: 85%\nScience Score: 90%\nOverall Performance: Excellent"
st.download_button("Download Report Card", report_card)
# Run the app with `streamlit run deaf_education_app.py`