Spaces:
Sleeping
Sleeping
Create app.py
Browse files
app.py
ADDED
|
@@ -0,0 +1,81 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import streamlit as st
|
| 2 |
+
import google.generativeai as genai
|
| 3 |
+
from dotenv import load_dotenv
|
| 4 |
+
import os
|
| 5 |
+
|
| 6 |
+
# Load environment variables
|
| 7 |
+
load_dotenv()
|
| 8 |
+
|
| 9 |
+
# Configure Gemini
|
| 10 |
+
genai.configure(api_key=os.getenv("GEMINI_API_KEY"))
|
| 11 |
+
model = genai.GenerativeModel('gemini-pro')
|
| 12 |
+
|
| 13 |
+
def main():
|
| 14 |
+
st.title("JEE SOCA Analysis System π")
|
| 15 |
+
st.subheader("AI-Powered Skill Assessment for JEE Aspirants")
|
| 16 |
+
|
| 17 |
+
with st.form("student_form"):
|
| 18 |
+
st.header("Student Questionnaire")
|
| 19 |
+
|
| 20 |
+
# Subject Knowledge
|
| 21 |
+
st.subheader("π Subject Knowledge")
|
| 22 |
+
math_score = st.slider("Mathematics Proficiency (1-10)", 1, 10)
|
| 23 |
+
physics_score = st.slider("Physics Proficiency (1-10)", 1, 10)
|
| 24 |
+
chemistry_score = st.slider("Chemistry Proficiency (1-10)", 1, 10)
|
| 25 |
+
|
| 26 |
+
# Study Habits
|
| 27 |
+
st.subheader("β° Study Habits")
|
| 28 |
+
study_hours = st.number_input("Daily Study Hours", min_value=0, max_value=16)
|
| 29 |
+
time_management = st.select_slider("Time Management Skills",
|
| 30 |
+
options=["Poor", "Average", "Good", "Excellent"])
|
| 31 |
+
|
| 32 |
+
# Problem Solving
|
| 33 |
+
st.subheader("π Problem Solving")
|
| 34 |
+
problem_approach = st.radio("Preferred Problem Solving Approach",
|
| 35 |
+
("Conceptual Understanding",
|
| 36 |
+
"Formula Memorization",
|
| 37 |
+
"Practice Problems"))
|
| 38 |
+
|
| 39 |
+
# Stress Management
|
| 40 |
+
st.subheader("π§ Stress Management")
|
| 41 |
+
stress_level = st.select_slider("Stress Level",
|
| 42 |
+
options=["Very Low", "Low", "Moderate", "High", "Very High"])
|
| 43 |
+
|
| 44 |
+
# Submission
|
| 45 |
+
submitted = st.form_submit_button("Generate SOCA Analysis")
|
| 46 |
+
|
| 47 |
+
if submitted:
|
| 48 |
+
with st.spinner("Analyzing responses..."):
|
| 49 |
+
# Prepare prompt
|
| 50 |
+
prompt = f"""Analyze this JEE student's profile and create a SOCA analysis:
|
| 51 |
+
Subject Scores:
|
| 52 |
+
- Mathematics: {math_score}/10
|
| 53 |
+
- Physics: {physics_score}/10
|
| 54 |
+
- Chemistry: {chemistry_score}/10
|
| 55 |
+
|
| 56 |
+
Study Habits:
|
| 57 |
+
- Daily Study Hours: {study_hours}
|
| 58 |
+
- Time Management: {time_management}
|
| 59 |
+
|
| 60 |
+
Problem Solving:
|
| 61 |
+
- Approach: {problem_approach}
|
| 62 |
+
|
| 63 |
+
Stress Management:
|
| 64 |
+
- Stress Level: {stress_level}
|
| 65 |
+
|
| 66 |
+
Provide the analysis in this format:
|
| 67 |
+
**Strengths:** [Identify 3 key strengths]
|
| 68 |
+
**Opportunities:** [Suggest 3 improvement areas]
|
| 69 |
+
**Challenges:** [List 3 main challenges]
|
| 70 |
+
**Action Plan:** [Create 4 actionable steps]
|
| 71 |
+
"""
|
| 72 |
+
|
| 73 |
+
# Get Gemini response
|
| 74 |
+
response = model.generate_content(prompt)
|
| 75 |
+
|
| 76 |
+
# Display analysis
|
| 77 |
+
st.subheader("SOCA Analysis Report")
|
| 78 |
+
st.markdown(response.text)
|
| 79 |
+
|
| 80 |
+
if __name__ == "__main__":
|
| 81 |
+
main()
|