def convert_bpe_word(bpe_sent, word_sent):
    """
    Given a sentence made of BPE subwords and words (as a string), 
    returns a list of lists where each sub-list contains BPE subwordss
    for the correponding word.
    """

    splited_bpe_sent = bpe_sent.split()
    word_sent = word_sent.split()
    word_to_bpe = [[] for _ in range(len(word_sent))]
    
    word_i = 0
    for bpe_i, token in enumerate(splited_bpe_sent):
        if token.startswith("▁"):
            word_i += 1
        word_to_bpe[word_i].append(bpe_i)

    for word in word_to_bpe:
        assert len(word) != 0
    
    word_to_bpe.append([len(splited_bpe_sent)])
    return word_to_bpe