Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Active Machine Learning with Python

You're reading from   Active Machine Learning with Python Refine and elevate data quality over quantity with active learning

Arrow left icon
Product type Paperback
Published in Mar 2024
Publisher Packt
ISBN-13 9781835464946
Length 176 pages
Edition 1st Edition
Languages
Arrow right icon
Author (1):
Arrow left icon
Margaux Masson-Forsythe Margaux Masson-Forsythe
Author Profile Icon Margaux Masson-Forsythe
Margaux Masson-Forsythe
Arrow right icon
View More author details
Toc

Table of Contents (13) Chapters Close

Preface 1. Part 1: Fundamentals of Active Machine Learning
2. Chapter 1: Introducing Active Machine Learning FREE CHAPTER 3. Chapter 2: Designing Query Strategy Frameworks 4. Chapter 3: Managing the Human in the Loop 5. Part 2: Active Machine Learning in Practice
6. Chapter 4: Applying Active Learning to Computer Vision 7. Chapter 5: Leveraging Active Learning for Big Data 8. Part 3: Applying Active Machine Learning to Real-World Projects
9. Chapter 6: Evaluating and Enhancing Efficiency 10. Chapter 7: Utilizing Tools and Packages for Active ML 11. Index 12. Other Books You May Enjoy

Handling model-label disagreements

Disagreements between model predictions and human labels are inevitable. In this section, we will study how to identify and resolve conflicts.

Programmatically identifying mismatches

To identify discrepancies between the model’s predictions and the human-annotated labels, we can write some simple Python code that highlights the mismatches for review.

Let’s consider the example of an NLP sentiment classifier. This type of classifier is designed to analyze and understand the sentiment or emotions expressed in text. By examining the words, phrases, and context used in a given piece of text, an NLP sentiment classifier can determine whether the sentiment is positive, negative, or neutral. First, we will use the sentiment-analysis model from Huggingface:

sentiment_pipeline = pipeline("sentiment-analysis")
data = ["I love you", "I hate you"]
sentiment_pipeline(data)

The returns the following output...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €18.99/month. Cancel anytime