Git Product home page Git Product logo

classify-lyrics's Introduction

Find out to which artist a song most likely belongs!

Lyrics-classifier with command-line tools for:

1. Scraping of all lyrics of chosen artists from lyrics.com

2. Building a dataframe-file of all the scraped lyrics

3. Finding out to which of the artists a text-example most likely belongs (classify)


diagram

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:

1. Get Lyrics:

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.
 

2. Add to Dataframe:

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.
 

3. Find out to which of the artists a text-example most likely belongs:

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.