Giter VIP home page Giter VIP logo

chatbot-js's Introduction

CHATBOT using Javascript:

Live Application Demo:

https://sandysanthosh.github.io/Chatbot-JS/

image

CHATBOT using Java:

https://github.com/sandysanthosh/Chatbot

https://howtodoinjava.com/ai/java-aiml-chatbot-example/

AIML:

     ARITIFICAL INTELLIGENCE MACHINE LANGUAGE
     xml based markup language human interface
      aliebot what is chat-bot

A.L.I.C.E

        simple to program
        easy to understand
        highly maintable

Create a Folder LIB

      add AB.jar

create a folder Src/main/ -> resources -> add Bots Folder

Alicebot:

  ab.util
  ab.*;

artifical linguistic internet company entity

open source project:

first step:

Ab.jar

maven pom.xml:

            <dependencies>
                <dependency>
                  <groupId>com.google</groupId>
                  <artifactId>Ab</artifactId>
                  <version>0.0.4.3</version>
                  <scope>system</scope>
                  <systemPath>
                  ${basedir}/lib/Ab.jar
                  </systemPath>
                </dependency>
              </dependencies>

AIML FILE:

        <aiml version ="2.0">
        <category>
        <pattern>what is you name</pattern>
        <template>ar</template>
        </category>
        </aiml>

Chat.java:

              package chatbott;
              import java.io.File;
              import org.alicebot.ab.*;
              import org.alicebot.ab.utils.*;
              public class chat {


                private static final boolean TRACE_MODE=false;

                public static void main(String args[])
                {
                  try {
                    String resourcepath=getpath();
                    MagicBooleans.trace_mode=TRACE_MODE;
                    Bot b=new Bot("super",resourcepath);
                    Chat chatsession=new Chat(b);
                    String textline="";


                    while(true)
                    {
                      System.out.println("YOU : ");
                      textline=IOUtils.readInputTextLine();

                      if(textline==null || textline.length()<1)
                      {
                        textline=MagicStrings.null_input;

                      }
                      else if(textline.equals("q"))
                      {
                        System.exit(0);
                      }
                      else if(textline.equals("wq"))
                      {
                        b.writeQuit();
                        System.exit(0);
                      }
                      else
                      {
                        String request=textline;
                        String response=chatsession.multisentenceRespond(request);
                        System.out.println("BOT :"+response);
                      }

                    }
                  }
                  catch (Exception e){

                  }
                }
                private static String getpath()
                {
                  File currd=new File(".");
                  String path=currd.getAbsolutePath();
                  String resourcepath=path + File.separator +"src" + File.separator +"main" +File.separator +"resources";
                  return resourcepath;
                }
              }

Run a Program:

   run -> chat.java ->check in console

chatbot-js's People

Contributors

sandysanthosh avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.