Skip to content

Instantly share code, notes, and snippets.

@prateekjoshi565
Created February 6, 2019 09:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save prateekjoshi565/3637b1d5f6abf80d1c5a17ee315359bb to your computer and use it in GitHub Desktop.
Save prateekjoshi565/3637b1d5f6abf80d1c5a17ee315359bb to your computer and use it in GitHub Desktop.
text preprocessing
# Remove punctuation
deu_eng[:,0] = [s.translate(str.maketrans('', '', string.punctuation)) for s in deu_eng[:,0]]
deu_eng[:,1] = [s.translate(str.maketrans('', '', string.punctuation)) for s in deu_eng[:,1]]
# convert text to lowercase
for i in range(len(deu_eng)):
deu_eng[i,0] = deu_eng[i,0].lower()
deu_eng[i,1] = deu_eng[i,1].lower()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment