-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Aayush Bajaj
authored and
Aayush Bajaj
committed
Dec 30, 2024
1 parent
5ed4ea3
commit b009e21
Showing
12 changed files
with
40,353 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Binary file added
BIN
+19.8 KB
content/projects/dl/.ob-jupyter/9de08d0435181dc1a28145fc963ab012e756f3b4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,2 @@ | ||
# Fetch Kanye West's songs | ||
artist = genius.search_artist("Kanye West", max_songs=100, sort="title") | ||
|
||
# Save lyrics to a text file | ||
with open("kanye_lyrics.txt", "w") as file: | ||
for song in artist.songs: | ||
file.write(song.lyrics + "\n\n") | ||
|
||
#now we clean the data: | ||
|
||
# Load raw lyrics | ||
with open("kanye_lyrics.txt", "r") as file: | ||
raw_data = file.read() | ||
|
||
# Clean lyrics | ||
cleaned_data = re.sub(r"\[.*?\]", "", raw_data) # Remove metadata like [Chorus] | ||
cleaned_data = re.sub(r"\s+", " ", cleaned_data) # Replace multiple spaces with one | ||
|
||
# Save cleaned lyrics | ||
with open("cleaned_kanye_lyrics.txt", "w") as file: | ||
file.write(cleaned_data) | ||
|
||
import numpy as np | ||
import pandas as pd | ||
import tensorflow as tf | ||
from tensorflow.keras.models import Sequential | ||
from tensorflow.keras.layers import LSTM, Dense, Embedding | ||
from tensorflow.keras.preprocessing.text import Tokenizer | ||
from tensorflow.keras.preprocessing.sequence import pad_sequences | ||
print("hello world") |
Oops, something went wrong.