Showing posts with label Ed Feigenbaum. Show all posts
Showing posts with label Ed Feigenbaum. Show all posts

Tuesday, February 07, 2017

The return of (virtual) Shadow

The late Shadow

Chapter 5 of Peter Norvig's excellent "Paradigms of Artificial Intelligence Programming: Case Studies in Common Lisp" is entitled "ELIZA: Dialog with a Machine". I have spent the afternoon studying his pattern-matching code and transferring it into an executable Lisp file.*

An example of an Eliza pattern is this:
'((?* ?P) need (?* ?X))
which picks up text before and after the word 'need'.

If you tell Eliza:
'(Shadow and I need a vacation),
the program will match the input with the pattern above, thus ..
(pat-match '((?* ?P) need (?* ?X)) '(Shadow and I need a vacation))
to create a binding
'((?P SHADOW AND I) (?X A VACATION))       ;   (dotted pair) binding
which can then be passed to the output-generating pattern. And so on.

---

But we're not so much interested in Eliza and that Rogerian psychoanalyst. We want Shadow, our much-missed departed cat (RIP July 1st 2016).

The first step is to change the rules: less talk of vacations and how you're feeling about your parents, more about voles. And being sick on the carpet.

The Eliza architecture was criticised, correctly, for being totally vacuous. The emptiness of the 'conversation' led to bored withdrawal after a period depending upon the narcissism of the user.

We can do better.

To add intelligence to Shadow (such a bright cat!) we have to give him knowledge (in the knowledge lies the power) together with reasoning capability.

Peter Norvig helpfully gives us an equation (chapter 16, p. 548 or thereabouts):
Expert System = Prolog + uncertainty + caching + questions + explanations
The Prolog part powers the knowledge-base capturing Shadow's deep understanding of his own likes, light-hearted escapades and more lethal habits; the Q&A allows for his more sensitive, introspective side.

Peter Norvig has a detailed chapter (11 - Logic Programming) where he explains how to implement Prolog in Lisp (interpreted).

I think this is the way to go with chatbots: combine Eliza-style interaction with a little knowledge-based reasoning to add interest and depth, and to steer the conversation. Perhaps a semantic grammar in there somewhere to help extract meaning from the user's input, though personally, given the ungrammaticality of dialogue, I've always put semantics/pragmatics first.

Anyway, watch this space. It won't be quick .. but we will bring him back!

---

* We spent the morning strolling in the sun around Cheddar reservoir.

Friday, November 25, 2016

"My chat bot found my wallet" - Adrian Zumbrunnen

When you turn your website into a chatbot ...



"It was a Saturday afternoon. I met up with a friend to enjoy the occasional good weather by the lake. It was a day void of serious topics or stress. Life is good, I thought to myself.

I headed home after a few drinks to prepare for an upcoming trip. The smile on my face soon vanished when I realized that my pockets felt awfully empty. I braced myself. Three seconds later, I panicked. Where was my wallet?!

My credit card, my ID and personal stuff was in there. I felt like ****.

After calling my card issuer to block my credit card, I waited for the confirmation email to breath some sigh of relief. But to my surprise, there was a much more delightful message waiting for me right there… It was an email from my conversational website:

Title: Chat bot message
Content: I found your wallet by the lake.

Wow! I only lost my wallet 30 minutes earlier and I had already gotten an email. That’s technology working its magic right there!

I answered as fast as I could. The other person sent me his number and we met later that same day. As he was kindly handing me back my wallet, I asked:

“Thanks so much! By the way, I’m just wondering… How did you get in touch with me?”

He looked at me slightly confused and says…

“What do you mean… We had a chat, no?”

That’s when it hit me. This guy thought he was having a real conversation with me on my website."
It's an interesting story, but if you access Adrian's site you will find it hard to imagine you're talking to him (picture above). (Try it).

Adrian provides you with little 'suggestion' buttons to avoid uncontrolled natural language input. This is current best practice, but it makes the experience not dissimilar to filling in a form.

---

Last night I tried the new Thomson Holidays chatbot (powered by IBM's Watson). It fell apart on the second dialogue input. Admittedly it's in beta. (Try it).

Feigenbaum's old AI adage, 'in the knowledge lies the power', holds good for chatbots. The system needs to know an awful lot of dialogue flows to create the illusion of conversation. This makes building chatbots labour-intensive (for machine-learning, you need big pre-recorded conversation datasets).

I have neither, which has demotivated me from experiments with Pandorabots. That, and its simple-minded stimulus-response architecture.

Checked on Replika a couple of days ago which I have signed up to. The iPhone version will be out soon but the Android app is pushed back to 2017. The training method is Q&A via SMS: people are sending 40-50 texts per day to train their replikas. Like I said: labour intensive.

---

You and I know that conversation isn't simply statistically-correlated sequences of 'he says', 'she says'. It's about something. Until the meaning of conversations (data structures representing external environment and internal attitudes) is part of the architecture, chatbot conversations will continue to fall off the rails without any warning.

You can see why capturing knowledge of the real world (and of the human psychological world) is difficult for a paradigm which mostly throws ever more ingenious massively-parallel weight-learning at truly enormous datasets.*

---

* Huge parallel with self-driving cars. Humans drive .. which obscures the fact that driving is many distinct activities, not just one. A relatively closed system like motorway travel in good weather conditions sharply contrasts with the horribly open system of urban driving with complex traffic patterns and uncontrolled pedestrians in bad weather.

Sunday, August 09, 2015

Simulating your significant other

Talking Angela: a tiresome app
I've told Clare that I'm writing a simulation of her - and that this explains why I spend long hours toiling away upstairs in  my study generating Prolog code.

I'm not sure whether she believes me ...

'Virtual Clare' will not be a chatbot in the mould of Eliza, or modern equivalents such as Cleverbot (try it here). Chatbot conversation is purposeless, vacuous and tedious beyond belief as it mindlessly pattern-matches canned responses*. But, as Ed Feigenbaum at Stanford noted with regard to expert systems, “In the knowledge lies the power.”

There were some expert systems a while back which explored a kind of creativity and learning. Given a comprehensive list of facts and a bunch of rules, they would apply the rules to generate new facts and then use heuristics to weed out those that were obvious, pointless and redundant. The system kind of saw the implications of what it knew. You can see how this might beef up a conversational chatbot's repertoire.

It's impossible for me to replicate the knowledge of an adult person - the significant other simply has had too many experiences, has too many memories and too much knowledge of the intricate web of daily life. The domain of conversation has to be drastically reduced -- for example, to the worldview of a cat.

Yes, notwithstanding Wittgenstein's aversion to the idea, I think Gossip Cat is coming back!

---

* So I guess that makes simulating me pretty easy, then ...