From 9c4fc1549e0563f4322bff5a1971f5ae3acce613 Mon Sep 17 00:00:00 2001 From: Aydan Ghazani Date: Mon, 21 Apr 2025 17:19:03 +0200 Subject: [PATCH] update seq2seq2_translation_tutorial.py data processing --- intermediate_source/seq2seq_translation_tutorial.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/intermediate_source/seq2seq_translation_tutorial.py b/intermediate_source/seq2seq_translation_tutorial.py index 5de4bb4ca3e..deeaba2520b 100755 --- a/intermediate_source/seq2seq_translation_tutorial.py +++ b/intermediate_source/seq2seq_translation_tutorial.py @@ -209,8 +209,8 @@ def readLangs(lang1, lang2, reverse=False): lines = open('data/%s-%s.txt' % (lang1, lang2), encoding='utf-8').\ read().strip().split('\n') - # Split every line into pairs and normalize - pairs = [[normalizeString(s) for s in l.split('\t')] for l in lines] + # Split every line into pairs, normalize and ignore third element (attribution) + pairs = [[normalizeString(s) for s in l.split('\t')[:2]] for l in lines] # Reverse pairs, make Lang instances if reverse: