ChatBot CLI Parent POM

ChatBot CLI Utils.

License

License

Categories

Categories

CLI User Interface
GroupId

GroupId

com.dopsun.chatbot
ArtifactId

ArtifactId

chatbot-cli-parent
Last Version

Last Version

0.3.0
Release Date

Release Date

Type

Type

pom
Description

Description

ChatBot CLI Parent POM
ChatBot CLI Utils.
Project URL

Project URL

https://github.com/dopsun/chatbot-cli
Source Code Management

Source Code Management

http://github.com/dopsun/chatbot-cli/tree/master

Download chatbot-cli-parent

How to add to project

<!-- https://jarcasting.com/artifacts/com.dopsun.chatbot/chatbot-cli-parent/ -->
<dependency>
    <groupId>com.dopsun.chatbot</groupId>
    <artifactId>chatbot-cli-parent</artifactId>
    <version>0.3.0</version>
    <type>pom</type>
</dependency>
// https://jarcasting.com/artifacts/com.dopsun.chatbot/chatbot-cli-parent/
implementation 'com.dopsun.chatbot:chatbot-cli-parent:0.3.0'
// https://jarcasting.com/artifacts/com.dopsun.chatbot/chatbot-cli-parent/
implementation ("com.dopsun.chatbot:chatbot-cli-parent:0.3.0")
'com.dopsun.chatbot:chatbot-cli-parent:pom:0.3.0'
<dependency org="com.dopsun.chatbot" name="chatbot-cli-parent" rev="0.3.0">
  <artifact name="chatbot-cli-parent" type="pom" />
</dependency>
@Grapes(
@Grab(group='com.dopsun.chatbot', module='chatbot-cli-parent', version='0.3.0')
)
libraryDependencies += "com.dopsun.chatbot" % "chatbot-cli-parent" % "0.3.0"
[com.dopsun.chatbot/chatbot-cli-parent "0.3.0"]

Dependencies

compile (1)

Group / Artifact Type Version
com.google.code.findbugs : jsr305 Optional jar 3.0.0

Project Modules

  • chatbot-cli

chatbot-cli

Build Status

Why

This is designed specifically for enterprise chat bot command line interface (CLI). By targeting enterprise chat bot, I mean:

  • each chat bot has finite list of capabilities,
  • users of chatbots have been communicated with its capabilities,
  • developers behind chatbot has domain knowledge while building chatbot

These characteristics adding up, means it's very different from public facing general purpose chat bot. And we need a special designed CLI to help enterprise chatbot build.

What

In the heart of chatbot-cli, it contains a Parser parses users input to command with parameters. And from there, enterprise bot developers can implement different functions.

Here are parser features implemented/ planned:

  • Command is defined by template with parameter placeholders.
    • One command can have multiple templates defined.
    • In a single template, it may have optional/ alternative formates of certain part of the command.
  • Multiple commands can be matched for a certain input
    • All these matched commands are rated with rank, and highest rank chose by default, but dewveloper of chatbot can choose alternatives if needed.
  • Bot developer can extend the resolve logic to customize the matching logic.

To be added

  • Command ranking is resolved by predefined rules together with Reinforcement Machine Learning
    • Selected command and user feedback can be recorded and as factors for resolving command in future.
    • User feedback cna be positive and negative, or no feedback.

How

A simple ChatBot command line parser, trained with templates.

  • It's designed for Command Line Interface (CLI) for ChatBot, with predefined list of command syntax.
    • This is NOT a NLP (Natural Language Processing) parser.
  • It's smart and predictable.
  • To Be Added Reinforcement learning

Build

public static void prepareParser() throws URISyntaxException {
    URL csUrl = ClassLoader.getSystemResource("input/command-data.properties");
    Path csPath = Paths.get(csUrl.toURI());

    CommandSet commandSet = new FileCommandSet(csPath);

    URL tsUrl = ClassLoader.getSystemResource("input/training-data.yml");
    Path tsPath = Paths.get(tsUrl.toURI());
    TrainingSet trainingSet = new FileTrainingSet(tsPath);

    ParserBuilder parserBuilder = Parser.newBuilder();
    parserBuilder.addCommandSet(commandSet);
    parserBuilder.addTrainingSet(trainingSet);

    parserBuilder.setTracer(System.out::println);
    parser = parserBuilder.build();
 }

In the above example, a Parser is created based on command data set Example.

Parse

Optional<ParseResult> optResult = parser.tryParse(command);

If optResult, is present, parse succeed. And returned ParseResult includes command.

Continuous improving

To Be Added Successfully parsing result, along with feedback, will be stored as training set, and improve parser working better next time.

Comments and suggestions

Raising issues if you have any feedback or reporting bugs.

Versions

Version
0.3.0
0.2.0
0.0.1