Monday, September 13, 2010

Learning to talk - artificial unintelligence

After a frustrating hour or two mucking around with my laptop today, I realised that I'd made a rudimentary error when I was coding things up, and created a stored procedure that would always do nothing. Sprinkling a few extra characters here and there and now it runs lickety-spit, or at least it now reliably spits out unreliable verbiage in response to an input. Now that it (sort of) works, I'm going to call it Robo Cod, and when I say "nice and caring person" to it, I expect Robo Cod to retort with "But just remember that I am not sure that I am not the only person who calls it that. It's a potato"

That's right, I've succeeded in building artificial unintelligence. I feel so proud of myself.

The code behind it is quite simple.  There's a few tweaks I need to make; basically, it's not very good at figuring out the most relevant parts of any phrase that's fed into it.  This didn't matter when I was just trying to generate scads of prose: if I tell it to start with "it" then it will happily produce
if it had been a bit more than usual and I estimated that I would have been a bit of a laugh and cheered everyone up a bit and I flipped through it excitedly. And on the way to the gig and by the time I was in a bit of an odd atmosphere in the dressing room and do the whole thing was a disappointment. I don't know if I am going to have to go to the toilet and I needed to go to a shop in Barking to sign copies of it.
whereas if I send it off to talk to somebody on Facebook and they say something reasonable like "I'm in Kuala Lumpur"  then I get a lot of guff like
"28 Acts in 28 minutes which I did not. How come I am so looking forward to the next "quadrant" and will also eat healthily and exercise every day. I am actually quite pleased that I had been in the same way as the Dice Man did with dice. It might be a bit of a laugh and cheered everyone up a bit and I flipped through it excitedly. And on the way to the gig and by the time I was in a bit of an odd atmosphere in the dressing room
which, although verbose, doesn't bear any relation to talk of the capital of Malaysia.

I suppose at the moment it's a fair facsimile of a pub bore - it will natter on to you for ages without appearing to take any notice of what you're saying. But I need to be able to deconstruct sentences a little better, to take it to the next step: chaining two or three of these things together to talk to one another. If I can get Jane Austen, Charles Dickens and a few twenty-first century writers to have an argument convincingly, I'll know that I've achieved something.

So, what have we done so far?
  • Written a script to automatically harvest blog posts
  • Scripted the breakdown of those blog posts into a corpus of text
  • Automated the production of phrases (of user configureable length) based on the corpus and a given input phrase
And left to do:
  • Add a degree of randomness to the process to stop it repeating itself.
  • Handle multiple corpuses for different authors
  • Process input phrases better in order to react more naturally in conversation
I'll report back in another week, or when the next bright idea arrives.

0 comments:

Post a Comment