Progress Meter

Arica Travis: Book 1

4074 / 40000 words. 10% done!

Showing posts with label science. Show all posts
Showing posts with label science. Show all posts

Monday, December 29, 2014

How to Use a Computer Program to Write a Novel

I have a few stories coming out in the coming weeks and months, but in the meantime I’ve been keeping busy with my human enhancement theory for using computer algorithms to write books.  I asked in my last post, “Why not?”  It’s a good question, so I’m taking my own counsel.  This will unfortunately be kept largely abstract, since I’ll be using a pen name and don’t care to reveal it here, but I’d like to provide some concrete numbers to go along with my hypothetical work-in-progress.

So I was able to follow my general plan for generating text from public domain works based on selecting sentences that contain certain keywords and then “rewriting” those sentences by automatically replacing nouns, verbs, and adjectives with synonyms.  However, rather than generating the text on a paragraph by paragraph basis depending on the specific idea I wanted to capture in each paragraph, I found it just as effective and less time consuming to let the text in a paragraph determine the keyword for the next paragraph, going on in a long chain of connected thoughts.  So I start the program with a keyword, but then the program selects a keyword from the paragraph generated by the original keyword to generate the next paragraph, from which another keyword is selected, and so on.  So the technical part is done, and performs pretty well as far as my expectations were concerned.  In its current state, the program generates about 15,000 words an hour.

Of course, a lot of this is incoherent, fraught with typos, and makes reference to characters and settings that have nothing to do with the story I’d like to tell.  So the hardest part has been the rewrite, as was expected.  I’m about a fourth of the way through the text right now (toward a goal of 50,000 words), and I’m going at a pace of about 2,000 words per hour.  At this rate it should take me about 25 hours to finish, which is longer than I’d expected, but still half the time it would take me writing normally (at 1,000 words per hour).  And that’s without counting all the editing I’m getting done as I go.


So far I’m enjoying the process of figuring out who the characters are, what their conflicts are, and then seeing what happens to them and what surprises pop up along the way.  It’s stretching me creatively as I go, straining to make connections between the otherwise unrelated snippets of text, incidentally a uniquely human feat as I pointed out in my last post and also came across in a recent article.  So again, computers can go a long way toward helping us as humans, but as for exercising the creativity to write the book itself – that’s more of a stretch.  The real question is whether using a computer in this human enhancing way results in books that anyone wants to read.  All I can say for now is that I think it’s great, so we’ll see if anyone else feels the same way.  I’m planning to publish it on Amazon by the end of December.

Thursday, November 20, 2014

Should Writers Be Worried About Being Replaced by Robots?

I've noticed a recent trend in the media/blogs on the topic of artificial intelligence (AI).  There have been positive posts and negative posts, but basically the debate is on whether or not improving AI algorithms is going to result in the self-destruction of humanity....  On that, here's a good article.  Don't get me wrong, I think there could definitely be unintended consequences, and accidents will certainly happen.  But as for the computer itself deciding it needs to exterminate the human race in order to serve its own best interests...I think it's unlikely.  But that's what people seem to be worried about.

What's funny to me though, is that even the people who are generally supportive of advancing this kind of technology end up running down the same path.  I read a post from Hugh Howey on the ramifications of AI in the writing world, and he posed the question, "How could computers ever learn to be creative?"  I get that he was just making a point, but to me that's the entirely wrong question to be asking.  What's interesting about it is that it appears that much of the research at least as far as creative writing is concerned is basically asking that same question: how can we get algorithms to BE creative.  It made me think of the "Fundamental Theorem of Biomedical Informatics."

An external file that holds a picture, illustration, etc.Object name is 169.S1067502708002417.gr1.jpg

It seems doctors used to have the same conundrum (some still do...).  No matter how advanced computers get, and no matter how much things we used to do start to get automated, when it comes down to it, having computers replace people entirely is almost always a bad idea (in my opinion).  Because they can't think for themselves, they can't be creative, and they can't foresee every possible scenario, it's always better to have humans deal with the human decisions.  Doctors should do the doctoring.  Computers are great at making a process easier, by doing the mundane everyday things that actually inhibit a human's ability to make decisions--and I say, the more of that stuff they can take care of the better.  But it works best when it's enhancing the human's ability to do his job, not replacing him.

Which brings me back to writing.  Howey mentioned in his post that there are already tools out there to automatically generate names, plot points, and so forth.  Writers are already using these, and no one considers their works to have been written by a computer.  I don't think the question should be about whether or not computers can be creative (or psychopathic...), but whether they can help people do their jobs better.  The technology is already there, and as has already been amply noted, algorithms are already being used to generate text for news reports and sporting events and in other areas.  What amazes me is that it's not already being used to help writers write faster and better.

