def align_embedding(sequences, padding_word="<PAD/>", max_length=-1):
    """
    Pads all sentences to the same length. The length is defined by the longest sentence.
    Returns padded sentences.
    """
    print("aligning sequences...")
    if max_length < 0:
        max_length = max(len(x) for x in sequences)
    padded_sequences = []
    for sequence in sequences:
        # new_sequence = [1]
        if len(sequence) >max_length:
            new_sequence = sequence[:max_length]
        else:
            new_sequence = sequence + [padding_word] * (max_length - len(sequence))
        # print("new_sequence:", new_sequence)
        padded_sequences.append(new_sequence)
    return padded_sequences