Coder Social home page Coder Social logo

markov-chain-generator's Introduction

Markov-Chain-Generator

Description


A C++ static library for generating Markov Chain text output

The Markov Chain is created from a source input text, and can produce varying levels of "randomness" in the output. The lower the prefix size, the more random the output (can produce seemingly garbage incomprehensible text). The larger the prefix size, the more structured of an output generated (too large and you will get a straight quotation of the input text)

What is a Markov Chain?


A Markov Chain is a stochastic process in which the conditional probability distribution of future states of the process depends only upon the present state, not on the sequence of events that preceded it. Wikipedia

A Markov Chain tells you the probability of transitioning from one state to another based only on the current state of the Markov Chain.

An effective use of this is text generation of varying degrees of randomness, based off some input text.

Explained Visually has a great explanation on how they work

Example output


Some sample output from running the generator on the full text of Alice in Wonderland

Alice was beginning to get in at once." And in she went. Once more she found she could see, when she went on growing and growing and growing sometimes taller and sometimes she scolded herself so severely as to size," Alice hastily replied, "only one doesn't like changing so often, you know. So you see, Miss, this here ought to tell me your history, you know," said Alice, "because I'm not looking for eggs, as it spoke. "As wet as ever," said Alice (she was so large a house that she remained the same thing, you know." "You might just as I used--and I don't take this child away with Alice. Alice heard the King said to herself, as she was dozing off, when suddenly, thump! thump! down she came upon a heap of sticks and dry leaves, and the blades of grass, but she heard a voice of thunder

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.