YRANOITCIP_final project

This project is originated from the idea of Pictionary, a game where one player draws the picture of something on a board while other teammates guess what it is. It is always funny to see all kinds of guesses the teammates come up with. After this class about text generation, the idea of an inverse Pictionary game occurred to me. Can we design an inverse game of Pictionary, where computer generates the text, i.e. instructions, and players try to draw it?

We need to give the computer some basic “knowledge” about how drawing instructions should look like. It would be ideal if we could have a huge “drawing instructions” dataset so we could use a RNN model to train the computer. However, such dataset is hard to obtain. Furthermore, since we need to make sure that the instructions make sense to the game participants based on their current situation, I developed a minimal template based on my expected scenario. The computer should be able to “improvise” based on the current situation, so do the participants. The computer arbitrarily changes certain parameters in the template in order to generate different texts. I hardcoded some of the parameters in order to cope with the environment. In order to be more creative, I use Spacy to let the computer find similar words in the dictionary for other parameters.

Another level of flexibility of the text generator roots on the interaction between the generated text and the environment. The instructions take in elements from the current participants and audiences and blend them into the drawings. So the final product would be a mixture of the hardcoded parameters, creativity of Spacy similarity semantics, and randomness taken from the current environments.


The following screenshots are two versions of generated drawing instructions:




And the source code:

Assignment 6_drawing instruction

So, I thought of doing a live computer generated drawing instructions using spaCy’s built-in word vectors and annoy vectors semantic similarity for this week’s assignment. The drawing will be produced base on the current environment. I’m thinking to develop this project into my final. To improve, I want to make the script to be more complicated and be more interesting so that the drawing will be more arbitrary and the instruction to be more specific.


Assignment 4_Tracery+Markov Chain

This week, I decided to use the Sonnet file that I created with Tracery couple weeks ago. I wanted to test it if Markov Chain’s model can duplicate similar text generation behavior.

So, using Tracery library, I used artificially designed template to generate Sonnet. The rules of text generation were explicitly articulated in the form of a template. Thanks to the library, I can replace some text components in the sentence.

On the other hand, I want to explore the possibilities of using Markov Chain to achieve the same behavior. Based on a relatively large Sonnet text data set, which was generated by Tracery library, a Markov model was built. It captures the interrelationship between individual and multiple characters and words, using the concept of n-grams. I used a similar function definition from the class notes and the Markov model is essentially a dictionary or look up table. Different keys in the dictionary correspond to multiple text predictions. The text generation was based on the same idea as in the class notes.

After the experiment, my Markov model is able to automatically learn the text generation rules previous specified by an artificial template. At the sentence level, the Markov model achieves the same effect as Tracery’s template. The grammar and syntax remain intact. However, Markov model picks random starting point and the whole format of Sonnet cannot be guaranteed.

Assignment 4

When I think of a particular form of the poem, I directly thought of Shakespeare Sonnets. I chose the one that I studied before, Sonnet 20, as my template. However, I realized the format of Sonnet does not have a rule that I can easily replace words. So, I borrowed a general format that Sonnet has and implement my own form.

The Sonnet I chose has total 11 sentences and every three sentences is categorized as one section. The last two sentences are its own section and indented.

So, I rewrote the poem by adding my own rule. Every section’s odd and even number sentences are in the same sentence structures. As you can see from the image in below:








So, I picked most of my vocabularies from Corpora and some I just manually typed it myself. Later, I installed base_english so I can implement capitalization and third person verb form. But, I realized that base_english does not include the different verb tense such as V+ing so I can only add “ing” manually; therefore, the grammar is a little off.

After looking back to my poem, I found that is really different than what I initially thought..The meaning has totally changed and it does not make much sense. Also, within each section, those sentences seem not associate or coherent to each other…which I realize how challenging it is to redesign a sonnet and implement my own style in it. In order to make it perfect, I believe there must be multiple trials and to reconsider the word choices.

HW 3_recipe

So this week, I decide to use a well known Taiwanese recipe as my first data source. While working on this assignment, the challenge I had was to figure out how to replace those specific words to my new words. I realize I have to go back to the text file to reorder the lines so that those words that I want to replace are placed on even lines.

Another challenge I found out was the awkward spacings after seeing the result. So, I seek out for help and realize that I can go all the way back to the first line and use line.strip(‘\n’) instead of line so that those additional spacings will disappear.

The idea is that using a recipe template with the ingredients and after all randomly shuffle the order the meal comes out differently every time. This process is sort of mimicking the process of cooking, which I found really interesting.

The text file of the recipe and find the original source here

three coup chicken recipe

Week 2_poetry generator_my cellphone

Letter to my cellphone and response back from my cellphone…

The reason why I wrote a love poem to my cellphone is because of this is the stuff that be with me every day and every second. So, I pretend that my phone has a characteristic like a human that probably will have something to say to me. So, I wrote the letter to my cellphone first and I created another poem as a response back from my cellphone back to me. The response letter took me awhile to come up with the words since I’m in the perspective of a “machine,” which it might not function as human. Therefore, I predicted what my cellphone would have a say to me. It was an interesting thoughts because I never thought I would treat my cellphone like a “person.”

I realized that every time when I generated the codes, some lines seem unrelated but somehow works. I think this is the beauty of randomness.

week 1_transcribe

#1: handwritten notes
The tides advance, the tides recedes. Winter goes and summer comes, summer wanes and the cold increase. The sun rises, the sun sets. The moon is full; the moon is black. The birds arrive, the birds depart. Flowers bloom; flowers fade. Seeds are sown; harvests are reaped. All nature in a circle of moods and I am apart of nature and so, like the tides, my moods will rise; my moods will fall.
It’s one of nature’s tricks, little understood, their each day and awaken with moods that have changed from yesterday. Yesterday’s joy will become today’s sadness; yesterday’s sadness will grow into tomorrow’s joy.

#2: handwritten notes
The problem of cell phone addition has increased an affected our life without notice. For example, people lose focus during business meeting, classes, and other events. These habits cause serious problems such as missing out the important details at the meeting and cannot concentrate their attention in the learning environment. The people who are mostly being affected are approximately between the age of 16 to 40. I think is important to face to this problem because of the addition that is causing problems of people’s daily life.
Nowadays, people are able to receive instant information by clicking keyboards or swiping their phone. We are living in the world that we are forced to receive new information every second; therefore, we are trained to be inpatient for anything. For example, we think a three minutes wait in the line for subway is too long. To wait for that three minutes would cause people being late at work.
The problem of being inpatient is affecting especially the group of millennials. These young adults are lack of patient at work and in a relationship. For example, these young adults expect quick returns or job promotions opportunities in their early career. Without making the major outcome, they start losing confidence and ambition. In addition, millennials have no patient to build a deep relationship with a person. They want to know about a person in a short period of time and may go on for the next one.
public safety.
in the city, safety is always the concern that people specially care about. In NYC, we constantly have violence happened around us which cause the anxiety of being in the public space. My target group would be those people who are less risk conscious and should be more alert while in the public. It is important to notice your surrounded environment; therefore, we can react and fight back to the risk and protect ourselves.