Spaces:
Sleeping
Sleeping
Update song_matching.py
Browse files- song_matching.py +4 -1
song_matching.py
CHANGED
@@ -11,7 +11,10 @@ class SongMatcher:
|
|
11 |
self.songs_df = pd.read_csv(songs_data_file)
|
12 |
self.sim_model = SentenceTransformer(model_name)
|
13 |
|
14 |
-
def match_songs_with_sentiment(user_sentiment_label, user_sentiment_score,
|
|
|
|
|
|
|
15 |
|
16 |
# Filter songs with the same sentiment label
|
17 |
matched_songs = songs_df[songs_df['sentiment'] == user_sentiment_label]
|
|
|
11 |
self.songs_df = pd.read_csv(songs_data_file)
|
12 |
self.sim_model = SentenceTransformer(model_name)
|
13 |
|
14 |
+
def match_songs_with_sentiment(user_sentiment_label, user_sentiment_score,user_input, score_range,songs_df):
|
15 |
+
|
16 |
+
# New: Define inputVector here
|
17 |
+
inputVector = sim_model.encode(user_input)
|
18 |
|
19 |
# Filter songs with the same sentiment label
|
20 |
matched_songs = songs_df[songs_df['sentiment'] == user_sentiment_label]
|