Created
September 18, 2018 09:19
-
-
Save chmodsss/c6d02145d6ebe4ba5f388b60b37d1707 to your computer and use it in GitHub Desktop.
Text generation 1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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