I would like to improve this following if statement
#Extract ORG, GPE, LOC and FAC labels from phrases
for entity in doc.ents:
if entity.label_ == "ORG" or entity.label_ == "GPE" or entity.label_ == "LOC" or entity.label_ == "FAC":
print(entity.text, entity.label_)
Is it possible reduce the number of "entity.label_" variables to one?
Aucun commentaire:
Enregistrer un commentaire