Brain

0.1.0

Brain is a tool to model, create and manage the knowledge base for aiml chaterbots.

Uses: Contact:

israel.araujo.freitas@gmail.com

//TODO
Modeling the Knowledge Base

On Brain, modeling is the graphical representation of knowledge, its relationships with other knowledges ( parents and children ) and the topics in which it is divided, all through a mental map. The modeling is part of the process of creating the knowledge base itself, and it is synchronized with the robot's real base.

Modeling the knowledge base of a chatbot is not exactly a trivial task, since there is a set of variables that directly affect the effectiveness of a good human-robot interaction, such as the richness of the vocabulary of both, or the clarity and objectivity of messages of either the specialization or generalization expected by an user on a particular subject, etc. Also certain subjects may be too complex or too large to be handled by a robot.

Considering that, Brain was designed to facilitate this task by adopting the strategy "divide and conquer". By dividing, the knowledge can be modeled with very fine granularity, being reduced to several small knowledges ( which we call "atomic knowledge" ) where each one is very specific, since it focuses only on a particular aspect of a greater knowledge. Some of the advantages of this approach is to have a broader view on knowledge and be much easier to define all the topics covered by it. The result of this approach is a much more solid base and complete knowledge.

But the most important for the base to be well modeled is that the botmaster master each knowledge he wants to model. Must already have very clear in his mind what he wants to represent through of Brain's mental map. Below is an outline of the modeling process:

  1. Define a target audience ;
  2. Define the subjects of interest to this target audience;
  3. Define the scope of subjects ( knowledge to be modeled );
  4. For each item of scope ( all knowledge ):
    1. Understand the knowledge that will be added;
    2. Define the relationships ( parents and children );
    3. Define the topics.

Understanding the behavior of the knowledge base

The knowledge base has a very dynamic viewing behavior. This dynamism is specifically designed to increase user productivity when modeling the base or creating lessons, and covers the following behaviors:

1. Selective Display

Knowledges are automatically displayed or hidden as relevant it is to clicked knowledge. In this way only the most relevant are displayed, hence that the screen does not get tiring by display a lot of information and hence the user can focus only on what really matters.

2. Visual Contextualization

When the user clicks a knowledge, Brain automatically selects all its knowledge parents, leaving all the way from the Root until itself with a different color from the others. This is to facilitate the user's contextualization on the knowledge that was selected.

3. Automatic Coloring

The color of a knowledge changes automatically with the amount of its internal knowledges, starting light and going darker depending of increase on the amount of its internal knowledges.

The Knowledge

On Brain, knowledge is an object that encapsulates the descriptions about something. It can be part of a greater knowledge and can also be composed of other smaller knowledges. Internally it is divided into topics.

To facilitate the processing of either complex subjects or larger subjects, Brain uses the "Divide and Conquer" strategy. Thus, how much more fragmented and specific a knowledge is, i.e., how much more topics and children knowledges it has, better is the domain of robot on it.

Adding a Knowledge

Note: On Brain, there are no isolated knowledge, all knowledge is necessarily connected to another, being Root the most basic, from which all derive.

  1. Right click on an existing knowledge;
  2. Click on "Add a Knowledge" option;
  3. Enter the name of new knowledge;
  4. Click "Save".

Renaming a Knowledge

  1. Right click on the knowledge you want to update;
  2. Click on "Rename this Knowledge" option;
  3. Type the new name;
  4. Click "Save".

Deleting a Knowledge

Attention: When a knowledge is deleted, it are also deleted in cascade all its children knowledges, its topics and its teachings.
  1. Right click on the knowledge that you want to delete;
  2. Click the on "Delete this Knowledge" option;
  3. Click "Yes".

Topics

Note: Topic is a group of teachings, an internal division of a knowledge, and it is specific only to the knowledge which it belongs to. Thus, for creating, editing or deleting a topic you must access this screen through the following steps:

  1. Right click on the knowledge you want divide;
  2. Click on "Topics & Teachings" option;
  3. Wait loading the Topics panel.

Creating a Topic

  1. Click "Create";
  2. Type the name of the new topic;
  3. Click "Save".
Renaming a Topic
  1. Click the topic you want to rename;
  2. Click "Update";
  3. Type the new name;
  4. Click "Save".

Deleting a Topic

Attention: When a topic is deleted, it are also deleted all its teachings.

  1. Click the topic you want to delete;
  2. Click "Delete";
  3. Click "Yes".

At first, the robot should be seen like a child: initially it has no knowledge, but starts to acquire it from the teachings that are passed to them.

Teaching is the smallest unit of knowledge passed to robot. It is the statement itself of what the robot should do according to the text typed by the chat's user. The teachings are that really prepare the robot to handle the situations created by users.

