{"id":19325410,"url":"https://github.com/krypt0nn/markov-chains","last_synced_at":"2026-06-15T03:32:41.558Z","repository":{"id":235146265,"uuid":"790148138","full_name":"krypt0nn/markov-chains","owner":"krypt0nn","description":"Haha funny text generator with markov chains","archived":false,"fork":false,"pushed_at":"2024-04-22T11:18:46.000Z","size":14,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-04-22T12:26:24.479Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/krypt0nn.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2024-04-22T11:01:15.000Z","updated_at":"2024-04-22T12:26:30.880Z","dependencies_parsed_at":"2024-04-22T12:26:29.329Z","dependency_job_id":"eadf310a-164e-4060-a954-cfb890bb7388","html_url":"https://github.com/krypt0nn/markov-chains","commit_stats":null,"previous_names":["krypt0nn/markov-chains"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/krypt0nn%2Fmarkov-chains","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/krypt0nn%2Fmarkov-chains/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/krypt0nn%2Fmarkov-chains/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/krypt0nn%2Fmarkov-chains/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/krypt0nn","download_url":"https://codeload.github.com/krypt0nn/markov-chains/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240427326,"owners_count":19799471,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-10T02:09:59.174Z","updated_at":"2026-06-15T03:32:36.528Z","avatar_url":"https://github.com/krypt0nn.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Funny stoopid text generation app\n\nWe've randomly decided to play with [Markov chains](https://en.wikipedia.org/wiki/Markov_chain) on my discord server, and I decided to release my results in github.\n\n\u003e If you have any questions - refer to `markov-chains --help` or `markov-chains \u003ccommand\u003e --help`.\n\n## Simple example\n\n1. Build the model from the input text files\n\n\u003e cargo run -- model from-scratch --messages inputs/json/kleden.txt --output outputs/models/kleden1.model\n\nAccepted input files formats are json strings and plain text lines:\n\nJson strings lines:\n\n\u003e \"Selamat Pagi\"\\\n\u003e \"Minecraft ugh\"\n\nPlain text lines:\n\n\u003e Political economy belongs to the category of the social sciences.\\\n\u003e The basis of the life of society is material production.\n\n2. Load model\n\n\u003e cargo run -- model load --model outputs/models/kleden1.model\n\nThere's a bunch of params you can change to play with the model. Most important ones are `--context-window` which configures the \"intelligence\" of the model, and `--min-length` which can force model to keep generating new text.\n\n## Complex example\n\n1. Generate messages bundle. Those are filtered lists of pre-processed words\n\n\u003e cargo run -- messages parse --path inputs/json/kleden.txt --output outputs/messages/kleden.bundle\n\u003e \n\u003e cargo run -- messages parse --path inputs/text/political-economy.txt --output outputs/messages/political-economy.bundle\n\u003e \n\u003e cargo run -- messages parse --path inputs/text/state-and-revolution.txt --output outputs/messages/state-and-revolution.bundle\n\n2. Merge books to one messages set\n\n\u003e cargo run -- messages merge --path outputs/messages/political-economy.bundle --path outputs/messages/state-and-revolution.bundle --output outputs/messages/background.bundle\n\n3. Create tokens from the messages sets\n\n\u003e cargo run -- tokens parse --path outputs/messages/kleden.bundle --output outputs/tokens/kleden.bundle\n\u003e \n\u003e cargo run -- tokens parse --path outputs/messages/background.bundle --output outputs/tokens/background.bundle\n\n4. Merge tokens to the single bundle\n\n\u003e cargo run -- tokens merge --path outputs/tokens/background.bundle --path outputs/tokens/kleden.bundle --output outputs/tokens/tokens.bundle\n\n5. Tokenize prepared messages bundles\n\n\u003e cargo run -- messages tokenize --messages outputs/messages/background.bundle --tokens outputs/tokens/tokens.bundle --output outputs/tokenized/background.bundle\n\u003e \n\u003e cargo run -- messages tokenize --messages outputs/messages/kleden.bundle --tokens outputs/tokens/tokens.bundle --output outputs/tokenized/kleden.bundle\n\n6. Create new dataset from the background messages bundle\n\n\u003e cargo run -- dataset create --messages outputs/tokenized/background.bundle --tokens outputs/tokens/tokens.bundle --output outputs/datasets/kleden2.bundle\n\n7. Extend this dataset with the kleden's messages bundle with bigger weight (10)\n\n\u003e cargo run -- dataset add-messages --path outputs/datasets/kleden2.bundle --messages outputs/tokenized/kleden.bundle --weight 10 --output outputs/datasets/kleden2.bundle\n\n8. Build the model\n\n\u003e cargo run -- model build --dataset outputs/datasets/kleden2.bundle --output outputs/models/kleden2.model\n\n9. Load model\n\n\u003e cargo run -- model load --model outputs/models/kleden2.model\n\nAuthor: [Nikita Podvirnyi](https://github.com/krypt0nn)\\\nLicensed under [MIT](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkrypt0nn%2Fmarkov-chains","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkrypt0nn%2Fmarkov-chains","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkrypt0nn%2Fmarkov-chains/lists"}