Giter VIP home page Giter VIP logo

markov's Introduction

README

Overview

The program presents a REPL, from which you can generate text in a number of different ways, a list of commands can be produced by typing help, and help for specific topics can be found by typing help topic.

Getting Started

  1. Download the KingJamesProgramming corpus from this repo

    tar xvf KingJamesProgramming.tar.xz
    
  2. Set up the virtualenv

    virtualenv venv
    source venv/bin/activate
    pip install -r requirements.txt
    
  3. Fire up the program

    python3 -m markov
    
  4. Generate text

    train 3 --noparagraphs /path/to/KingJamesProgramming/*
    tokens 350
    

Warning: Repetition

To avoid infinite loops, the paragraphs and sentences generators may end abruptly. Because they generate blocks of text at a time, and a block would only end when a specific token (such as a paragraph break) occurs, the generators are programmed to end the chunk immediately if they find themselves generating a token from the same state repeatedly (with the threshold set at the number of occurences of that state in the training corpus). This can cause issues with small training sets or, if the training set has many rare words, with a high chance of choosing a random token.

markov's People

Contributors

barrucadu avatar jkopczyn avatar danswann avatar

Watchers

James Cloos 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.