def count_entities(doc, ent_label):
    """Counts the number of entities in doc that is of type ent_label
    
    Keyword arguments
    doc -- a spacy.tokens.doc.Doc object
    ent_label -- the entity lable to be checked, e.g. "PERSON"
    """
    
    return len([ent for ent in doc.ents if ent.label_ == 'PERSON'])