- This repo contains the final project for the Master's course Deep Learning at University of Groningen
- The dataset can be downloaded from here
- The Base model can be found in src/cv_task/models.py
- Base trained model can be found in src/cv_task/base_model
- The ResNet-34 implementation can be found in src/cv_task/models.py
- The trained ResNet-34 models can be found in src/cv_task/model_pretrained and src/cv_task/model_random which are pre-trained and randomly initialized models
- Use the following to list all possible commandline parameters for training script
python src/cv_task/train.py --help
- For training with default parameters, run
python src/cv_task/train.py
- Use the following to list all possible commandline parameters for testing script
python src/cv_task/test.py --help
- For testing with default parameters, run
python src/cv_task/test.py
- To generate various plots, the following jupyter notebook src/cv_task/plot_graphs.ipynb is useful
- In the folder of the src/nlp_task, you will find models for semantic analysis on a tweet dataset regarding the Coronavirus.
- The semantic analysis is performed using a pretrained version of the BERT model and an untrained version of it, as well as a baseline LSTM model.
- The baseline model can be found in the
base_lstm_model.py
file. The program can easily be run by runningpython base_lstm_model.py
. It will print some data statistics, a model summary, a classification report and it will generate a confusion matrix in the directory that this file is run from.
- The BERT model can be found in the
BERT_model.py
file. The model is designed using the Google colab notebook found here. This model is pretrained using thebert-base-uncased
model, and finetuned according the semantic analysis task with 5 different semantic labels. Before training and testing, the tweets are cleaned up using a cleanup function as defined by Edgar Jonathan for another BERT model on the same dataset, found here. - The BERT model in the file can be run in both the pretrained and the untrained manner by commenting or uncommenting the following lines:
if __name__ == "__main__":
# uncomment these lines to run an untrained BERT model
print("\n\n----------------- untrained ------------------")
main(True)
# uncomment these lines to run an pretrained BERT model using bert-base-uncased
print("\n\n----------------- pretrained -----------------")
main(False)