def check_problematic_slots(slot_preds_list, slot_dict):
    """ Check non compliance of B- and I- slots for datasets that use such slot encoding. """
    cnt = 0
    sentence = slot_preds_list
    for i in range(len(sentence)):
        slot_name = slot_dict[int(sentence[i])]
        if slot_name.startswith('I-'):
            prev_slot_name = slot_dict[int(sentence[i - 1])]
            if slot_name[2:] != prev_slot_name[2:]:
                print('Problem: ' + slot_name + ' - ' + prev_slot_name)
                cnt += 1
    print('Total problematic slots: ' + str(cnt))
