Natural Language Processing with spaCy 01-02-2024, 02:55 AM
#1
import spacy
nlp = spacy.load("en_core_web_sm")
text = "Natural Language Processing is an exciting field!"
# Tokenization and Named Entity Recognition (NER)
doc = nlp(text)
for token in doc:
print(f"Token: {token.text}, POS: {token.pos_}, NER: {token.ent_type_}")
nlp = spacy.load("en_core_web_sm")
text = "Natural Language Processing is an exciting field!"
# Tokenization and Named Entity Recognition (NER)
doc = nlp(text)
for token in doc:
print(f"Token: {token.text}, POS: {token.pos_}, NER: {token.ent_type_}")