Thursday, 4 May 2023

A simple natural language dialogue system using Prolog

Introduction

Here is a natural language dialogue system that answers simple queries given by human. Basically, it is a template system, with simplification rules and translation rules, written in SWI-Prolog to convert human queries into commands.

Each query is processed in the following way:

  1. Split the query into a list of words.
  2. Convert all letters of the words into lower case letters.
  3. Apply simplification rules to reduce the words into a short sentence.
  4. Apply translation rules to convert the short sentence into a command.
  5. Execute the command. For this system, a message is returned to the human.

Sample Dialogue

In the dialogue below,

  1. |: query asked by human
  2. [ query splitted into words with lower case letters ]
  3. [ simplified sentence ]
  4. [ command to be executed ]
  5. The sentence between a pair of --- are answered by the system.

Source Code

No comments:

Post a Comment