Using T5 and keytotext generate short sentences in style of LOTR
For training t5-base
is used and after lots of cleaning the model was finetunned for 3 epochs on google colab gpus; training not book is available at notebooks
.
Using FastApi
a web app was designed for more user friendly interactions. After running the app you can choose the file with image of a car and see the results, Note: that if you are running the app for the first time it will take a bit because it needs to download trained models from google drive.
- Clone the repo into your local device.
- Move to clone project directory (you should be in
story_gen
) - Create conda virtual environment using command below: (you can change environment name to what you like, here we choose
story_gen
)conda create -n story_gen python=3.7 anaconda
- Activate your environment using command below:
conda activate story_gen
- Install requirements using command below:
pip install -r requirements.txt
- Move to
/src
using command below:cd src
- Run the following command to start the app:
uvicorn main:app --reload
- After app starts, open http://127.0.0.1:8000/docs in your browser.
- Right now the model only has seen LOTR style, in the future might be nice to add other styles.
- Training data is really few and some other generative models like
gpt2
will not preform well, so it would be great to work on gathering more data. - Although lots of preprocessing was done one the text it still needs more cleaning.