{"id":666,"date":"2017-03-11T20:18:43","date_gmt":"2017-03-12T01:18:43","guid":{"rendered":"http:\/\/sites.williams.edu\/scientephic\/?p=666"},"modified":"2017-03-11T20:25:24","modified_gmt":"2017-03-12T01:25:24","slug":"teaching-a-computer-to-write","status":"publish","type":"post","link":"https:\/\/sites.williams.edu\/scientephic\/research\/teaching-a-computer-to-write\/","title":{"rendered":"How to Teach a Computer to Write Stories"},"content":{"rendered":"<div><em>This is part of a three part series detailing the computer science senior thesis projects.&nbsp;<\/em><\/div>\n<div>\n<hr>\n<\/div>\n<div>While computers writing stories from scratch may sound like something from science fiction, Melanie Subbiah disagrees. For her senior thesis in computer science, Melanie is teaching computers to write new stories on their own, a cutting edge field&nbsp;called <em>open narrative generation<\/em>. She&#8217;s always loved creative writing and has taken many Williams College literature and writing courses. &nbsp;While struggling to decide on a thesis topic she says, &nbsp;&#8220;it suddenly occurred to me, why not study creative writing from a computer science standpoint?&#8221;<\/div>\n<div>&nbsp;<\/div>\n<div>Working with Williams Professor Andrea Danyluk, an expert on machine learning, she has developed a process to guide computers through the creative steps. First, she gives the computer a collection of stories written by regular authors&nbsp;to analyze. Computers require inspiration in the same way humans do! She has the&nbsp;computer identify the paragraphs, sentences, words, and parts of speech. With all these notes the existing stories can be broken down into patterns, something computers are adept at handling.&nbsp;<\/div>\n<div>\n<figure id=\"attachment_668\" aria-describedby=\"caption-attachment-668\" style=\"width: 300px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/sites.williams.edu\/scientephic\/files\/2017\/03\/Screen-Shot-2017-02-28-at-8.37.41-AM.png\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-668 size-medium\" src=\"https:\/\/sites.williams.edu\/scientephic\/files\/2017\/03\/Screen-Shot-2017-02-28-at-8.37.41-AM-300x173.png\" width=\"300\" height=\"173\" srcset=\"https:\/\/sites.williams.edu\/scientephic\/files\/2017\/03\/Screen-Shot-2017-02-28-at-8.37.41-AM-300x173.png 300w, https:\/\/sites.williams.edu\/scientephic\/files\/2017\/03\/Screen-Shot-2017-02-28-at-8.37.41-AM-768x442.png 768w, https:\/\/sites.williams.edu\/scientephic\/files\/2017\/03\/Screen-Shot-2017-02-28-at-8.37.41-AM-1024x589.png 1024w, https:\/\/sites.williams.edu\/scientephic\/files\/2017\/03\/Screen-Shot-2017-02-28-at-8.37.41-AM.png 1314w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><figcaption id=\"caption-attachment-668\" class=\"wp-caption-text\">In the rectangles are two short and unique stories. While they may seem very different, they can be broken down into the same pattern below. Melanie uses a large collection of human stories to identify these kinds of patterns and then automatically generate a new story by using portions of the pattern of different stories.<\/figcaption><\/figure>\n<\/div>\n<div>&nbsp;<\/div>\n<div>Good stories have a moving plot filled with impactful events. So, Melanie&nbsp;has designed algorithms&nbsp;the computer can use to&nbsp;identify the events of the stories. Then, it&#8217;s time to generate a new plot. She uses an increasingly popular machine learning tool called a neural network. A neural network mimics the human brain by using many neurons. Each neuron might be responsible for a very specific pattern, or in the case of our brains a memory or function. When they receive the right stimulus, e.g. a phrase or event, they fire and produce a new result. Her neural network uses the collection of events it learned from&nbsp;other stories to create a new plot.&nbsp;<\/div>\n<div>&nbsp;<\/div>\n<div>As any writer can attest, storywriting does not stop when you come up with a plot. What parts of the plot do you tell the reader? From what perspective? With what details and emotion? Melanie builds on existing work to transform the computer&#8217;s plot into sentences that we can then enjoy.&nbsp;<\/div>\n<div>&nbsp;<\/div>\n<div>By the end of the year, she will have several stories authored by computers as well as evaluations on how logical &nbsp;and original they are. She&#8217;s very excited to continue this work, and it&#8217;s helping her decide if and where she wants to attend graduate school.<\/div>\n<div>\n<figure id=\"attachment_669\" aria-describedby=\"caption-attachment-669\" style=\"width: 117px\" class=\"wp-caption alignleft\"><a href=\"https:\/\/sites.williams.edu\/scientephic\/files\/2017\/03\/Screen-Shot-2017-02-28-at-8.38.03-AM.png\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-669 size-medium\" src=\"https:\/\/sites.williams.edu\/scientephic\/files\/2017\/03\/Screen-Shot-2017-02-28-at-8.38.03-AM-117x300.png\" width=\"117\" height=\"300\" srcset=\"https:\/\/sites.williams.edu\/scientephic\/files\/2017\/03\/Screen-Shot-2017-02-28-at-8.38.03-AM-117x300.png 117w, https:\/\/sites.williams.edu\/scientephic\/files\/2017\/03\/Screen-Shot-2017-02-28-at-8.38.03-AM.png 350w\" sizes=\"auto, (max-width: 117px) 100vw, 117px\" \/><\/a><figcaption id=\"caption-attachment-669\" class=\"wp-caption-text\">Melanie&#8217;s process, her pipeline, starts with human written stories and breaks them down into patterns. Then, she builds up a new story by taking bits and pieces from all the patterns the computer has learned.<\/figcaption><\/figure>\n<p>&nbsp;<\/p>\n<figure id=\"attachment_667\" aria-describedby=\"caption-attachment-667\" style=\"width: 225px\" class=\"wp-caption alignleft\"><a href=\"https:\/\/sites.williams.edu\/scientephic\/files\/2017\/03\/IMG_3340.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-667 size-medium\" src=\"https:\/\/sites.williams.edu\/scientephic\/files\/2017\/03\/IMG_3340-225x300.jpg\" width=\"225\" height=\"300\" srcset=\"https:\/\/sites.williams.edu\/scientephic\/files\/2017\/03\/IMG_3340-225x300.jpg 225w, https:\/\/sites.williams.edu\/scientephic\/files\/2017\/03\/IMG_3340-768x1024.jpg 768w, https:\/\/sites.williams.edu\/scientephic\/files\/2017\/03\/IMG_3340.jpg 960w\" sizes=\"auto, (max-width: 225px) 100vw, 225px\" \/><\/a><figcaption id=\"caption-attachment-667\" class=\"wp-caption-text\">Melanie Subbiah, Class of 2017<\/figcaption><\/figure>\n<\/div>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>The splash image for this post is from&nbsp;<a href=\"http:\/\/sunlightsucks.com\/wp-content\/uploads\/2015\/08\/ThinkstockPhotos-470024761.jpg\" target=\"_blank\">this site<\/a>&nbsp;and is not owned or originally produced by The ScientEphic.&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This is part of a three part series detailing the computer science senior thesis projects.&nbsp; While computers writing stories from scratch may sound like something from science fiction, Melanie Subbiah disagrees. For her senior thesis in computer science, Melanie is teaching computers to write new stories on their own, a cutting edge field&nbsp;called open narrative &hellip; <a href=\"https:\/\/sites.williams.edu\/scientephic\/research\/teaching-a-computer-to-write\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">How to Teach a Computer to Write Stories<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1004,"featured_media":673,"comment_status":"closed","ping_status":"closed","sticky":true,"template":"","format":"standard","meta":{"_acf_changed":false,"ngg_post_thumbnail":0,"footnotes":"","_links_to":"","_links_to_target":""},"categories":[65459,21878,6378],"tags":[],"class_list":["post-666","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-computer-science","category-news","category-research"],"acf":[],"_links":{"self":[{"href":"https:\/\/sites.williams.edu\/scientephic\/wp-json\/wp\/v2\/posts\/666","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/sites.williams.edu\/scientephic\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/sites.williams.edu\/scientephic\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/sites.williams.edu\/scientephic\/wp-json\/wp\/v2\/users\/1004"}],"replies":[{"embeddable":true,"href":"https:\/\/sites.williams.edu\/scientephic\/wp-json\/wp\/v2\/comments?post=666"}],"version-history":[{"count":5,"href":"https:\/\/sites.williams.edu\/scientephic\/wp-json\/wp\/v2\/posts\/666\/revisions"}],"predecessor-version":[{"id":676,"href":"https:\/\/sites.williams.edu\/scientephic\/wp-json\/wp\/v2\/posts\/666\/revisions\/676"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/sites.williams.edu\/scientephic\/wp-json\/wp\/v2\/media\/673"}],"wp:attachment":[{"href":"https:\/\/sites.williams.edu\/scientephic\/wp-json\/wp\/v2\/media?parent=666"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sites.williams.edu\/scientephic\/wp-json\/wp\/v2\/categories?post=666"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sites.williams.edu\/scientephic\/wp-json\/wp\/v2\/tags?post=666"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}