File size: 1,332 Bytes
414953b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
# 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.")