NLP-GENIUS is a cutting-edge natural language processing project that combines the power of transformers and machine learning to create an innovative music technology suite. It features:
Transform any title into complete song lyrics using a fine-tuned GPT-2 model trained on over 1M songs. The model captures musical patterns and lyrical structures to generate coherent and creative lyrics that match the input title's theme.
An advanced machine learning classifier that can predict a song's genre based on its lyrics. Using a combination of logistic regression and naive Bayes algorithms, it achieves impressive accuracy in categorizing songs into different musical styles.
- Fine-tuned GPT-2 transformer model for lyric generation
- Sophisticated text preprocessing pipeline
- Multi-model ensemble classification
- Docker containerization for easy deployment
- Comprehensive evaluation metrics and benchmarking
- A long training has already been made over 1M lyrics (RTX 4090 for 18 hours) :
- Download the weights here.
- Extract the archive in the transformer directory. Your file tree should look like this :
/NLP-GENIUS$ tree -L 2
.
├── README.md
├── dataset
│ └── song_lyrics.csv
...
└── transformers
├── Dockerfile
├── __pycache__
├── classes.py
├── preprocessing.py
├── requirements.txt
├── title_to_lyrics_transformer.py
├── trained_model # <- Extracted archive
└── training.pyConfigure a .env file in the transformer directory. The following config will train the model for 10 epochs over 1000 rows :
# /NLP_GENIUS/transformers/.env
TSF_TRAINING=True
TSF_EPOCHS=10
TSF_ROWS=1000Then install the dependencies and run the python script :
/NLP-GENIUS/transformers$ pip install -r requirements.txt
/NLP-GENIUS/transformers$ python title_to_lyrics_transformer.pyMake sure to be at the root of the project. First image build will take some time (copying the whole dataset) ~ 12mn.
pwd # /NLP-GENIUS
docker build -t nlp_transformer -f transformers/Dockerfile .docker run -e TSF_TITLE="Hello darkness" -it nlp_transformer