Sleep Story Machine is my capstone project for my undergrad in CSE at UofL. Me and three other students implemented this as an independent project; rather than working with an external company (as is the norm). The goal of this project is to demonstrate the advancements in machine learning by providing easily accessible and novel bedtime stories to children.
Sleep Story Machine is accessible from its web interface (sleepstorymachine.xyz) or through Google Assistant. The later makes possible a scenario in which a Google Home device could lull the user to sleep with a simple voice command.
The story generation is handled by Open-AI's GPT-2 model and is fine-tuned on Grimm's fairy-tales.
- User input
- On the web interface this is a simple text box. This is fed directly into the model
- The Google assistant asks for a topic from the user. This topic is then inserted into one of a few static templates in order to improve story generation.
- ex. Topic given: "a puppy" -> "Once upon a time a 'puppy' set out on an adventure..."
- Text generation
- The input is passed to a worker that feeds it to the running GPT-2 model. After a short amount of time the model then returns new text.
- If returning to the assistant the generated text is sent directly back.
- If returning to the web interface, the text is wrapped in html so that it can be loaded into the webpage.
- The assistant front end reads the story to the user and then asks for another topic.
- The web interface prints multiple results and also provides highlighted text based on the logits produced by GPT-2
The major issue was the ability to fine-tune the model:
- Amount of data online that could legally be used
- Difficulty, this was our first deep learning NLP project.
- Compute resources
I would like to revisit this project with new skills under my belt and improve it. Maybe use higher level tools like huggingface transformers.