Hashtags play a very important role when businesses and influencers on social media look to increasing their audience engagement. But creating/choosing relevant and popular hashtags is time-consuming and at times difficult too. I have automated this process.
The Microsoft COCO database will be used. Here are examples of the data:
A transformer model is used to generate captions for the image.
The caption is then filtered using the nltk stopwords list, and punctuations/single-characters will be removed to create hashtag-like words for the image.
These words are embedding using GloVe and are matched to categories in the Instagram popular hashtag database.
See requirements.txt for package info.
- Clone the repo.
- Download GloVe. Unzip and place in transformer/src/models/glove/.
- Download pre-trained models from here. Unzip and place in transformer/src/.
- To run the flask app, from transformer/ run:
python caption.py - Open the port specified in your terminal (http://0.0.0.0:5000/).
- Upload your image.