Article: Context Following Primer
By Michael Rice, Aikernel Project Administrator
Here's a neat new feature of the Aikernel version 1.3.1. It is called context following and it was added to the ol' kernel for a number of reasons but the primary one being to showcase how different problems can be solved in different ways using the modular features of the software.
Recall the last post about the new AiRSS Cell that I added to the project. Recall that this cell is very primitive in the features that it exposes now, but this is how it comes together with the context following piece. Recall also that the RSS cell allows you to review channels offered by publishers such as java.sun.com, Slashdot, etc. Once you have browsed the channels, you can list the news items in the channel.
This is kind of how a natural dialog with a user might go:
user> what channels
Not impressed, huh? Ok, I know this isn't rocket science, but I want to show you that this is cool and can be pretty useful to you. There are a lot of moving parts here, but let's start backwards with the word "first". Recall that the AiRSS Cell binds and responds to the universal activator called universal.ordinal.first. Well, let's add in the Strawman cell.
The Strawman Cell is designed simply to complicate the calculations while we are constructing the Aikernel. It's job is to complicate dialogs and calculations Instead of spending a lot of time developing lots of cells that are similar in function simply to test the Aikernel, it is nice to have some clean room implementation of a cell that behaves in totally neutral ways so that the other cells and the logic can be built around it.
Check to make sure that the Strawman is resident in your session. If you are using the telnet session on naturalmachine.com (to connect use telnet naturalmachine.com 14284 from a command prompt), then type the command [cells]. You should see the Strawman cell some where in your list. Something like this:
2) Hello World Cell,
v1.0 (system name=hello)
3) Strawman Cell, v1.0
If you don't see the "**installed**" after the cell summary, then type the command [install strawman]. It should look like this on screen:
Now, we've got the strawman installed. At this time, double check to make sure that the AiRSS cell is installed. Go through the same procedure that you followed above (i.e., type [cells] then [install airss] if you don't see the "**installed**" flag).
Have I gotten a little far away from my main point? Let's revisit it now. The object here is to get the Aikernel to understand (in the long run) that after I browse or list channels that if I say "first", that the correlation between these different contexts should convince the Aikernel to serve up the item listing as the correct response. Ok, so I made it a little more complex sounding, so let's go through an actual example (now that we've got our cells installed):
user>what channels are
This is the same as before, you've just learned that there are two channels available. Now, be a normal, well adjusted ambiguous human and give a very computer unfriendly, ambiguous response for the next turn:
user>OK, can you list that one
Luckily, you triggered the Channel List context by using the key word "list" and, behind the scenes our reference implementation of the Aikernel made the ContextRelationship between the Browse and the List contexts defined by the AiRSS Cell. Nevertheless, the AiRSS Cell still doesn't know which channel you were looking for:
aik> I don't know which channel you are referring to
OK, now, you are going to be very clear with the system and say you want the first one. This is where the Strawman is going to try to get in the way. We've set up the Strawman to respond to all the universal activators. In this case, both AiRSS and Strawman are bound to the universal activator named "universal.ordinal.first" so they both get included as Choices in the Arbitrator of our reference implementation. However, in processing the choices and the adjustScoreForContextHistory() method of the Arbitrator we see that in the recent history there was a Browse context triggered and there is a relationship there! Therefore, it gets scored just a little bit higher and gets taken as the "best" choice.
user>the first one
Want to see again a little more explicitly? Let's change our dialog a little bit (if you want to do this for yourself, you'll need to log out of your session and log back in to clear the history and the relationships that have been constructed for your session):
user>what channels are
Hmmm. Now, we think we've been more clear, but there isn't enough statistical history for the system to know whether when you asked for the "first" you meant the List Context or the Strawman context. So it says:
: not totally sure what
you want to do, please select
The Aikernel has gotten in between the cells and the user and asked for more clarification. If you want to review this in explicit detail, this is under the "tie" parts of the ActivatorModule and the Arbitrator class in the reference implementation. Now, when we select option 2, the relationship gets built. When we go through the same dialog, the system will now skip the tie breaking prompt step!
OK, so maybe you are asking yourself, "what happens if I actually wanted to trigger the strawman instead"? Or what if the likelihood of the strawman (or some other cell) was equally likely to as an outcome. Well, these should get handled through normal everyday usage of the cell. The more you use it, the more "intelligent" it gets.
Room for improvement? Of course, lots of it!! Here are some of the issues that this raises:
a) I would like to find a way on the last turn not to just say "There
are 20 items...", to understand that we are in a multi turn discovery
and say "Oh, I see. OK, there are..." or something to that effect. Something
that acknowledges the personal nature of this.
|contact project admin|