Showing posts with label markov chain. Show all posts
Showing posts with label markov chain. Show all posts

Thursday, 1 August 2013

Dream Syntax (A Collection of 102 dreams from 2008-2013), and a Dream Generated from Other Dreams.

P7314855

In 2008 I began a small project called Dream Syntax - a dream journal which not only collected stories of my dreams but also the drawings of the spaces within my dreams. I have just self-printed and hand-bound the textual portion of this project, which consists of 102 dreams from the years 2008 to 2013.

example_of_maps

On Dream Syntax: If the spaces and urban configurations of a city have the ability to affect the way we inhabit it, shouldn't the spaces in our dreams have the potential to influence us as well, since we experience them just as intensely as our everyday reality? The city exists largely in the memories of its inhabitants, and places in a rapidly changing city may be erased from existence as quickly as a hazy dream evaporates in the early morning. Who is to say then that dreams are of no consequence? Our memories of our dreams are no less tangible than the memories of the real places that we remember ourselves once inhabiting—places which, in reality, exist only in our imagination.

P7314858

P7314864

For THE ARTIST, THE BOOK AND THE CROWD, I was asked to rewrite a book that was of significance to me. There are very many books that have influenced me and my own work; my first degree had been in English Literature, and you could say that reading and writing will always be my first love. Although there were many works to choose from, I decided to rewrite my own book.

Computer_Generated_Dream

On A Dream Generated From Other Dreams: "Since 2008, I've been collecting my dreams in the form of texts and maps of interior spaces, in an attempt to articulate a 'dream syntax'. In 2013, I began experimenting with a simple Markov Text Generator written in Python. I was interested in using it to generate 'predictions' of what I might be dreaming next by applying it to the data I have collected from my dreams over the last few years. A Markov text generator uses a Markov chain to generate the next word in a sentence, and it is commonly used to generate spam text which looks superficially authentic. The choice of the next word depends only on the word preceding it, and there is no real memory or computation of grammar involved. The entire text is simply assessed in terms of what words have a higher probability of being used after each subsequent word. This allows one to generate a 'real-looking' text that repurposes words from a master text, through a very simple mechanism. This is a generated ghost of a dream, parsed from the last 6 years of dreaming."

The book and the print will be at shown at THE ARTIST, THE BOOK AND THE CROWD at The Substation Gallery, from 2 to 11 August 2013, a show about artists' relationship with books and the written/spoken word. Curated by Ho Rui An, Ang Siew Ching and Karen Yeh, THE ARTIST, THE BOOK AND THE CROWD features new and recent work by Song-Ming Ang, Stephen Black, Sze-Yenn Cheong, Heman Chong, Debbie Ding, Ho Tzu Nyen, Ho Zhen Ming, Godwin Koay, Michael Lee, Lee Wen, Susie Lingham, Joyce Teo, Yu Mingyi and Zhao Renhui.


You're invited to come to the opening tonight (1 August 2013) at the Substation at 7pm! I will be reading excerpts from my book.

More Information:
http://www.substation.org/event/the-artist-the-book-and-the-crowd/

https://www.facebook.com/events/1392190280999985/
http://artistbookcrowd.com/



The Book Binding Process


I read books all the time, and going by my pigheaded kind of logic, since I read so many books I should KNOW how to make my own books. Piffle and bosh, I thought it would be a piece of cake. Unfortunately this is a very labour intensive work. This took numerous hours to complete at a time that I already had too little time to spare. I was there sewing for hours. I decided to embark on it because I already had all the tools - a suitable awl, a bone folder, some thread, a needle, some PVA glue, and a cutting board. Actual professional bookbinders, PLEASE AVERT YOUR EYES NOW, or else you will see that my stitching is horrifyingly messy and because I made it up.

P7314836

P7314838

P7314847

I used Cheap Impostor to do the imposition for this book, which consists of 208 pages, or 13 signatures of 16 each (4 pages). Its a shareware program which costs USD$35, and I know there were many many "free" alternatives but to be honest I didn't have so much time to waste tweaking things forever and this just did the job. I've gotten to the point in my life where I will pay for applications and software if they do the job, especially coming from the perspective of someone who has gotten paid to write code before. So I registered the licence, and within 5 minutes of downloading it, I was on my way to make an imposition of the book that was absolutely perfect for my duplex printer. One another note is that you must select LONG-EDGE BINDING when printing with a duplex printer that ejects paper the short side first.