Here's a scenario (using current technology, not future): say you already have written a novel or two.  You've even written a detailed outline of your third novel, but haven't started writing yet.  You've got some modest coding proficiency and some basic knowledge about natural language generation (from the Internet...), and you decide you've probably got a detailed enough outline to be able to determine the general theme (in a keyword or two) of every major paragraph in your story (for an 80,000 word story at 25 words per paragraph on average, say 3200 paragraphs).  You take each keyword, run it through every sentence in your previous two novels and pick one at random that contains that keyword (or a synonym), then run the sentence through a loop that replaces the nouns, adjectives, etc. in it with synonyms, then generate two or three more sentences based on those synonyms (or hypernyms, or hyponyms) following the same process.  Do that for all 3200 paragraphs and suddenly you have an 80,000 word rough draft.

This is obviously going to give you quite a bit of garbage, but that's what the rewrite is for.  You can go through and pull out the stuff that doesn't make sense, add in foreshadowing events, etc.  The point is you can make that part of the algorithm as complicated as you want.  Better output will require more sophisticated techniques, and methods will naturally improve over time, but once it's up and running, you've got a novel written.  Aside from having to spend some more time on the outline and rewrite than you probably normally would have, you've completely skipped the part where you actually write that first draft.  And once it's set up you can use it over and over and over....

Some would probably argue, rightfully so, that this takes much of the fun out of the writing experience (as well as much of the quality...).  I totally agree with that.  After all, the reader is going to have to stretch their brain to make connections between many of the individual sentences.  But your outline guarantees that there is an overarching plot line, and the human brain is designed for filling in the gaps to get from A to Z (and it doesn't hurt that readers seem to have lower and lower expectations of writing quality).  And what's fun about it for the author, is that the computer didn't write that plot, didn't create those characters.  You did.  You can still come up with fascinating characters, put them in amazing places, and tell a riveting story about them.  With the surplus of story ideas most writers have, I would think this would be a dream machine for many.  They can still plod through personally writing the stories they're passionate about, but why not take that wacky side idea and throw it in the generator, just for fun?  Why not publish it when it's done (with a pen name if they're worried about that).  With how many writers rely on getting as many novels published as quickly as possible in order to pay the bills, I think this will come sooner rather than later.  Again, I'm surprised it's not already here.

Monday, March 18, 2013

What Is Science?


"Doubt is not an agreeable condition, but certainty is an absurd one."
--Voltaire in letter to Frederick II of Prussia (6 April, 1767)

Somewhere along the course of its journey from Enlightenment to the present, science evolved from an aqueous unformed puddle of goo into the multicellular steel-boned behemoth we see today.  It converted from a gas into a solid.  The invisible incomprehensible God of the Westminster Confession reverted back into the vengeful Judeo-Christian God of the Old Testament, creating a resolute Master from what had once been an ambivalent guide.

At least this is what appears to have happened in the public domain.

It has become routine for groups of people with different opinions to beat each other over the head with science.  Instead of a quest for knowledge, it has become a sledge hammer, an indefatigable weapon-of-mass-destruction that acts irrefutably in the possessor’s behalf against all others.  Whenever I see it employed in the media or being wielded in website Comments sections, I usually wonder of the combatants: do you even know what science is?

Science goes through cycles called “paradigm shifts” (see Thomas Kuhn’s seminal The Structure of Scientific Revolutions), where the previous model or perspective on truth is expanded or entirely replaced.  Some examples include Copernicus’ astronomic model orbiting the Earth around the Sun instead of vice-versa, Newton’s classical mechanics over Aristotle’s, and the emergence of Einstein’s Theory of Relativity.  While it is definitely the norm for scientists to go with the current paradigm and learn all that can possibly be learned within it, the fact that every previous paradigm has at some point been overturned and replaced should make everyone a little more amenable to opposing views.

Science is not a concrete comprehensive encyclopedia of all knowledge.  It is the pursuit of knowledge, the act of seeking to obtain it.  So to believe in science is merely to believe that there are those who seek to learn more about the world around them.  Which I think is true of just about everyone.

Rivalries definitely exist in the scientific community, especially when small groups of scientists start following outside-the-current-paradigm lines of study.  But it’s nothing compared to what we see in the public domain.

And it’s not limited to a particular political persuasion (see for example “Republicans Against Science” in the New York Times and “Is Environmentalism Anti-Science?” in Discover Magazine).

Now don’t get me wrong--there are some serious issues going on here, and things would probably be a lot easier on everyone if everyone would just go with the current scientific consensus and trust the scientists to identify when our current paradigm needs a face-lift.  But at the same time, every time there’s been a paradigm shift in the past, it’s been because of people thinking against the grain.  And every single time, the new paradigm has been better than the last.

So consider your position carefully the next time someone asks you the banal question: “Don’t you believe in science?”  It’s true, you could just be another liberal kook or another entrenched conservative--only time will tell.  But at least you know what science is.  And on the off chance that you aren’t just a kook--if you've done your research and stick to your guns and against all odds somehow manage to turn out right in the end--you’ll be in really good company.