def format_token_ner(token_list, label_list, tokenizer, seq_len, lab_encoder, ign_value):
    """
    Given a list of sub-tokens and their assigned NER-labels, as well as a tokenizer, it returns their corresponding lists of 
    indices, attention masks, tokens types and transformed labels. Padding is added as appropriate.
    """
    
    token_ids = tokenizer.convert_tokens_to_ids(token_list)
    # Add [CLS] and [SEP] tokens (single sequence)
    token_ids = tokenizer.build_inputs_with_special_tokens(token_ids)
    
    # Generate attention mask
    token_len = len(token_ids)
    attention_mask = [1] * token_len
    
    # Generate token types
    token_type = [0] * token_len
    
    # Add special tokens labels
    token_labels = [ign_value] + [lab_encoder.transform([label])[0] if label != ign_value else label \
                                  for label in label_list] + [ign_value]
    assert len(token_labels) == token_len
    
    # Padding
    pad_len = seq_len - token_len
    token_ids += [tokenizer.pad_token_id] * pad_len
    attention_mask += [0] * pad_len
    token_type += [0] * pad_len
    token_labels += [ign_value] * pad_len

    return token_ids, attention_mask, token_type, token_labels