brain

package module
v0.0.0-...-1e57096 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 23, 2021 License: MIT Imports: 3 Imported by: 1

README

chatbrains

Test CodeQL

Brains for use in chatbots

Usage

Each "brain" type implements the following 3 methods

Init

Initialise the brain with config

Train

Train using the provided input

Generate

Generate a response to the input

Brain types

Markov

A basic markov chain. Will attempt to figure out a relevant subject from the input, and generate from there using the chain

Double Markov

Similar to Markov, but uses a backwards-propagating Markov chain in addition to a forward-propagating one to generate text either side of the subject.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExtractSubject

func ExtractSubject(message []string, length int) []string

func ProcessString

func ProcessString(rawString string) []string

Types

type Brain

type Brain interface {
	//TODO Add a more flexible init method
	Init(o int, l int)
	Train(d string) error
	Generate(p string) (string, error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL