Created
February 6, 2019 09:36
-
-
Save prateekjoshi565/3637b1d5f6abf80d1c5a17ee315359bb to your computer and use it in GitHub Desktop.
text preprocessing
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
# 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