# -*- coding: utf-8 -*- """ Created on Mon Feb 18 19:13:53 2019 @author: Lenovo """ import pandas as pd import numpy as np #import itertools from keras.layers import * from keras.models import * from keras.utils import plot_model NUM_SAMPLES = 1000 BATCH_SIZE = 64 EPOCH = 200 txt = pd.read_table('cmn.txt',header=None).iloc[:NUM_SAMPLES,:,] txt.columns=['inputs','targets'] txt['targets'] = txt['targets'].apply(lambda x: '\t'+x+'\n') input_texts = txt.inputs.values.tolist() target_texts = txt.targets.values.tolist() targets_characters = sorted(list(set(txt.targets.unique().sum()))) inputs
中英文翻译Seq2Seq
最新推荐文章于 2024-11-01 19:38:18 发布
