def get_sentid_from_offset(doc_start_char, doc_end_char, offset2sentid):
    """ This function gets the sent index given the character offset of an entity in the document 
    
    Args:
        doc_start_char: starting character offset of the entity in the document 
       
        doc_end_char: ending character offset of the entity in the document 
       
        offset2sentid: a mapping from character offset to sent index in the document 
    """
    sentid = None
    for offset in offset2sentid:
        if offset[0] <= doc_start_char < doc_end_char <= offset[1]:
            return offset2sentid[offset]
    return sentid