Giter VIP home page Giter VIP logo

lyrics_classification's Introduction

Lyrics Classification with MultinomialNB

The goal of the project is to build a text classification model on song lyrics and predict the artist from a piece of text.

CLI

Let's copy a piece of text from Frank Sinatra's famous song from a website and check whether the model can predict the singer right.

Result: With a probability of 97%, the model predicts that the singer of the chosen song is Frank Sinatra! 👏

See more results here.

Workflow:

  1. Choosing some artists from MetroLyrics.
  2. Web Scraping: downloading the URLs of all songs of chosen artists and getting song lyrics using Requests module, RegEx, and BeautifulSoup.
  3. Constructing text corpus (a list of strings) and labels.
  4. Cleaning the text with the help of Natural Language Toolkit (NLTK) or spaCy. There are both text cleaning methods for NLP in the classification_model.py.
  5. Converting a text corpus into a numerical matrix using Bag of Words method (BoW).
  6. Normalizing the counts with the Term Frequency and the Inverse Document Frequency (TF-IDF).
  7. Applying Naive Bayes algorithm for multinomially distributed data (MultinomialNB). Putting TF-IDF and MultinomialNB in a pipeline.
  8. Exporting the code from Jupyter to a Python file and сreating a pipeline for building a CLI.
  9. Creating Word Cloud with the most frequent words in songs of chosen artists:

lyrics_classification's People

Contributors

lenaromanenko avatar

Stargazers

 avatar  avatar

Watchers

 avatar

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.