Question
Named entity recognition code run with 5 different sentences and the output is provided below. Explain in brief the outputs of the code. import spacy
Named entity recognition code run with 5 different sentences and the output is provided below.
Explain in brief the outputs of the code.
import spacy
nlp = spacy.load("en_core_web_sm")
doc = nlp("Samsungs new Galaxy S23 Ultra arrives with a 200-megapixel camera")
for ent in doc.ents:
print(ent.text, ent.start_char, ent.end_char, ent.label_)
Outputs with 5 diferent sentences on the same code:
1. Samsungs new Galaxy S23 Ultra arrives with a 200-megapixel camera
Output: Samsung 0 7 ORG
Galaxy S23 Ultra 14 30 PRODUCT
200 46 49 CARDINAL
2. Netflix lists rules and exemptions to prevent account sharing outside household
Output: Netflix 0 7 ORG
3. Zopa, the UK neobank, raises $93M more at a $1B+ valuation
Output: UK 10 12 GPE
$93M 29 33 MONEY
1B+ 45 48 MONEY
4. The Biden administration says Apples and Googles app stores are stifling competition
Output: Biden 4 9 PERSON
Apples 30 37 ORG
Google 42 48 ORG
5. . Large glacier near Seattle has completely disappeared, says researcher who has tracked it for years
Output: Seattle 19 26 GPE
years 94 99 DATE
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started