A collection of machine learning models for analyzing earthquake-related social media content, developed for the Oxfam project.
You need to join our Politus organization in HuggingFace, and create a read token for accessing the models. Finally, you need to set the 'token' variable in 'my_token.py' file as your created token.
Note: You will get authentication error if you don't have this token.
-
Install Anaconda from https://www.anaconda.com/download
Note: Any recent version of Anaconda/Miniconda will work, as long as it can create environments with Python 3.10.4
-
Create and activate environment:
# Create environment and install dependencies in one go conda create -n kedv python=3.10.4 conda activate kedv pip install transformers torch numpy huggingface_hubTested library versions for the development environment:
- transformers==4.49.0
- torch==2.1.0+cu121
- numpy==1.26.3
- huggingface_hub==0.26.2
Note:
- We have tested with cuda version of 12.2.
- Although we tested with these versions, latest libraries should also work as well.
The model pipeline works in the following order:
- Earthquake Detection: Detect earthquake-relevant tweets.
- Aid Recognition: Identify if a tweet is about any aid activity.
- Aid Subcategory Classification: Determine the specific kind of aid activity.
Each model can be run independently using the following format:
python <model_name>.pyYou need to modify the scripts to run it for your own purposes.