Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/asmeurer/markov

Generate text from hangouts chat with markov chains
https://github.com/asmeurer/markov

Last synced: 6 days ago
JSON representation

Generate text from hangouts chat with markov chains

Awesome Lists containing this project

README

        

## Generate Markov Text from your Hangouts Chat

This uses https://github.com/TehMillhouse/PyMarkovChain to generate random
sentences from your Google Hangouts chat using Markov Chains.

### How to use

You need to go to https://www.google.com/settings/takeout/custom and download
your hangouts as json. Then go in and find the chat you are interested in. For
me, it was the most recent one, so (in Python)

```py
>>> import json
>>> from os.path import expanduser
>>> a = json.load(open(expanduser('~/Downloads/[email protected]/Hangouts/Hangouts.json')))
>>> b = a['conversation_state']
>>> c = b[-1] # You'll want to look at the elements of b to get the chat you are interested in
>>> json.dump(c['event'], open("hangouts.json")) # To this directory
```

Then run

```bash
$ ./markov.py
```

to generate a sentence. You can also supply a seed like,

```bash
$ ./markov.py you are
```