Generate realistic Instagram captions using transformers 🤗
Hugging Captions fine-tunes GPT-2, a transformer-based language model by OpenAI, to generate realistic photo captions. All of the transformer stuff is implemented using Hugging Face's Transformers library, hence the name Hugging Captions.
Required
git clone https://github.com/antoninodimaggio/Hugging-Captions.git
cd Hugging-Captions
pip install -r requirements.txt
python download.py -h
for helppython download.py --tag shibainu \
--caption-queries 60 \
--min-likes 10
python tune_transformer.py --tag shibainu --train
--prompt
, you want too lead your model in the right direction, the more specific the better.python tune_transformer.py -h
for helppython tune_transformer.py --tag shibainu --generate \
--prompt Adorable\ smile
--max-length 60 \
--min-length 20 \
--num-captions 40
python tune_transformer.py --tag shibainu --train --generate \
--prompt Adorable\ smile
--max-length 60 \
--min-length 20 \
--num-captions 40
/Hugging-Captions/text/generated_text/<tag>_gen.txt
to look at your generated captionsSome of the generated captions are going to be ugly. Some of the generated captions are going to be really good but a word or two simply does not make sense. This is expected no matter how much the data, both training and generated, is cleaned. If you are not getting the results that you want I have four suggestions.