In this project, we will be fine-tuning text classification NLP models from huggingface with Covid-19 tweet data to build a model that classifies text based on Covid-19 vaccine sentiment.We will fine tune the RoBERTa model to categorize sentiments expressed in a vast collection of COVID-19-related tweets. We will then build a Gradio app for our model to give our model an interface and host it on huggingface
- Tweet Sentiment Analysis Roberta: Model Fine Tuning process.
- main.py: Gradio app
- Data: Training and testing datasets for model development.
- Hugging Face Space: Gradio app deployed on Huggingface
You need to have Python 3
on your system. Then you can clone this repo and being at the repo's root :: repository_name> ...
- Clone this repository:
git clone https://github.com/Azie88 NLP-Huggingface-Covid-19-Tweet-Sentiment-Analysis
- On your IDE, create A Virtual Environment and Install the required packages for the project:
-
Windows:
python -m venv venv; venv\Scripts\activate; python -m pip install -q --upgrade pip; python -m pip install -qr requirements.txt
-
Linux & MacOs:
python3 -m venv venv; source venv/bin/activate; python -m pip install -q --upgrade pip; python -m pip install -qr requirements.txt
The two long command-lines have the same structure. They pipe multiple commands using the symbol ;
but you can manually execute them one after the other.
- Create the Python's virtual environment that isolates the required libraries of the project to avoid conflicts;
- Activate the Python's virtual environment so that the Python kernel & libraries will be those of the isolated environment;
- Upgrade Pip, the installed libraries/packages manager to have the up-to-date version that will work correctly;
- Install the required libraries/packages listed in the
requirements.txt
file so that they can be imported into the python script and notebook without any issue.
NB: For MacOs users, please install Xcode
if you have an issue.
- Run the Gradio app (being at the repository root):
Gradio:
For development
gradio main.py
For normal deployment/execution
python main.py
-
Go to your browser at the following address :
- Run the jupyter notebook on colab for more indepth insights on the deep learning process.
Gradio App on Huggingface |
---|
![]() |
![]() |
![]() |
Andrew Obando
Feel free to star ⭐ this repository if you find it helpful!