Markovian chatbot build from a combination of movie dialogues and text messages.
Clone or download
Latest commit 51b53c1 Jan 9, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
data Updating README Dec 11, 2018
lib Changed tabs to spaces. Jan 9, 2019
.gitignore Peri is a gem now. Dec 9, 2018
Gemfile Peri is a gem now. Dec 9, 2018
Gemfile.lock Adding loading bar. Dec 31, 2018
LICENSE Initial commit. Nov 11, 2018
README.md Updating README Dec 11, 2018
peri.gemspec Debugging loading. Dec 31, 2018

README.md

Peri

Chatbot created in Ruby using markov chains.

Installation

  1. Run git clone https://github.com/Akrivus/Peri.git
  2. Run gem build peri.gemspec
  3. Run gem install peri
  4. You can now reference Peri.

Examples

Basic example of how Peri works below:

require 'peri'

peri = Peri.new()
corpora = peri.load_corpora('path/to/corpora.txt')  # Creates an array of lines.
chain = peri.load_chain(corpora)    # Creates a markov chain from the loaded corpora.
weights = peri.load_weights(chain)  # Generates a set of weights from the markov chain.

# The corpora allows the chain to parse data easier.
# The chain allows data to be rendered through a semi-predictable (stochstic) sequence.
# The weights make these semi-predictable (stochastic) sequences predictable.
# Now for the fun part.

response = peri.respond(chain, weights, "Hello!") #=> "Hello!"

Corpora supports ERB and some basic keyword captures, which can be seen by looking through the "data" folder on this repository.

Contribution

Pull requests are welcomed!