File size: 602 Bytes
edc4276
1afb4fa
edc4276
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import streamlit as st
#import torch
# Import your model classes here

# Load your models
emotion_model = 'lstm_model.h5'
recommender_model = 'knn_model.npy'

st.title("Emotion-based Song Recommender")

# User input for lyrics
lyrics = st.text_area("Enter lyrics here:")

if st.button("Recommend Songs"):
    if lyrics:
        # Predict emotion
        emotion = emotion_model.predict(lyrics)

        # Get song recommendations
        recommendations = recommender_model.recommend(emotion, ...)

        st.write("Emotion Detected:", emotion)
        st.write("Recommended Songs:", recommendations)