chatfreely

package module
v0.0.0-...-5bb56a2 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2023 License: GPL-3.0 Imports: 8 Imported by: 0

README

ChatFreely

ChatFreely is a super-intelligent, sentient and sweet AI. Just kidding. It's a program that generates brand new blog posts from the corpus of text on your own WriteFreely blog.

It uses a Markov chain to generate often nonsensical but sometimes amusing new strings of words. It's functionally like ChatGPT, but more silly and without all the non-consensual training on vast amounts of intellectual property.

Limitations

Like most modern "AI" tools:

  • ChatFreely will confidently poop out language without any concern for truth or reality. It has no capacity for any kind of logical inference that would allow it to understand truth as humans do.
  • It will produce instructions and content based on the data it was trained on, for better or worse.
  • It has no knowledge of the world and events, in 2023 or in any other year. It does not have knowledge. It is a mathematical model coded into a computer program.

Getting started

With Go installed, open a terminal and run:

go get github.com/writefreely/chatfreely
Training

Next train the "AI" on your WriteFreely blog with the following command, replacing [instance-url] and [blog-alias] with your own.

The -o flag sets the order of your Markov model -- setting it to 2 makes it more coherent; setting it to 1 makes it more unhinged but more original.

chatfreely train -i [instance-url] -c [blog-alias] -o 2

For example:

chatfreely train -i write.as -c blog -o 2
Using with Write.as

Write.as implements rate-limiting on its post-retrieval API that requires an application key. Follow the instructions there to retrieve yours, and then set an environment variable, WRITEAS_APP_KEY=your-app-key-here..., before training your model.

Generating

Finally, generate a brand new post, again specifying the order (-o) that you used to train the model:

chatfreely gen -i [instance-url] -c [blog-alias] -o 2

Commands

NAME:
   ChatFreely - Generative "AI" that learns from WriteFreely blogs.

USAGE:
   chatfreely [global options] command [command options] [arguments...]

COMMANDS:
   train          Train the markov chain.
   generate, gen  Generate a blog post from training data.
   help, h        Shows a list of commands or help for one command

GLOBAL OPTIONS:
   --help, -h  show help
train

Train the markov chain.

USAGE:
   chatfreely train [command options] [arguments...]

OPTIONS:
   --alias value, -c value     Alias of the WriteFreely collection to train on
   --instance value, -i value  WriteFreely instance to train on
   --order value, -o value     Markov chain order (recommend 1 or 2)
   --help, -h                  show help
generate

Generate a blog post from training data.

USAGE:
   chatfreely generate [command options] [arguments...]

OPTIONS:
   --alias value, -c value     Alias of the WriteFreely collection to train on
   --instance value, -i value  WriteFreely instance to train on
   --order value, -o value     Markov chain order (same as training)
   --help, -h                  show help

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildModel

func BuildModel(alias, instance string, order int) (*gomarkov.Chain, error)

BuildModel creates a model with the given order, fetching posts from the given collection via the WriteFreely API.

func BuildModelWithPosts

func BuildModelWithPosts(posts []writeas.Post, order int) (*gomarkov.Chain, error)

BuildModelWithPosts creates a model with the given order for the given posts.

func GenerateBlogPost

func GenerateBlogPost(chain *gomarkov.Chain) (string, error)

GenerateBlogPost generates and returns a post from the given training data.

func PrintBlogPost

func PrintBlogPost(chain *gomarkov.Chain) error

PrintBlogPost prints out a post from the given training data.

Types

This section is empty.

Directories

Path Synopsis
cmd
chatfreely command

Jump to

Keyboard shortcuts

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