def transform_sequence_to_word_ids(seq, word_to_id):
    
    """ Create list of word IDs for sequence of words, padded with zeroes and truncated to a fixed length
    
    Args:
        seq: list of words
        word_to_id: dict with words as keys and corresponding ids as values
        
    Return:
        list of word IDs padded and truncated to length of 30 items
    """
    
    seq_word_ids = []
    for word in seq:
        seq_word_ids.append([word_to_id[word]])
    
    # pad sequence with zeros
    for i in range(30 - len(seq_word_ids)):
        seq_word_ids.append([0])
        
    return seq_word_ids[:30]