Giter Site home page Giter Site logo

politiciansinrap's Introduction

Politicians In Rap

Quick Python script to search Genius for a keyword and then scrape the corresponding lyrics, date of release, and genre for the result. I then used TextBlob to determine the polarity of the sentiment of the line that includes the keyword in the lyrics (e.g. whether it is a positive or negative use of the keyword).

Motivated by https://projects.fivethirtyeight.com/clinton-trump-hip-hop-lyrics/ Implementation borrowed heavily from Jason Q Ng (https://github.com/jasonqng/genius-lyrics-search/blob/master/README.md#genius-lyrics-search) and Big-Ish Data (https://bigishdata.com/2016/09/27/getting-song-lyrics-from-geniuss-api-scraping/)

Credentials

Before running make sure you get credentials from Genius.com: https://genius.com/api-clients. Add them to credentials.txt and copy it to a credentials.ini.

Limitations • Only returns ~1000 results. Limitations of Genius API

• Can’t filter results by genre. For example, I used this to query use of politicians names in Rap. Unfortunately, mostly news showed up (e.g. transcripts of speeches).

• TextBlob sentiment analysis doesn’t work particularly well on rap.

politiciansinrap's People

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.