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.
Solution: NER - Python Tutorial
From the course: Natural Language Processing in Python
Solution: NER
This assignment starts by reading in the children's books data set. So let's go back to our home directory. To get to that data set we have to go up a folder to the course materials, down to the data folder, and we're going to be looking at children's books. So let's do a read csv and then we're going to go up a folder, into the data folder, and then specify the children's books data. Okay, you can see this is 100 rows, so let's save this whole thing as books and just view a few for now. And once again, we have for each book, its title, author, and a short description. And now our next step is to apply NER to the description column, which is this one right here. So to do this, I'm going to go back to our reference notebook and copy this NER analyzer. So let's just go through everything in here once more. We're specifying our task is named entity recognition. This is the model we want to use. This is using a CPU, but I want to use my GPU. Then I'm going to comment out this line of code…
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)
-