1. Scraping of all lyrics of chosen artists from lyrics.com
A Naive-Bayes Classification is used on a tf-idf-vectorized lyrics-corpus (bag-of-words) with filtered and lemmatized words.
You can use the tools in 3 steps:
Choose 2-4 artists from Lyrics.com and copy the artist-urls.
Download the lyrics for each artist with:
# python get_lyrics.py "artist_name" "url"
python get_lyrics.py eminem https://www.lyrics.com/artist/Eminem/
This will create a folder "eminem_lyrics" with all lyrics available as txt-files. As a song can exist in multiple versions, there can be several lyrics-files for one song. For better results, duplicates may be deleted before proceeding.
You can take a few files out of the folder to use them with the classifier later.
Add an artist's lyrics to the dataframe with:
# python add_to_dataframe.py "artist_name"
python add_to_dataframe.py eminem
Repeat for every chosen artist.
python classify_lyrics.py "May I have your attention please? Will the real Slim Shady please stand up?"
or
python classify_lyrics.py songname.txt
A whole song will perform much better than a small text-sample.
This project was created during the Spiced Academy Data Science Bootcamp Nov/2021.