Teaching is specific to just one topic, so it only makes sense for that topic to which it belongs to. Thus, to create, edit or delete a teaching, the user must access this screen through the following steps:

  1. Right click on the knowledge you want to add the teachings;
  2. Click on "Topics & Teachings" option;
  3. Wait loading the Topics panel;
  4. Click the topic that will contains the teachings;
  5. Wait loading the Teachings panel.

Creating a Teaching

  1. Click on "Create";
  2. Enter the content of the requested fields:
    • When the user says:

      Enter in this field the sentences that users of chat probably will write about this particular topic. May be entered several sentences at once, only one per line. How much more sentences registered, greater is the ability of "understanding" of the robot.

      May be used the star wildcard (*) for "capture" a portion of the user's sentence that match in the registered sentence (each line in this field, also known as pattern). Once captured this portion, it can be retrieved by get star syntax: ${*index}, where index is an integer value greater than 0. For example, the sentence "My name is Israel and I live in Brazil" against the pattern "My name is * and I live in *" will store "Israel" in the first star and "Brazil" in the second star. Do ${*1} to retrieve the name, or just ${*} (the index is optional to first star). Do ${*2} (the index is required since second star) to retrieve the country.

      For example, for topic "favorite movies", an user may type one of the following sentences:

      In this example, the robot will be able to understand and give the appropriate response to any of these sentences.

    • Responding to:

      Enter in this field the robot sentence that motivated this last new user interaction. For example, the following robot message could have motivated the user to enter one of the sentences given in the example above ("When the user says"):

      This field holds the micro context of robot dialogue. It allows the robot to "remember" what it wrote just before the last user message. Leave this field empty when the previous robot sentence is not relevant.

    • Memorize:

      Enter in this field the key informations that the robot should keep in memory during the chat session. Such key informations are composed of three parts, all required and in this order:

      1. a name that represents the information that will be memorized (also known as 'variable')
      2. the equal sign (=)
      3. the information itself that must be memorized.

      It is allowed only one memorize instruction per line. To retrieve the content of a variable, use the get syntax: ${variableName}.

      The get syntax is available both in Memorize field and in Say field.

    • Say:

      Enter in this field what the robot should say when the user types any of the sentences entered in the field "When the user says". May be entered several responses at once, only one per line. This approach enables the robot to give different answers to the same user sentence, because this response is the result of a random selection among several possible answers registered. Hence, how much more responses registered, greater is the "intelligence" of the robot.

      May be used the get syntax (both ${variableName} and ${*index}).

      For example, even for the topic "favorite movies", the following sentences may be entered as an robot answer:

  3. Click "Save".

Here is a complete example:

When the user says:
  My favorite movie is *
  (or) My favorite is *

Responding to:
   What is your favorite movie?

Memorize:
  favMovie = ${*1}
  botFavMovies=${favMovie} and Matrix 

Say:
   ${favMovie}? Excellent movie!
   (or) ${favMovie}?? I love it!
   (or) Excellent movie!

Editing a Teaching

  1. Click the teaching you want to update;
  2. Click "Update";
  3. Enter the content of the requested fields;
  4. Click "Save".

Deleting a Teaching

  1. Click the Teaching you want to delete;
  2. Click "Delete";
  3. Click "Yes".

To make the changes in the knowledge base be reflected over the real robot's knowledge base, just click on the "Apply" button, which sits on top of the center panel. When the generation of the base is finished, the system will report the status of this execution in the status bar, and also will report the place where the AIML files were generated in.

Knowledge Base

This is where all the robot's knowledge is stored in and it is represented graphically through a mental map.

Knowledge

On Brain, the knowledge is an object that encapsulates the descriptions about something. It can be part of a greater knowledge and can also be composed of other smaller knowledges. Internally it is divided into topics.

To facilitate the processing of either complex subjects or larger subjects, Brain uses the "Divide and Conquer" strategy. Thus, how much more fragmented and specific a knowledge is, i.e., how much more topics and children knowledges it has, better is the domain of robot on it.

Topic

Topic is a group of teachings, an internal division of a knowledge, and it is specific only to the knowledge which it belongs to.

Teaching

Teaching is the smallest unit of knowledge passed to robot. It is the statement itself of what the robot should do according to the text typed by the chat's user. The teachings are that really prepare the robot to handle the situations created by users.

Teaching is specific to just one topic, so it only makes sense for that topic to which it belongs to.

Normalization ( Not implemented yet. )

It is the process of standardization of the text typed by the user, adapting this text to certain rules of writing and grammar used by the robot. Normalization basically operates in the following points:

TypeTermNormalized
Synonymsvisualizesee
Abbreviations/
Slang
uyou
Gendershehe
Orthographic Correctionsmovimovie
Grammatical CorrectionsOk byeOk. Bye!