Add labels to input datawith values ["scientist", "university", "city"]
Execute NER task
Remove labels fromresults
Rename output to entities
5. Run created pipeline
res = pipeline.run({ "text": """Dr. Paul Hammond, a renowned neurologist at Johns Hopkins University, has recently published a paper in the prestigious journal "Nature Neuroscience".
His research focuses on a rare genetic mutation, found in less than 0.01% of the population, that appears to prevent the development of Alzheimer's disease. Collaborating with researchers at the University of California, San Francisco, the team is now working to understand the mechanism by which this mutation confers its protective effect.
Funded by the National Institutes of Health, their research could potentially open new avenues for Alzheimer's treatment."""
})
Here, we run pupline with input text.
Note that text and labels keys are expected byTokenSearcherNER task described above. Refer to class description in Used components section.
Result should look similar to:
{ "text": """Dr. Paul Hammond, a renowned neurologist at Johns Hopkins University, has recently published a paper in the prestigious journal "Nature Neuroscience".
His research focuses on a rare genetic mutation, found in less than 0.01% of the population, that appears to prevent the development of Alzheimer's disease. Collaborating with researchers at the University of California, San Francisco, the team is now working to understand the mechanism by which this mutation confers its protective effect.
Funded by the National Institutes of Health, their research could potentially open new avenues for Alzheimer's treatment.""",
"entities": [{"start":4,"end":16,"span":"Paul Hammond","score":0.5637074708938599,"entity":"scientist"},{"start":44,"end":68,"span":"Johns Hopkins University","score":0.8921091556549072,"entity":"university"},{"start":347,"end":371,"span":"University of California","score":0.7202138900756836,"entity":"university"},{"start":373,"end":386,"span":"San Francisco","score":0.7660449743270874,"entity":"city"} ]}
Used components
What next
Explore more about components and concepts on the following pages, or jump to class descriptions and more advanced examples.