Skip to content

Instantly share code, notes, and snippets.

@chmodsss
Created September 18, 2018 09:19
Show Gist options
  • Save chmodsss/c6d02145d6ebe4ba5f388b60b37d1707 to your computer and use it in GitHub Desktop.
Save chmodsss/c6d02145d6ebe4ba5f388b60b37d1707 to your computer and use it in GitHub Desktop.
Text generation 1
import string
puncts = string.punctuation.replace('.','')
punct = str.maketrans('','', puncts)
data = open('story.txt','r').read()
# data pre-processing only for alphabet strings
def clean(xx):
return ' '.join(x for x in xx.split() if not x.isnumeric())
cdata = clean(data.translate(punct))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment