def create_alignment(df):
    """
    Map the sentence position indexes of the abstract sentences for a whole
    papers dataframe. Used later to map the separately calculated sentence 
    embeddings (due to performance gains in SBERT batch embedding) to 
    the correct paper.
    
    :param df: The papers dataframe.
    
    :return alignment: The sentence-to-position alignment dictionary.
    """
    alignment = {}
    current_start = 0
    current_end = 0
    for index, row in df.iterrows():
        abstract = row.abstract_sentences
        current_end += len(abstract)
        alignment[index] = {"start": current_start, "end": current_end}
        current_start = current_end
    return alignment