Skip to content

jchang504/tailor

Repository files navigation

Tailor

Tailor is a Python command-line tool for automatic generation of "original" song lyrics based on a collection of songs' lyrics.

The current version supports multiple file and directory (with optional recursive search) input and song structure customization; it uses a bigram-based language model to generate the lyrics, and outputs to stdout. There are a lot more cool features to come, being added faster than I can implement them to TODO.md!

Usage

usage: generate.py [-h] [-n N_GRAM_SIZE] [-p] [-r] [-s]
                   [-f SONG_SECTION [SONG_SECTION ...]]
                   lyrics_files [lyrics_files ...]

Generate song lyrics from an N-gram language model

positional arguments:
  lyrics_files          One or more text files containing lyrics of a song,
                        with each line separated by \n and each verse
                        separated by a blank line; or directories containing
                        such files

optional arguments:
  -h, --help            show this help message and exit
  -n N_GRAM_SIZE, --n-gram-size N_GRAM_SIZE
                        Specify the maximum N-gram size to use when processing
                        lyrics and generating the song. Note that preprocessed
                        lyrics data might not contain N-gram data up to the
                        specified size. Default: 2
  -p, --preprocessed-data
                        Use input files containing string representations of
                        preprocessed data dictionaries instead of raw lyrics.
                        Each input file should contain repr(d) for a single
                        data dictionary d of the form generated by process.py.
  -r, --recursive       Recursively search input directories for files
  -s, --section-titles  Print the section title in brackets before each
                        section of the song
  -f SONG_SECTION [SONG_SECTION ...], --song-form SONG_SECTION [SONG_SECTION ...]
                        Specify the structure of the song by listing the
                        section titles as arguments. Identical titles
                        represent sections that should be identical. Default:
                        ['Verse 1', 'Chorus', 'Verse 2', 'Chorus', 'Bridge',
                        'Chorus']

Thanks

Thanks to the eponymous Taylor Swift, whose critics' claims that all her songs are about the same thing gave me the idea for this.

Also thanks to www.metrolyrics.com, which provided the lyrics for testing and development.

Lastly, the greatest thanks to Ro-IT, a constant source of technical and general support, advice, and assistance. "Stay, stay, pay."

About

N-gram language model-based song lyrics generation

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published