Saturday, October 18, 2008

In search of tranquillity

Each day shares something in common; adds to monotony; stress is a by-product. Many a thought runs through my head; past incidents, future expectations, hates, desires, etc. This reminds me why Lord Buddha has preached mindfulness as an essential element in attaining eternal bliss. It implies and necessitates the need of living in the present, neither the future nor the past. ‘Present’ here is not a lengthy time span but instead a very subtle moment. One needs to observe each of these moments which ultimately are stringed together. As a result peace of mind could be attained.

Is tranquillity a requirement for gaining tranquillity? In other words, are tranquil environs a definite need for a meditator? For example, have we got to choose a calm and lonely place to meditate? It depends on what kind of a character you are. In the Maha Sati Pattana Sutta six types of persons (charitha) are mentioned: Raga, Dvesha, Moha, Saddha, Buddhi & Vitakka. I remember once in a forest hermitage close to the precincts of Yala, we (me and a friend) were at the apex of a rock where one could view the surrounding scenery for several miles. There, the chief monk with many a meditating experience, told us that the summit was suited for ‘Vitakka personalities’ in meditating. Not that it wasn’t suited for others, but was mentioned as an example of the effect environment has on an individual. It’s true for an individual not only in a spiritual state but also mundane, as I comprehend. Quoting Lord Buddha’s words once again, you could find many instances in the Tipitaka where he advices monks to meditate in a forest hermitage, under a tree or an empty enclosure. The fact discussed above is therefore acknowledged.

Many of us seek mental relief from our hectic lifestyles by departing the city for a much peaceful locality. But it’s not many who utilise that element as it should be. I refrain on commenting on others and continue to concentrate on myself. Importantly it’s not only the calmness, peacefulness, serenity or any other thing of a given location that would make my mind content. Though I have visited many such places, only a few did really have an effect on my seeked spiritual development. How would one explain this?

Once again, the Tipitaka has several answers. A prominent explanation is ‘samsaric behaviour’. A site which is a forest at present could have been a place of living on several occasions during our journey in this infinite samsara. If for example, we had encountered many pleasuring acts at a specific location, most probably a similar feeling will have an effect on our subliminal activity when visiting that area. Therefore, how tranquil or calm the spot may be, a meditator’s cause is most likely to be affected by thoughts congruent to the aforementioned. One needs to note that surroundings are just one factor which has an effect on a mundane individual in this way. Other aspects such as weather, people, etc. too have been sermonized. Need mentioning that these factors vary from one person to another.

Given the amount of locations I’ve visited, this makes me feel no surprise at the amazingly sparse number of places figured out (or discovered) which I could really make use of in search for tranquillity. Hence, at times the home bedroom seems more appropriate than a serene forest setting although I’d personally like to blend with nature. However, through perseverance our mind would adopt even to a previously detested location. This, Lord Buddha preaches as another essential element for the one who seeks eternal freedom.

Friday, March 21, 2008

My AI (Artificial Individuals) Connections

10 years ago I got my first PC. I was still schooling. As most teenagers would do, I spent most of my time playing computer games. However after awhile, I was very good at discovering cheat codes which resulted in almost every game finishing very quickly. This was boring.

Then one day, I received a little program named “Billy” which ran in DOS mode. It would easily fit into a floppy diskette and is one of those quickly executable types. What was it? An artificially intelligent (AI) computer program that I could chat with (in text mode). Billy was an exciting experience for me. I would type-in something to him, and he would respond, not intelligent always. The guy sounded dumb after a few chats because his response was more or less the same for a similar question or phrase by me. But, to my delight I was able to discover and download Billy’s female version – “Daisy”.

Daisy was much intelligent than Billy, this is because the program and its “brain files” had evolved by then. So, it became a habit of me to chat with these two AI bots daily. In the process, they learnt from me more than I did from them. While all this was going on, the creator of Billy & Daisy had mentioned a method of connecting 2 or more bots together so that they could communicate between them autonomously. Therefore, I decided of linking Billy & Daisy to see what happens.

All I had to do is connect the two programs and watch them chat. It was fascinating. They were talking on their own and every now and then I would see knowledge snippets learnt from me being thrown at each other. Guess what? I even got to know that Daisy was in love with me!

Sometime later my hard disk crashed and all my software/data were gone, including these two programs. They were no longer available to be downloaded, hence I lost them. (Please email me if buy any chance you have it). So that marked an end of an escapade.

