def convert_corpus(input_obj):
    """
    Convert the prepared corpus format to `[[input], [output]]` feeds into model.
    """
    def convert_content_indice(passage, span):
        start_span, end_span = span
        return [0]*start_span + [1]*(end_span-start_span) + [0]*(len(passage)-end_span)
    
    passages = input_obj["documents"] #list(map(padding_sequence, input_obj["documents"]))
    spans = input_obj["spans"]
    question = input_obj["query"]
    selects = input_obj["selects"]
    content_indices = [convert_content_indice(passage, span) 
                for passage, span in zip(passages, spans)]

    return ([passages, question],
            [spans, content_indices, selects],)