From the course: Natural Language Processing in Python

Unlock this course with a free trial

Join today to access over 26,400 courses taught by industry experts.

Named entity recognition (NER)

Named entity recognition (NER) - Python Tutorial

From the course: Natural Language Processing in Python

Named entity recognition (NER)

“

The next concept we'll be covering is called Named Entity Recognition, or NER. And the way that NER works is that it looks at your text and then it finds and labels entities in your text. So things like people, places, and so on. Now if you remember way back to our text pre-processing lesson, we briefly mentioned NER as something that you can do within spaCy. But in practice, it performs a lot better using Transformers. So that's why we're covering it here. And the way we're going to be doing NER with LLMs is using the BERT model. Once again, this is an encoder-only model, which is used for understanding, and it's the default LLM for when you want to do NER with transformers. And here's what the code would look like. You can see, once again, we're going through the same steps. We're first importing the pipeline module, we're specifying our NER task, we're choosing the default model, which in this case is BERT, and we're specifying device equals negative one which means we're only…

Contents