def _improve_segmentation(doc):
    """
    Helper function to improve spacy sentence segmentation specifically for product descriptions.
    A lot of descriptions contain lists that spacy does not properly handle. To fix that, this function marks every
    token that is followed by an empty token (i.e. newline) as the start of a sentence.
    This does NOT cause issues when there is a whitespace after a token even though it looks like it might.

    :param doc: The loaded spacy model.
    :return: The model, but with improved segmentation for sentence splitting.
    """
    for token in doc[:-1]:
        if not token.text.strip():
            # blank, such as \n \n etc.
            doc[token.i+1].is_sent_start = True
    return doc