The Final Binding


P7314870

Book aficionados may describe my binding as a "creative mix between a coptic stitch and long stitch". Or, a big amateurish mess of red thread. You may be wondering, "Debbie, why did you use red thread to bind your book together? Was it because red threads represent the red string of destiny or fate in many east asian cultures including our own?" Well the answer is a lot more quotidian. I mainly had four spools of threads in my posession at the time of binding. I could have bound it with white, red, yellow, or green thread. However, I had a lot more of this red thread than the white, yellow and green threads. The white, yellow, and green had come from a pound store in London in a box of 12 spools for a pound, so you can imagine it seemed a little dodgy as well. The white would have been my first choice but i was almost out of it as white is often one's first go-to colour for sewing things back together. But... I had lot of red thread because these had been cast-offs from a friend's overzealous shopping trip at Ikea...

BUT HEY WHATEVER, I'VE MADE MY OWN BOOK!

Sunday, 28 April 2013

Ghost Trap: Markov Text Generator

This post is overdue, as I have been meaning to type this out since the previous month! I had been asked to design a Mouse Trap and a Ghost Trap as an "entrance exam" for a postgraduate programme I had been applying to (and if you must know, that endeavour was successful!!!), and I thought it would be good to record the process of making the Ghost Trap in particular, for it has proven to be a very useful tool in other projects (and for playing around with words...)

mousetrap

A Mouse Trap

The Mouse Trap I designed was cute but quite normal by most standards; I won't pretend to be a product designer, but the Ghost Trap was clearly meant to be the more exciting exercise of the two. Firstly, I don't believe in ghosts, having not seen one, and there was no reason to try to imagine ghosts in the supernatural sense if there wasn't anything there to begin with, so I felt it was more appropriate to contemplate the idea of a ghost trap vis-a-vis digital presence. Secondly, another thing to note is that I am more of a "hobby" programmer than a serious programmer, so whatever solution it was also had to be realistically possible to execute over one weekend (which had been the time I had to develop this). I didn't have the luxury of time to invent something fantastically complicated.

So, the simpliest idea was to generate the ghost of myself. As those of you who follow this blog will know, I write a lot here, and this basically sounds like Debbie speaking in real life, obviously because I wrote it). Another thing I do is use foursquare and flickr a lot. For people following my updates and reading all of the gratuitous amount of information and digital flotsam that I generate each and every day, this might constitute all of what some people might ever see or hear of Debbie. My digital footprint could be, in some ways, the only surviving evidence of Debbie. So what if Debbie wasn't there but something else continued generating and posting what I would probably say on my blog, and posting location information about Debbie? Would people believe in the ghost of Debbie?

The first thing I wanted to do was to fake Debbie's location. I tried compiling some stats from my currently active flickr and foursquare account:

525603193

525603203

525603209

My current flickr account started in October 2007
As of 17 March 2013, I have uploaded 37843 items to it.
It is 1995 days from the start date to the end date, end date included
Or 5 years, 5 months, 17 days including the end date.
All photos taken with my smartphone have been uploaded to flickr with geodata.
I have developed a habit of uploading every single digital photograph I have ever taken as soon as possible without editing. I also take photographs of notes, receipts, places I want to remember, but I file these as Private only.
Out of these 37843 photos, 24063 have geodata.
I have taken an average of 12.0616541353 geotagged images every day between 1 October 2007 and 17 March 2013

525603195

My current foursquare account was started on 9 October 2010.
From and including: Saturday, October 9, 2010
To and including: Sunday, March 17, 2013
It is 891 days from the start date to the end date, end date included
Or 2 years, 5 months, 9 days including the end date
As of 17 March 2013, I have made 1,115 Check-ins.
Most check-ins were only made when I wanted to find other tips and users in the area.
I have made an Average of 1.25140291807 Check-ins every day between 9 October 2007 and 17 March 2013

