<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>netpoetic.com &#187; -NP-Software</title>
	<atom:link href="http://netpoetic.com/category/np-software/feed/" rel="self" type="application/rss+xml" />
	<link>http://netpoetic.com</link>
	<description>exploring digital poetry and electronic literature</description>
	<lastBuildDate>Tue, 31 Jan 2012 18:13:43 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>charNG: case study of authoring a poetry generator</title>
		<link>http://netpoetic.com/2011/06/charng-case-study-of-authoring-a-poetry-generator/</link>
		<comments>http://netpoetic.com/2011/06/charng-case-study-of-authoring-a-poetry-generator/#comments</comments>
		<pubDate>Tue, 28 Jun 2011 07:25:23 +0000</pubDate>
		<dc:creator>edde addad</dc:creator>
				<category><![CDATA[-NP-Software]]></category>
		<category><![CDATA[-NP-Theory/Critical]]></category>

		<guid isPermaLink="false">http://netpoetic.com/?p=2337</guid>
		<description><![CDATA[Hi all! The other day Jim Andrews commented that poetry generator development involves making parameters configurable by variables and graphic user interface elements. Now, over the last year or so I&#8217;ve been asking myself: ytf am I doing this? When I code a poetry generator, what exactly am I exploring? How can I formalize, track, [...]]]></description>
			<content:encoded><![CDATA[<p>Hi all!  The other day Jim Andrews <a href="http://netpoetic.com/2011/03/five-ways-to-approach-poetry-generation-as-a-natural-language-researcher/">commented</a> that poetry generator development involves making parameters configurable by variables and graphic user interface elements.</p>
<p>Now, over the last year or so I&#8217;ve been asking myself: ytf am I doing this?  When I code a poetry generator, what exactly am I exploring?  How can I formalize, track, measure what I&#8217;m working on?  There are no pre-existing representations.  But I figured I&#8217;d use Jim Andrew&#8217;s comment as a starting point for thinking about charNG, the most recent generator I&#8217;ve developed.</p>
<p><a href="http://www.eddeaddad.net/charNG/">charNG</a> is a character n-gram generator in the tradition of Dissociated Press and Travesty.  I coded it in my spare time over the past couple of months, posting various output on <a href="http://gnoetrydaily.wordpress.com/">Gnoetry Daily</a>, including for a chapbook of poems remixing the text of HP Lovecraft.  (advert: if you enjoy surreal gothic arcana, you should take a look: <a href="http://gnoetrydaily.wordpress.com/chapbooks/">Lovecraft Remixed</a>.)  </p>
<p>Anyway, after the cut I&#8217;ll trace the development of charNG, focusing on which aspects of the character n-gram generation I implemented, which I parameterized, which I made accessible in the graphic user interface, and why.  See below for more.</p>
<p><span id="more-2337"></span></p>
<h3>Intro</h3>
<p>The reason I need to think this through is because I do poetry generation the same way a cat stalks the room.  I basically do whatever I&#8217;m interested in at the moment without much long-term planning.  In part this is because my funded research is by nature fairly structured.  So I figure if I keep my poetry generation as unstructured as possible, I&#8217;ll open myself to research and technologies I might not otherwise have a chance to work with.  And since I&#8217;m doing poetry generation for myself, I might as well enjoy it.</p>
<blockquote><p>Poetry generation is process; generators and outputs trace explorations.</p></blockquote>
<p>Before I started charNG, I knew what character n-grams are, and I had a fairly good idea about how Dissociated Press and Travesty are related, but I wanted to do some coding on it to get a really good feel for the algorithms.  I want to emphasize that <strong>what&#8217;s important here are the algorithms involved, not the code itself</strong>.  Before too long the platform will be obsolete and the code will be usable only through emulators or antiques.  But the algorithms will be the same as they were for Andrey Markov in 1906, as they were for Ausonius in the 4th Century AD, as they were for everybody before and in-between.</p>
<blockquote><p>Output is subjective and software becomes obsolete, but output sets are infinite and methods and algorithms are eternal.
</p></blockquote>
<p>So: one reason to develop poetry generators it to acquire an intimate understanding of computional poetry algorithms.  Once you have this understanding, you will have a stronger mastery of your tools.  </p>
<h3>Early Versions</h3>
<p>First, what is a character n-gram?  If you wanna know the details in as unmathematical way as possible, see <a href="http://gnoetrydaily.wordpress.com/2011/06/14/sketch-charng/#more-2890">the explanation</a> I wrote up for charNG.  A summary is: it&#8217;s a sequence of characters in a text.  </p>
<p>I started with a simple interface, built in JavaScript.  I chose client-side JavaScript because I wanted something that could be easily saved by anyone who found it interesting.  Part of the reason I developed charNG was because there used to be a server-side Travesty generator on a url including eskimo/rstarr/poormfa, but that generator disappeared a couple months ago.  But a client-side generator can be saved by anyone, and either re-used personally or posted publically if it&#8217;s got a free-software license (as charNG does). </p>
<p><a href="http://netpoetic.com/wp-content/uploads/2011/06/charngram-apr12.png"><img src="http://netpoetic.com/wp-content/uploads/2011/06/charngram-apr12.png" alt="" width="525" height="524" class="alignnone size-full wp-image-2338" style="border: 1px solid black" /></a></p>
<p>The top textarea contains the corpus, from which the n-gram model is built.  I&#8217;ve used Shakespeare as a &#8220;hello world&#8221; ever since I read The American Council of Trustees and Alumni&#8217;s report on &#8220;<a href="http://www.goacta.org/publications/PDFs/VanishingShakespeare.pdf">The Vanishing Shakespeare</a>&#8220;, which talks about how Tha Bard is no longer required in many courses.  </p>
<p>The next (grayed-out) textarea is a log of the computations so I can see what&#8217;s happening.  Even when I&#8217;m using a good IDE I like to include logs as well as use debuggers, so if something wacky happens in a run I can see why it happened.</p>
<p>The two buttons show charNG&#8217;s first two capabilities: first was &#8220;analyze&#8221; to show the n-gram model being built; next was &#8220;Write&#8221;.  At first charNG only output character bigrams.</p>
<p>Finally, the lowermost textarea shows the output of the generation.</p>
<p>So the first thing that charNG did was take a corpus (the topmost textarea), count all the different sequences of characters in it, and print it out in the greyed-out area.  For example, if the corpus begins with &#8220;From fairest creatures we desire increase,&#8221;, and we&#8217;re building a 4-gram language model, then our model will include &#8220;From&#8221;, &#8220;rom &#8220;, &#8220;om f&#8221;, &#8220;m fa&#8221;, &#8221; fai&#8221;, &#8220;fair&#8221;, and so on.  Some of these may seem kind of strange, but as it turns out the 4-gram &#8220;om f&#8221; occurs 7 times in Tha Sonnets, in places like &#8220;wh<strong>om f</strong>ortune&#8221;, and &#8220;rand<strong>om f</strong>rom&#8221;.</p>
<p>The next thing it did was to determine how to use these n-gram models to write poetry.  Well, if you&#8217;ve come up with the string &#8220;cre&#8221; so far, and your 4-gram model tells you (among other things) that these are the 4-grams it&#8217;s seen beginning with &#8220;cre&#8221;:</p>
<blockquote><p>
crea 13,<br />
cred 3,<br />
cree 2,<br />
crep 1,<br />
cres 1,<br />
cret 1,
</p></blockquote>
<p>then you may want to just randomly pick a number between 1 and 21; if it&#8217;s 13 or less you write &#8220;a&#8221; to make &#8220;crea&#8221;; if it&#8217;s 14-16 you write &#8220;d&#8221; to make &#8220;cred&#8221;; if it&#8217;s 17 or 18 you write &#8220;e&#8221; to make &#8220;cree&#8221;; if it&#8217;s 19 you write &#8220;p&#8221; to make &#8220;crep&#8221;; if it&#8217;s 20 you pick &#8220;s&#8221; to make &#8220;cres&#8221;; if it&#8217;s 21 you write &#8220;t&#8221; to make &#8220;cret&#8221;.  This sort of thing was developed by the engineer Claude Shannon around the 1940s, based on ideas by mathematician Andrey Markov from the early 1900s.</p>
<p>In charNG&#8217;s as shown above, the only options are &#8220;Write&#8221; (to generate text) and &#8220;Analyze&#8221; (to show the n-gram models in the corpus.)  The n-gram model being used (bigram) is hard-coded, along with everything else except the choice of corpus.</p>
<p>Now as a tool, charNG by this point is not very flexible: it only can output something like this:</p>
<blockquote><p>kn ich flomalveeane thin,<br />
Whe pay s ld tharde whenl,<br />
Wheecheluselauset’dothallseinkn’sselothrkn eav
</p></blockquote>
<p>Which sounds kinda like getting your teeth pulled out.  But, it has made me familiar with character n-gram generation.  In particular, I was curious about the extent to which you had to represent an n-gram model in memory (i.e. have a data structure that contained a string like &#8220;crea&#8221; paired to a number like &#8220;13&#8243;) or whether you could just generate by looking at the data model.  The way I did it by just looking at the data model was inspired by how Dissociated Press, one of the earliest character n-gram generators, does it: every time you want to generate a number, you pick the string you&#8217;re looking for (like &#8220;cre&#8221;), you look through the corpus to see how many times &#8220;cre&#8221; exists, you pick one of those, and you print out the next character you want.  It&#8217;s equivalent to explicitly building a model for generation, because every instance of an n-gram built at model-building time also exists at <a href="http://gnoetrydaily.wordpress.com/2010/11/04/other-tools-dissociated-press-in-emacs/#more-1598">Dissociated Press</a>-style-generation time.  You&#8217;re basically just doing a run-time tradeoff: either you can have an initial model that takes up memory and initializiation time to build, or you can generate a bit slower.  Why would anyone want to explore this question?  That&#8217;s the joy of unfunded efforts: as long as what you&#8217;re doing is more fun than TV, you WIN.</p>
<blockquote><p>When you generate poetry as described above, you have no funders to report to, no program managers to satisfy, no auditors to review your code, and no audience to concern you. Your knowledge and abilities are constrained only by your will. This in itself is poetry.
</p></blockquote>
<h3>Mid-development</h3>
<p>Anyways, at first charNG only output character bigrams, and the code was not that clean: I had to re-write it to generalize beyond bigrams.  After I&#8217;d convinced myself that generating from corpus was the same as generating from models (I could have just written out a mathematical proof but this was more fun!) I had to decide whether to continue working on this.  I figured I would, and I generalized the n from which n-grams could be built as a parameter in code:</p>
<p><a href="http://netpoetic.com/wp-content/uploads/2011/06/charng-apr24.png"><img src="http://netpoetic.com/wp-content/uploads/2011/06/charng-apr24-600.png" alt="" width="600" height="263" class="alignnone size-full wp-image-2366" style="border: 1px solid black" /></a></p>
<p>Note that I&#8217;ve de-emphasized the corpus window at the expense of the analysis and the generation output.  From my time working with designers in a web shop I&#8217;ve come to appreciate that I know nothing about design, so in general I just focus completely on functionality: an unadorned interface focusing on the view I need of the algorithms I&#8217;m exploring.  </p>
<p>Since I&#8217;m working on this in my spare time, I don&#8217;t want to waste too much time recalling context (i.e. remembering how everything works, what I was working on, and what I thought might be fun to work on next) so I usually end a programming session by noting somewhere what I thought would be interesting next.  In this case, I did so by listing the parameters and I was frequently changing on the GUI but not yet making them GUI-editable.  (in part because, for example, verbose detail printing was not completely implemented.)</p>
<p>At this point in the development, I was thinking of ways to add newlines and spaces to make the output look more like 20th century free verse.  I got the idea from the generator <a href="http://janusnode.com/">JanusNode</a>, which has an &#8220;eecummingsify&#8221; button that uses rules to add spaces given a configuration file of text to match for.  I think that&#8217;s brilliant, but I wanted something simpler.  At this point I was just adding newlines every once in a while and generating from higher-order n-grams.  But I was already getting more interesting results:</p>
<blockquote><p>
But I worse cold differite,<br />
And han steep in Grece crossed inher’d,<br />
And to despacious cons my memoving,<br />
And did moan walks;<br />
And be.<br />
And this,<br />
And cleasure brange canot me, death of look,<br />
And besmell’ to sic plague-tiend’ring paid dear;<br />
They he can all a faults, of forbeauty, new-fould would ashinks bles up his shal, do you shalf wouldst you no me<br />
When love’s not gones on sakes brain worth to bide,<br />
That shall is thiefs his in our befor ther or time tendom leaven by mortunearseth showers gavength hell?
</p></blockquote>
<p>The above is a contiguous selection from unsupervised generation (i.e. generating a bunch of lines and selecting several adjacent lines without breaking them up or editing them) from Tha Sonnets.  The repeated &#8220;And&#8221; in the selection gives it a bit of coherence, and it has some nice phrases.  4-grams are great for portmanteaux: you&#8217;re looking at just enough context to make interesting new words, without getting words that are unnaturally long.  The created words sound like Old English or something, and for me the feeling is of a meaning that is possibly comprehensible but just out of reach.</p>
<h3>Near-complete</h3>
<p>By the time I announced the generator on Gnoetry Daily a couple weeks ago, I had explored a number of new features:</p>
<p><a href="http://netpoetic.com/wp-content/uploads/2011/06/charng-june14.png"><img src="http://netpoetic.com/wp-content/uploads/2011/06/charng-june14-600.png" alt="" width="600" height="290" class="alignnone size-full wp-image-2377" style="border: 1px solid black" /></a></p>
<p>I&#8217;d implemented GUI versions of the parameters I&#8217;d been playing around with, such as type of n-grams model, number of characters to generate, and verbosity of generation details.  I&#8217;d implemented free-style transformations by adding a percent chance of inserting a newline after any word, or initial spaces before a line.  I&#8217;d messed around with these after using them at 0% chance each, which only uses newlines and initial spaces that are seen in the corpus.</p>
<p>I&#8217;d added a feature to show the portmanteaux in the output.  Basically, this looks at the words in the output, and prints any that it doesn&#8217;t see in the words in the corpus.  Sometimes it lists words that are in the larger set of English language words; in the image above, charNG would list the word &#8220;infect&#8221; as a portmanteau, because the corpus only contains &#8220;infection&#8221; (&#8220;infect&#8221; is created from the output element &#8220;infect,&#8221; which is created from the 5-gram &#8220;fect,&#8221; (note the comma) which is derived from such corpus elements as &#8221; defect,&#8221;)  One of the ways I like to use charNG is to just paste in a corpus, generate 4-grams, and look at the portmanteaux</p>
<p>Of course, just generating a bunch of text and picking out what you like is fun too.  I posted some of this on Gnoetry Daily:</p>
<ul>
<li><a href="http://gnoetrydaily.wordpress.com/2011/05/31/crowning-the-blood/">Crowning the blood</a></li>
<li><a href="http://gnoetrydaily.wordpress.com/2011/06/19/pain-of-manhood/">Pain of Manhood</a></li>
<li><a href="http://gnoetrydaily.wordpress.com/2011/05/24/you-see-me-sucka-for-love/">you see me</a> (sucka for love)</li>
</ul>
<p>I especially like how 4-grams worked when processed with <a href="http://gnoetrydaily.wordpress.com/2011/01/11/codework-parenthetical-insertions/">codework parenthetical insertions</a>:</p>
<blockquote><p>
all the reployal :f.u[n]tually she lawsui:t.er[ror] to had objections who aborited minationstar mand<br />
his some, assed and, in Alliarace on the :w.ith[ered]eir relights<br />
be:f.or[get]m, thearenticational to the<br />
1.2 bi:s.ho[ut]page which on :l.us[ts]iona, while rule as Howed<br />
t:h.or[ror]res:t.ri[ck]al familigate.]</p>
<p>&nbsp;<br /> &#8211; from <a href="http://gnoetrydaily.wordpress.com/2011/04/26/beg-allows-us-govergned-decline-and-fall-april-2011/">be:g.al[lows] US govergned</a></li>
</blockquote>
<p>There are many features that could still be added, but sometimes I think it&#8217;s best to keep the generator simple, so I don&#8217;t get caught up on one approach for too long.  There are so many possibilities out there.</p>
<blockquote><p>A clockwork toy rattles on the tabletop; <br />listen to it <br />and build another.</p></blockquote>
<p>One of the most interesting things in developing charNG was varying the chaining approach during generation.  I tried choosing between &#8220;Markov&#8221;, &#8220;one-character overlap&#8221;, or &#8220;cento/cut-up&#8221;, as described in <a href="http://gnoetrydaily.wordpress.com/2011/06/14/sketch-charng/">the documentation</a> I wrote for charNG.   Basically, one-char overlap only considers the last character when deciding which n-gram to choose next.  And cento/cut-up doesn&#8217;t consider any context when deciding what n-gram to pick next; it basically picks a random set of cut-ups.</p>
<p>This gave me the opportunity to read up on <a href="http://en.wikipedia.org/wiki/Cento_(poetry)">Centos</a> a bit.  Basically they&#8217;re supervised cut-ups, traditionally using classical poetry as source text; the practice is from Greek poets <a href="http://www.malleablejangle.netfirms.com/gilesgoodland.htm">from before 400 BC</a> and Roman poets thereafter.  In particular, I tracked down Ausonius&#8217; &#8220;Cento Nuptialis&#8221;, which was composed to amuse the Emperor Valentinian in the 4th century AD.  On pg 373- of a <a href="http://books.google.com/books?id=-dlfAAAAMAAJ&amp;dq=Ausonius%20%20By%20Decimus%20Magnus%20Ausonius%2C%20Paulinus%20(of%20Pella.)&amp;pg=PP1#v=onepage&amp;q&amp;f=false">Loeb Classical Library translation</a> that&#8217;s been scanned online, Ausonius introduces his cento by saying: </p>
<blockquote><p>
This book, then hurriedly composed in a single day with some lamp-lit hours thrown in, I lately found among my rough drafts; and so great is my confidence in your sincerity and affection, that for all your gravity I could not withhold even a ludicrous production.  So take a little work, continuous, though made of disjointed tags; one, though of various scraps; absurd, though of grave materials; mine, though the elements are another&#8217;s&#8230;</p>
<p>And if you will suffer me, who need instruction myself, to instruct you, I will expound what a cento is.  It is a poem compactly built out of a variety of passages and different meanings, in such a way that either two half-lines are joined together to form one, or of one line and the following half with another half.  For to place two (whole) lines side by side is weak, and three in succession is mere trifling.
</p></blockquote>
<p><a href="http://en.wikipedia.org/wiki/Ausonius">Decimius Magnus Ausonius</a>, consul, soldier, and mediocre poet, from the 21st century I your peer salute you.</p>
]]></content:encoded>
			<wfw:commentRss>http://netpoetic.com/2011/06/charng-case-study-of-authoring-a-poetry-generator/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>New on Netartery</title>
		<link>http://netpoetic.com/2011/05/new-on-netartery-4/</link>
		<comments>http://netpoetic.com/2011/05/new-on-netartery-4/#comments</comments>
		<pubDate>Sat, 07 May 2011 08:30:44 +0000</pubDate>
		<dc:creator>Jim Andrews</dc:creator>
				<category><![CDATA[-NP-Creative/Artworks]]></category>
		<category><![CDATA[-NP-Reviews]]></category>
		<category><![CDATA[-NP-Software]]></category>
		<category><![CDATA[Jim Andrews]]></category>

		<guid isPermaLink="false">http://netpoetic.com/?p=2232</guid>
		<description><![CDATA[DREAMING METHODS&#8211;OPEN SOURCE PROJECT by Andy Campbell Dreaming Methods has three new projects available to experience – each one created without the use of Flash or any other browser plugin. MAINLY THE MYSTERIES by Gregory Whitehead One of the great audio artists of our time was asked to write about what he still believes in, [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://netartery.vispo.com" target="_blank"><img class="size-full wp-image-1828 alignnone" src="http://netpoetic.com/wp-content/uploads/2010/10/netartery.jpg" alt="" width="300" height="65" /></a></p>
<p><strong><a href="http://netartery.vispo.com/?p=1021" target="_blank">DREAMING METHODS&#8211;OPEN SOURCE PROJECT</a></strong><br />
by Andy Campbell<br />
Dreaming Methods has three new projects available to experience –  each  one created without the use of Flash or any other browser plugin.</p>
<p><strong><a href="http://netartery.vispo.com/?p=935" target="_blank">MAINLY THE MYSTERIES</a></strong><br />
by Gregory Whitehead<br />
One of the great audio artists of our time was asked to write about <em>what he still believes in, through all the riptides of the past decades.</em></p>
<p><strong><a href="http://netartery.vispo.com/?p=926" target="_blank">THE CLUB</a></strong><br />
by Jim Andrews<br />
Selected North American politicians, business men, and pyschopaths dbCinemized.</p>
<p><strong><a href="http://netartery.vispo.com/?p=914" target="_blank">UNDERBELLY &amp; SISTER STONE CARVER</a></strong><br />
by Christine Wilks<br />
Christine on the relation of her piece Underbelly to where she&#8217;s from, and her sister&#8217;s stone carving.</p>
<p><strong><a href="http://netartery.vispo.com/?p=911" target="_blank">UNICODE BY JORG PIRINGER</a></strong><br />
by Jim Andrews<br />
A review of Jorg&#8217;s piece posted on netpoetic.</p>
<p><strong><a href="http://netartery.vispo.com/?p=885" target="_blank">CITY BIRD BY MILLIE NISS</a></strong><br />
by Jim Andrews<br />
A short review of the late Millie Niss&#8217;s new book of poems.</p>
<p><strong><a href="http://netartery.vispo.com/?p=857" target="_blank">ANDREW TOPEL</a></strong><br />
by Jim Andrews<br />
Some outstanding visual poetry by Andrew Topel.</p>
<p><strong><a href="http://netartery.vispo.com/?p=856" target="_blank">IN THE SOUP WITH THE DIGITAL BOOK</a></strong><br />
by Paul Green<br />
New contributor Paul Green, audio artist extrordinaire, wonders about the digital book.</p>
<p><strong><a href="http://netartery.vispo.com/?p=845" target="_blank">RADIAUTEUR&#8211;NEW WEBZINE FOR RADIO ART</a></strong><br />
by Gregory Whitehead<br />
Description of and call for works concerning a new online webzine for radio art.</p>
<p><strong><a href="http://netartery.vispo.com/?p=837" target="_blank">MARIA ENGBERG REVIEWS FUNKHOUSER AND DRUCKER</a></strong><br />
by Jim Andrews<br />
Thoughts on Engberg&#8217;s article recently published in EBR.</p>
<p><strong><a href="http://netartery.vispo.com/?p=828" target="_blank">MOM&#8217;S MUSIC</a></strong><br />
by Jim Andrews<br />
A last experience together of music.</p>
<p><strong><a href="http://netartery.vispo.com/?p=789" target="_blank">SLIDVID 3.0</a></strong><br />
by Jim Andrews<br />
A software project by Andrews.</p>
<p><strong><a href="http://netartery.vispo.com/?p=765" target="_blank">THE CURSE OF THE &#8216;CODE BLUE&#8217; MOTTO</a></strong><br />
by Jim Andrews<br />
The motto of the Canadian national junior hockey team in 2011 was “Code  Blue”. Who knew that their motto would prove ironic? After the final  game, did whoever thought up the motto for the Canadian juniors glimpse,  in a kind of literary horror, the final meaning the motto would have in  history?</p>
]]></content:encoded>
			<wfw:commentRss>http://netpoetic.com/2011/05/new-on-netartery-4/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>my typewriter</title>
		<link>http://netpoetic.com/2011/05/my-typewriter/</link>
		<comments>http://netpoetic.com/2011/05/my-typewriter/#comments</comments>
		<pubDate>Tue, 03 May 2011 20:03:57 +0000</pubDate>
		<dc:creator>Joerg Piringer</dc:creator>
				<category><![CDATA[-NP-Experiments]]></category>
		<category><![CDATA[-NP-Software]]></category>
		<category><![CDATA[Joerg Pringer]]></category>

		<guid isPermaLink="false">http://netpoetic.com/?p=2247</guid>
		<description><![CDATA[a couple of days ago there was the news that the last factory that produced typewriters closed (which is not true at all in fact). there are still hundreds of thousands used ones around. you can get them at flea markets for 1-5 euros. i&#8217;d really recommend buying one or a couple (in case one [...]]]></description>
			<content:encoded><![CDATA[<p>a couple of days ago there was the news that the last factory that  produced typewriters closed (which is not true at all in fact). there are still hundreds of thousands  used ones around. you can get them at flea markets for 1-5 euros. i&#8217;d  really recommend buying one or a couple (in case one breaks). it&#8217;s a  perfect tool for writing down random thoughts or to create experimental  writing.</p>
<p>it&#8217;s always on. no need to switch it on and wait for the computer to start.</p>
<p>it needs no power. you can go hiking with it for weeks.</p>
<p>it&#8217;s a musical instrument.</p>
<p>it&#8217;s exercise for your fingers.</p>
<p>you cannot delete anything. that helps from time to time.</p>
<p>it looks nice.</p>
<p>you can get multicolored ink-ribbons.</p>
<p>you can sell the sheets of paper as unique artworks.</p>
<p>it&#8217;s good for showing in a museum when you are famous.</p>
<div id="attachment_2249" class="wp-caption alignnone" style="width: 310px"><a href="http://netpoetic.com/wp-content/uploads/2011/05/Foto-27.04.2011-13-43-19.jpg"><img class="size-full wp-image-2249" src="http://netpoetic.com/wp-content/uploads/2011/05/Foto-27.04.2011-13-43-19.jpg" alt="my typewriter an olivetti LETTERA 82 (travel typewriter)" width="300" height="404" /></a><p class="wp-caption-text">my typewriter an olivetti LETTERA 82 (travel typewriter)</p></div>
]]></content:encoded>
			<wfw:commentRss>http://netpoetic.com/2011/05/my-typewriter/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Presenting Sea and Spar Between</title>
		<link>http://netpoetic.com/2010/12/presenting-sea-and-spar-between/</link>
		<comments>http://netpoetic.com/2010/12/presenting-sea-and-spar-between/#comments</comments>
		<pubDate>Tue, 21 Dec 2010 03:30:14 +0000</pubDate>
		<dc:creator>Nick Montfort</dc:creator>
				<category><![CDATA[-NP-Creative/Artworks]]></category>
		<category><![CDATA[-NP-Software]]></category>
		<category><![CDATA[Nick Montfort]]></category>
		<category><![CDATA[Stephanie Strickland]]></category>

		<guid isPermaLink="false">http://netpoetic.com/?p=1929</guid>
		<description><![CDATA[The magazine Dear Navigator 1:2/3 includes a new poetry generator, Sea and Spar Between, by Nick Montfort and Stephanie Strickland. Stephanie and I worked on this project for a year, it generates about 225 trillion stanzas, and we&#8217;re delighted to see it published in the company of great writing in the School of the Art [...]]]></description>
			<content:encoded><![CDATA[<p>The magazine <i>Dear Navigator 1:2/3</i> includes a new poetry generator, <a href="http://blogs.saic.edu/dearnavigator/winter2010/nick-montfort-stephanie-strickland-sea-and-spar-between/"><i>Sea and Spar Between,</i></a> by Nick Montfort and Stephanie Strickland. Stephanie and I worked on this project for a year, it generates about 225 trillion stanzas, and we&#8217;re delighted to see it published in the company of great writing in the School of the Art Institute of Chicago&#8217;s new Web magazine.</p>
<p>There&#8217;s much to say about the project, but we do have a statement, and instructions, published along with the piece. I&#8217;ll just mention one aspect of the project that is not very visible: The file <a href="http://www.saic.edu/webspaces/portal/degrees_resources/departments/writing/DNSP11_SeaandSparBetween/sea_spar.js">seaspar.js</a> explains that <i>Sea and Spar Between</i> is licensed under a free software license. As the license says, anyone may copy it, modify it, or make use of it in some other way in creating another project &#8211; if that level of engagement interests you, please, go for it. In any case, I hope that you&#8217;ll take a look at <a href="http://blogs.saic.edu/dearnavigator/winter2010/nick-montfort-stephanie-strickland-sea-and-spar-between/"><i>Sea and Spar Between</i></a> and that you&#8217;ll let us know what you think.</p>
]]></content:encoded>
			<wfw:commentRss>http://netpoetic.com/2010/12/presenting-sea-and-spar-between/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Interactive Poetry Generation Systems: an Illustrated Overview</title>
		<link>http://netpoetic.com/2010/10/interactive-poetry-generation-systems-an-illustrated-overview/</link>
		<comments>http://netpoetic.com/2010/10/interactive-poetry-generation-systems-an-illustrated-overview/#comments</comments>
		<pubDate>Thu, 07 Oct 2010 18:22:49 +0000</pubDate>
		<dc:creator>edde addad</dc:creator>
				<category><![CDATA[-NP-Software]]></category>

		<guid isPermaLink="false">http://netpoetic.com/?p=1603</guid>
		<description><![CDATA[Greetings all! Over at Gnoetry Daily we&#8217;ve been exploring human-computer poetry generation using a variety of systems. These are computer tools that humans can use to write text poetry. Anyways I thought I&#8217;d put together an illustrated guide to some of the interactive poetry generators that are out there. Here&#8217;s a preview: Look below to [...]]]></description>
			<content:encoded><![CDATA[<p>Greetings all!  Over at <a href="http://gnoetrydaily.wordpress.com/">Gnoetry Daily</a> we&#8217;ve been exploring human-computer poetry generation using a variety of systems.  These are computer tools that humans can use to write text poetry.  Anyways I thought I&#8217;d put together an illustrated guide to some of the interactive poetry generators that are out there.  Here&#8217;s a preview:<br />
<a href="http://netpoetic.com/wp-content/uploads/2010/10/preview.png"><img src="http://netpoetic.com/wp-content/uploads/2010/10/preview-h.png" alt="" width="600" height="797" class="alignnone size-full wp-image-1790" /></a></p>
<p>Look below to read all the information, click to enlarge any image, and feel free to provide feedback or pointers to useful systems!</p>
<p><span id="more-1603"></span></p>
<h1>1. Collaborative Generation</h1>
<p>These are tools that allow humans to interact with them in some structured way while generating poetry.</p>
<h2>1a. Gnoetry</h2>
<p>Gnoetry is an interactive <a href="http://netpoetic.com/2010/06/computer-science-for-poets-n-gram-language-models/">n-gram</a> generator that allows humans to select words for it to re-generate in the context of a poetic form.</p>
<p>The human begins by selecting a poetic form.<br />
<a href="http://netpoetic.com/wp-content/uploads/2010/09/gnoetry-1-choose-form.png"><img src="http://netpoetic.com/wp-content/uploads/2010/10/gnoetry-1-choose-form-h.png" alt="" width="191" height="226" class="alignnone size-full wp-image-1683" /></a></p>
<p>The human then selects the source texts from which to build a language model&#8230;<br />
<a href="http://netpoetic.com/wp-content/uploads/2010/09/gnoetry-2-select-source-texts.png"><img src="http://netpoetic.com/wp-content/uploads/2010/10/gnoetry-2-select-source-texts-h.png" alt="" width="360" height="416" class="alignnone size-full wp-image-1685" /></a></p>
<p>&#8230;and decides how much each source texts should be weighed during word generation.<br />
<a href="http://netpoetic.com/wp-content/uploads/2010/09/gnoetry-3-weight-source-texts.png"><img src="http://netpoetic.com/wp-content/uploads/2010/10/gnoetry-3-weight-source-texts-h.png" alt="" width="252" height="172" class="alignnone size-full wp-image-1686" /></a></p>
<p>Gnoetry then generates a poem.  After this, the human selects words by mousing over them, and clicks &#8216;Regenerate&#8217; to have Gnoetry replace the selected words.  In this way, the human and the tool collaboratively build a poem:<br />
<a href="http://netpoetic.com/wp-content/uploads/2010/09/gnoetry-4-collaborate.png"><img src="http://netpoetic.com/wp-content/uploads/2010/10/gnoetry-4-collaborate-h.png" alt="" width="600" height="429" class="alignnone size-full wp-image-1679" /></a></p>
<p>Gnoetry was written by Jon Trowbridge with input from Eric Elshtain and other poets.  </p>
<ul>
<li>YouTube video of <a href="http://www.youtube.com/watch?v=S4EqLUUhn7E">Gnoetry in motion</a></li>
<li><a href="http://mchainpoetics.wordpress.com/the-programs-info-and-screenshots/">More information</a> about Gnoetry including building language models by <a href="http://mchainpoetics.wordpress.com/2009/08/08/adding-source-texts-to-gnoetry/">adding source texts</a></li>
<li>Installation on <a href="http://mchainpoetics.wordpress.com/gnoetry-0-2-download-and-install-howto/">Ubuntu</a> (including setting up a partition on Windows or Mac) or with an <a href="http://mchainpoetics.wordpress.com/2009/07/09/try-gnoetry-without-installing-ubuntu/">Ubuntu LiveCD</a></li>
<li>Gnoetry-authored chapbooks and more information at <a href="http://www.beardofbees.com/gnoetry.html">Beard of Bees Press</a>.</li>
</ul>
<h2>1b. jGnoetry</h2>
<p>A Javascript implementation of Gnoetry.  It allows you to markov-generate a poem from a bigram model built on a weighed corpus.  Then you select which words of the poem you want to  keep, and which you want to re-generate.</p>
<p><a href="http://netpoetic.com/wp-content/uploads/2010/10/jgnoetry-generation.png"><img src="http://netpoetic.com/wp-content/uploads/2010/10/jgnoetry-generation-600.png" alt="" width="600" height="318" class="alignnone size-full wp-image-2590" /></a></p>
<p>jGnoetry provides you with several options:</p>
<p><a href="http://netpoetic.com/wp-content/uploads/2010/10/jgnoetry-with-options.png"><img src="http://netpoetic.com/wp-content/uploads/2010/10/jgnoetry-with-options-600.png" alt="" width="600" height="412" class="alignnone size-full wp-image-2592" /></a></p>
<p>More info about jGnoetry:</p>
<ul>
<li>Access the <a href="http://www.eddeaddad.net/jGnoetry/">jGnoetry JavaScript web page</a></li>
<li><a href="http://gnoetrydaily.wordpress.com/2011/12/27/presenting-jgnoetry/">More information</a> about jGnoetry&#8217;s development</li>
</ul>
<h2>1c. eGnoetry</h2>
<p>The full version of Gnoetry can take a while to install and start using; hence &#8220;e&#8221;Gnoetry, which is a subset/variant of the full Gnoetry.  It&#8217;s a Java applet on a web page, so it&#8217;s easier to access.  It was developed with Processing and the RiTa + g4p libraries and includes source code so you can modify and extend it if you wish.</p>
<p>When you first access the web page, a poem is automatically generated:</p>
<p><a href="http://netpoetic.com/wp-content/uploads/2010/10/egnoetry-1.png"><img src="http://netpoetic.com/wp-content/uploads/2010/10/egnoetry-1h.png" alt="" width="600" height="472" class="alignnone size-full wp-image-1668" /></a></p>
<p>Here&#8217;s how you, the human, can use eGnoetry to write poetry interactively:</p>
<ul>
<li>You can edit the currently-generated poem by clicking on the word buttons in blue.  Doing so will replace that word with a new word consistent with a <a href="http://netpoetic.com/2010/06/computer-science-for-poets-n-gram-language-models/">bigram model</a> built from a given text</li>
<li>If you want to start over you can click &#8220;regenerate verse&#8221; to replace the entire poem </li>
<li>Clicking &#8220;Form&#8230;&#8221; cycles through the poem&#8217;s form (free verse, eHaiku, quatrain).</li>
<li>Language models for three default texts are provided (Alice in Wonderland, Shakespeare&#8217;s Sonnets, and Heart of Darkness) and they can be cycled through by clicking on the &#8220;Model:&#8230;&#8221; button</li>
<li>You can build new models by copying texts to your computer&#8217;s clipboard, then pasting them into the &#8216;New Model Text&#8217; area and pressing the &#8220;Import Model&#8221; button</li>
<li>Clicking the &#8220;Export Verse&#8221; button attempts to open a new web page containing the poem for printing or copying</li>
</ul>
<p><a href="http://netpoetic.com/wp-content/uploads/2010/10/egnoetry-2.png"><img src="http://netpoetic.com/wp-content/uploads/2010/10/egnoetry-2h.png" alt="" width="600" height="480" class="alignnone size-full wp-image-1669" /></a></p>
<p>More info about eGnoetry:</p>
<ul>
<li>Access the <a href="http://www.eddeaddad.net/eGnoetry/">eGnoetry Java applet</a></li>
<li><a href="http://gnoetrydaily.wordpress.com/2010/09/27/sketch-presenting-egnoetry/">More information</a> about eGnoetry&#8217;s development</li>
</ul>
<h2>1d. WpN</h2>
<p>A generalization of the Oulipo w &plusmn; n algorithm.  Also enables erasures and generation from templates.</p>
<p><a href="http://netpoetic.com/wp-content/uploads/2010/10/wpn-1.png"><img src="http://netpoetic.com/wp-content/uploads/2010/10/wpn-1-h.png" alt="" width="600" height="308" class="alignnone size-full wp-image-2055" style="border:1px solid black" /></a></p>
<ul>
<li>WpN is a <a href="http://www.eddeaddad.net/WpN/">web-based program</a> (Javascript)</li>
</ul>
<h2>1e. Icon Poet</h2>
<p>Icon Poet lets you click buttons that represent part-of-speech classes, which cycle through the words that are displayed in the edit area. A GUI interface lets you add members to the parts of speech.</p>
<p><a href="http://netpoetic.com/wp-content/uploads/2010/10/icon-poet.png"><img src="http://netpoetic.com/wp-content/uploads/2010/10/icon-poet.png" alt="" width="600" height="468" class="alignnone size-full wp-image-2594" /></a></p>
<ul>
<li>You can download Icon Poet (a Windows program) from <a href="http://www.iconpoet.com/">iconpoet.com</a>. </li>
</ul>
<h1>2. Unsupervised Generation</h1>
<p>Unsupervised Generation systems primarily generate poetry without direct human involvement.  These systems are interactive in allowing humans to write generation rules, set parameters, select input texts, and determine which sequence of generations or transformations the tools should make.  Also, humans often use the systems and then select from the output to build their own poems.</p>
<h2>2a. JanusNode</h2>
<p>JanusNode contains a number of tools to write poetry.  First, by selecting from a drop-down menu you can generate various types of text and poetry, such as Haiku in the example below.  A number of different types of text can be generated by default, such as Blues lyrics, Insults, and Bureaucratese.  The human can write and add new rules to produce new types of generators.<br />
<a href="http://netpoetic.com/wp-content/uploads/2010/10/janusnode-haiku.png"><img src="http://netpoetic.com/wp-content/uploads/2010/10/janusnode-haiku-h.png" alt="" width="600" height="392" class="alignnone size-full wp-image-1665" /></a></p>
<p>The human can also generate from word-based or character-based bi- and tri-gram models, either using some of the pre-build models, or creating new models.<br />
<a href="http://netpoetic.com/wp-content/uploads/2010/10/janusNode-markov.png"><img src="http://netpoetic.com/wp-content/uploads/2010/10/janusNode-markov-h.png" alt="" width="600" height="428" class="alignnone size-full wp-image-1714" /></a></p>
<p>After some text is generated, it can be made to look more &#8220;poetic&#8221; by eecummingsification, which introduces linebreaks and spaces in the text being authored.  The way JanusNode eecummingsifies can be modified by editing configuration files.  Similarly, Dadafying a text rearranges the words and adds spaces between them.<br />
<a href="http://netpoetic.com/wp-content/uploads/2010/10/janusNode-cummings.png"><img src="http://netpoetic.com/wp-content/uploads/2010/10/janusNode-cummings-h.png" alt="" width="600" height="427" class="alignnone size-full wp-image-1712" /></a></p>
<p>Also, JanusNode can do Text Mapping, which replaces the characters in the text.  Below is an example of a Shakespearean Sonnet mapped to &#8220;LeetSpeak&#8221;.  New Text Mappings can be authored and added.<br />
<a href="http://netpoetic.com/wp-content/uploads/2010/10/janusNode-leet.png"><img src="http://netpoetic.com/wp-content/uploads/2010/10/janusNode-leet-h.png" alt="" width="600" height="428" class="alignnone size-full wp-image-1713" /></a></p>
<p>JanusNode is a labor of love, born of two decades&#8217; of part-time development, reflecting the interests of its creator, Chris Westbury.</p>
<p>&#8220;The world cannot tell you itself. You have to help it to tell itself to you.&#8221;  &#8211; JanusNode documentation</p>
<ul>
<li><a href="http://janusnode.com/">official web page</a> with latest versions for Windows and MacOS</li>
<li>Usage notes on <a href="http://houseofsubstance.blogspot.com/2008/02/janusnode-repost-for-duros62_29.html">writing generation rules</a>, more <a href="http://houseofsubstance.blogspot.com/2008/03/still-more-janusnode_02.html">advanced rules</a>, <a href="http://houseofsubstance.blogspot.com/2008/03/easier-janusnode_05.html">automatic rule generation</a>, and <a href="http://houseofsubstance.blogspot.com/2008/03/janusnode-markov-chains_15.html">n-gram generation</a>.</li>
</ul>
<h2>2b. ePoGeeS</h2>
<p><strong>e</strong>PoGeeS is a <strong>Po</strong>etry <strong>Ge</strong>n<strong>e</strong>ration <strong>S</strong>ketchbook that can do things like generate several lines of verse, generate individual lines, generate words, and generate rhymed words.  Generation is done from a bigram or class-based language model, and while you&#8217;re working on a poem you can examine a list of all possible next or previous words in the language model.<br />
<a href="http://netpoetic.com/wp-content/uploads/2010/10/epogees-1.png"><img src="http://netpoetic.com/wp-content/uploads/2010/10/epogees-1h.png" alt="" width="651" height="358" class="alignnone size-full wp-image-1644" /></a></p>
<p>Several verse generation variables can be changed, such as number of lines and rhyme scheme.  Each individual line is actually generated from a number of possible candidates which are then evaluated and ranked; you can select random sampling or stochastic beam search to manage the evaluation.<br />
<a href="http://netpoetic.com/wp-content/uploads/2010/10/epogees-2.png"><img src="http://netpoetic.com/wp-content/uploads/2010/10/epogees-2h.png" alt="" width="654" height="355" class="alignnone size-full wp-image-1649" /></a></p>
<p>Evaluation of candidate lines is done by analyzing the phonemes that make up the sounds of the words in the candidate line.  The human user can set the sound types that are more likely to end up in the final candidate line selected.<br />
<a href="http://netpoetic.com/wp-content/uploads/2010/10/epogees-3.png"><img src="http://netpoetic.com/wp-content/uploads/2010/10/epogees-3h.png" alt="" width="656" height="360" class="alignnone size-full wp-image-1650" /></a></p>
<p>The default (&#8220;hello world&#8221;) language model is Shakespeare&#8217;s Sonnets.  The human can create new word-based language models by pasting in text and clicking &#8216;build&#8217;.  The human can also examine various aspects of the language, phoneme, and rhyme models.<br />
<a href="http://netpoetic.com/wp-content/uploads/2010/10/epogees-4.png"><img src="http://netpoetic.com/wp-content/uploads/2010/10/epogees-4h.png" alt="" width="655" height="358" class="alignnone size-full wp-image-1651" /></a></p>
<p>ePoGeeS was developed by eddeaddad (i.e. me) for his <a href="http://gnoetrydaily.wordpress.com/author/eddeaddad/">own poetry generation</a>.  It&#8217;s a little idiosyncratic because he just added whatever he needed at the time and ignored any details he wasn&#8217;t interested in, but you&#8217;re welcome to try it out!</p>
<ul>
<li>it&#8217;s a <a href="http://www.eddeaddad.net/epogees/">web-based program</a> (Java applet)</li>
<li>see online <a href="http://notes.eddeaddad.net/?page_id=22">documentation</a> with more screen-captures</li>
</ul>
<h2>2c. Infinite Monkeys</h2>
<p>Infinite Monkeys allows you to define templates to generate poetry.  Once the poem is generated, a text-to-speech interface will allow you to have your computer read your poem to you.</p>
<p><a href="http://netpoetic.com/wp-content/uploads/2010/10/infinite-monkeys.png"><img src="http://netpoetic.com/wp-content/uploads/2010/10/infinite-monkeys.png" alt="" width="600" height="450" class="alignnone size-full wp-image-2439" /></a></p>
<p>Language resources include a set of predefined parts-of-speech, which you can add to.</p>
<p><a href="http://netpoetic.com/wp-content/uploads/2010/10/infinite-monkeys-2.png"><img src="http://netpoetic.com/wp-content/uploads/2010/10/infinite-monkeys-2.png" alt="" width="600" height="450" class="alignnone size-full wp-image-2440" /></a></p>
<ul>
<li><a href="http://code.google.com/p/infinitemonkeys/">Infinite Monkeys</a> is written in FreeBASIC for Windows (and possibly Linux and FreeBSD?)</li>
<li>The <a href="http://code.google.com/p/infinitemonkeys/downloads/list">Downloads page</a> includes the application as well as a pdf of poetry written with it.</li>
</ul>
<h2>2d. Rhyming Robot (seuss)</h2>
<p>Rhyming robot, also known as seuss, is a codeset that generates markov text that is arranged into rhyming lines.</p>
<p><a href="http://netpoetic.com/wp-content/uploads/2010/10/rhymingRobot.png"><img src="http://netpoetic.com/wp-content/uploads/2010/10/rhymingRobot.png" alt="" width="600" height="475" class="alignnone size-full wp-image-2442" style="border:1px solid black" /></a></p>
<ul>
<li>You can use it <a href="http://www.scienceforums.net/etc/rhyme/poetry.php">on the web</a></li>
<li>It is <a href="https://github.com/capnrefsmmat/seuss">written in python</a>; it can run via command line, web interface, or IRC interface.</li>
<li>Also see <a href="http://www.scienceforums.net/topic/46413-computer-generated-poetry/">development notes</a>.</li>
</ul>
<h2>2e. charNG</h2>
<p>charNG is a character n-gram generator with Markov, cento/cut-up, and one-char overlap modes.</p>
<p><a href="http://netpoetic.com/wp-content/uploads/2010/10/charNG.png"><img src="http://netpoetic.com/wp-content/uploads/2010/10/charNG-600.png" alt="" width="600" height="293" class="alignnone size-full wp-image-2415" style="border:1px solid black" /></a></p>
<ul>
<li><a href="http://www.eddeaddad.net/charNG/">charNG is a web-based application</a> written in JavaScript</li>
<li>also see <a href="http://gnoetrydaily.wordpress.com/2011/06/14/sketch-charng/">release notes</a> and <a href="http://netpoetic.com/2011/06/charng-case-study-of-authoring-a-poetry-generator/">development notes</a></li>
</ul>
<h2>2f. Mchain</h2>
<p>Mchain is a tool that uses n-grams to generate an arbitrary quantity of text, which can be output to a text file.  The human then uses Mchain&#8217;s output in some way to create a poem; by selecting interesting phrases from the text, for example.  Mchain a command-line application:<br />
<a href="http://netpoetic.com/wp-content/uploads/2010/10/mchain-1-running.png"><img src="http://netpoetic.com/wp-content/uploads/2010/10/mchain-1-running-h.png" alt="" width="600" height="234" class="alignnone size-full wp-image-1732" /></a></p>
<p>Mchain was written by Adam Scovel. </p>
<ul>
<li>Mchain 0.3 <a href="http://mchainpoetics.wordpress.com/the-programs-info-and-screenshots/">info and screenshots</a> (at the bottom half of the page)</li>
<li>Mchain 0.2 (Python script) <a href="http://mchainpoetics.wordpress.com/mchain-script-installation-and-download/">download and installation</a> information</li>
<li>Mchain 0.3 (C++ program) <a href="http://mchainpoetics.wordpress.com/compile-mchain-03-source-c/">download and compilation</a> information</li>
</ul>
<h2>2g. Dissociated Press</h2>
<p>Developed in the early 70s, Dissociated Press is possibly the earliest n-gram generator (character- and word-based) that produces poetic-looking output.  It is still available in the standard GNU Emacs distribution via &#8220;M-x dissociated-press&#8221;.</p>
<p><a href="http://netpoetic.com/wp-content/uploads/2010/10/dissociatedpress-2.png"><img src="http://netpoetic.com/wp-content/uploads/2010/10/dissociatedpress-2-h.png" alt="" width="420" height="402" class="alignnone size-full wp-image-1844" /></a></p>
<p>The Emacs version of Dissociated Press was developed by the Free Software Foundation.</p>
<ul>
<li>You get it as part of <a href="http://www.gnu.org/software/emacs/">Emacs</a> text editor</li>
<li><a href="http://www.gnu.org/software/emacs/manual/html_node/emacs/Dissociated-Press.html">Documentation</a> and <a href="http://gnoetrydaily.wordpress.com/2010/11/04/other-tools-dissociated-press-in-emacs/#more-1598">usage notes</a></li>
</ul>
<h2>2h. Other Systems</h2>
<p>The web is full of &#8220;mad lib&#8221;-style slot-filling poetry generators and other simple programs for generating poetry, which may be of varying use to poets.  Below are some examples:</p>
<ul>
<li><a href="http://www.eddeaddad.net/eDiastic/">Diastic Reading</a> &#8211; a web implementation of an approach used by Jackson Mac Low that creates a poem from a text given a seed string.  (an <a href="http://www.eskimo.com/~rstarr/poormfa/diastic.html">older implementation</a> seems to be offline)</li>
<li><a href="http://www.motorhueso.net/cap/index.php">CAP &#8211; Computer Aided Poetry</a> by Eugenio Tisselli &#8211; given a seed text, replaces words with semantically-related words.  Also see <a href="http://netartery.vispo.com/?p=223">usage notes</a>.</li>
<li><a href="https://github.com/nathanielksmith/weltanschauung">Weltanschauung</a>, a perl command-line application that generates cut-ups from text.  Also see an <a href="http://www.youtube.com/watch?v=L_88FlTzwDE">explanatory presentation</a> on youtube.
<li><a href="http://thinkzone.wlonk.com/PoemGen/PoemGen.htm">Thinkzone Poem Generator</a> &#8211; a slot-filling generator that lets you edit the templates as well as the words in each slot, and provides Javascript code.
<li><a href="http://www.codeasart.com/poetry/darwin.html">Darwinian Poetry</a>, in which you get to help poems evolve.</li>
<li>Oulipoems: <a href="http://www.sporkworld.org/oulipoems/muse.html">The Electronic Muse</a>, a grammar-based tool in which the user generates and re-arranges lines of poetry in a variety of styles, with the ability to add words</li>
<li><a href="http://nickm.com/poems/ppg256.html">ppg256</a> &#8211; simple poetry generators developed in only 256 characters of Perl</li>
<li><a href="http://teacher.scholastic.com/writewit/poetry/poetry_engine.htm">Poetry Idea Engine</a> &#8211; an animated Flash program from Scholastic to teach kids poetic forms using slot-filling.</li>
<li>Wave Books&#8217; <a href="http://www.wavepoetry.com/erasures/">Erasures</a> tool &#8211; which allows you to remove words from an existing poem</li>
<li>ALAMO&#8217;s <a href="http://alamo.mshparisnord.org/litteraciels.html">Littéraciels</a> &#8211; including Langage Algorithmique pour la Production Assistée de Littérature </li>
<li>Similarly, an Oulipo <a href="http://www.spoonbill.org/n+7/">n+7 generator</a> is always fun </li>
<p>.
</ul>
<h1>3. General Tools</h1>
<p>These are tools in which the human takes the initiative in developing the poem, and is more of an essential component of the process than in systems discussed so far.</p>
<h2>3a. GTR Language Workbench</h2>
<p>GTR Language Workbench was developed a while back, went offline, and is now being distributed by the Newark Review.  The web page calls it &#8220;a digital studio for language which allows for any number of literary and aesthetic modifications to texts, similar to the way current graphic design software like Photoshop and audio software like Sound Forge permit artists to create, modify and combine different visual and sound pieces.&#8221;</p>
<p><a href="http://netpoetic.com/wp-content/uploads/2010/10/gtrscreenshot.png"><img src="http://netpoetic.com/wp-content/uploads/2010/10/gtrscreenshot-600.png" alt="" width="600" height="481" class="alignnone size-full wp-image-2597" /></a></p>
<ul>
<li>It&#8217;s a program for PCs and Macs, you can download an  <a href="http://web.njit.edu/~newrev/3.0//workbench/Workbench.html">installer</a> from the Newark Review</li>
</ul>
<h2>3b. The Muse</h2>
<p>The Muse is made up of four web-based programs that were developed to help songwriters during the February Album Writing Month challenge.  The first two programs are oriented towards music.  Plot Spline suggests constraints for lyrics, and Struxxure suggests musical structures.  Both are random generators.<br />
<a href="http://netpoetic.com/wp-content/uploads/2010/10/muse-1.png"><img src="http://netpoetic.com/wp-content/uploads/2010/10/muse-1.png" alt="" width="521" height="492" class="alignnone size-full wp-image-1746" /></a></p>
<p><a href="http://netpoetic.com/wp-content/uploads/2010/10/muse-2.png"><img src="http://netpoetic.com/wp-content/uploads/2010/10/muse-2.png" alt="" width="372" height="419" class="alignnone size-full wp-image-1748" /></a></p>
<p>LyriCloud is the third program, and focuses on helping write song lyrics.  It generates a &#8220;cloud&#8221; of words which are related in some way: semantically, or through corpus adjacency.  The human clicks on one of the words, which produces another cloud centered on the word that had been clicked on.  In this way, the human generates a sequence of words which can be used to build lyrics around.<br />
<a href="http://netpoetic.com/wp-content/uploads/2010/10/muse-3.png"><img src="http://netpoetic.com/wp-content/uploads/2010/10/muse-3.png" alt="" width="435" height="463" class="alignnone size-full wp-image-1784" /></a></p>
<p>Titular is the fourth program, designed to help the songwriter with song titles.  It works by filling part-of-speech templates that were built from a corpus of actual song titles.<br />
<a href="http://netpoetic.com/wp-content/uploads/2010/10/muse-4.png"><img src="http://netpoetic.com/wp-content/uploads/2010/10/muse-4.png" alt="" width="474" height="379" class="alignnone size-full wp-image-1750" /></a></p>
<p>LyriCloud and Titular are the most obviously suited for text poetry, but all four may be useful, depending on the poet&#8217;s needs.  The Muse was developed by Burr Settles.</p>
<ul>
<li>Try out <a href="http://muse.fawm.org/">The Muse</a> at FAWM.org</li>
<li>A <a href="http://pages.cs.wisc.edu/~bsettles/pub/settles.calc10.pdf">research paper</a> (pdf) describing and evaluating LyriCloud and Titular
</ul>
<h2>3c. RiTa + Processing</h2>
<p>Processing is a tool resembling a simplified Java IDE.  It is popular for writing animated and installation poetry (as opposed to poetry that focuses on texts and algorithms.)  RiTa is a Java class library that was developed for use with Processing and includes objects like an n-gram model builder and generator, a grammar builder, and part-of-speech tagger, and much more.  Using RiTa and Processing requires more human development effort than the previous programs, but they can be a powerful set of tools &#8211; for example, eGnoetry (above) was written using this combination.</p>
<p>RiTa and Processing are well-documented and include a number of example programs with source code, which makes programming almost as easy as writing HTML.  For example, a simple n-gram generator can be written in a few lines of code:<br />
<a href="http://netpoetic.com/wp-content/uploads/2010/10/rita-simplest.png"><img src="http://netpoetic.com/wp-content/uploads/2010/10/rita-simplest-h.png" alt="" width="600" height="399" class="alignnone size-full wp-image-1755" /></a></p>
<p>Processing was developed by Ben Fry, Casey Reas, and a number of volunteers.  RiTa was developed by Daniel C. Howe.</p>
<ul>
<li><a href="http://processing.org/">Processing</a> &#8211; a tool and set of libraries for writing Java-based animated and installation poems</li>
<li><a href="http://www.rednoise.org/rita/">RiTa</a> &#8211; a library developed for text generation with Processing </li>
</ul>
<h1>4. Historical Systems</h1>
<p>Humans have been developing poetry generators since the dawn of (computer) history!  Many of them are no longer available, but here is some information about several of them, with an emphasis on systems with versions that might still be available or in use.  (for the full story on historical systems, check with <a href="http://web.njit.edu/~funkhous/2003/brasil/creativetime.html">Chris Funkhouser</a>)</p>
<ul>
<li>Christopher Stratchey&#8217;s <a href="http://www.alpha60.de/research/muc/DavidLink_RadarAngels_EN.htm">Love Letter</a> generator.  Are love letters poems?  Maybe, maybe not&#8230; but this algorithm dates from 1952, and the developer was pals with Alan Turing!</li>
<li>If love letters aren&#8217;t poems, then maybe Theo Lutz&#8217;s Stochastic Texts are!  Check out this <a href="http://copernicus.netzliteratur.net/index1.html">German emulator</a> and <a href="http://www.stuttgarter-schule.de/lutz_schule_en.htm">the relevant paper</a>.</li>
<li><a href="http://www.yisongyue.com/shaney/">Mark V. Shaney</a> (<a href="http://en.wikipedia.org/wiki/Mark_V_Shaney">information</a>) &#8211; a word n-gram generator from the early 1980s, used on the Tao Te Ching and for Usenet posts.  Also see this <a href="http://www.beetleinabox.com/mkv_input.html">Markov Text Synthesizer</a> and this <a href="http://cm.bell-labs.com/cm/cs/tpop/markov.pl">Markov Perl script</a>.</li>
<li>The character n-gram generator <a href="http://bensonofjohn.co.uk/poetry/tools/travesty.php">Travesty</a> is from the same era.</li>
<li><a href="http://gnoetrydaily.wordpress.com/2010/06/19/other-tools-3-brief-poems-with-rkcp/#more-681">Ray Kurzweil&#8217;s Cybernetic Poet</a> &#8211; the poetry generator that will help bring on The Singularity!</li>
<li><a href="http://gnoetrydaily.wordpress.com/2010/07/10/other-tools-3-poems-with-versifier-and-thunder-thought/#more-735">Thunder Thought and Versifier</a> &#8211; classic DOS poetry generators by Rosemary West</li>
<li>Charles Hartman is an early programmer of <a href="http://cherry.conncoll.edu/cohar/Programs.htm">poetry tools</a>.
<li><a href="http://gnoetrydaily.wordpress.com/2010/09/15/other-tools-more-about-verbasizer/">Verbasizer</a> &#8211; a lyrics generation tool used by David Bowie</li>
</ul>
<p>That&#8217;s all for now!  If I&#8217;ve missed anything important, please let me know!</p>
]]></content:encoded>
			<wfw:commentRss>http://netpoetic.com/2010/10/interactive-poetry-generation-systems-an-illustrated-overview/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Computer Science for Poets: N-Gram Language Models</title>
		<link>http://netpoetic.com/2010/06/computer-science-for-poets-n-gram-language-models/</link>
		<comments>http://netpoetic.com/2010/06/computer-science-for-poets-n-gram-language-models/#comments</comments>
		<pubDate>Wed, 02 Jun 2010 08:54:16 +0000</pubDate>
		<dc:creator>edde addad</dc:creator>
				<category><![CDATA[-NP-Software]]></category>
		<category><![CDATA[-NP-Theory/Critical]]></category>

		<guid isPermaLink="false">http://netpoetic.com/?p=1379</guid>
		<description><![CDATA[Hi everyone!  Over at Gnoetry Daily we&#8217;ve been doing n-gram computer-assisted poetry generation for a while, and I decided to write up a little tutorial introducing n-grams and how they can be used for poetry generation.  It&#8217;s posted below; I&#8217;m trying to make it easy to understand, so let me know if there&#8217;s anything that&#8217;s [...]]]></description>
			<content:encoded><![CDATA[<p>Hi everyone!  Over at <a href="http://gnoetrydaily.wordpress.com/">Gnoetry Daily</a> we&#8217;ve been doing n-gram computer-assisted poetry generation for a while, and I decided to write up a little tutorial introducing n-grams and how they can be used for poetry generation.  It&#8217;s posted below; I&#8217;m trying to make it easy to understand, so let me know if there&#8217;s anything that&#8217;s not clear!</p>
<p><span id="more-1379"></span></p>
<h3>1. Unigrams</h3>
<p>I&#8217;ll use Shakespeare as an example; either you&#8217;ll like it, or you&#8217;ll like that I&#8217;m shredding it.  So think of Shakespeare&#8217;s line:<br />
&#8220;When I do count the clock that tells the time.&#8221;<br />
It contains several words:<br />
1. when<br />
2. I<br />
3. do<br />
4. count<br />
5. the<br />
6. clock<br />
7. that<br />
8. tells<br />
9. the<br />
10. time<br />
Computational linguists might call each word a unigram, as part of a language model.</p>
<p>I could generate my own poetry by rolling a 10-sided dice:<br />
- if a &#8217;3&#8242; came up, I&#8217;d write &#8216;do&#8217;.<br />
- if a &#8217;9&#8242; came up I&#8217;d write &#8216;the&#8217;.<br />
- if a &#8217;1&#8242; came up I&#8217;d write &#8216;when&#8217;.<br />
and so on.  After rolling the dice a couple times I might get something like:</p>
<blockquote><p>do the when clock the when when that</p></blockquote>
<p>Which sounds pretty incoherent, but this is just the first step!</p>
<h3>2. Bigrams from a single line</h3>
<p>Think of that line again:<br />
&#8220;When I do count the clock that tells the time.&#8221;<br />
It contains several adjacent pairs of words:<br />
1. when I<br />
2. I do<br />
3. do count<br />
4. count the<br />
5. the clock<br />
6. clock that<br />
7. that tells<br />
8. tells the<br />
9. the time<br />
Computational linguists might call these bigrams.</p>
<p>If I found a 9-sided dice, I could generate my own poetry again.<br />
- For example, if an &#8217;8&#8242; came up, I&#8217;d write &#8216;tells the&#8217;<br />
- The previous bigram ends with the word &#8216;the&#8217;.  So for the next word I&#8217;d look at those bigrams that begin with &#8216;the&#8217;.  There are two of these:<br />
5. (&#8216;the clock&#8217;)<br />
9. (&#8216;the time&#8217;).<br />
So I flip a coin, and I decide on 5.<br />
So far my poem is:</p>
<blockquote><p>tells the clock</p></blockquote>
<p>- Then for the next word I&#8217;d look at those bigrams that begin with &#8216;clock&#8217;. Unfortunately there is only one, &#8216;clock that,&#8217; so I need to choose that.<br />
- And after that, there is only one bigram that begins with &#8216;that&#8217; (&#8216;that tells&#8217;) so I need to choose that!<br />
- And after that there is only one bigram that begins with &#8216;tells&#8217; (&#8216;tells the&#8217;) so I need to choose that.<br />
- Luckily there are again two bigrams that begin with &#8216;the&#8217; so I flip a coin and pick &#8216;the clock&#8217;.</p>
<p>So thus far my poem is:</p>
<blockquote><p>tells the clock that tells the clock</p></blockquote>
<p>which is bad, but at least makes a bit more sense than the unigram-generated poem.</p>
<p>But the sequence &#8216;the clock that tells the&#8217; is lifted straight from the original line of poetry (a.k.a. the training data) because there weren&#8217;t a whole lot of options available.  This is the danger of using a small data set!  So let&#8217;s look at a bit more data.  At this point, using a computer programs helps.</p>
<h3>3. Bigrams from Shakespeare&#8217;s Sonnets</h3>
<p>Let&#8217;s take the entire set of Shakespeare&#8217;s sonnets from Project Gutenberg, and write a program to read the text file and break each line of poetry into bigrams as above.  There are a couple decisions we need to make when tokenizing (splitting the text into words) such as whether we should split things like &#8220;self-substantial&#8221; into two words or not, but the programming itself is pretty straightforward.</p>
<p>It turns out there are 11817 unique bigrams in Shakespeare&#8217;s sonnets which occur a total of 17534 times.  For example:<br />
- &#8220;eyes are&#8221; is a unique bigram which occurs 2 times<br />
- &#8220;fragrant rose&#8221; is a unique bigram which occurs 1 time<br />
- &#8220;even to&#8221; is a unique bigram which occurs 3 times<br />
and so on.</p>
<p>So let&#8217;s generate a poem!  How do we know where to start?  We keep a separate list of those words that begin a line of poetry!  Here is a list of the tokens that start lines in the Sonnets, along with the number of times they occur:</p>
<p>I 37, a 17, above 1, accuse 1, admit 1, advantage 1, after 2, against 10, ah 5, alack 1, alas 2, all 10, although 5, am 1, among 1, an 1, and 242, angry 1, anon 1, another 1, applying 1, are 3, art 1, as 40, askance 1, at 5, attending 1, authorizing 1, awakes 1, ay 2, bare 1, be 9, bear 1, bearing 2, beated 1, beauteous 1, beauty 2, beauty&#8217;s 1, because 2, before 3, beggar&#8217;d 1, being 4, beshrew 1, better 1, betwixt 1, beyond 1, blessed 1, book 1, borne 1, both 3, bound 1, breathed 1, bring 1, but 89, buy 1, by 14, call&#8217;d 1, calls 1, came 2, can 3, cannot 1, canst 1, cheered 1, chiding 1, clouds 1, come 2, comes 1, commanded 1, commit 1, compar&#8217;d 1, compare 1, consum&#8217;d 1, coral 1, could 1, counting 1, crawls 1, creating 1, creep 1, cries 1, crooked 1, crowning 1, cupid 1, darkening 1, dear 1, death&#8217;s 1, delights 1, describe 1, deserves 1, desire 1, desiring 1, despite 1, devouring 1, die 2, disdains 1, dissuade 1, distill&#8217;d 1, divert 1, do 4, doing 1, dost 3, doth 6, doubting 1, drawn 1, drink 1, drugs 1, dulling 1, duty 1, each 2, eat 1, either 1, enjoy&#8217;d 1, entitled 1, ere 2, eternal 1, even 10, exceeded 1, excuse 1, excusing 1, fair 3, fairing 1, farewell 1, featur&#8217;d 1, feed&#8217;st 1, feeding 1, feeds 1, find 1, finding 2, flatter 1, for 73, forgot 1, from 14, full 2, gainst 1, gentle 1, gilding 2, give 5, giving 1, gor&#8217;d 1, grant 1, great 1, growing 1, grows 1, had 2, hang 1, haply 1, happy 1, harsh 1, hast 1, hate 1, hath 6, have 6, he 7, hearing 1, hence 1, her 4, herein 1, hers 1, hiding 1, him 2, his 3, holds 1, how 21, hung 1, if 35, in 36, incapable 1, incertainties 1, increasing 1, injurious 1, intend 1, is 10, is&#8217;t 1, it 6, join 1, just 1, kill 2, kind 1, kissing 1, knowing 2, laid 1, lascivious 1, lean 1, leaving 1, leese 1, lest 6, let 10, lifts 1, like 8, lilies 1, lo 3, look 6, looking 2, lord 1, lose 1, love 4, love&#8217;s 3, loving 1, mad 2, made 2, make 6, makes 2, making 7, mark 2, may 3, me 2, methinks 1, might 1, mine 10, more 5, most 2, much 1, music 1, my 30, myself 2, naming 1, nativity 1, nature&#8217;s 1, nay 2, needs 1, neither 1, never 1, no 17, none 1, nor 24, not 10, nothing 1, now 9, o 47, o&#8217;er 1, o&#8217;ercharg&#8217;d 1, oaths 1, of 20, on 6, one 5, only 1, or 38, others 1, our 2, painting 2, past 3, perforce 1, pitiful 1, pity 3, plods 1, pluck 1, pointing 1, points 1, poor 1, possessing 1, potions 1, praising 1, presents 1, presume 1, prison 1, profitless 1, proving 1, receiving 1, resembling 2, reserve 2, return 2, revenge 1, richer 1, rise 1, robb&#8217;d 1, robbing 1, root 1, roses 2, rough 1, ruin 1, sap 1, savage 1, save 7, say 1, seeking 1, seems 1, self 1, serving 1, sets 2, shall 10, she 3, shifts 1, show 1, showing 1, simply 1, sin 1, since 15, sing 1, sings 1, sinks 1, sland&#8217;ring 1, so 47, some 7, sometime 2, speak 2, speaking 1, spend&#8217;st 1, spending 1, steal 1, stealing 2, still 2, stirr&#8217;d 1, straight 1, strikes 1, such 5, suffering 1, suns 1, supposed 1, suspect 1, swear 1, sweet 4, sweets 1, take 3, tan 1, tell 1, tempteth 1, ten 1, than 13, that 83, that&#8217;s 1, the 78, thee 1, their 1, theirs 1, then 33, thence 1, there 2, therefore 8, these 5, they 11, thine 4, think 1, this 8, those 7, thou 25, though 10, three 3, through 1, thus 8, thy 29, till 6, time 1, time&#8217;s 1, tir&#8217;d 1, tired 1, tis 3, to 78, to-morrow 2, too 1, towards 1, triumph 1, truth 1, two 1, under 2, unlearned 1, unless 4, unlook&#8217;d 2, unmoved 1, unthrifty 1, until 1, upon 7, use 1, uttering 1, vaunt 1, want 1, was 4, we 1, weary 1, weeds 1, weighs 1, were 4, were&#8217;t 1, wh&#8217;r 1, what 14, what&#8217;s 2, whate&#8217;er 1, when 57, whence 1, where 11, wherein 2, whereon 1, whereto 3, which 47, while 4, whilst 11, who 18, whoe&#8217;er 1, whoever 1, whom 1, whose 6, why 12, will 4, wilt 1, wishing 1, with 18, within 5, without 5, wooing 1, worthy 1, wound 1, wretched 1, yet 20, you 7, your 5, yourself 2</p>
<p>So in Shakespeare&#8217;s sonnets, the token &#8220;I&#8221; begins a line of verse 37 times; the token &#8220;how&#8221; begins a line of verse 21 times; the token &#8220;why&#8221; begins a line of verse 12 times, and so on.</p>
<p>Now let&#8217;s say we get a lottery machine, and wrote &#8220;I&#8221; on 37 of those little ping-pong balls, and wrote &#8220;how&#8221; on 21 of the ping-pong balls, and &#8220;why&#8221; on 12 of the ping-pong balls, and so on.  Then we draw out one of the ping-pong balls, look at the token on it, and put it back.  Let&#8217;s say the ping-pong ball we drew out said: &#8220;that&#8221;.  So thus far we have a poem that goes:</p>
<blockquote><p>that</p></blockquote>
<p>So now we can have our program look at the tokens that follow &#8220;that&#8221; in our corpus.  Here is a list of the tokens that follow &#8220;that&#8221; in Shakespeare&#8217;s Sonnets:<br />
I 28,  a 1,  able 1,  affable 1,  all 1,  am 1,  art 1,  audit 1,  barren 1,  be 1,  bears 2, beauteous 1,  beauty 3,  before 1,  besiege 1,  best 1,  better 1,  blessed 1,  bond 1,  bosom 1, brightness 1,  by 1,  calls 1,  can 1,  cannot 1,  censures 1,  churl 1,  copy 1,  deep 1, did 2,  do 2,  doth 3,  due 3,  ease 1,  enfeebled 1,  eternal 1,  ever 1,  every 2,  eyes 1, face 1,  fair 1,  fears 1,  feeds 1,  fell 1,  fester 1,  fire 1,  flies 1,  flower 1,  followed 1, for 2,  fresh 1,  from 1,  full 1,  gainst 1,  gave 1,  give 1,  glory 1,  god 1,  ground 1, grows 1,  guides 1,  harvest 1,  hath 1,  have 2,  having 1,  he 3,  heals 1,  heart 1,  heaven&#8217;s 1, heavy 1,  her 1,  heretic 1,  hidden 1,  him 1,  his 1,  honour 1,  idle 1,  in 7,  ink 1, is 9,  it 2,  keeps 2,  languish&#8217;d 1,  leads 1,  leaves 1,  level 1,  liberty 1,  life 1, like 1,  long 1,  looks 1,  loss 1,  love 3,  love&#8217;s 1,  loves 1,  made 1,  makes 2,  man&#8217;s 1, may 1,  men 1,  millions 1,  mine 3,  more 1,  muse 1,  music 1,  my 6,  myself 1,  nimble 1, nothing 1,  offence 1,  on 2,  one 1,  other 1,  our 1,  over-goes 1,  pay 1,  pen 1,  pine 1, plea 1,  poor 1,  pour&#8217;st 1,  purpose 1,  putt&#8217;st 1,  receive 1,  record 1,  repose 1,  riches 1, right 1,  said 2,  same 1,  says 1,  seals 1,  shall 1,  she 5,  sin 1,  smells 1,  so 2, sometimes 1,  sorrow 1,  still 1,  struck 1,  sun 1,  sweet 3,  taught 1,  tells 2,  the 4, thee 1,  then 1,  there 1,  thereby 1,  they 2,  this 2,  thou 18,  through 1,  thy 2,  time 7, to 5,  tongue 3,  touches 1,  travels 1,  unfair 1,  use 1,  ushers 1,  vex&#8217;d 1,  vow&#8217;d 1, we 2,  wear 1,  weight 1,  well 1,  were 1,  when 2,  which 19,  wild 1,  with 1,  word 1, writ 1,  writes 1,  you 9,  your 3, yourself 1</p>
<p>So in our corpus, &#8220;that I&#8221; occurs 28 times, &#8220;that music&#8221; occurs once, &#8220;that word&#8221; occurs once, and so on.  So let&#8217;s say we get our lottery machine to pick one of these words, and let&#8217;s say it picked &#8220;loss.&#8221;  So thus far we have a poem that goes:</p>
<blockquote><p>that loss</p></blockquote>
<p>So now we can have our program look at the words that follow &#8220;loss&#8221; in our corpus, and we use our lottery machine to pick one of them.  Let&#8217;s say it picks &#8220;in&#8221; so we have:</p>
<blockquote><p>that loss in</p></blockquote>
<p>So now we can look at the words that follow &#8220;in&#8221;, and pick one of them.  And so on, until we might get a line like:</p>
<blockquote><p>that loss in youth doth appear and straight</p></blockquote>
<p>which doesn&#8217;t make a lot of sense altogether.  But the first part does.  And since we&#8217;re humans, we&#8217;re in charge, so we can fix it!  First, let&#8217;s cut out the last three words, leaving us with:</p>
<blockquote><p>that loss in youth doth</p></blockquote>
<p>Then let&#8217;s re-generate the poem, starting with picking a word that follows &#8220;doth,&#8221; then a word that follows that, and so on.  This time around, we might get:</p>
<blockquote><p>that loss in youth doth bear all things remov&#8217;d</p></blockquote>
<p>which is better than before.</p>
<h3>4. Conclusions</h3>
<p>So to sum up:</p>
<ul>
<li>n-gram language models are built with things like bigrams and unigrams.  They are built on training data.  They collect information about what words are seen next to each other, and how frequently those sequences of words are seen in the data.</li>
<li>you can generate poetry by having a program select words from the n-gram language model.  You can use the frequency counts to make it more likely that a given word will be picked.</li>
<li> if the line generated by sampling from a bigram model is coherent, it&#8217;s because each pair of words is coherent.  (i.e. the language model does not contain bigrams like &#8216;when when&#8217;)  However, this may not be enough to generate poetry completely algorithmically.  You may need to have a human author intervene.</li>
</ul>
<p>There&#8217;s a lot more to n-grams, of course.  <a href="http://en.wikipedia.org/wiki/N-gram">Wikipedia</a> is a good place to start reading on it.  Otherwise, check out a copy of Jurafsky and Martin&#8217;s &#8220;<a href="http://www.cs.colorado.edu/~martin/slp.html">Speech and Language Processing</a>.&#8221;</p>
<p>Hope that was interesting!  later.</p>
]]></content:encoded>
			<wfw:commentRss>http://netpoetic.com/2010/06/computer-science-for-poets-n-gram-language-models/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Slideshows, apps, and OOP</title>
		<link>http://netpoetic.com/2010/02/slideshows-apps-and-oop/</link>
		<comments>http://netpoetic.com/2010/02/slideshows-apps-and-oop/#comments</comments>
		<pubDate>Tue, 02 Feb 2010 12:26:00 +0000</pubDate>
		<dc:creator>Jim Andrews</dc:creator>
				<category><![CDATA[-NP-Creative/Artworks]]></category>
		<category><![CDATA[-NP-Experiments]]></category>
		<category><![CDATA[-NP-Software]]></category>
		<category><![CDATA[Jim Andrews]]></category>

		<guid isPermaLink="false">http://netpoetic.com/?p=1022</guid>
		<description><![CDATA[I&#8217;ve been working on a new Javascript app to display images on the net. If you&#8217;ve seen any of the previous dbCinema slideshows, you may recall they didn&#8217;t have fade in/out of the images. I was finally motivated to make that sort of app. The motivation was not for the dbCinema images, but for some [...]]]></description>
			<content:encoded><![CDATA[<div id="attachment_1023" class="wp-caption alignleft" style="width: 310px"><a href="http://vispo.com/dbcinema" target="_blank"><img class="size-full wp-image-1023 " style="margin-left: 4px;margin-right: 4px" src="http://netpoetic.com/wp-content/uploads/2010/02/kleeapp.png" alt="" width="300" height="256" /></a><p class="wp-caption-text">From &#39;Klee Flowers&#39;</p></div>
<p>I&#8217;ve been working on a new Javascript app to display images on the net. If you&#8217;ve seen any of the previous dbCinema slideshows, you may recall they didn&#8217;t have fade in/out of the images. I was finally motivated to make that sort of app. The motivation was not for the dbCinema images, but for some others which aren&#8217;t up yet, which I&#8217;ll show you when that project is finished.</p>
<p>However, I have developed the app with the dbCinema images. All of the dbCinema slideshows at <a href="http://vispo.com/dbcinema" target="_blank">http://vispo.com/dbcinema</a> now have that feature. Fade in/out enhances the experience of these images because there is often continuity between the images, and the fading in of one over another reveals the nature of the continuity in a way that both shows how the thing is growing/changing and contributes to the &#8216;cinema&#8217; of dbCinema.</p>
<p>It also provides &#8216;action&#8217; while the app is busy downloading the next image, which is a consideration in streaming net art. Usually the images are 1280&#215;1024 in size and vary from around 75kb to about 400kb in file size, so the downloading of the images is usually not instantaneous.</p>
<p>There are lots of slideshow apps on the net. Why not use one of those? Well, the ones I saw were usually suitable for smaller images. I wanted this to take up the entire screen for an art experience, not a showing of photos. I also wanted to have categories of links that usually weren&#8217;t available with the ones on the net. And I wanted the interface simple and integrated into the viewing area, rather than having one area for the graphics and one for the controls, so the full screen could be used to show the graphics. But, also, I&#8217;ve been kind of interested in the architecture of a slideshow app. More on that a bit later.</p>
<p><span id="more-1022"></span></p>
<p>The app has two &#8216;pages&#8217; or screens. The first displays thumbails of some or all of the images. Some of the series have hundreds of images; in that case, the thumbnails show every second or third image. This page or screen also usually contains a link to information about the series. And links to the previous and next series via the &#8216;&lt;&lt;&#8217; and &#8216;&gt;&gt;&#8217; buttons.</p>
<p>When you either click a thumbnail image or the &#8216;[...]&#8216; button, you enter the second page or screen which displays the slideshow. You can adjust the amount of time images are displayed and the amount of time images fade by clicking the &#8216;Options&#8217; button. You can also choose whether images fade in/out or just fade in. When the images fade in/out, there&#8217;s a dimming and brightening. When they just fade in, that dimming/brightening is not present. Sometimes the dimming/brightening is nice, such as in the Silvia Saint series. It gives it a sort of breath in and out.</p>
<p>But, all that said, the main thing I&#8217;ve learned in making this app is how to make a better one that I haven&#8217;t made yet. And therein lies an interesting lesson for me.</p>
<p>The architecture of the current app involves two images. One image fades in while the other fades out. Or one fades in while the other, which is already faded in, stays static, and disappears once the other is faded in.</p>
<p>A more general architecture would be as follows. It would involve going OOP (object oriented programming) with the app. The idea would be to program an image object. When it&#8217;s time to display a particular image, an image object would be dynamically created. The data of this object would include the image itself, it&#8217;s name and so forth. The methods or behaviors would include the mouse event functions, the fade in/out functions, the destructor function, and so on. When the object is no longer required, it&#8217;s deleted.</p>
<p>The advantage of this dynamic creation/destruction of image objects is that rather than being limited to two images, you can have several images onscreen at once. So, for instance, when the user quickly presses the &#8216;&gt;&#8217; button repeatedly, the response could be more as one would like.</p>
<p>But, more importantly, it would free up formal possibilities. For instance, one could program keyboard functionality so that when a particular key is pressed, a particular image could fade in/out or do that and grow/shrink.</p>
<p>Getting away from the notion of a slideshow into a more general form.</p>
<p>And that is of artistic interest. Programming should suggest and open up formal possibilities. Going OOP, properly understood, does that. So next up for me when I approach another Javascript project will be getting a handle on OOP in Javascript. There&#8217;s an interesting article on the subject at <a href="http://msdn.microsoft.com/en-us/magazine/cc163419.aspx" target="_blank">http://msdn.microsoft.com/en-us/magazine/cc163419.aspx</a></p>
<p>Part of the idea of dbCinema is to explore the possibilities of cinema between the still, the slideshow, and the sort of dbCinema at <a href="http://vispo.com/dbcinema/londonhypotrochoid" target="_blank">http://vispo.com/dbcinema/londonhypotrochoid</a> which is further yet from slideshow but is, nonetheless, based on 100 pictures downloaded from the net via a Google image search of &#8220;London&#8221;. This latter piece does not use the new slideshow app but dbCinema itself.</p>
]]></content:encoded>
			<wfw:commentRss>http://netpoetic.com/2010/02/slideshows-apps-and-oop/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>reading programs (part 4)</title>
		<link>http://netpoetic.com/2009/11/reading-programs-part-4/</link>
		<comments>http://netpoetic.com/2009/11/reading-programs-part-4/#comments</comments>
		<pubDate>Mon, 02 Nov 2009 22:53:33 +0000</pubDate>
		<dc:creator>Joerg Piringer</dc:creator>
				<category><![CDATA[-NP-Software]]></category>
		<category><![CDATA[-NP-Theory/Critical]]></category>
		<category><![CDATA[Joerg Pringer]]></category>

		<guid isPermaLink="false">http://netpoetic.com/?p=815</guid>
		<description><![CDATA[it’s getting readable again before i turn back into the illegible at the following and last chapter. the first language for this fourth part of my small series is called ORK short for Objects R Kool. ORK is an object oriented language with a very verbose syntax. Unlike most of the esoteric programming languages you [...]]]></description>
			<content:encoded><![CDATA[<p>it’s getting readable again before i turn back into the illegible at the following and last chapter. the first language for this fourth part of my small series is called</p>
<p><strong>ORK </strong></p>
<p>short for <em>Objects R Kool</em>. <em>ORK</em> is an object oriented language with a very verbose syntax. Unlike most of the esoteric programming languages you have to write a lot of code even to get the most simple task done.</p>
<p>a simple hello world-program would be written like this:</p>
<pre>When this program starts:
There is a scribe called Writer.
Writer is to write "Hello, world!"</pre>
<p>or a script that outputs the input could be like:</p>
<pre>There is such a thing as a mouse.
A mouse can be_eaten.
A mouse has a status which is a word.
A mouse has a voice which is a scribe.
A mouse has an input which is an inputter.</pre>
<pre>When a mouse is to be_eaten:
There is a word called squeaky sound.
input is to readOne squeaky sound.
If input says it's done then status is "eaten".
voice is to write squeaky sound.</pre>
<pre>There is such a thing as a cat.
A cat can eat a mouse.
A cat has a Lingo which is a linguist</pre>
<pre>When a cat is to eat a mouse:
The mouse is to be_eaten.
Lingo's first operand is the mouse's status.
Lingo's second operand is "eaten".
Lingo is to compare.
If Lingo says it's not equal then I am to loop.</pre>
<pre>When this program starts:
There is a cat called Lucifer Sam.
There is a mouse called Gerald.
Gerald's status is "alive".
Lucifer Sam is to eat Gerald.</pre>
<p>more info:<br />
<a href="http://codu.org/eso/#ORK" target="_blank">http://codu.org/eso/#ORK</a></p>
<p>and one of the possibly most verbose languages is called</p>
<p><strong>English</strong></p>
<p>i rather quote the Esoteric Programming Languages-wiki than write about <em>English</em> myself:</p>
<p><em>English is a declarative programming language. Many people are familiar with it even if they don&#8217;t know any other programming language.<br />
[…]<br />
A compiler of English (usually to some other high-level language) is called a &#8216;programmer&#8217;. They are usually humans and they err. </em></p>
<p>a hello world example program:</p>
<pre>This program writes "Hello World" (without quotes) to the output.</pre>
<p>a fibonacci sequence program:</p>
<pre>Read an article about the Fibonacci sequence. Now write a program that computes it.</pre>
<p>more info:<br />
<a href="http://www.askoxford.com/" target="_blank">http://www.askoxford.com/</a></p>
<p>there’s a huge number of similar languages (around 6500 that are still in use).</p>
]]></content:encoded>
			<wfw:commentRss>http://netpoetic.com/2009/11/reading-programs-part-4/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>reading programs (part 3)</title>
		<link>http://netpoetic.com/2009/09/reading-programs-part-3/</link>
		<comments>http://netpoetic.com/2009/09/reading-programs-part-3/#comments</comments>
		<pubDate>Mon, 21 Sep 2009 16:43:43 +0000</pubDate>
		<dc:creator>Joerg Piringer</dc:creator>
				<category><![CDATA[-NP-Software]]></category>
		<category><![CDATA[-NP-Theory/Critical]]></category>
		<category><![CDATA[Joerg Pringer]]></category>

		<guid isPermaLink="false">http://netpoetic.com/?p=685</guid>
		<description><![CDATA[in the third part of my small series about programs that can be read i&#8217;d like to introduce two languages out of the mass of esoteric programming languages that focus on using commands that consist of single characters or ASCII-codes. this property is crucial for my own attempt in creating an esoteric programming language which [...]]]></description>
			<content:encoded><![CDATA[<p>in the third part of my small series about programs that can be read i&#8217;d like to introduce two languages out of the mass of esoteric programming languages that focus on using commands that consist of single characters or ASCII-codes. this property is crucial for my own attempt in creating an esoteric programming language which i will sketch in the last instalment.</p>
<p>the first of the two languages is called</p>
<p><strong>AlphaBeta</strong></p>
<p>It uses the letters of the alphabet as commands. Upper- and lowercase letters are different commands.</p>
<p>A quote from the description page: <em>AlphaBeta uses 5 registers as a way to store memory, 2 are changeable and hold an integer, 1 is a result register and cannot be changed, 1 is used for looping and the other is used for memory ( like <a title="Brainfuck" href="http://esoteric.voxelperfect.net/wiki/Brainfuck">brainfuck</a>&#8216;s &gt; and &lt; ). There is no way of comments. Also, AlphaBeta has 1 kb of ram.</em></p>
<p>a hello world programm in AlphaBeta:</p>
<pre>cccCISccccCIScccCIYx
SGSHaaCLgDLihhhDLDLgggDL
TTGaaCL
SGccbbbCLDLgggDLjggggDLSHDL
TTGaaaCL</pre>
<p>a program that copies its input to its output:</p>
<pre>JCLigggO</pre>
<p>more info:<br />
<a href="http://esoteric.voxelperfect.net/wiki/AlphaBeta" target="_blank">http://esoteric.voxelperfect.net/wiki/AlphaBeta</a></p>
<p>the second language is</p>
<p><strong>Capuirequiem</strong></p>
<p>Capuirequiem uses the ASCII characters with the number codes 33 to 126 as commands or literals of the language.</p>
<p>a hello world program:</p>
<pre>[Hello World!]O</pre>
<p>a program that prints out the fibonacci sequence:</p>
<pre>[This function output a number in decimal format]Z
[
[]D/V
D /01!\$ 48,_KW\C/
!SB DL Z\O
]"n{</pre>
<pre>[Print out the fibonacci sequence]Z
[1.]O 0"a{1"b{ [
"a}"b}D"a{_KD"b{
"n}X [.]O
1L
]X</pre>
<p>The language is known to be Turing complete.</p>
<p>more info:<br />
<a href="http://esoteric.voxelperfect.net/wiki/Capuirequiem" target="_blank">http://esoteric.voxelperfect.net/wiki/Capuirequiem</a></p>
]]></content:encoded>
			<wfw:commentRss>http://netpoetic.com/2009/09/reading-programs-part-3/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>reading programs (part 2)</title>
		<link>http://netpoetic.com/2009/09/reading-programs-part-2/</link>
		<comments>http://netpoetic.com/2009/09/reading-programs-part-2/#comments</comments>
		<pubDate>Mon, 07 Sep 2009 22:16:19 +0000</pubDate>
		<dc:creator>Joerg Piringer</dc:creator>
				<category><![CDATA[-NP-Software]]></category>
		<category><![CDATA[-NP-Theory/Critical]]></category>
		<category><![CDATA[Joerg Pringer]]></category>
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://netpoetic.com/?p=595</guid>
		<description><![CDATA[i continue my small series about esoteric programming languages with LOLCODE: LOLCODE is inspired by the infamous lolcat internet meme. Lolcats are images distributed via the net with cats and their written “thoughts” on it. The language they speak is called lolspeak (lol is the net-acronym for “loughing out loud”) an english dialect. An example [...]]]></description>
			<content:encoded><![CDATA[<p>i continue my small series about esoteric programming languages with<strong> LOLCODE:</strong></p>
<p>LOLCODE is inspired by the infamous <em>lolcat</em> internet meme. <em>Lolcats</em> are images distributed via the net with cats and their written “thoughts” on it. The language they speak is called <em>lolspeak</em> (<em>lol</em> is the net-acronym for “loughing out loud”) an english dialect. An example of <em>lolspeak</em> would be the question: “I Can Has Cheezburger?” (it’s also the name of the biggest <em>lolcat</em>-blog).</p>
<p>LOLCODE’s commands are modeled after <em>lolspeak</em> words and grammar. And so a typical “hello world”-program would look like this:</p>
<pre>HAI
CAN HAS STDIO?
VISIBLE "HAI WORLD!"
KTHXBYE</pre>
<p>or a program that counts to ten:</p>
<pre>HAI
CAN HAS STDIO?
I HAS A VAR
IM IN YR LOOP
   UP VAR!!1
   VISIBLE VAR
   IZ VAR BIGGER THAN 10? KTHXBYE
IM OUTTA YR LOOP
KTHXBYE</pre>
<p>unlike code poetry in the almost esoteric programming language <em>perl,</em> poems written in LOLCODE can also be understood or at least read by non-programmers.</p>
<div class="mceTemp">
<dl>
<dt><img class="size-full wp-image-597" src="http://netpoetic.com/wp-content/uploads/2009/09/lolcode.jpg" alt="lolcode" width="350" height="459" /></dt>
</dl>
</div>
<p>(picture by <a href="http://www.flickr.com/photos/33809408@N00/" target="_blank">kn0thing</a>)</p>
<p>if you&#8217;d like to try it out yourself an online javascript translator and interpreter can be found here:<br />
<a href="http://fullvolume.co.uk/static/lolcode/">http://fullvolume.co.uk/static/lolcode/</a></p>
<p>more info:<br />
<a href="http://lolcode.com/">http://lolcode.com/</a><br />
<a href="http://www.icanhascheezburger.com">http://www.icanhascheezburger.com</a></p>
]]></content:encoded>
			<wfw:commentRss>http://netpoetic.com/2009/09/reading-programs-part-2/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

