Skip to content

Commit 9c4fc15

Browse files
committed
update seq2seq2_translation_tutorial.py data processing
1 parent 752e0c9 commit 9c4fc15

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

intermediate_source/seq2seq_translation_tutorial.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -209,8 +209,8 @@ def readLangs(lang1, lang2, reverse=False):
209209
lines = open('data/%s-%s.txt' % (lang1, lang2), encoding='utf-8').\
210210
read().strip().split('\n')
211211

212-
# Split every line into pairs and normalize
213-
pairs = [[normalizeString(s) for s in l.split('\t')] for l in lines]
212+
# Split every line into pairs, normalize and ignore third element (attribution)
213+
pairs = [[normalizeString(s) for s in l.split('\t')[:2]] for l in lines]
214214

215215
# Reverse pairs, make Lang instances
216216
if reverse:

0 commit comments

Comments
 (0)