def extract_modified_bs_sequence(sax_sequence):
    """
    This functions extracts the modified Behaviour Subsequence (BS) sequence list, which is the original sax word
    sequence where every consecutive pairs of sax words are equal are fused into the same sax word.

    :param sax_sequence: list of original sax words
    :type sax_sequence: list of str
    :return:
        - bs_sequence (:py:class:`list of str`) - list of modified sax words
        - bs_lengths (:py:class:`list of int`) - list of lengths of each modified sax word
    """
    bs_sequence = []
    bs_lengths = []
    curr_len = 1
    for i in range(len(sax_sequence)):
        curr_bs = sax_sequence[i]
        if i < len(sax_sequence)-1:
            next_bs = sax_sequence[i+1]
        else:
            next_bs = ''
        if curr_bs == next_bs:
            curr_len = curr_len + 1
        else:
            bs_sequence.append(curr_bs)
            bs_lengths.append(curr_len)
            curr_len = 1
    return bs_sequence, bs_lengths