An open API service indexing awesome lists of open source software.

https://github.com/bespoyasov/text-generator

A naive text generator built in JavaScript using Markov chains.
https://github.com/bespoyasov/text-generator

code-generation javascript markov-chain text-generation web-worker

Last synced: 3 months ago
JSON representation

A naive text generator built in JavaScript using Markov chains.

Awesome Lists containing this project

README

          

# Text Generator ๐Ÿ”—

Generates a random yet syntactically plausible-ish and meaningful-ish text using Markov chains and a bit of luck. Sometimes outputs โ€œwise thoughtsโ€โ„ข

## Try Yourself! ๐Ÿ‘จโ€๐Ÿ’ป

Open the [app](https://bespoyasov.ru/showcase/text-generator/browser/) in the browser and upload a .txt file with a text that will be used as the source for word predictions. The more words this text contains the better, more than 100k is perfect.

## How it works ๐Ÿ› 

The generator uses Markov chains to randomly choose a word based on previously generated words. More info about Markov chains, how text generation works, and how to create one of these generators:

- ๐Ÿ‡ท๐Ÿ‡บ [In Russian](https://bespoyasov.ru/blog/text-generation-with-markov-chains/)
- ๐Ÿ‡ฌ๐Ÿ‡ง [In English](https://dev.to/bespoyasov/text-generation-with-markov-chains-in-javascript-i38)