Giter VIP home page Giter VIP logo

markovnamegenerator's Introduction

Markov Namegen logo

Build Status Badge License Badge

Markov Namegen is a Markov chain-based procedural name generator written in Haxe. Run it in your browser.

Demonstrates the markov-namegen haxelib. Read the docs here.

Features

  • Hundreds of customizable/combinable training data presets.
  • Configurable corpus, order and prior model parameter settings.
  • Filter results by length, start, end, content and regex match.
  • Sort by Damerau-Levenshtein distance to list results by similarity.
  • Save and share custom data, settings and results with one click.

Usage

Run the demo to generate your own words. Press the "Generate" button to begin, or select "Settings" to configure advanced options.

For example, enter the settings:

Training Dataset: English Towns
Order: 5
Backoff: 1 (on)
Length: 8-12
Starts with: b
Include: ham
Similarity To: birmingham

Click the "Generate" button and the results will be displayed on the page. Here are my first 10 results when using the settings above:

Barkingham Basingham Birkenham Bebingham Bollingham Bridlingham Billenham Berwickham Botteringham Bradnincham

Screenshots

Here is the demo in action. Using a single data set:

Screenshot

Appending two presets:

Screenshot

Joining the individual words from two presets:

Screenshot

How It Works

The markov-namegen haxelib uses Markov chains to procedurally generate original words.

Using a set of words as training data, the library calculates the conditional probability of a letter coming up after a sequence of letters chosen so far. It looks back up to "n" characters, where "n" is the order of the model.

The generator can use several orders of models, each with memory n. Starting with the highest order models (models with bigger memories), it tries to get a new character, falling back to lower order models if necessary - an approach known as Katz's back-off model.

A Dirichlet prior is used to add a constant probability that any letter may be picked as the next letter. This acts as an additive smoothing factor and adds a bit more "randomness" to the generated output.

Countless words are generated, and are then filtered and sorted according to several tweakable criteria like length, start and end characters, similarity to a target word, and so on.

Library Setup

Get the Markov Namegen library from GitHub or through haxelib.

Include it in your .hxml

-lib markov-namegen

Or add it to your Project.xml:

<haxelib name="markov-namegen" />

Demo Setup

To run the demo locally, clone the repository and run the following in your console within the root folder of the repository:

haxe MarkovNames.hxml

Then navigate to the bin directory and open index.html in a web browser to use the name generator.

Markov Namegen Ports

Some users have ported and extended the Markov Namegen library to different programming languages. See:

Notes

  • Many of the concepts used for the generator were suggested in this article by Jeffrey Lund.
  • If you have any questions or suggestions then get in touch or open an issue.
  • Read the documentation.

License

  • The website and demo code are licensed under CC BY-NC.
  • The haxelib itself is provided under the MIT license.
  • The noUiSlider settings sliders are WTFPL.
  • Most of the training data is compiled from sites like Wikipedia and census data sources over many years. CC-BY-SA 3.0 as a derivative from Wikipedia content will cover most of the content if you wish to use these for other purposes, but I provide no guarantee.

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.