Skip to content

Latest commit

 

History

History
17 lines (11 loc) · 1.19 KB

README.md

File metadata and controls

17 lines (11 loc) · 1.19 KB

Markov Text Generator

Python based text generator that uses the markovify python library.

Example data can be found in /data/input.jsonl. In this case, the data has been obtained from Twitter by using either Tweepy or twarc - All we care about is how the text corpus (body) is formatted. You're more than welcome to have a look at my Python Twitter Scraper using Tweepy for a basic implementation

How-to

  1. Load an input file (.jsonl) file with (ideally) more than 1000 sentences. More sentences help build stronger texts.
  2. Run create_text_body and specify the text_key to look for in your input file.
  3. Run create_markov_chain with your resulting text_body and pass in the state_size.
  4. generate_text will create a specific amount of sentences by a specified minimum and maximum length of characters. An output file is required, which is where we'll save our newly created sentences.

Quick links