Skip to content

Fine Tuning text classification NLP models from huggingface with Covid-19 tweet data to build a model that classifies text based on Covid-19 sentiment

Notifications You must be signed in to change notification settings

Azie88/NLP-Huggingface-Covid-19-Tweet-Sentiment-Analysis

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

43 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NLP-Huggingface-Covid-19-Tweet-Sentiment-Analysis

shutterstock_1708020592

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

Project Links 📑

Getting Started🏁

You need to have Python 3 on your system. Then you can clone this repo and being at the repo's root :: repository_name> ...

  1. Clone this repository: git clone https://github.com/Azie88 NLP-Huggingface-Covid-19-Tweet-Sentiment-Analysis
  2. 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.

  1. Run the Gradio app (being at the repository root):

Gradio:

For development

  gradio main.py

For normal deployment/execution

  python main.py  
  1. Run the jupyter notebook on colab for more indepth insights on the deep learning process.

App Screenshots 🖼️

Gradio App on Huggingface

Author✍️

Andrew Obando

Andrew Obando | LinkedIn Medium


Feel free to star ⭐ this repository if you find it helpful!

About

Fine Tuning text classification NLP models from huggingface with Covid-19 tweet data to build a model that classifies text based on Covid-19 sentiment

Topics

Resources

Stars

Watchers

Forks

Languages