def get_alphabet(train_context_path):
    """
    Gets set of characters found in training data
    Returns  dictionaries mapping characters to their ids and reciprocally

    """
    

    with open(train_context_path, 'r') as f_in:
        data = f_in.read()
        emb_alphabet = list(set(data))

    char2id = {}
    id2char = {}
    idx = 2 # 0 = pad, 1 = unknown char
    for char_id in range(len(emb_alphabet)): 
        char2id[emb_alphabet[char_id]] = idx
        id2char[idx] = emb_alphabet[char_id]
        idx += 1
        
    return emb_alphabet, char2id, id2char