场景:机器翻译,每行一个样本,包括中文句子和英文句子,中间由制表符(’\t’)分割
def load_data(file):
with open(file, 'r', encoding='utf-8') as f:
text = f.read()
print(type(text)) # <class 'str'>
# for line in text:
# line = line.strip().split('\t')