How It Works

 The goal of our project was to create a children's story generator that takes prompts from the user, a child, and generates a story. The code will also speak the story using text to speech. There were several components that went into creating this model. We first spent some time finding simple data online that we could use to train our model. We created a python program that would clean all of this data so that it would be ready for use in training. We cleaned data from various collections of stories and we also tried translating Russian stories for use in training as well. After we cleaned the data it was used in a model that then created a children's story of its own. The idea here is that we will use speech recognition to pick up a prompt from a child and use that to generate a story. Then we will read the story using text-to-speech. In this way we will be able to make it an interactive and fun experience.

Cleaning the Data

 For the data cleaning we did two main things. For the Russian stories we made a script to translate them into English. We also used transcripts from YouTube videos to access some stories that way. Then we created a python script that went through all the stories and removed all extra characters, such as bullet points and new lines. We also removed lines that contained advertisements or information that was not relevant to the story. We cleaned the data by iterating through all the lines in the story backwards and deleting unnecessary information. Then using indexing we removed the text at the beginning and end that was not relevant to the stories. Once the data was cleaned, we took all of the stories and saved them into a text file to be used in another code.

Training the Model

 We used a GPT neo model for training and generating our story. GPT neo is a language model that utilizes deep learning to generate human-like text. This AI model has been used for many different language projects such as correcting grammar and making definitions for words. GPT neo is very similar to GPT 3, it can handle up to 2.7 billion parameters which is the same as the smallest GPT-3 model and bigger than the GPT 2 model. After we take input from the child using the speech recognition module, we generate a story using the ai.generate function.

Speech Recognition

 For the speech recognition part of this project, we used a JavaScript module called speechRecognition to listen to the user's voice input and convert it into text that displays in the text-box. This text is then sent to our model using the 'Generate' button and used to create an original children's story.

Our Website

 To begin creating our website, each team member designed one page on an application called NicePage. We then uploaded each HTML file from NicePage into our server and combined them into one functioning website. We ran into many formatting issues along the way, but we fixed these by manually converting the HTML from NicePage into the format that we needed for Flask, a Python module that is helpful in developing websites. to implement our website with a URL and correctly linked pages.