def create_label_map(label_lists, trailing_piece_tag="X"):
        """
        Create a dictionary object to map a label (str) to an ID (int).

        Args:
            label_lists (list): A list of label lists. Each element is a list of labels
                which presents class of each token.
            trailing_piece_tag (str, optional): Tag used to label trailing word pieces.
                Defaults to "X".

        Returns:
            dict: A dictionary object to map a label (str) to an ID (int).
        """

        unique_labels = sorted(set([x for y in label_lists for x in y]))
        label_map = {label: i for i, label in enumerate(unique_labels)}

        if trailing_piece_tag not in unique_labels:
            label_map[trailing_piece_tag] = len(unique_labels)

        return label_map

        Create a dictionary object to map a label (str) to an ID (int).

        Args:
            label_lists (list): A list of label lists. Each element is a list of labels
                which presents class of each token.
            trailing_piece_tag (str, optional): Tag used to label trailing word pieces.
                Defaults to "X".

        Returns:
            dict: A dictionary object to map a label (str) to an ID (int).
        
utils_nlp/models/transformers/named_entity_recognition.py