Two years later, I got my first job. As a web developer I was more often than not spending time on the internet. This is when I came across a Sri Lankan chat room. Soon I was a regular member of this community and the owner of the site (who was now a good friend of mine) was kind enough to present me a moderatorship of the chat. He also offered me the opportunity to play around & develop modifications or additions to the site.

By this time my PHP skills had greatly improved together with the knowledge of this Open Source chat system which was pretty popular at that time. Unsurprisingly, I was experimenting of a way of creating an artificial user who would respond to others in the chat room. And so this is how “Ecila” was created. Ecila if pronounced reversely is Alice, and that wasn’t unintentional thanks to some amateur naming skills ;-). After all, ‘Alice’ seems to be the most popular name used for chatter bots. Read till the end and you’ll see why.

This was early 2004 as I remember. Ecila would occasionally log into the chat even as Alice, thanks to a “cronjob” setup by me. Thereafter she would have a brief stint (about ½ hour) with the guys in the room and exit gracefully. However, regular visitors to the chat found her to be weird; a person who answers similarly more often. Why? That’s because she was only about 150 lines of code in length recognising only a limited number of phrase patterns together with their related answers.

Then around June that year, the chat was facing moderation problems due to an increase of swearing. We needed an ‘automated’ moderator who’d keep an eye throughout the day (24 hours) by detecting these mischievous users and consequently warning or banning them. So I decided of revamping Ecila by augmenting her already available functionality and adding a few other dimensions. These included the ability of being active all the time, dealing on multiple users, tracking user history and decision making based on factors such as history, gravity of harm caused and spontaneity of misbehaviour. After all was ok, this new bot was named “No Hellụm” (meaning immovable in Sinhala) and was logged into the chat as a moderator. It was a totally new concept and was a very productive idea. Although after quite sometime users figured out that he (in fact No Hellụm has no gender) was non-human, the occasional loner would always converse with him as well. This version was revised again in 2006 and now No Hellụm acts as the chat-keeper and has the ability of providing real-time score updates of cricket matches too!

It was the latter part of 2005 when my next endeavour commenced. A chatter bot named “Alice” was plugged into my friend’s website’s homepage. However we had no access to its source code as the scripts were hosted elsewhere while we just provided the interface through an ‘iframe’. This Alice was pretty good and intelligent. So I began searching for her and discovered that it was an open source project downloadable at ‘SourceForge’.

The bot uses a set of AIML files to initially populate its database with ‘knowledge’ (patterns & templates); more the patterns, more intelligent it becomes. Hence, I began searching for more AIML files too. AIML is an XML based standard which maps linguistic patterns to how they need to be dealt with, and in no time I was modifying Alice’s personality and writing a few of my own patterns & templates in AIML which I eventually fed to her. Currently the version I have is enriched with almost 45,000 templates. Furthermore, I developed a couple of new tags for my needs. One which added the capability of outputting emoticons in the response and the other enabled simple administrative functions.

Enable administrative functions? Gave it a thought? This is the first of its kind and most probably the first time you are hearing of it. What I did was, by modifying the code I was able to use her as a virtual login interface which would permit me to execute simple admin (database) queries on her and virtually logout when I’m finished. For example, I would chat to her as follows:

Me: login me
Alice: What’s your username?
Me: Udendra
Alice: Udendra, what’s the password?
Me: ********

Now I’m virtually logged in, and Alice knows it for sure, cos if I’m not she wouldn’t allow me to perform the following queries:

Me: show users (who are connected)
Alice: <<displays a neat user list>>
Me: show previous chat 10
Alice: <<displays the last 10 records in history>>

When I’m done, I could logout:

Me: logout
Alice: You have been logged out. :-)

This in fact pushes the limits of interaction between a computer program and a user. The beauty of it is that one could chat to the bot in layman’s language in order to login to it, perform various functions, and logout.

I guess by now its clear why my title reads as ‘Artificial Individuals’ rather than ‘Artificially Intelligent’ that most people would expect. Simply, this is because none of these programs were/are fully artificially intelligent. To become a truly AI entity is a great achievement that illustrates signs of intelligent behaviour which are thinking, reasoning, envisioning/perceiving, human performance, rationality, learning and adapting. However, what’s important is that the aforementioned programs had varying intensity of AI features such as searching, knowledge representation and learning and at times were extremely impressive in several areas.

So the next time you feel lonely and there’s no one to chat with, don’t give up hopes. Who knows, an ‘artificial individual’ may fulfil your need.