CHAT-L

From Blue Mars Developer Guidebook

Jump to: navigation, search

CHAT-L (Chat Language), is a powerful chat scripting langage with a very compact but easy to understand syntax.

The CHAT-L language definition contained herein is hereby made openly available for all academic, private, and commercial use. You may create and deploy runtime systems that support this language specification.

This manual covers Version 2 of the CHAT-L language. See Changes from Version 1 for a summary of revisions.

Any questions or comments should be addressed to gowilcox@gmail.com

Contents

Overview

CHAT-L covers topic scripts and control scripts.


CHAT-L topic script is a series of topics. Each topic has a name, a set of keywords relevant to recognizing the topic, and a series of rules. Some rules respond to input statements, some to input questions, some to both, and some are for voluntary output by the chatbot when it has control of the conversation.


Selection of which topics to try is controlled by the runtime system and is configurable using a control script. The system will try rules until it finds one that can be successfully applied to generate output. You can completely ignore learning control scripting for now, since if you don't provide one the system will give you a default one.


A really simple topic might look like the one below. It has no real generality and only reacts to perfectly matching sentences, but it gives you the flavor and rough syntax of the language, so you can see how easy it can be to write a topic. Everything is always written from the chatbot's perspective.


topic: self (live)

t: My name is Suzette.

t: KAILUA() I live in Kailua.

t: I like surfing

?: (where do I live) ^reuse(KAILUA)

s: (you live in California) ^reuse(KAILUA)


If the user asks where do you live, the chatbot will respond with I live in Kailua. Similarly if the user says I live in California the chatbot will respond in kind. If the user replies that's nice, the chatbot will continue with I like surfing. Or the system might randomly pick this topic and start out saying My name is Suzette and move on to I live in Kailua and I like surfing.

This same topic could be made much more likely to match a wide variety of user input using additional CHAT-L pattern abilities to swallow noise words and handle collections of synonyms or objects:


topic: self ( live)

t: My name is Suzette.

t: KAILUA() I live in Kailua.

t: I like surfing

s: (you * ~live * in * [:city :nation]) ^reuse(KAILUA)

?: (where * I * [~live ~shelter]) ^reuse(KAILUA)


* is a wildcard that matches any number of words in sequence (including 0). A ~word is a synonym set and a :word is an object set. Words in square brackets are alternatives.

This topic would use the statement responder (s:) to react correctly to the user saying he has some approximation of living (live rent own dwell abide stay exist inhabit reside domicile lodge board sleep) in any city or country in the world. The chatbot would reply I live in Kailua by reusing the output section of the topic sentence (t:) labeled KAILUA.

Because CHAT-L automatically maps variant forms of words to a canonical one, the word I in the question responder (?:) actually accepts I, me,myself, my, and mine. If the user asks some approximation of Tell me where you live or Where is your apartment the question responder would respond the same way (apartment is a member of ~shelter).

The statement responder could have been made even more general by altering it to:


s: (you * [~live ~shelter] * in * [:city :nation]) ^reuse(KAILUA)


Then the topic would react to the user saying My castle is in Scotland or I am sleeping with friends in Russia.

The output of a rule can be literally what to say, or it can intermix function calls (like ^reuse) which can do a wide range of things.

Top Level Script Elements

A CHAT-L script is organized into series of top-level declarations. The declarations include:

  • concept: Concepts declare collections of keywords for use with pattern matching and fact queries. See Chatbot_BasicPatternMatching Sets for details.
  • topic: declares an area of conversation and how to handle it. See the immediately following documentation on Topic Scripting.
  • fact: and table: and route: declare facts that can be used with the fact query functions and in patterns. See Fact Declarations for details.

Topic Scripting Details

Details on aspects of CHAT-L topic scripting are available at:


Chatbot Keyword Matching

This links to the details about how keywords of patterns and keywords of topics are matched to user input.


CHAT-L Patterns

This links to the details for writing the pattern side of a rule.


CHAT-L Output

This links to the details for writing the output side of a rule.


CHAT-L Topics

This links to the details of organizing rules into topics.


CHAT-L Fact System

This links to the details of using the fact system with rules.


Chatbot Memory

This links to details about how the chatbot tracks personal information.

Control Scripting Details

Chatbot Control Script links to details about how the control script manages the topic script.

Problems with this wiki page? Contact us either by: Support Email or Support Ticket System

Blue Mars Guidebook Privacy Policy
Blue Mars Guidebook Community Guidelines

Personal tools