GithubHelp home page GithubHelp logo

kenkyusei / intelligo Goto Github PK

View Code? Open in Web Editor NEW

This project forked from intelligo-mn/intelligo

0.0 0.0 0.0 177 KB

:robot: AI Chatbot Framework for Node.js

Home Page: https://www.techstar.cloud/

License: MIT License

JavaScript 100.00%

intelligo's Introduction


Intelligo AI chatbot framework

npm downloads undefined Followers License Tweet

Intelligo is a JavaScript Framework to build Facebook Messenger's Chat bots.

Installation

NPM

Example

'use strict';

const express = require('express'),
      Intelligo = require('intelligo');
      
const app = express();

const bot = new Intelligo({
  PAGE_ACCESS_TOKEN: 'PAGE_ACCESS_TOKEN',
  VALIDATION_TOKEN: 'VALIDATION_TOKEN',
  APP_SECRET: 'APP_SECRET',
  app: app
});

bot.initWebhook();

//Train the neural network with an array of training data.
bot.learn([
  { input: 'I feel great about the world!', output: 'happy' },
  { input: 'The world is a terrible place!', output: 'sad' },
]);

//Subscribe to messages sent by the user with the bot.on() method.
bot.on('message', (event) => {
   
  const senderID = event.sender.id,
        message = event.message;
      
  if (message.text) {
      const result = bot.answer(message.text);
      bot.sendTextMessage(senderID, result);
  } 
});
app.set('port', process.env.PORT || 5000);
app.listen(app.get('port'), function() {
  console.log('Server is running on port', app.get('port'));
});

Training

Use bot.learn() to train the neural network with an array of training data. The network has to be trained with all the data in bulk in one call to bot.learn(). More training patterns will probably take longer to train, but will usually result in a network better at classifying new patterns.

Example using strings with inputs and outputs:

bot.learn([
    { input: 'I feel great about the world!', output: 'happy' },
    { input: 'The world is a terrible place!', output: 'sad' },
  ]);
  
var result = bot.answer('I feel great about the world!');  // 'happy'

bot.on('message', (event));

Triggered when a message is sent to the bot.

bot.on('message', (event) => {
   
  if (message.text) {
      const result = bot.answer(message.text);
      bot.sendTextMessage(event.sender.id, event.message);
  } 
});

Contributors

You may contribute in several ways like creating new features, fixing bugs, improving documentation and examples or translating any document here to your language. Find more information in CONTRIBUTING.md. Contributors

This project exists thanks to all the people who contribute.

Backers

Thank you to all our backers! ๐Ÿ™ [Become a backer]

Sponsors

Support this project by becoming a sponsor. Your logo will show up here with a link to your website. [Become a sponsor]

License

Copyright (C) 2019 Opengineer.
Intelligo framework is open-sourced software licensed under the MIT license.
(See the LICENSE file for the whole license text.)

intelligo's People

Contributors

tortuvshin avatar y21 avatar nomadbot avatar doljko avatar monkeywithacupcake avatar opengineer avatar intelligobot avatar codacy-badger 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.