def remove_subtree(doc, clean_sent, indices_to_remove_subtree):
    """
    This function removes a subtree given a spaCy Doc object and
    the indices of each token to remove. The indices are used in a
    spaCy Span object to get the tokens of the subtree.

    Note:
        Span object -> slice doc[start : end]
            start: The index of the first token of the span
            end: The index of the first token after the span.

    Args:
        doc: spaCy Doc of the clean sentence
        clean_sent:str the string of the clean sentence Doc object
        indices_to_remove_subtree: list of indices of the subtree to be removed

    Return:
        new_sent:str the newly trimmed sentence

    """

    # Create span of the subtree to be removed
    span_of_subtree_start = indices_to_remove_subtree[0]
    span_of_subtree_end = indices_to_remove_subtree[-1] + 1
    span_to_be_removed = doc[span_of_subtree_start:span_of_subtree_end].text

    # Remove span from the clean sentence
    new_sent = clean_sent.replace(span_to_be_removed, "")

    # Return the new sentence
    return new_sent