After looking at the sheer number of records, it looked like it would take too long to extract and process all the location data of Debbies (to produce a decent result), I thought it would be better to just generate a text which sounded like it had been written by me. This could be more quickly accomplished by what I thought would be a much simpler method: a markov text generator.

A Markov text generator is something that uses a markov chain to generate the next word in a sentence. The choice of the next word only depends on the current last word, and not on the entire sentence of all the words before that, and so in that sense it does not have memory ("markov property") despite often seeming to be smarter or more complex than it actually is.

It was not hard to find simple applications of it in action, as many spammers have used markov text generators to generate realistic looking paragraphs which are actually gibberish but then make it through spam filters. In fact, I first came into contact with the term while trying to figure out why I was receiving these realistic looking paragraphs of pure gibberish which were spam except in many cases there were no advertising links, thus rendering the spam pointless.

I found a simple example in python that I could read the code for (something that i could completely understand how it worked) and apply to my own text. The idea is that all the text is broken up and recorded as 3 word groups. For every A-B-C set of words, it checks: for each A-B, what is a possible C? After all the sets of A-B and possible Cs are recorded (if C occurs many times, then it will be repeated in the list of possible Cs for that A-B set, thus increasing the probability we will see that C returned after A-B. And of course, with location data, the same procedure could be applied to determine what would be a likely C Location for any particular A-B set of locations.

Screen Shot 2013-03-17 at 10.42.48 PM.png

Screen Shot 2013-03-17 at 10.42.53 PM.png

Next I generated a big text file of all the text in my blog. This was to be the base material for the debbietext to be generated.

Screen Shot 2013-03-17 at 10.39.46 PM.png

I ran the markov python script on the file and generated many fragments and snippets. I went on to tweak the script a bit along the way.

Screen Shot 2013-03-17 at 10.30.48 PM.png

From these snippets, I picked out a few I liked and compiled it into a full text with the punctuation cleaned up. For the interest of not making this blog any more of a piece of meta-writing than it already is, here is a generated text in image form.

Screen Shot 2013-04-29 at 12.52.27 AM.png

I used this markov generated text as the text for the newest Map without Buildings I have drawn, which is currently showing at Theo.do.lites (Lasalle ICA Gallery 1) as I had been working on that drawing at the time that I had been putting this together. So, what do you think? Does it sound like the ghost of debbie speaking?



To top this off, I wrote most of this blog post last night before falling asleep, and then at night I had a dream about visiting an old friend's house, browsing through his bookshelf, and picking up a 2nd hand copy of Jerome Rothenberg's The Lorca Variations. From there, I discovered that the copy of Lorca Variations was the exact copy of the book which I thought I had sold off some years ago. Even stranger still, I had been using the book as a diary, and some of my teenage diary entries had been scrawled inbetween the spaces of the pages! I had forgotten that I had used the book to write my personal diary notes, so I was shocked I had sold the book off without realising or remembering this! My friend had bought the book from a 2nd hand book dealer without realising what was inside the book - because he only collected books and did not read any of them.

I woke up soon after that dream, and upon waking I went to google the description of "The Lorca Variations", because I honestly could not recall what was in the book, except my general impression that the book had been really tedious and boring to me (sorry! but really not my cup of tea!) at the time I had read it for an English Literature module at NUS. I still remember it had been assigned to us by Dr Gwee Li Sui for the introductory EN2101 module, and I had tossed the book aside after that module and never looked at it since (except to try to hawk it off online to other unsuspecting literature students, but I can't even recall if I managed to sell it in the end...)

The blurb for "The Lorca Variations" on google books goes:
Having recently returned to translating Lorca, Rothenberg began to appropriate and rearrange items of Lorca's vocabulary and to compose a series of poems of his own that 'both are & aren't mine, both are & aren't Lorca.' As an original work, The Lorca Variations are, as he describes them, 'a way of coming full circle into a discovery that began with Lorca & for which he has stood with certain others as a guide & constant fellow-traveler.'
I can't believe my subconscious has reintroduced to me a book which I had completely forgot I had ever read. And at a time when I am working on a project like this.