Git Product home page Git Product logo

masqueraide's Introduction

											         .,ad88888ba,.
											     .,ad8888888888888a,
											    d8P"""98888P"""98888b,
											    9b    d8888,    `9888B
											  ,d88aaa8888888b,,,d888P'
											 d8888888888888888888888b
											d888888P""98888888888888P
											88888P'    9888888888888
											`98P'       9888888888P'
											             `"9888P"'
											                `"'



Masqueraide Build Status Dependency Status

Masqueraide is an AI/Bot library that is designed to run on social networks. Masqueraide works by having two concepts called 'Rooms' and 'Engines'. Social networks are 'Rooms', and the underlying NLP (Natrual Language Processing) algorithms are the 'Engines'.

In the near future, Masqueraide will have plugin support, more NLP engines and more social networks.

This library was part of a group project to make as if the AI/Bot is able to pass the Turing Test proposed by Alan Turing in 1950.

By default, Masqueraide utilises & builds on top of the excellent twitter_ebooks framework by @mispy.

Requirements

  • ruby
  • bundler
  • aspell (This might change in the future.)

Installation

If you're on Linux, first get masqueraide's depedencies:

[sudo] apt-get update -qq
[sudo] apt-get install -qq aspell libaspell-dev aspell-en aspell-el aspell-nl
# Assuming that ruby is installed
[sudo] gem install bundler

Then, if you have bundler installed, run:

git clone https://github.com/hako/masqueraide

And then execute:

$ bundle

Or

Add this line to your application's Gemfile:

gem 'masqueraide'

And then execute:

$ bundle

Or install it yourself as:

$ gem install masqueraide

Usage

The following example below is for a standard twitter bot.

There are two ways to dance:

A block.

require 'masqueraide'

# Create a new bot with a name.
bot = Masqueraide::AI.new('Bot')

# Before your bot can generate responses, it needs a dataset to learn from.
bot.learn_from_dataset path_to_dataset

# You can assign your bot a room, by default the 'Twitter Room' is selected.
bot.assign_room :twitter

# An example Bot configuration.
# This configures the bot's actions for the chosen room.
# In this case, this is the configuration for the 'Twitter Room'
bot.room.configure do |config|
  config.consumer_key = ''
  config.consumer_secret = ''
  config.access_token = ''
  config.access_token_secret = ''
end

# Dance. (Starts the bot)
bot.dance

A class.

require 'masqueraide'

# An example Bot class.
# This configures your bot's actions in the 'Twitter Room'
class BotClass < Masqueraide::Room::Twitter
  def configure
    self.consumer_key = ''
    self.consumer_secret = ''
    self.access_token = ''
    self.access_token_secret = ''
  end

  def on_startup
    scheduler.every '1m' do
      tweet(ai('twitter_handle').say(130))
    end
  end
end

# Create a new bot for the chosen room, in this case the 'Twitter Room'
# Each room may require additional parameters. The bot is tied a twitter handle.
bot = Masqueraide::AI.new('Bot', Bot.new('twitter_handle'))

# Before your bot can generate responses, it needs a dataset to learn from.
bot.learn_from_dataset path_to_dataset

# Dance. (Starts the bot)
bot.dance

Supported Social Networks

Masqueraide supports the current social networks below:

  • Twitter (By using twitter_ebooks)
  • Snapchat

Some social networks that might be supported in the future depending on the size of the userbase and popularity.

  • Facebook Messenger
  • Instagram
  • Telegram
  • Kik
  • Skype
  • GroupMe
  • Yik Yak
  • Your own????

You can create your own 'room' by creating a class under Masqueraide::Room and assigning your AI to that room.

Examples

Example bots are in the examples folder.

NLP

NLP related helper functions are available under Masqueraide::NLP

Development

After checking out the repo using git, cd into the masqueraide directory and run bundler.

To install this gem onto your local machine, run bundle exec rake install. To release a new version, update the version number in version.rb, and then run bundle exec rake release to create a git tag for the version, push git commits and tags, and push the .gem file to rubygems.org.

Contributing

  1. Fork it ( https://github.com/hako/masqueraide/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

masqueraide's People

Contributors

hako avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  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.