Search icon
Subscription
0
Cart icon
Close icon
You have no products in your basket yet
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Natural Language Processing with Java and LingPipe Cookbook

You're reading from  Natural Language Processing with Java and LingPipe Cookbook

Product type Book
Published in Nov 2014
Publisher
ISBN-13 9781783284672
Pages 312 pages
Edition 1st Edition
Languages

Table of Contents (14) Chapters

Natural Language Processing with Java and LingPipe Cookbook
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
1. Simple Classifiers 2. Finding and Working with Words 3. Advanced Classifiers 4. Tagging Words and Tokens 5. Finding Spans in Text – Chunking 6. String Comparison and Clustering 7. Finding Coreference Between Concepts/People Index

Thresholding classifiers


Logistic regression classifiers are often deployed with a threshold rather than the provided classifier.bestCategory() method. This method picks the category with the highest conditional probability, which, in a 3-way classifier, can be just above one-third. This recipe will show you how to adjust classifier performance by explicitly controlling how the best category is determined.

This recipe will consider the 3-way case with the p, n, and o labels and work with the classifier produced by the Classifier-building life cycle recipe earlier in this chapter. The cross-validation evaluation produced is:

Category p
Recall: 0.64
Prec  : 0.57
Category n
Recall: 0.41
Prec  : 0.54
Category o
Recall: 0.81
Prec  : 0.81

We will run novel data to set thresholds.

How to do it...

Our business use case is that recall be maximized while p has .65 precision and n has .5 precision for reasons discussed in the Classifier-building life cycle recipe. The o category is not important in this...

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 $15.99/month. Cancel anytime}