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) - 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…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
-
-
-
-
(Locked)
Section introduction2m 33s
-
(Locked)
Hugging Face overview5m 3s
-
(Locked)
Demo: Create a new environment2m 48s
-
(Locked)
Sentiment analysis with LLMs5m 15s
-
(Locked)
Demo: Basic sentiment analysis pipeline8m 21s
-
(Locked)
Demo: Timing, logging, and device setup4m 33s
-
(Locked)
Demo: Compare sentiment scores7m 7s
-
(Locked)
Pro tip: Speed up transformers code5m 31s
-
(Locked)
Assignment: Sentiment analysis with LLMs1m 32s
-
(Locked)
Solution: Sentiment analysis with LLMs9m 9s
-
(Locked)
Named entity recognition (NER)5m 2s
-
(Locked)
Demo: Basic NER pipeline3m 8s
-
(Locked)
Demo: Hugging Face Model Hub2m 23s
-
(Locked)
Demo: Clean NER output7m 35s
-
(Locked)
Assignment: NER51s
-
(Locked)
Solution: NER14m 53s
-
(Locked)
Zero-shot classification4m 16s
-
(Locked)
Demo: Zero-shot classification7m 7s
-
(Locked)
Assignment: Zero-shot classification32s
-
(Locked)
Solution: Zero-shot classification5m
-
(Locked)
Text summarization3m
-
(Locked)
Demo: Text summarization3m 22s
-
(Locked)
Demo: Multiple pipelines7m 26s
-
(Locked)
Assignment: Text summarization27s
-
(Locked)
Solution: Text summarization4m 50s
-
(Locked)
Pro tip: Text generation3m 38s
-
(Locked)
Document embeddings2m 59s
-
(Locked)
Cosine similarity5m 5s
-
(Locked)
Document similarity with embeddings2m
-
(Locked)
Demo: Feature extraction and embeddings10m 17s
-
(Locked)
Demo: Cosine and document similarity5m 58s
-
(Locked)
Pro tip: Recommender function12m 55s
-
(Locked)
Assignment: Document similarity48s
-
(Locked)
Solution: Document similarity6m 10s
-
(Locked)
Key takeaways2m 52s
-
(Locked)
-