Created
January 21, 2022 06:01
-
-
Save eileen-code4fun/df99a7cef8e10e8a7c79b6dc2314d928 to your computer and use it in GitHub Desktop.
Translation Load
This file contains hidden or 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 tensorflow as tf | |
def split(text): | |
parts = tf.strings.split(text, sep='\t') | |
return parts[0], parts[1] | |
dataset = tf.data.TextLineDataset(['spa.txt']).map(split) | |
eng_dataset = dataset.map(lambda eng, spa : eng) | |
spa_dataset = dataset.map(lambda eng, spa : spa) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment