Spaces:
Sleeping
Sleeping
File size: 3,123 Bytes
827e494 |
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 79 80 81 |
import streamlit as st
import google.generativeai as genai
from dotenv import load_dotenv
import os
# Load environment variables
load_dotenv()
# Configure Gemini
genai.configure(api_key=os.getenv("GEMINI_API_KEY"))
model = genai.GenerativeModel('gemini-pro')
def main():
st.title("JEE SOCA Analysis System π")
st.subheader("AI-Powered Skill Assessment for JEE Aspirants")
with st.form("student_form"):
st.header("Student Questionnaire")
# Subject Knowledge
st.subheader("π Subject Knowledge")
math_score = st.slider("Mathematics Proficiency (1-10)", 1, 10)
physics_score = st.slider("Physics Proficiency (1-10)", 1, 10)
chemistry_score = st.slider("Chemistry Proficiency (1-10)", 1, 10)
# Study Habits
st.subheader("β° Study Habits")
study_hours = st.number_input("Daily Study Hours", min_value=0, max_value=16)
time_management = st.select_slider("Time Management Skills",
options=["Poor", "Average", "Good", "Excellent"])
# Problem Solving
st.subheader("π Problem Solving")
problem_approach = st.radio("Preferred Problem Solving Approach",
("Conceptual Understanding",
"Formula Memorization",
"Practice Problems"))
# Stress Management
st.subheader("π§ Stress Management")
stress_level = st.select_slider("Stress Level",
options=["Very Low", "Low", "Moderate", "High", "Very High"])
# Submission
submitted = st.form_submit_button("Generate SOCA Analysis")
if submitted:
with st.spinner("Analyzing responses..."):
# Prepare prompt
prompt = f"""Analyze this JEE student's profile and create a SOCA analysis:
Subject Scores:
- Mathematics: {math_score}/10
- Physics: {physics_score}/10
- Chemistry: {chemistry_score}/10
Study Habits:
- Daily Study Hours: {study_hours}
- Time Management: {time_management}
Problem Solving:
- Approach: {problem_approach}
Stress Management:
- Stress Level: {stress_level}
Provide the analysis in this format:
**Strengths:** [Identify 3 key strengths]
**Opportunities:** [Suggest 3 improvement areas]
**Challenges:** [List 3 main challenges]
**Action Plan:** [Create 4 actionable steps]
"""
# Get Gemini response
response = model.generate_content(prompt)
# Display analysis
st.subheader("SOCA Analysis Report")
st.markdown(response.text)
if __name__ == "__main__":
main() |