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.
Assignment: Sentiment analysis with LLMs - Python Tutorial
From the course: Natural Language Processing in Python
Assignment: Sentiment analysis with LLMs
Your first assignment for this section is on sentiment analysis, and you have a message from Oscar Wynn. You may remember him way back from the machine learning section when he asked you to do sentiment analysis, and he has a follow-up to that message. He says, regarding my earlier message, can you do sentiment analysis using hugging face and LLMs, instead of Vader and rules, and compare the results? Thank you. You can see in this case, he's attached the movie reviews sentiment CSV file. And that has the movie reviews as well as the sentiment scores from Vader. So your key objectives for this assignment are first, if you haven't already, create a new NLP Transformers environment that has all the correct installs. To do this, you can either watch the demo a few lessons prior to this, or you can find all the code within the Environments folder in the course resources. And then from that environment, you're going to launch a Jupyter Notebook. And from there, you can start coding. So your…
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)
-