Inspiration

"Where the pool with a
Swimming pool in it can seem
Rather vacuous" -Chomsky

Chomsky made this. Chomsky is the intelligent-being behind Twaiku.

We liked the idea of a twitter client that only allows users to post haikus, but we wanted something more. We wanted a tool to generate haikus with user input.

What it does

Twaiku: Twitter with Haikus. Twaiku is a twitter client that only allows users to post in haikus. Its signature feature: Chomsky will help generate haikus for you.

How we built it

The Team: Backend: Joel Gustafson + Robert Tran Frontend: Kenny Friedman + Nick Gomez

The Tech: The back-end haiku magic happens with NLTK, a massive toolkit for natural language processing in Python. The iOS app connects to the server with a websocket, allowing us to update our haiku generation model with minimal latency. Users simply need to start writing whatever is on their mind, and Chomsky will help you generate poetic masterpieces with its quick algorithms.

Challenges we ran into

The immediate and clear challenge coming into this project was a fast algorithm that could generate haikus seamlessly. Speed was a top priority. We wanted to be able to suggest future words given sequence of words and also be able to suggest words in between a sequence of words. Other challenges included being able to detect the number of syllables in a word and autocomplete words from partial characters.

For our initial phase, we started with Microsoft's language processing tools: the 'Language Understanding Intelligent Service' and the 'Web Language Model API'. After producing a working algorithm to generate haikus in around 14 seconds apiece, we concluded that it simply wasn't fast enough and needed to look for another solution.

We turned to NLTK. Using its large library of samples of English texts, we pursued its 'trigram' tools. Trigrams allow us to look at chains of triples of words that occur frequently together. With some researching and hacking, we were able to produce promising results in millisecond time ranges. As it is, we are confident in Twaiku's ability to suggest future words, but the ability to fill in words in between or before a sequence of words quickly remains unfinished, due to the forward-chaining nature of the trigram model.

The other main challenge was the UI. As users input words, our haiku generation model was being updated in real-time to the user. The challenges included being able to make dynamic UI elements and manipulate strings to create a pleasant experience of haiku writing. Also, our team had never used Swift before.

Accomplishments that we're proud of

Firstly, we are proud the collection of haikus Twaiku was able to generate. Throughout the hackathon, we would marvel at our generated haikus - even writing them on the chalkboard for everyone to reflect on.

Secondly, the UI is amazing.

Lastly, we were able to create a fast solution to haiku generation.

What we learned

Among our group members, we were first time learners of natural language processing, swift programming, web sockets, and twitter API. We are excited about Chomsky and Twaiku is able to do, but our solutions to haiku generation have many implications for us outside of Twaiku.

What's next for Twaiku

We want a polished product that we can deploy to the world. This includes adding features to our iOS app, developing an Android app, and making our backend robust and scalable.

Share this project:

Updates