implementation seq2seq for generate out words from input words

I have an idea to get output string from given input string which isn't taken from training or dev data. I used seq2seq model. But I can't get how to use it for string which is not in training data. I built seq2seq from this example https://github.com/keras-team/keras/blob/master/examples/lstm_seq2seq.py. Data which I used: input string (word1) and output string(word2). Here is code of data preparation:

def prepare_data(num_samples, filename):
    # Vectorize the data.
    input_texts = []
    target_texts = []
    input_characters = set()
    target_characters = set()
    '''
    with open(data_path, 'r', encoding='utf-8') as f:
        lines = f.read().split('\n')
    '''
    print('Read data')
    arr_words, arr_trans = get_data(csv_file=filename)
    input_texts = arr_words
    target_texts = arr_trans

    for i, line in enumerate(input_texts[: max(num_samples, len(input_texts) - 1)]):
        print(input_texts[i])
        if pd.isnull(input_texts[i]) != True:
            for char in input_texts[i]:
                print(char)
                if char not in input_characters:
                    print('Input char:', char)
                    input_characters.add(char)
        print(target_texts[i])
        target_texts[i] = '\t' + target_texts[i] + '\n'
        if pd.isnull(target_texts[i]) != True:
            for char in target_texts[i]:
                if char not in target_characters:
                    print('Target char:', char)
                    target_characters.add(char)

    input_characters = sorted(list(input_characters))
    target_characters = sorted(list(target_characters))
    num_encoder_tokens = len(input_characters)
    num_decoder_tokens = len(target_characters)
    max_encoder_seq_length = max([len(txt) for txt in input_texts])
    max_decoder_seq_length = max([len(txt) for txt in target_texts])

    print('Number of samples:', len(input_texts))
    print('Number of unique input tokens:', num_encoder_tokens)
    print('Number of unique output tokens:', num_decoder_tokens)
    print('Max sequence length for inputs:', max_encoder_seq_length)
    print('Max sequence length for outputs:', max_decoder_seq_length)

    input_token_index = dict(
        [(char, i) for i, char in enumerate(input_characters)])
    target_token_index = dict(
        [(char, i) for i, char in enumerate(target_characters)])

    encoder_input_data = np.zeros(
        (len(input_texts), max_encoder_seq_length, num_encoder_tokens),
        dtype='float32')
    decoder_input_data = np.zeros(
        (len(input_texts), max_decoder_seq_length, num_decoder_tokens),
        dtype='float32')
    decoder_target_data = np.zeros(
        (len(input_texts), max_decoder_seq_length, num_decoder_tokens),
        dtype='float32')

    for i, (input_text, target_text) in enumerate(zip(input_texts, target_texts)):
        for t, char in enumerate(input_text):
            encoder_input_data[i, t, input_token_index[char]] = 1.
        for t, char in enumerate(target_text):
            # decoder_target_data is ahead of decoder_input_data by one timestep
            decoder_input_data[i, t, target_token_index[char]] = 1.
            if t > 0:
                # decoder_target_data will be ahead by one timestep
                # and will not include the start character.
                decoder_target_data[i, t - 1, target_token_index[char]] = 1.

    # Reverse-lookup token index to decode sequences back to
    # something readable.
    reverse_input_char_index = dict(
        (i, char) for char, i in input_token_index.items())
    reverse_target_char_index = dict(
        (i, char) for char, i in target_token_index.items())

    return num_decoder_tokens, num_encoder_tokens, decoder_input_data, decoder_target_data, encoder_input_data, \
           target_token_index, input_token_index, reverse_target_char_index, reverse_input_char_index, max_decoder_seq_length,\
           input_texts, target_texts

Which structure of neural networks should I use (seq2seq or another)? If it's seq2seq, how can I use prediction?