# app.py import streamlit as st from learning_path_model import LearningPathModel # Initialize the learning path model model = LearningPathModel() # Sample content data (replace with actual data) content_data = [ {"id": 1, "title": "Intro to Python", "description": "Learn the basics of Python programming."}, {"id": 2, "title": "Data Science with Python", "description": "Advanced data science techniques using Python."}, {"id": 3, "title": "Machine Learning", "description": "An introduction to machine learning concepts and algorithms."}, ] st.title("Personalized Learning Path Generator") # User input user_input = st.text_area("Describe your current knowledge level and what you want to learn:", height=150) if st.button("Generate Learning Path"): if user_input: # Generate recommendations recommendations = model.recommend_learning_path(user_input, content_data) st.subheader("Recommended Learning Path") for rec in recommendations: st.write(f"**{rec['title']}**") st.write(f"{rec['description']}") summary = model.summarize_content(rec['description']) st.write(f"**Summary:** {summary}") else: st.error("Please enter a description of your current knowledge and learning goals.")