This project focuses on the creation of a rap battle model for the course of Natural Language Processing of the Artificial Intelligence master's program at Telecom Paris. The main objective of this work is to provide a complete approach to develop a rap battle model.
You can check the interactive experience we made with this model at this address.
It's recommended to choose one workspace among the next ones to setup and achieve our work process:
- Google Colab account
- Kaggle account
Important note: Some files are not notebooks. Make sure to convert them into notebook to use it on online workspace like Google Colab.
Important note: All the following steps has to be executed in the right order because you'll need to use the output of previous steps to achieve the current one.
In order to retrieve all the necessary battle to train our model, you have to launch the scrape_data() function contained in web_scrapping.py.
We recommend to get all the battles in several times by modifying the values inside the next line for the for loop:
for battle_id in range(1, 49001):
Once all the data are scraped, you can execute the gathering_data.py file to put all the data into a database.
You can now use your generated database within the following notebook data_cleaning.ipynb. Please follow the instruction inside the file in order to correctly clean the data. Some functions has to be launched each time and some are not.
Important note: You have two parts that generate an output.
- The before last part will generate 3 files, and especially corpus_cleaned_lyrics that will be used at Step 4.
- The last part of this file will generate corpus_cleaned_lyrics_batch_{batch}.txt that will be used at Step 6.
Use specific algorithms to train our model without taking into account Defender | Challenger architecture
Now, you should have a new generated file corpus_cleaned_lyrics.txt. You will use this file into model.py that you can convert into notebook if you prefer to use online workspace. You will generate three .txt files that are required to train and validate your new model. As an output, you should get a new model.
The analysis.ipynb is a specific file dedicated to show different analysis conducted onto our models. You can use it on your generated models to retrieve some data.
Whole process to optimize all the previous steps to create a model with Defender | Challenger architecture
Model_LSTM_optmized.ipynb is the last file used in this project. It's dedicated to generate a specific model taking into account the rap battle mecanics with Challenger and Defender lyrics. To use this file, you have to locate your previously generated files corpus_cleaned_lyrics_batch_{batch}.txt at Step 3 and use them.
Our battle sources are taken from RapPad.co and are undoublty not under Creative Commons License. Therefore, you cannot use this work for any commercial project as long as you use these battles as sources.
RapPad.co and all contributors of this website.
