Inspiration

The idea behind the project was inspired by the works of William Shakespeare. A noteworthy poem, which though is not a sonnet but lead us to explore this domain would be the "Quality of Mercy" from Merchant of Venice. Once we were introduced to the Sonnets written by him, we were fascinated by the interesting rhyme scheme and structure in it. We wanted to replicate this while using our knowledge in the computer science field.

What it does

The Application consists of two parts, char-RNN and Web Interface. The char-RNN uses LSTM Architecture to analyze and generate the probability of a character appearing given the previous N characters. This concept was used to generate poems of various lengths with sonnets as reference. The Web Interface, provides the user a platform to interact with the RNN model to generate interesting poems and displays it on a greeting card. The objective of the interface is to act as a prototype application for the RNN.

How we built it

The char-RNN was built using pytorch in google colab environment. Various model architecture and hyperparameters were tested and the weights of the best outcome of these were stored as pth files. In the end the most optimal model was chosen for the web application. The web application was developed using ReactJS framework which is considered to be one the best for developing single page applications. Heroku was used to host both, the API and the web application.

Challenges we ran into

The challenges we ran into while makes this project were: The neural network not crossing a particular accuracy value and getting stagnant. Deciding whether punctuations should be considered with the model or not. Training the model for a long time was difficult as hardware resources were limited. Choosing the optimal Pytorch version such that the application can run without any errors while accounting for the memory space. Reducing the response time between API and Web App as much as possible.

Accomplishments that we're proud of

Implementing a char-RNN which can generate understandable poems on the spot for a given user input. Implementing a web application that can interact with the NN model and present the user with the result. Hosting an application on the internet for the first time.

What we learned

How to create an optimal RNN which can understand the given input. Avoiding vanishing gradient problems by trying out different architectures such as LSTM etc. Hosting web application and establishing communication between the API and the web application.

What's next for Shakespearean Poem Generation for Greeting Cards

  1. Reducing the time of response between API and web application.
  2. Improving upon the web application to enable users to order the gift cards generated.
  3. Improving the char-RNN created to make more meaningful poems by applying NLP concepts.
Share this project:

Updates