Lyricae is an assistant tool for composing lyrics by making recommendations based on sentiment selected and the verses written by the user.
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. The project consists in two fundamental parts: first lyrics scraping and processing to create the dataframes for the recommendation system, and the application itself.
See deployment for notes on how to deploy the project on a live system.
For the live application it is required Python 3.7 or higher, and nodeJS v12.18.0
In order to create the database, you will only need Python 3.7.
Run this commands to install python 3 and nodeJS:
$ sudo apt-get update
$ sudo apt-get install python3.7
$ sudo apt-get install nodejs
$ sudo apt-get install npm
The project was developed in the specified versions , and it has not been tested with previous versions in which it might work as well.
First of all, install python requirements and npm packages:
pip install -r requirements.txt
cd app
npm install
NOTE: See deployment to k.now how to get the application deployed with docker. This application runs currently on a development server.
- Run the API:
cd app
export FLASK_APP=api.py
npm run start-api
- Run the web server:
cd app
npm start
If ypu get the error "System limit for number of file watchers reached", run the next command before starting the web server:
echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p
NOTE: These scripts take some minutes to finish.
- DOWNLOAD LYRICS: Run "donwload_lyrics.py" to automatically donwload all the songs of the .csv file in the folder "/lyrics_dataset". This lyrics will be downloaded to "/lyrics_lyricwikia":
python donwload_lyrics.py
- PROCESS LYRICS: Run "process_lyrics.py" to process the lyrics and create the dataset for the recommendation engine:
python process_lyrics.py
- POSTPROCESS LYRICS: Run "postprocess.py" to filter words in other languages other than English, as some of them are in Spanish:
python postprocess.py
- WORD SIMILARITIES: You need to donwload the Word2Vec model to "Word2Vec" directory to be able to run either "KeyedVectors.py" or the notebook "KeyedVectors.ipynb". This script calculates similarities between words in the dataframes created previously:
python KeyedVectors.py