Git Product home page Git Product logo

kanye-text-generator's Introduction

Kanye Text Generator

This tool uses the lyrics from all of Kanye Wests studio albums to learn how he is likely to write lyrics and then generates a set amount of characters in Kanyes style.

How it works

Learning process

I created a JSON file for each of Kanyes albums which contains all of his lyrics from that album (no featured artist lyrics ar included). On page load the JavaScript loops over this source text and compiles an array of ngrams (collection of characters), each with a child array of the possible next characters. This is very primitive but it provides quite a convincing output. The quality (readability) of the text can be controlled by changing the amount of characters in the ngrams, for instance if the code is set to look at 10 character long ngrams it will be almost indistinguishable from the original source material, if the ngram is set to 2 characters then the result will be completely incomprehensible. I find that an ngram of 4-6 characters works well.

Generation process

To generate the output text the code finds the first word to start from (in this implementation I've just used the first ngram in the source text for simplicity). Once it has the first ngram it looks at the ngrams array and selects a random element from the ngrams possible next character array. This continues until the output text is of the required length.

Credits

kanye-text-generator's People

Contributors

scottharrisondev avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

kanye-text-generator's Issues

Allow user to tweak ngram order

The ngram order is the length of the ngrams which the code looks for. This is best suited to somewhere between 4 and 6 for reasonable text. I'd like the user to be able to adjust this using a slider to maybe between 2 and 8 just to show the difference it can make at the extreme ends of the scale.

Add control bar

This would go under the help text, above the Ye button. This would include the option to use Twitter or Lyrics as a source of the data. It would also allow you to change the amount of output text you want. It also currently allows you to change the order so you can tweak how realistic the output text is.

End output on a full word

Currently after the set character limit the output just returns. It would be ideal if the output could be aware that it is halfway through a word and complete the word before returning. This could be done by checking if the current ngram ends in one of these characters: '.!?' for example.

Style site for mobile

The mobile experience currently works but isn't optimised. This is especially clear in font size and button size.

Style range slider

Order slider needs to be styled. Bear in mind that the slider only appears on desktop. Also worth noting that I am hoping to add more controls to the application as well as a small description next to each one (<10 chars each).

Vary the output length

The output length is currently set to 500 characters. This could be changed to be user variable or a random length between 100 and 1000 characters for example.

Change source material to be from Twitter

As we all know Kanye West has quite a presence on Twitter. It would be good to pull in his last 200 tweets for example and process the language used in them to see what the generator outputs.

Add Meta tags and GA

  • Setup a Google Analytics profile and add the code to the site
  • Add mobile Meta tags (viewport related)
  • Add display Meta tags (title etc.)

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.