Documente Academic
Documente Profesional
Documente Cultură
3.
4.
A Quick Recap
Given: Examples (x,f(x)) of some unknown function f Find: A good approximation of f x provides some representation of the input
The process of mapping a domain element into a representation is called Feature Extraction. (Hard; ill-understood; important) x {0,1}n or x Rn f(x) {-1,+1} f(x) {1,2,3,.,k-1} Binary Classification Multi-class classification
A document A classifier (black box)
Some labels
Spam detection
Sentiment classification
What else can you do, if you had such a black box system that can classify text? Try to spend 30 seconds brainstorming
Getting started with LBJ Writing our first classifier: Spam/Ham Playing with features Looking inside the black box classifier for feature weights
Writing classifiers
Supports
Programming using learned models High level specification of features and constraints between classifiers Inference with constraints Different learning algorithms
Classifiers are functions defined in terms of data Learning happens at compile time
Abstracts away the feature representation, learning and inference Allows you to write learning based programs Application developers can reason about the application at hand
Demo
First, we will write an application that assumes the existence of a black box classifier
SPAM DETECTION
Spam detection
Which of these (if any) are email spam?
Subject: save over 70 % on name brand software ppharmacy devote fink tungstate brown lexicon pawnshop crescent railroad distaff cytosine barium cain do How application elegy donnelly hydrochloride common embargo shakespearean bassett trustee nucleolus chicano narbonne telltale tagging swirly lank delphinus bragging bravery cornea asiatic susanne
Subject: please keep in touch just like to say that it has been great meeting and working with you all . i will be leaving enron effective july 5 th you know? to do investment banking in hong kong . i will initially be based in new york and will be moving to hong kong after a few months . do contact me when you are in the vicinity .
The function being learned The feature representation The source of the training data The learning algorithm
Demo
How to train?
How do different learning algorithms perform? Does this choice matter much?
Features
Can we do better?
Sentiment classification
Which of these product reviews is positive?
I recently made the switch from PC to Mac, and I can say that I'm not sure why I waited so long. Considering that I have only had do How my computer a few weeks I can't say much about the durability and longevity of the hardware, but I can say that the operating system (mine shipped with Lion) and software is top notch. I've been an Apple user for a long time, but my most recent MacBook Pro purchase has convinced me to reconsider. I've know? had several hardware issues, including a failed keyboard, battery failure, and a bad DVD drive. Now, the backlight on the display fails to turn on when waking from sleep
you
How alt.atheism comp.graphics comp.os.ms-windows.misc comp.sys.ibm.pc.hardware comp.sys.mac.hardware comp.windows.x misc.forsale rec.autos rec.motorcycles rec.sport.baseball
do you know?
rec.sport.hockey sci.crypt sci.electronics sci.med sci.space soc.religion.christian talk.politics.guns talk.politics.mideast talk.politics.misc talk.religion.misc
Demo
A document A classifier (black box)
Some labels
Summary
Download the code & data (http://l2r.cs.uiuc.edu/~danr/Teaching/CS446-12/handsonclassification.html) for this class and play with it Try to solve the Badges game puzzle with LBJ
Think about what features are needed Write a parser for reading the data Write a classifier for solving the puzzle
Next Class
Questions
Badge Classifier
Characters in entire name Two consecutive Characters Character as Vowel, Character as Consonant .
Feature Engineering is Important (especially if labeled data is small) What is the baseline? 70 +, 24 -
f(
) = Politician
f( f(
Represented by
All sentences in the news, which the string Roger Federer occurs
All sentences in the news, which the string Bill Gates occurs
Our goal
Corporate Mogul
Warren Buffet Larry Ellison
Lets brainstorm
One solution
All sentences in the news, which the string Barack Obama occurs
Identify mentions using the named entity recognizer Define features based on the words, parts of speech and dependency trees Train a classifier
Summary
1.
2.
3.
4.
Questions