We are a group of aspiring STEM majors and so when the opportunity to use Machine Learning showed up for a website, we decided to jump at it. Often times, we have problems coming up with an appealing caption for our Instagram posts or thinking of motivational phrases.
It's is truly a first world problem but what if you could use Machine Learning to generate those inspiring/motivating phrases and rid yourself of all that hassle.
What it does
Quotify helps you turn your words into inspiration by using Machine Learning to generate quotes! Simply enter a starting phrase and quotify will turn it into a compelling and inspiring quote.
Some of the inspiring quotes that were generated:
- "Life is like travelling through time so stop being afraid of taking a chance and start appreciating where you are in life."
- "Motivation often comes from internalizing the things we fear. if you can't resist that, it will only come back to haunt or rob you of what you really want in life."
- "In the end, it is necessary to discover your inner beauty and truth."
How we built it
- We trained a model to generate quotes by finetuning GPT2 (a state-of-the-art language model) on a quotes dataset. - We compiled a list of quotes which were inspiring or motivating from this dataset. By doing so we were able to apply transfer-learning to make use of GPT's ability to generate English text and customise it to generate quotes.
- FastAPI was used as the backend to communicate with the trained model and our front end which was written in react.
- In order to increase the aesthetics of the website, we used Bootstrap and Material-UI as well as displaying relevant images using the Unsplash API. Upon receiving user input the frontend makes a GET request to the FastAPI backend which generates the quote from the GPT2 model hosted there.
- The model was deployed on Google cloud using Docker
Challenges we ran into
Deploying the model was a lot harder than we anticipated given its huge size of around 500MB. Finding a free solution to host it led us to Docker.
The model took us around 9 hours to train using Google Colab with a GPU backend. This long training time meant we were not able to play around with different parameters to tune the model further.
Our relative lack of experience in React and CSS made styling the frontend arduous process. Additionally, most of our time was spent on training and deploying the model, giving us relatively less time to improve the frontend
Accomplishments that we're proud of
- The model is pretty good and is able to generate relevant and meaningful quotes which sound realistic.
- Deploying the model to production via Google Cloud using Docker was a huge learning curve but highly rewarding.
What we learned
Through the course of this hackathon, we learned a lot more about Machine learning, Deep Learning and CSS.
The whole hackathon was a learning experience as it tested our knowledge of things we were familiar with as well as new tech stacks. It also showed us the importance of how could computing and availability of state-of-the-art pre-trained models like GPT2 have made it easy for anyone to apply Machine Learning to their specific use case.
What's next for Quotify
- Train and tune the model further
- Improve the frontend and UI/UX