Spaces:
Sleeping
Sleeping
updated readme
Browse files
README.md
CHANGED
@@ -5,7 +5,7 @@ Song recommendation website.
|
|
5 |
## High-Level Functional Features
|
6 |
|
7 |
- Associates a song with a mood based on the lyrics.
|
8 |
-
- Lists out similar songs.
|
9 |
|
10 |
## Eventual Non-Functional Features
|
11 |
|
@@ -16,13 +16,19 @@ Song recommendation website.
|
|
16 |
|
17 |
- A simple web app that takes in song name and artist.
|
18 |
- A backend server that -
|
19 |
-
- Fetches the lyrics
|
20 |
- Passes the lyrics into the model to assign a mood.
|
21 |
-
- Uses this mood to fetch similar songs.
|
22 |
-
- Backend served and scaled by TFX
|
23 |
|
24 |
### Tech Stack
|
25 |
|
26 |
-
- Front-end - React
|
27 |
- Rest of the stuff in Python.
|
28 |
-
- Database -
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5 |
## High-Level Functional Features
|
6 |
|
7 |
- Associates a song with a mood based on the lyrics.
|
8 |
+
- Lists out similar songs. (TODO)
|
9 |
|
10 |
## Eventual Non-Functional Features
|
11 |
|
|
|
16 |
|
17 |
- A simple web app that takes in song name and artist.
|
18 |
- A backend server that -
|
19 |
+
- Fetches the lyrics from genius.com
|
20 |
- Passes the lyrics into the model to assign a mood.
|
21 |
+
- Uses this mood to fetch similar songs. (TODO)
|
22 |
+
- Backend served and scaled by TFX (TODO)
|
23 |
|
24 |
### Tech Stack
|
25 |
|
26 |
+
- Front-end - React (TODO)
|
27 |
- Rest of the stuff in Python.
|
28 |
+
- Database - TBD
|
29 |
+
|
30 |
+
## TODO
|
31 |
+
- Deploy the simple flask app
|
32 |
+
- Added functionality: Interpet model prediction
|
33 |
+
- Added functionality: Store predictions
|
34 |
+
- Added functionality: Validation by user
|
app.py
CHANGED
@@ -101,10 +101,11 @@ def get_lyrics(song_title, artist_name):
|
|
101 |
if lyrics.count('-')>200:
|
102 |
return False, f"Song not found - {song_title} by {artist_name}"
|
103 |
verses=[]
|
104 |
-
for x in lyrics.split('Lyrics')[1][:-
|
105 |
if '[' in list(x) or len(x)==0:
|
106 |
continue
|
107 |
verses.append(x.replace("\'","'"))
|
|
|
108 |
return True, '\n'.join(verses)
|
109 |
except TimeoutError:
|
110 |
return False, "TIMEOUT"
|
|
|
101 |
if lyrics.count('-')>200:
|
102 |
return False, f"Song not found - {song_title} by {artist_name}"
|
103 |
verses=[]
|
104 |
+
for x in lyrics.split('Lyrics')[1][:-6].split('\n'):
|
105 |
if '[' in list(x) or len(x)==0:
|
106 |
continue
|
107 |
verses.append(x.replace("\'","'"))
|
108 |
+
verses[-1] = verses[-1][:-1] if verses[-1][-1].isnumeric() else verses[-1]
|
109 |
return True, '\n'.join(verses)
|
110 |
except TimeoutError:
|
111 |
return False, "TIMEOUT"
|