This is a university project developed for the "Data Science" course at KTH, for this project we aimed to perform sentiment classification of social media comments in swedish using semi-supervised learning. The final report can be seen here.
Carlos Lago |
Xuecong Liu |
Zhenlin Zhou |
Eliott Remmer |
To get a local copy up and running follow these simple steps.
- Python
sudo apt install python3 python3-dev
- Clone the repo
git clone https://github.com/carloslago/SentimentClassification.git
- Install Python packages
sudo pip install -r requirements.txt
The project fine-tunes a BERT model with social media comments with both supervised learning and unsupervised learning (GAN-BERT).
Data should have the following format, for unlabelled data the sentiment label doesn't need to be present.
{"sentiment_label": "-1/1", "message": "This is a comment in swedish"}
Fine-tuning swedish BERT:
python bert_fine_tuning.py
Training GAN-BERT with unsupervised data:
python gan_bert.py
Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.
Feel free to send us any bug reports, ask any questions or request any features via email. Just keep in mind we did this as a university project.