Open niranjan8129 opened 6 years ago
import tensorflow as tf
source_words = ['#U@SAA$', '%Goo@#g-le'] target_words = ['USA', 'Google']
model = tf.keras.Sequential([ tf.keras.layers.Embedding(input_dim=vocab_size, output_dim=embedding_dim), tf.keras.layers.GlobalAveragePooling1D(), tf.keras.layers.Dense(output_dim) ])
model.compile(optimizer='adam', loss='mse')
model.fit(source_words, target_words, epochs=num_epochs, batch_size=batch_size)
how to train custom word like
source word --------------------- target word
1- #U@SAA$ -------------------------- USA 2- %Goo@#g-le ----------------------- Google