text:
# Practical Structured Learning Techniques for Natural Language Processing

IA et Robotique

24 oct. 2013 (il y a 8 années et 15 jours)

602 vue(s)

http://pub.hal3.name#daume06thesis
Practical Structured Learning Techniques for Natural Language Processing
by
Harold Charles Daume III
A Dissertation Presented to the
UNIVERSITY OF SOUTHERN CALIFORNIA
In Partial Fulllment of the
Requirements for the Degree
DOCTOR OF PHILOSOPHY
(COMPUTER SCIENCE)
August 2006
Copyright 2006 Harold Charles Daume III
\Arrest this man,he talks in maths..."
ii
DedicationFor Kathy,who keeps me sane and happy...
iii
Acknowledgments
My thesis work has beneted tremendously from the in uence,advice and support of
many colleagues,friends and family.I am eternally grateful to my adviser,Daniel Marcu,
for continuous help and support throughout my graduate career.Daniel's grounding
kept me focused,but I am equally indebted to his support while I found my own path.
Many thanks also to the other members of my committee,especially Stefan Schaal (to
whom most blame goes for my interest in machine learning) and Andrew McCallum
(discussions with whom have greatly improved this work).The other members of my
thesis committee|Ed Hovy,Kevin Knight and Gareth James|have provided consistently
useful feedback.Many thanks also to John Langford for pushing me to also consider the
theoretical implications of this work.Many of the theoretical results in this thesis are
due to interactions with John,especially the central convergence theorem in Chapter 3.
My path to NLP was a circuitous one.Many thanks to Chris Quirk for pointing me
to LTI back at CMU when I didn't even know NLP was a eld.The entire LTI crowd was
incredibly supportive as I was getting to know the eld,especially Eric Nyberg,Teruko
Mitamura,Lori Levin and Alon Lavie who guided my rst year's travels through this
eld.My LTI experiences were made enjoyable by interactions with many other faculty
and students,especially Kathrin Probst,Alicia Tribble,Rosie Jones and Ben Han.
iv
Many thanks to Alex Fraser,my fantastic ocemate,for both providing a sounding
board for ideas and teaching me how to use the ISI espresso machine.I'm also greatly
indebted to Mike Collins,Fernando Pereira and Ben Taskar:their encouragement and
enthusiasm has been priceless.Discussions with others,inside and outside ISI,have
greatly in uenced this work.At the risk of forgetting someone,I have greatly enjoyed
my interactions with:Drew Bagnell,Je Bilmes,John Blitzer,Eric Brill,Mike Collins,
Lin,David McAllester,Ryan McDonald,Dragos Munteanu,Ani Nenkova,Franz Och,Bo
Teh,Liang Zhou.
Finally,I thank my family and friends both for their support during this thesis as
well as before it.My parents always encouraged me intellectually and provided for me
a fantastic education.My friendships have salvaged my sanity on several occasions.A
special thanks to Jason Cheng,Rob Pierry,Charlie Sharp,Dane Tice and Mark Yohalem
for non-academic support.My love and gratitude goes out to Kathy,who now knows
much more about natural language processing and machine learning than she probably
ever wanted to.Her support,through the good times and the bad,was a necessary
nutrient for this thesis to properly develop.
v
Contents
ii
Dedication iii
Acknowledgments iv
List Of Tables x
List Of Figures xi
Abstract xiv
1 Introduction 1
1.1 Structure in Language.............................1
1.2 Example Problem:Entity Detection and Tracking.............2
1.3 The Role of Search...............................3
1.4 Learning in Search...............................4
1.5 Contributions..................................5
1.6 An Overview of This Thesis..........................6
2 Machine Learning 8
2.1 Binary Classication..............................8
2.1.1 Perceptron...............................9
2.1.2 Logistic Regression...........................10
2.1.3 Support Vector Machines.......................12
2.1.4 Generalization Bounds.........................13
2.1.5 Summary of Learners.........................15
2.2 Structured Prediction.............................16
2.2.1 Dening Structured Prediction....................16
2.2.2 Feature Spaces for Structured Prediction..............18
2.2.3 Structured Perceptron.........................18
2.2.4 Incremental Perceptron........................20
2.2.5 Maximum Entropy Markov Models..................20
2.2.6 Conditional Random Fields......................21
vi
2.2.7 Maximum Margin Markov Networks.................22
2.2.8 SVMs for Interdependent and Structured Outputs.........23
2.2.9 Reranking................................24
2.2.10 Summary of Learners.........................25
2.3 Learning Reductions..............................26
2.3.1 Reduction Theory...........................27
2.3.2 Importance Weighted Binary Classication.............27
2.3.3 Cost-sensitive Classication......................28
2.4 Discussion and Conclusions..........................28
3 Search-based Structured Prediction 30
3.1 Contributions and Methodology........................31
3.2 Generalized Problem Denition........................32
3.3 Search-based Structured Prediction......................33
3.4 Training.....................................33
3.4.1 Cost-sensitive Examples........................33
3.4.2 Optimal Policy.............................34
3.4.3 Algorithm................................34
3.4.4 Simple Example............................36
3.4.5 Comparison to Local Classier Techniques..............37
3.4.6 Feature Computations.........................39
3.5 Theoretical Analysis..............................40
3.6 Policies.....................................41
3.6.1 Optimal Policy Assumption......................41
3.6.2 Search-based Optimal Policies.....................42
3.6.3 Beyond Greedy Search.........................43
3.6.4 Relation to Reinforcement Learning.................44
3.7 Discussion and Conclusions..........................45
4 Sequence Labeling 47
4.1 Sequence Labeling Problems..........................48
4.1.1 Handwriting Recognition.......................48
4.1.2 Spanish Named Entity Recognition..................49
4.1.3 Syntactic Chunking..........................50
4.1.4 Joint Chunking and Tagging.....................50
4.2 Loss Functions.................................51
4.3 Search and Optimal Policies..........................52
4.3.1 Sequence Labeling...........................52
4.3.2 Segmentation and Labeling......................53
4.3.3 Optimal Policies............................53
4.4 Empirical Comparison to Alternative Techniques..............54
4.5 Empirical Comparison of Tunable Parameters................56
4.6 Discussion and Conclusions..........................59
vii
5 Entity Detection and Tracking 61
5.1 Problem Denition...............................61
5.2 Prior Work...................................64
5.2.1 Mention Detection...........................64
5.2.2 Coreference Resolution.........................66
5.2.2.1 Binary Classication.....................66
5.2.2.2 Multilabel Classication...................68
5.2.2.3 Random Fields........................69
5.2.2.4 Coreference Resolution Features..............69
5.2.3 Shortcomings..............................69
5.3 EDT Data Set and Evaluation........................71
5.4 Entity Mention Detection...........................72
5.4.1 Search Space and Actions.......................72
5.4.2 Optimal Policy.............................72
5.4.3 Feature Functions...........................73
5.4.3.1 Base Features........................73
5.4.3.2 Decision Features......................75
5.4.4 Experimental Results.........................75
5.4.5 Error Analysis.............................76
5.5 Coreference Resolution.............................76
5.5.1 Search Space and Actions.......................76
5.5.2 Optimal Policy.............................77
5.5.3 Feature Functions...........................79
5.5.3.1 Base Features........................79
5.5.3.2 Decision Features......................81
5.5.4 Experimental Results.........................81
5.5.5 Error Analysis.............................81
5.6 Joint Detection and Coreference.......................83
5.6.1 Search Space and Actions.......................83
5.6.2 Optimal Policy.............................84
5.6.3 Experimental Results.........................84
5.7 Discussion and Conclusions..........................85
6 Multidocument Summarization 87
6.1 Vine-Growth Model..............................87
6.2 Search Space and Actions...........................89
6.3 Data and Evaluation Criteria.........................90
6.4 Optimal Policy.................................91
6.5 Feature Functions...............................92
6.6 Experimental Results..............................93
6.7 Error Analysis.................................94
6.8 Discussion and Conclusions..........................94
viii
7 Conclusions and Future Directions 96
7.1 Weak Feedback Models............................97
7.1.1 Comparison Oracle Model.......................97
7.1.2 Algorithm................................97
7.1.3 Analysis.................................98
7.1.4 Experimental Results.........................99
7.1.5 Discussion................................100
7.2 Hidden Variable Models............................100
7.2.1 Translation Classication.......................101
7.2.2 Search-based Hidden Variable Models................102
7.2.2.1 Iterative Algorithm.....................103
7.2.2.2 Optimal Policy........................104
7.2.3 Features and Data...........................104
7.2.4 Experimental Results.........................106
7.2.5 Comparison to Expectation Maximization..............106
7.3 Other Applications for Searn.........................108
7.3.1 Parsing.................................108
7.4 Machine Translation..............................110
7.5 Limitations...................................111
7.6 Conclusions...................................111
Bibliography 113
Appendix A
Summary of Notation................................130
A.1 Common Sets and Functions.........................130
A.2 Vectors,Matrices and Sums..........................130
A.3 Complexity Classes...............................131
Appendix B
Proofs of Theorems..................................132
Appendix C
Relevant Publications................................134
ix
List Of Tables
2.1 Summary of structured prediction algorithms.................25
4.1 Empirical comparison of performance of alternative structured prediction
algorithms against Searn on sequence labeling tasks.(Top) Comparison
for whole-sequence 0/1 loss;(Bottom) Comparison for individual losses:
Hamming for handwriting and Chunking+Tagging and F for NER and
Chunking.Searn is always optimized for the appropriate loss.......55
4.2 Evaluation of computation of expected loss:dierences between both single
Monte-Carlo (MC 1) and ten Monte-Carlo (MC 10) against the optimal
approximation..................................57
4.3 Evaluation of computation of vector encodings:changes in performance
for using word-at-a-time rather than chunk-at-a-time encodings.......57
4.4 Evaluation of beam sizes:dierences between beam search and greedy
search (baseline is a beam of 10)........................58
4.5 Evaluation of multiclass reduction strategies:comparing unweighted all
pairs to weighted all pairs............................58
5.1 A list of the four possible mention types with descriptions and examples..62
5.2 A list of the seven entity types,with descriptions and subtypes.......63
5.3 Coreference errors evaluated on a mention-type basis............84
6.1 Summarization results;values shown are Rouge 2 scores (higher is better).94
x
List Of Figures
1.1 An example paragraph extract from a document from our training data
with entities identied..............................2
2.1 The averaged perceptron learning algorithm.................10
2.2 Plot of several convex approximations to the zero-one loss function.....15
2.3 The averaged structured perceptron learning algorithm...........19
3.1 Complete Searn Algorithm..........................35
3.2 Example structured prediction problemfor motivating the Searn algorithm.36
4.1 Eight example words from the handwriting recognition data set......48
4.2 Example labeled sentence from the Spanish Named Entity Recognition task.49
4.3 Example labeled sentence from the syntactic chunking task.........50
4.4 Example sentence for the joint POS tagging and syntactic chunking task.51
4.5 Number of iterations of Searn for each of the four sequence labeling prob-
lem.Upper-left:Handwriting recognition;Upper-right:Spanish named
entity recognition;Lower-left:Syntactic chunking;Lower-right:Joint chunk-
ing/tagging....................................59
5.1 An example paragraph extract from a document from our training data
with entities identied;reproduced from Figure 1.2.............62
5.2 A partial sentence fromour example text in original sequence-based format
and in the BIO-encoding............................65
5.3 ACE scores on the mention detection task for all ACE 2004 systems as
well as my Searn-based system........................75
xi
5.4 Running example for the computation of the optimal policy step for the
5.5 ACE scores on the coreference subtask for the three ACE 2004 systems
that competed in this subtask,one baseline,and the Searn-based system.82
5.7 ACE scores on the full EDT task for all ACE 2004 system,and my Searn-
based joint system................................85
5.8 ACE scores on the full EDT task for all ACE 2004 system,my Searn-
based joint system and a pipeline version of my Searn-based system...86
6.1 The dependency tree for the sentence\The man ate a sandwich with pickles".88
6.2 An example of the creation of a summary under the vine-growth model..89
6.3 An example query from the DUC 2005 summarization corpus........90
6.4 An example summary from the DUC 2005 summarization corpus......91
6.5 Example 100-word output fromthe BayeSum systemafter rule-based sen-
tence compression and post-processing.....................93
6.6 Example 100-word output fromthe Searn-based Vine Growth model after
post-processing..................................93
7.1 Learning curves for weak-feedback experiments on syntactic chunking;y-
axes are 1  F.(Left) X-axis is amount of supervised data available.
The higher (circled blue) curve is the purely supervised setting;the lower
(crossed black) curve is when the remaining data is used as a weak-feedback
oracle.(Right) The higher (red diamond) curve is keeping the amount of
supervised data constant (200 words) and varying the amount of oracle
data;the lower (crossed black) curve is replicated from left.........99
7.2 Two example alignments used in the translation classication task.The
left alignment is for a positive example;the right alignment is for a negative
example......................................101
7.3 Custom corpus used for proof of concept experiments for hidden variable
alignments model................................105
7.4 Three alignments found during the Searn-based hidden variable training;
the left two are positive examples,the right-most example is negative...106
xii
7.5 (Left) The dependency tree for the sentence\the man ate a big sandwich."
(Right) The sequence of shift-reduce steps that leads to this parse structure.109
xiii
AbstractNatural language processing is replete with problems whose outputs are highly complex
and structured.The current state-of-the-art in machine learning is not yet suciently
general to be applied to general problems in NLP.In this thesis,I present Searn (for
\search-learn"),an approach to learning for structured outputs that is applicable to the
wide variety of problems encountered in natural language (and,hopefully,to problems in
other domains,such as vision and biology).To demonstrate Searn's general applicability,
I present applications in such diverse areas as automatic document summarization and
entity detection and tracking.In these applications,Searn is empirically shown to
achieve state-of-the-art performance.
Searn is based on an integration of learning and search.This contrasts with standard
approaches that dene a model,learn parameters for that model,and then use the model
and the learned parameters to produce newoutputs.In most NLP problems,the\produce
new outputs"step includes an intractable computation.One must therefore employ a
heuristic search function for the production step.Instead of shying away from search,
Searn attacks it head on and considers structured prediction to be dened by a search
problem.The corresponding learning problem is then made natural:learn parameters so
that search succeeds.
xiv
The two application domains I study most closely in this thesis are entity detection
and tracking (EDT) and automatic document summarization.EDT is the problem of
nding all references to people,places and organizations in a document and identifying
their relationships.Summarization is the task of producing a short summary for either
a single document or for a collection of documents.These problems exhibit complex
structure that cannot be captured and exploited using previously proposed structured
prediction algorithms.By applying Searn to these problems,I am able to learn models
that benet from complex,non-local features of both the input and the output.Such
features would not be available to structured prediction algorithm that require model
tractability.These improvements lead to state-of-the-art performance on standardized
data sets with low computational overhead.
Searn operates by transforming structured prediction problems into a collection of
classication problems,to which any standard binary classier may be applied (for in-
stance,a support vector machine or decision tree).In fact,Searn represents a family of
structured prediction algorithms depending on the classier and search space used.From
a theoretical perspective,Searn satises a strong fundamental performance guarantee:
given a good classication algorithm,Searn yields a good structured prediction algo-
rithm.Such theoretical results are possible for other structured prediction only when
the underlying model is tractable.For Searn,I am able to state strong results that
are independent of the size or tractability of the search space.This provides theoretical
justication for integrating search with learning.
xv
Chapter 1
Introduction
I present an ecient,theoretically justied learning algorithm for structured prediction
that achieves state-of-the-art performance in a wide range of natural language processing
problems.Structured prediction is a generalized task that encompasses many problems
in natural language processing,as well as many problems from computational biology,
computational vision and other areas.The key issue in structured prediction that dieren-
tiates it from more canonical machine learning tasks (such as classication or regression)
is that the objects being predicted have internal structure.Adequately representing this
internal structure is key to obtaining good solutions to real-world problems,and an al-
gorithm that can function under any notion of structure is to be preferred to one with
restricted applicability.
1.1 Structure in Language
Many tasks in natural language processing can be formulated as mappings from inputs
x 2 X to outputs y 2 Y.For example,in machine translation,X might be the set of
all French sentences and Y might be the set of all English sentences.In this setting,
one can view machine translation as the task of developing a mapping from X to Y
that obeys some properties (adequacy of the translation to the original and uency of
the translation).Other common NLP tasks also t naturally into this framework.In
automatic document summarization,x 2 X is a document (or document collection) and
y 2 Y is a summary.In information extraction,x 2 X is a document and y 2 Y is the
relevant\information"contained in x.In sequence labeling and parsing,x is a sentence
and y is the corresponding annotation.
For each of these problems,specialized solutions have been developed.Beginning with
the in uential work in machine translation by Brown et al.(1993),we have witnessed a
burgeoning of statistical approaches to natural language problems.We have high perfor-
mance models for machine translation (Och,2003),parsing (Collins,2003;Charniak and
Johnson,2005),information extraction (Bikel,Schwartz,and Weischedel,1999;Florian
et al.,2004;Wellner et al.,2004),summarization (Knight and Marcu,2002;Barzilay,
2003;Zajic,Dorr,and Schwartz,2004),part of speech tagging (Brill,1995) and syntactic
chunking (Punyakanok and Roth,2001;Zhang,Damerau,and Johnson,2002;Sutton,
Rohanimanesh,and McCallum,2004;Sutton,Sindelar,and McCallum,2005),to name a
1
JERUSALEM
namgpe{1
{ The commander
nom
per{2
of Israeli
pregpe{3
troops
nom
per{4
in the
West Bank
nam
loc{5
said there was a simple goal to the helicopter
preveh{6
assassination on Thurs-
day of a gun-wielding local Palestinian
pre
gpe{7
nom
per{8
.\I
pro
per{2
hope it will reduce the
violence and bring back reason to this area
nomloc{9
",Maj Gen
pre
per{2
Yitzhak Eitan
namper{2
told
reporters
nomper{10
at a brieng hours after three missiles
nomwea{11
red from an Apache
pre
veh{6
helicopter
nom
veh{6
killed Hussein Obaiyat
nam
per{8
,along with two middle-aged women
nomper{12
standing near his
pro
per{8
van
nomveh{13
in Beit Sahur
namgpe{14
,near Bethlehem
nam
gpe{15
,it has touched o one of the bloodiest and most intense weekends of ghting yet
in the six-week-old con ict,with gunre crackling through the West Bank
nam
loc{5
and
Gaza Strip
namloc{16
.Five Palestinians
nomper{17
and an Israeli
pregpe{3
soldier
nomper{18
were shot
Figure 1.1:An example paragraph extract from a document from our training data with
entities identied.
few.With a handful of exceptions (primarily the work stemming from the use of condi-
tional random elds),the majority of these techniques have required the development of
specialized algorithms for performing the parameter learning.One goal of this thesis is
to provide a generic learning technique that can be applied to a large variety of problems,
allowing the researcher to focus eort on other aspects of natural language problems.
1.2 Example Problem:Entity Detection and Tracking
For the purposes of clear exposition,I will use the entity detection and tracking (EDT)
problem as a running example throughout the thesis.(Additionally,of all the tasks I
attack in this thesis,EDT is the most signicant.)
The entity detection and tracking problem focuses on discovering the set of entities
discussed in a document and identifying the textual span of the document (the mentions)
that refer to these entities.As part of the detection phase,a system must also identify,
for each entity,its corresponding entity type (person,place,organization,etc.) and,for
each mention of an entity,its mention type (name,nominal,pronoun,etc.).
In Figure 1.2,I show one paragraph from the data set I use,wherein entities have
been identied,types have been disambiguated and coreference chains have been marked.
In this paragraph,I underline every entity mention.Each mention is followed by a
superscript that identies the mention type and a subscript that identies both the entity
type and coreference chain of that mention.For instance,the word\commander"is a
nominal reference to a person,identied as entity number 2.At the beginning of the
second sentence,the word\I"is a pronominal mention also referring to entity 2 (and
hence is the same entity).A few of the coreference chains that appear in this extract are:
fJERUSALEMg,fcommander,I,Gen,Yitzhak Eitang,fIsraeli,Israelig and ftroopsg.
Entity detection and tracking is interesting from three separate angles.From a lin-
guistics perspective,identifying coreference is a challenging problem.An analysis of
what sources of knowledge are required to adequately solve this problem would greatly
increase our state of knowledge.From a computer science perspective,it is computation-
ally challenging.Even just the coreference task|identifying the entity chains given the
2
mentions|turns out to be FNP-hard
1
under any reasonable model.This can be shown
by reduction to graph partitioning (McCallum and Wellner,2004).Developing ecient
algorithms for solving this problem is of utmost importance to building a system that
can function in the real-world.Finally,from a machine learning perspective,this task is
interesting because it exhibits signicantly complex structure.A machine learning tech-
nique that could solve EDT directly would need to be able to make much more complex
Like all natural language processing problems,the primary diculty in the EDT
task is ambiguity and the multiple diverse sources of information required to resolve
this ambiguity.Consider,for instance,the example paragraph shown in Figure 1.2.
Identifying that the\I"in the second sentence is the same person as the\commander"
in the rst sentence is an extremely challenging inference to make.In fact,it is possible
that the two mentions actually refer to two dierent entities who happen to agree in
what they say.Identifying that the\Gen"entity is the same as\Yitzhak Eitan"requires
some knowledge of syntax,as does linking this entity with the pronoun\I."On the other
hand,identifying that the\Apache"referred to in the second sentence is coreferent with
\helicopter"form the rst sentence requires external knowledge that an Apache is a type
of helicopter.Identifying that\his"in the second sentence is coreferent with\Hussein
Obaiyat"and not\Yitzhak Eitan"requires further syntactic knowledge.
From a machine learning perspective,the EDT problem is hard because of the ne-
cessity for tying decisions together.That is,the decision at the end of the example in
Figure 1.2 that stipulates that\West Bank"is a named location is wholly tied to the
decision at the beginning of the example that the same string is also a named location.
Learning under the in uence of such mutually reinforced decisions is challenging.A
signicant contribution of this thesis is a technique for dealing with this diculty.
1.3 The Role of Search
Natural language processing problems like those discussed in Section 1.6|and structured
prediction problems more generally|all include a search component.This component is
inherantly tied to the fact that structured prediction involves producing something more
complex than a single scalar response.To nd the best (or approximate best) output,
some variety of search is necessary.
In real-world NLP applications,search comes in many avors.In very rare cases,
one can apply dynamic programming-based exact search techniques.This occurs most
frequently in sequence labeling problems or in natural language parsing.However,in
order to make the problems amenable to dynamic programming (and hence ecient),
restrictions must be placed on the models and feature spaces.In particular,the\Markov
assumption"must be used in sequence labeling tasks:this states that the features used
to predict the label for the word at position i can only refer to the k most recent other
labels (for typical k 2 f0;1;2g).In the case of parsing,a similar assumption is used:that
the grammar is context free.Although these assumptions patently violate what we know
about language,they are necessary for maintaining a polynomial time search algorithm.
1
See Appendix A.3 for a discussion of the computational complexity classes relevant to this thesis.
3
Unfortunately,being polynomial time is often not sucient in practice.For instance,
lexicalized context free parsing is O(N
6
),where N is the length of the sentence (Manning
and Schutze,2000).Even worse,synchronous context free parsing,as used in syntactic
machine translation,is O(N
12
),where N is the length of the input sentence (Huang
and Chiang,2005).Even simple sequence labeling is O(NK
2
),where N is the length
of the sentence and K is the number of possible labels.When K is very large (on the
order of hundreds),such as for phoneme recognition,K
2
is very costly (Pal,Sutton,and
McCallum,2006).In other applications,there simply is no polynomial time solution
under even very simplied models;see (Germann et al.,2003) for an example in machine
translation.
The eectively intractable (intractable or high-order polynomial) nature of these im-
portant problems has led to the use of approximate search algorithms.These include
greedy search (Germann et al.,2003),beam search (Och,Zens,and Ney,2003;Pal,Sut-
ton,and McCallum,2006),approximate A* search (Klein and Manning,2003b),lazy
pruning,hill-climbing search,and others (Russell and Norvig,1995).None of these al-
gorithms is guaranteed to nd the best possible output.In practice,this is a signicant
problem.Each requires domain-specic tweaking of search parameters to balance e-
ciency against search errors.Performing this tweaking well is often incredibly dicult.
1.4 Learning in Search
The canonical way of looking at structured prediction problems is as follows.First,one
constructs a model.This model eectively tells us:for a given input,what are all the
possible outputs.For instance,in machine translation,a phrase-based model tells us that
the set of possible translations for a given Arabic input sentence is the set of all English
sentences that can be derived through a sequence of phrase translation and reordering
steps.In sequence labeling,the model tells us all the possible output sequences for a
given input string (typically this is just the set of all sequences over an alphabet of tags
of equal length to the input sentence).
Once one has a model,one attaches features to that model.The goal of the features
is to identify characteristics of input/output pairs that are indicative of whether the
output is\good"or not.For translation,these features might look like phrase translation
probabilities.For sequence labeling,the features are often lexicaled pairs,such as\assign
labeldeterminer'to the wordthe'."The features come with corresponding parameters,
and the goal of learning is to adjust the parameters so that,for a given input,out of
all possible outputs considered by the model,the\correct one"has a high score.The
corresponding search problem is to nd the output with the highest score.
The approach advocated in this thesis falls under the heading of learning in search.
The key premise of this paradigm is that given that one will be applying search to nd
the best output,one should adjust the learning algorithm to account for this.This idea
has been previously explored by Boyan and Moore (1996),Collins and Roark (2004) and
me (Daume III and Marcu,2005c).However,the algorithm described in this thesis takes
this idea one step further.Instead of accounting for search in the process of learning,I
treat the structured prediction problem as being dened by a search process.The result
4
is that the role played originally by the model is now played by the specication of a
search algorithm,and the learning involved is only to learn how to search.
The specic algorithmI describe,Searn,works on the following basic principle.Each
decision made during search is treated as a (large) classication problem.The goal is to
learn a classier that will make each search decision optimally.The primary diculty is
that in order to dene\optimally"we must take into account what this same classier did
in the past search steps and what it will do in future search steps.I propose a relatively
straightforward iterative algorithm for optimizing in this chicken-and-egg situation.
1.5 Contributions
The primary contribution in this thesis is the development of an algorithm called Searn
(for\search-learn") for solving structured prediction problems under any model,any
feature functions and any loss.Unlike previous approaches to the structured prediction
problem (see Section 2.2),Searn makes no assumptions of conditional independence and
is computationally ecient in a superset of those problems to which competing generic
algorithms may be applied.
I formally show that Searn possesses many desirable properties (see Chapter 3).
Most importantly,I show that the dierence in performance between the model that
Searn learns and the best possible model is small (under certain conditions).This result
holds independent of the model structure or the feature functions and is a signicant
improvement over techniques whose performance depends strongly on the locality of fea-
tures in the output.More generally,I show that any problemthat can be solved eciently
by competing techniques can also be solved eciently by Searn.Finally,I show that
Searn is easily extended to hidden variable problems,both in the unsupervised and
semi-supervised settings,as well as learning under weak feedback (see Chapter 7).
In addition to having attractive theoretical properties,I show that Searn performs
very well in a set of diverse real-world problems.These problems include the standard
sequence labeling tasks considered by most other structured prediction techniques as well
as the more complex joint sequence labeling task (see Chapter 4).However,the true
test of Searn is in problems with more complex structure.I apply Searn to a complex
information extraction problem|entity detection and tracking|and obtain a state-of-
the-art model (see Chapter 5).Finally,I apply Searn in the development of a novel
model for automatic summarization (see Chapter 6) that easily surpasses the limitations
of any other current structured prediction technique.
In addition to the main contributions described above,the development of Searn
has led to several other results.The most signicant secondary result is that,to my
knowledge,Searn is the rst algorithm to show a strong connection between structured
prediction and reinforcement learning.This connection alone opens up the possibility for
many avenues of future research (some of which are discussed in Chapter 7).Additionally,
this thesis opens up the possibility to ask new interesting questions about the connection
between computational complexity,search and learning (also discussed in Chapter 7).
Finally,I will make available many of the applications developed in this thesis to the
general public to allow others to benet from this work.
5
1.6 An Overview of This Thesis
This thesis is presented in three parts.The rst part,comprising the next two chapters,
focuses on structured prediction as a machine learning problem.This part concludes
with a description of my structured prediction algorithm,Searn.The second part of
the thesis,comprising Chapter 4 though Chapter 6,discusses the application of Searn
to three problems in NLP (one problem per chapter).The third and nal part of the
thesis concludes and presents preliminary results on extensions to the Searn algorithm
in more complex settings.
The breakdown of this thesis makes it inappropriate to discuss\prior work"in a single
information on machine learning and structured prediction.It will not discuss any prior
work on any of the applications I consider.Subsequent chapters will include their own
prior work sections at the end.This organization allows easy referencing between my
work and that of others.It also enables more discussion of the pros and cons of my
approach in comparison to prior work.
The chapters in this thesis are organized as follows:
Part I:Machine Learning
Chapter 2 introduces relevant background from machine learning.The chapter intro-
duces the relevant statistical learning theory necessary to understand the remainder
of the thesis as well as the notion of loss-driven learning.This chapter also formally
denes the notion of a learning reduction that I make heavy use of in the develop-
ment of my own algorithm,Searn.It concludes with a discussion of prior work on
Chapter 3 introduces my algorithm,Searn,for solving structured prediction prob-
lems.This chapter also contains the bulk of the theoretical results pertaining to
Searn and describes the connections between structured prediction and reinforce-
ment learning.Chapter 3 concludes with a comparison of Searn to prior work in
structured prediction.
Part II:Applications
Chapter 4 begins a sequence of three chapters on experimental results with Searn.
This chapter focuses on the simplest problem:sequence labeling.I describe how
to apply Searn to this problem and present results on three data sets:syntactic
chunking,named entity recognition in Spanish and handwriting recognition.I then
present the results of applying Searn to a joint sequence labeling task:simultane-
ous part of speech tagging and syntactic chunking.
Chapter 5 describes the application of Searn to the entity detection and tracking prob-
lem introduced in Section 1.2.In this chapter,I discuss both the algorithmic and
search issues involved in the EDT task as well as the task of developing useful
features for this problem.I report the eects of various knowledge sources on
the EDT problem:lexical,syntactic,semantic and knowledge-based,and nd that
knowledge-based features prove incredibly useful for this problem.
6
Chapter 6 applies Searn to a set of summarization models.These models truly stretch
the applicability of generic structured prediction techniques and show that it is
possible to optimize a structured prediction model against a weaker variety of loss
function than I consider in the other experimental setups.
Part III:Future Work
Chapter 7 describes two extensions to Searn.The rst is a methodology for apply-
ing Searn to hidden variable models,such as those commonly used in machine
translation.The second is a technique for improving Searn-learned models on the
basis of weak user feedback.I present proof-of-concept experimental results in word
alignment and summarization.I then conclude the thesis by summarizing the im-
portant contributions and looking forward to future research,both theoretical and
practical.
7
Chapter 2
Machine Learning
One goal of this thesis is to develop a learning framework that is able to learn to predict
complex,structured outputs with highly interdependent features,as typied by the entity
detection and tracking problem.This chapter presents the background material necessary
to understand my contributions in this area.
There are three primary sections in this chapter.In Section 2.1,I introduce back-
ground information in non-structured statistical learning.This second focuses on three
popular algorithms for binary classication:the perceptron,logistic regression and the
support vector machine.In Section 2.2,I introduce the current state-of-the-art structured
prediction techniques.These techniques can be seen as extensions of the previously de-
scribed binary classication algorithms to the structured prediction domain.Finally,in
Section 2.3,I describe the technique of learning reductions.Reductions are a technique
for transforming a hard learning problem into an easier learning problem and form the
theoretical basis of my algorithm for solving structured prediction problems.
2.1 Binary Classication
Supervised learning aims to learn a function f that maps an input x 2 X to an output
y 2 Y.The standard supervised learning setting typically focuses on binary classication
(Y = f1;+1g),multiclass classication (Y = f1;:::;Kg for a small K),or regression
(Y = R).For an example of binary classication,we might want to predict whether
or not it will be sunny tomorrow on the basis of past weather data.Such a decision
will be made on the basis of a feature function,denoted :X!F,where F is the
\feature space."In our example,(x) might encode information such as temperature,
atmospheric pressure and time of year.Typically,F = R
D
,the D-dimension real vector
space.
The general hypothesis class we consider is that of linear classiers (i.e.,biased hyper-
planes)
1
.That is,we parameterize our binary classication function by a weight vector
w 2 R
D
and a scalar b 2 R.The classication function is given in Eq (2.1).
1
The restriction to linear classiers may seem overly restrictive (for instance,linear classiers cannot
correctly solve the\XOR problem").However,by employing kernels,one can convert most of the algo-
rithms I describe in this chapter into non-linear classiers.The use of kernels is a bit outside the scope
of this thesis,so I do not discuss them further.See (Burges,1998;Daume III,2004a;Christianini and
Shawe-Taylor,2000) for further discussion.
8
f(x;w;b) = w
>
(x) +b =
X
d
w
d
(x)
d
+b (2.1)
The classication decision is according to the sign of f.That is,if f(x) > 0 then we
decide the class is +1 and if f(x) < 0 then we decide the class is 1.
Once we have restricted ourselves to the linear hypothesis class,the learning problem
becomes that of nding\good"values of w and b.These values are learned on the basis
of a nite data sample hx
n
;y
n
i
1:N
of training examples.Exactly how we dene\good"
determines the algorithm we choose to use.Nevertheless,all three algorithms we discuss
have the same basic avor for how they dene\good."Each involves two components:
1.Fitting the data.The algorithms attempt to nd parameters that correctly classify
the training data,or at least make few mistakes.Moreover,the algorithms disprefer
weight vectors that over-classify the negative examples:yf(x) = 2 is worse than
yf(x) = 1 for an incorrectly classied example.
2.Not over-tting the training data.Often by having some very large components in
the weight vector,our learned function is able to trivially predict the training data,
but does not generalize to new data.By requiring that the weight vector is small
(or sparse),we aid generalization ability.
2.1.1 Perceptron
The perceptron algorithm (Rosenblatt,1958) learns a weight vector w and bias b in an
online fashion.That is,it processes the training set one example at a time.At each step,
it ensures that the current parameters correctly classify the training example.If so,it
proceeds to the next example.If not,it moves the weight vector and bias closer to the
current example.The algorithm repeatedly loops over the training data until either no
further updates are made or a maximum iteration count has been reached.
It can be shown that,if possible,the perceptron algorithm will eventually converge to
a setting of parameter values that correctly classies the entire data set.Unfortunately,
this often leads to poor generalization.Improved generalization ability is available by
using weight averaging.Weight averaging is accomplished by modifying the standard
perceptron algorithm so that the nal weights returned are the average of all weight
vectors encountered during the algorithm.In can be shown that weight averaging leads
to a more stable solution with better expected generalization (Freund and Shapire,1999;
Gentile,2001).
Averaging can be navely accomplished by maintaining two sets of parameters:the
current parameters and the averaged parameters.At each step of the algorithm (after
processing a single example),the current parameters are added to the averaged parame-
ters.Once the algorithm completes,the averaged parameters are divided by the number
of steps and returned as the nal parameters.
Unfortunately,this nave algorithmis terribly inecient.First,we would like to avoid
adding the entire weight vector to the averaged vector in each iteration.We would only
like to make the addition when an update is made.Moreover,the vectors (x) are often
sparse.This makes the update to the true weight vector ecient,but the sum of the
9
Algorithm AveragedPerceptron(x
1:N
;y
1:N
;I)
1:w
0
h0;:::;0i,b
0
0
2:w
a
h0;:::;0i,b
a
0
3:c 1
4:for i = 1:::I do
5:for n = 1:::N do
6:if y
n

w
0
>
(x
n
) +b
0

 0 then
7:w
0
w
0
+y
n
(x
n
),b
0
b
0
+y
n
8:w
a
w
a
+cy
n
(x
n
),b
a
b
a
+cy
n
9:end if
10:c c +1
11:end for
12:end for
13:return (w
0
w
a
=c;b
0
b
a
=c)
Figure 2.1:The averaged perceptron learning algorithm.
weights and the averaged weights inecient.It turns out we can get around both of these
problems very straightforwardly.
An ecient implementation of the averaged perceptron training algorithmis shown in
Figure 2.1.In step (1),the running weight vector and bias are initialized to zero.In step
(2),the averaged weight vector and bias are initialized to zero.In step (3),the averaging
count is initialized to 1.The algorithm then runs for I iterations.In each iteration,
the algorithm processes each example.Step (6) checks to see if the algorithm currently
classies example hx
n
;y
n
i incorrectly.The example is classied incorrectly exactly when
y
n
and the current prediction w
0
>
(x
n
) +b
0
have a dierent sign:when their product
is negative.
If the current example hx
n
;y
n
i is misclassied by the current parameters (w
0
;b
0
),
then in step (7),the algorithm moves w
0
closer to y
n
(x
n
) and b
0
closer to y
n
.In step
(8),the averaged weights are updated in the same way,but where the averaging count
c is used as a multiplicative factor.Finally,in step (10),regardless of whether an error
was made or not,c is incremented.
After the algorithmhas nished,the nal parameters are returned.The non-averaged
version would simply return w
0
and b
0
returns (w
0
w
a
=c) and (b
0
b
a
=c).It is straightforward to show that this accomplishes
weight averaging as desired.
2.1.2 Logistic Regression
Logistic regression is a second popular binary classication method.It is identical to
binary maximum entropy classication in practice,though the derivation of the two for-
mulations diers.Logistic regression assumes that the conditional probability of the class
y is proportional to expf(x).This is given in Eq (2.2).
10
p(y j x;w;b) =
1
Z
x;w;b
exp

y

w
>
(x) +b

(2.2)
=
1
1 +exp

2y

w
>
(x) +b

Like the perceptron,the classication decision is based on the sign of f(x).
To train a logistic regression classier,one attempts to nd parameters w and b that
maximize the likelihood (probability) of the training data.Thus,logistic regression is
a maximum likelihood classier.This accomplishes our goal of performing well on the
training data,but does not explicitly seek small weights.To accomplish the latter,a
prior is placed over the weights.This is typically taken to be a zero-mean,spherical
Gaussian with variance 
2
(Chen and Rosenfeld,1999),though alternative priors have
been employed (Goodman,2004).This transforms logistic regression from a maximum
likelihood method to a maximum a posteriori method,where the posterior distribution
over weights given the training data is given in Eq (2.3).
p

w;b j hx
n
;y
n
i
1:N
;
2

/p

w j 
2

N
Y
n=1
p(y
n
j x
n
;w;b) (2.3)
/exp

1

2
jjwjj
2

N
Y
n=1
1
1 +exp

2y
n

w
>
(x
n
) +b

Originally,this maximization problem was solved using iterative scaling methods
(Berger,1997).Unfortunately,these techniques are quite inecient in practice.Re-
limited-memory BFGS (Nash and Nocedal,1991;Averick and More,1994) have enjoyed
great success (Minka,2001;Malouf,2002;Minka,2003;Daume III,2004b).Both of these
techniques rely on the ability to compute the gradient of Eq (2.3) with respect to w and
b.This is easier if,instead of maximizing the posterior,we instead maximize the log
posterior.The log posterior is given in Eq (2.4) and its gradient in given in Eq (2.5),
where C is independent of w and b.
log p(w;b) = 
1

2
jjwjj
2

N
X
n=1
log
h
1 +exp

2y
n

w
>
(x
n
) +b

i
+C (2.4)
@
@w
log p(w;b) = 
1
2
2
w+2
N
X
n=1
y
n
(x
n
)

1
1 +exp[2y
n
w
>
(x
n
)]

(2.5)
In the binary classication case,one can explicitly compute the second order informa-
tion required to directly apply a conjugate gradient method.For multiclass classication,
this is not possible,and an approximate Hessian method such as limited memory BFGS
11
results and (Daume III,2004b) for a description of an ecient implementation.
2.1.3 Support Vector Machines
Support vector machines provide an alternative formulation of the learning problem in
terms of a formal optimization problem (Boser,Guyon,and Vapnik,1992).SVMs are
based on the large margin framework.This framework states that if we have to choose
between two settings of parameters,we should choose the one that maximizes the distance
between the corresponding hyperplane and the nearest data point on either side.Such
large margin solutions are intuitively appealing because they are robust against small
changes in the data.Theoretically,it can be shown that maintaining a large margin will
lead to good generalization (Vapnik,1979;Vapnik,1995).Furthermore,it is straight-
forward to show that the parameters have a large margin if and only if jjwjj is small
(independent of b).
For a moment we restrict ourselves to the simplied problem of separable training
data (with a margin of 1)
2
.That is,there exists setting of the parameters so that we
can perfectly classify the training data with a large margin.This leads to the simplest
formulation of the SVM,given in Eq (2.6).
minimize
w;b
1
2
jjwjj
2
(2.6)
subject to y
n

w
>
(x
n
) +b

 1 8n
The SVM optimization problem states that we wish to nd a weight vector w and
bias b with minimum norm.The constraints state that,for each data point hx
n
;y
n
i the
given parameters over-classify this example.That is,the example would be correctly
classied if the product in the constraints were always greater than zero,but here we
require the stronger condition that it be greater than one.
In many cases this optimization problem will be infeasible:there will not exist a
parameter setting that obeys the constraints.Moreover,even for separable data,we often
do not wish to force the algorithm to actually achieve perfect classication performance
on the training data (for instance,if there are any errors on the data).This leads to
the soft-margin formulation of the SVM.The idea in the soft-margin SVM is that we no
longer require all examples to be over-classied with a margin of one.However,for every
example that does not obey this constraint,we measure how far we would have to\push"
that example in order to achieve the desired hard-margin constraint.This measurement
is known as the\slack"of the corresponding example.This leads to the formulation
shown in Eq (2.7).
minimize
w;b
1
2
jjwjj
2
+C
N
X
n=1

n
(2.7)
2
The margin is simply the smallest value of y
n
f(x
n
) across the entire data set.
12
subject to y
n

w
>
(x
n
) +b

 1 
n
8n

n
 0
In the soft-margin formulation,our objective function includes two components.The
rst (small norm) forces the SVM to nd a solution that is likely to generalize well.The
second (small sumof slack variables ) forces the SVMto classify most of the training data
correctly.The hyper-parameter C  0 controls the trade-o between tting the training
data and nding a small weight vector.As C tends toward innity,the soft-margin SVM
approaches the hard-margin SVM and all the training data must be correctly classied.
As C tends toward zero,the SVM cares less and less about correctly classifying the
training data and simply seeks a small weight vector.
In the constraints of the soft-margin SVM formulation,we now require that each
example be over-classied by 1  
n
rather than 1.If parameters can be found that
classies each example with a margin of 1,then the 
n
s can be made to all be zero.
However,for inseparable data,these slack variables account for the training error.While
there are as many constraints as data points,it can be shown by the Karush-Kuhn-Tucker
conditions (Bertsekas,Nedic,and Daglar,2003) that at the optimal weight vector,only
very few of these are\active."That is,at the optimal values of w and b,y
n

w
>
(x
n
)+b

is strictly greater than one and are hence inactive for many n.The examples n that are
active are called the support vectors because those are the only examples that have any
aect on the classication decision.In particular,wcan be written as a linear combination
of the support vectors,ignoring the rest of the training data.
There are many algorithms for solving the SVM problem.The most straightforward
is to treat it directly as a quadratic programming problem (Bertsekas,Nedic,and Daglar,
2003) and apply a generic optimization package,such as CPLEX (CPLEX Optimization,
1994).However,the very special formof the optimization problem(namely the sparsity of
the constraints) has lead to the development of specialized algorithms,such as sequential
minimal optimization (Platt,1999).More recently,however,it has been recognized that
simple gradient-based techniques can lead to highly ecient solutions to the SVMproblem
(Wen,Edelman,and Gorsich,2003;Ratli,Bagnell,and Zinkevich,2006).
2.1.4 Generalization Bounds
One of the most fundamental theoretical questions about classication problems is the
question of generalization:how well will we do on\test data."This question is usually
answered in the form\with high probability,the error we observe on unseen test data
will be at most the error we incur on the training data plus a regularization term."
The regularization term typically makes use of quantities such as the number of training
examples,the number of features,and the\size"(or complexity) of the weight vector.
In order to prove statements of this form,one needs to make assumptions about the
relationship between the training data and the test data.In particular,we have to assume
that the training data is representative of the test data.This is formalized as saying that
there is a xed,but unknown,probability distribution D and the training data and test
data are both sampled from D.This is the identicality assumption.The second assump-
tion is to assure us that our training data is representative of the entire distribution D.
13
We assume that the training data is drawn independently from D.Formally,if we knew
D,then,conditional on D,the points in the training data would be independent.When
the training data obeys these properties,we say that it is independently and identically
distributed from D (or,\i.i.d."from D).The i.i.d.assumption underlies the majority of
the theoretical work on generalization bounds.
For concreteness,consider the support vector machine.Denote by L
emp
(D;f) the
average empirical loss (Eq (2.8)) over the training data D for the classier f.Denote by
L
exp
(D;f) the expected loss (Eq (2.9)) of the classier f over data drawn i.i.d.from a
distribution D.
L
emp
(D;f) =
1
N
N
X
n=1
1(y
n
6= f(x
n
)) (2.8)
L
exp
(D;f) = E
(x;y)D

1(y 6= f(x))

(2.9)
A (comparatively) simple generalization bound for the SVM takes the form of The-
orem 2.1.Note that,depending on stronger assumptions,stronger bounds are available
(Bartlett and Shawe-Taylor,1999;Zhang,2002;McAllester,2003;McAllester,2004;
Langford,2005).This one was chosen because it is comparatively easier to state.
Theorem 2.1 (SVM Generalization;(Langford and Shawe-Taylor,2002)).For
all averaging classiers c with normalized weights w,for all error rates  > 0 and all
margins > 0,Eq (2.10) holds with probability greater than 1  over training sets S of
size m drawn i.i.d.from a distribution D.
KL(^e

(c) + jj e(c) ) 
1
m

2 ln
m+1

ln

F

F
1
(e)


(2.10)
where

F(x) is the tail probability of a zero-mean,unit variance Gaussian,e

(c) is the
expected margin-error rate for the classier c with respect to a margin and e(c) is the
error of the classier c (i.e.,e(c) = e
0
(c)).
This theorem works as follows.We are comparing the empirical error (on the lhs of
the KL) of the classier to the true error (on the rhs of the KL),modulo a xed error
rate .We desire the divergence between these error distributions to be small because
this would imply that our estimated empirical error is close to what we expect to see
on test data.The theorem states that this divergence is bounded by a term that scales
roughly as 1=m,where m is the number of training points,and roughly as ln

F(1= ),
where is the margin.In particular,as mincreases,the bound becomes tighter.Also,as
increases,the bound becomes tighter.Thus,to achieve good generalization,one wants
a lot of data and a large margin.
The important things to note about Theorem 2.1 are the following.First,it assumes
that the training data is i.i.d.(this is the standard assumption).Second,the bound
improves as the weight vector shrinks (i.e.,as the margin increases).Third,the bound
improves as the number of training examples grows.This provides some theoretical
justication for the SVM formulation.
14
-4
-3
-2
-1
0
1
2
3
4
0
1
2
3
4
5
6
7
8
0/1 LossHinge LossSquared LossLog LossExp Loss
Figure 2.2:Plot of several convex approximations to the zero-one loss function.
2.1.5 Summary of Learners
The learners described in this section|the Perceptron,maximum entropy models and
support vector machines|are eective solutions to the binary classication problem.
In general,support vector machines tend to outperform the perceptron and maximum
entropy models empirically.However,they do so at a non-trivial computational cost.
The perceptron is highly ecient and often reaches a reasonable solution even after only
one pass through the training data.Maximum entropy models,while slightly slower,still
operate at a speed of roughly O(N).SVMs,contrastively,often scale at least as O(N
2
)
if not O(N
3
).For large data sets this can render them intractable.
Despite these dierences,these three models are not so dissimilar.In fact,when
optimized using sub-gradient methods (Zinkevich,2003;Ratli,Bagnell,and Zinkevich,
2006),SVMs are exactly the result of adding regularization and margins to the percep-
tron (Collobert and Bengio,2004).In particular,the\update"term in the perceptron
happens not only when a mistake is made,but when an example is not over-classied.
Furthermore,weights are shrunk at every iteration toward zero according to the regular-
ization parameter C.On the other hand,the perceptron can also be seen as a stochastic
approximation to the gradient for maximum entropy models when the log normalizing
constant is approximated with a max rather than a sum (Collins,2002).
These similarities can be seen more clearly by examining the exact loss function
optimized by the three learners.In Figure 2.2,I have plotted these (and other) loss
functions.In this graph,I plot the prediction yf(x) along the x-axis and the loss along
the y-axis.The most basic loss,0/1 loss,is the desired loss.It is a step-function that
is zero when yf(x) > 0 and one otherwise.This is the loss function that the perceptron
optimizes.In general,however,it is a dicult function to optimize:neither is it convex
nor dierentiable.The other functions we consider are convex upper bounds on the 0/1
loss.For instance,the log loss,which is optimized by maximum entropy models,touches
the 0/1 loss at the corner and slowly falls to asymptote at the axis as yf(x)!1.
15
The hinge loss (also called the margin loss),which is optimized by the SVM,is a ramp
function that has slope 1 when yf(x) < 1 and is zero otherwise.Two other loss
functions|squared loss and exponential loss|are also shown;these are used in other
learning algorithms such as neural networks (Bishop,1995) and boosting (Schapire,2003;
Lebanon and Laerty,2002).Each of these loss functions has dierent advantages and
disadvantages;these are too deep and o-topic to attempt to discuss in the context of
this thesis.The interested reader is directed to (Bartlett,Jordan,and McAulie,2005)
for more in-depth discussions.
2.2 Structured Prediction
The vast majority of prediction algorithms,such as those described in the previous sec-
tion,are built to solve prediction problems whose outputs are\simple."Here,\simple"
is intended to include binary classication,multiclass classication and regression.(I
note in passing that some of the aforementioned algorithms are more easily adapted to
multiclass classication and/or regression than others.) In contrast,the problems I am
interested in solving are\complex."The family of generic techniques for solving such
\complex"problems are generally known as structured prediction algorithms or structured
learning algorithms.To date,there are essentially four state-of-the-art structured predic-
tion algorithms (with minor variations),each of which I brie y describe in this section.
However,before describing these algorithms in detail,it is worthwhile to attempt to for-
malize what is meant by\simple,"\complex"and\structure."It turns out that dening
these concepts is remarkably dicult.
2.2.1 Dening Structured Prediction
Structured prediction is a very slippery concept.In fact,of all the primary prior work that
proposes solutions to the structured prediction problem,none explicitly denes the prob-
lem (McCallum,Freitag,and Pereira,2000;Laerty,McCallum,and Pereira,2001;Pun-
Collins,and Pereira,2004;Tsochantaridis et al.,2005).In all cases,the problem is ex-
plained and motivated purely by means of examples.These examples include the following
problems:
 Sequence labeling:given an input sequence,produce a label sequence of equal
length.Each label is drawn from a small nite set.This problem is typied in NLP
by part-of-speech tagging.
 Parsing:given an input sequence,build a tree whose yield (leaves) are the elements
in the sequence and whose structure obeys some grammar.This problem is typied
in NLP by syntactic parsing.
 Collective classication:given a graph dened by a set of vertices and edges,pro-
duce a labeling of the vertices.This problem is typied by relation learning prob-
lems,such as labeling web pages given link information.
16
 Bipartite matching:given a bipartite graph,nd the best possible matching.This
problem is typied by (a simplied version of) word alignment in NLP and protein
structure prediction in computational biology.
There are many other problems in NLP that do not receive as much attention from
the machine learning community,but seem to also fall under the heading of structured
prediction.These include entity detection and tracking,automatic document summariza-
tion,machine translation and question answering (among others).Generalizing over these
examples leads us to a partial denition of structured prediction,which I call Condition
1,below.
Condition 1.In a structured prediction problem,output elements y 2 Y decompose into
variable length vectors over a nite set.That is,there is a nite M 2 N such that each
y 2 Y can be identied with at least one vector v
y
2 M
T
y
,where T
y
is the length of the
vector.
This condition is likely to be deemed acceptable by most researchers who are active
in the structured prediction community.However,there is a question as to whether it
is a sucient condition.In particular,it includes many problems that would not really
be considered structured prediction (binary classication,multitask learning (Caruana,
1997),etc.).This leads to a second condition that hinges on the formof the loss function.
It is natural to desire that the loss function does not decompose over the vector represen-
tations.After all,if it does decompose over the representation,then one can simply solve
the problem by predicting each vector component independently.However,it is always
possible to construct some vector encoding over which the loss function decomposes
3
This
means that we must therefore make this conditions stronger,and require that there is no
polynomially sized encoding of the vector over which the loss function decomposes.
Condition 2.In a structured prediction problem,the loss function does not decompose
over the vectors v
y
for y 2 Y.In particular,l(x;y;^y) is not invariant under identical
permutations of y and ^y.Formally,we must make this stronger:there is no vector
mapping y 7!v
y
such that the loss function decomposes,for which jv
y
j is polynomial in
jyj.
Condition 2 successfully excludes problems like binary classication and multitask
learning from consideration as structured prediction problems.Importantly,it excludes
standard classication problems and multitask learning.Interestingly,it also excludes
problems such as sequence labeling under Hamming loss (discussed further in Chap-
ter 4).Hamming loss (per-node loss) on sequence labeling problems is invariant over
permutations.This condition also excludes collective classication under zero/one loss
on the nodes.In fact,it excludes virtually any problem that one could reasonably hope
to solve by using a collection of independent classiers (Punyakanok and Roth,2001).
3
To do so,we encode the true vector in a very long vector by specifying the exact location of each
label using products of prime numbers.Specically,for each label k,one considers the positions i
1
;:::;i
Z
in which k appears in the vector.The encoded vector will contain p
i
1
1
p
i
2
2
   p
i
Z
Z
copies of element k,
where p
1
;:::is an enumeration of the primes.Given this encoding it is always possible to reconstruct
the original vector,yet the loss function will decompose.
17
The important aspect of Condition 2 is that it hinges on the notion of the loss function
rather than the features.For instance,one can argue that even when sequence labeling is
performed under Hamming loss,there is still important structural information.That is,
we\know"that by including structural features (such as Markov features),we can solve
4
The dierence between these two perspectives is
that under Condition 2 the loss dictates the structure,while otherwise the features dictate
the structure.Since when the world hands us a problem to solve,it hands us the loss but
not the features (the features are part of the solution),it is most appropriate to dene
the structured prediction problem only in terms of the loss.
Current generic structured prediction algorithms are not built to solve problems under
which Condition 2 holds.In order to facilitate discussion,I will refer to problems for
which both conditions hold as\structured prediction problem"and those for which only
Condition 1 holds as\decomposable structured prediction problems."I note in passing
that this terminology is nonstandard.
2.2.2 Feature Spaces for Structured Prediction
Structured prediction algorithms make use of an extended notion of feature function.For
structured prediction,the feature function takes as input both the original input x 2 X
and a hypothesized output y 2 Y.The value (x;y) will again be a vector in Euclidean
space,but which now depends on the output.In particular,in part of speech tagging,an
element in (x;y) might be the number of times the word\the"appears and is labeled
as a determiner and the next word is labeled as a noun.
All structured prediction algorithms described in this Chapter are only applicable
when  admits ecient search.In particular,after learning a weight vector w,one will
need to nd the best output for a given input.This is the\argmax problem"dened in
Eq (2.11).
^y = arg max
y2Y
w
>
(x;y) (2.11)
This problemwill not be tractable in the general case.However,for very specic Y and
very specic ,one can employ dynamic programming algorithms or integer programming
algorithms to nd ecient solutions.In particular,if  decomposes over the vector
representation of Y such that no feature depends on elements of y that are more than
k positions away,then the Viterbi algorithm can be used to solve the argmax problem
in time O(M
k
) (where M is the number of possible labels,formally from Condition 1).
This case includes standard sequence labeling problems under the Markov assumption as
well as parsing problems under the context-free assumption.
2.2.3 Structured Perceptron
The structured perceptron is an extension of the standard perceptron (Section 2.1.1) to
structured prediction (Collins,2002).Importantly,it is only applicable to the problem
4
This is actually not necessarily the case;see Section 4.2 for an extended discussion.
18
AlgorithmAveragedStructuredPerceptron(x
1:N
;y
1:N
;I)
1:w
0
h0;:::;0i
2:w
a
h0;:::;0i
3:c 1
4:for i = 1:::I do
5:for n = 1:::N do
6:^y
n
arg max
y2Y
w
0
>
(x
n
;y
n
)
7:if y
n
6= ^y
n
then
8:w
0
w
0
+(x
n
;y
n
) (x
n
;^y
n
)
9:w
a
w
a
+c(x
n
;y
n
) c(x
n
;^y
n
)
10:end if
11:c c +1
12:end for
13:end for
14:return w
0
w
a
=c
Figure 2.3:The averaged structured perceptron learning algorithm.
of 0/1 loss over Y:that is,l(x;y;^y) = 1(y 6= ^y).As such,it only solves decomposable
structured prediction problems (0/1 loss is trivially invariant under permutations).Like
all the algorithms we consider,the structured perceptron will be parameterized by a
weight vector w.The structured perceptron makes one signicant assumption:that
Eq (2.11) can be solved eciently.
Based on the argmax assumption,the structured perceptron constructs the perceptron
in nearly an identical manner as for the binary case.While looping through the training
data,whenever the predicted ^y
n
for x
n
diers from y
n
,we update the weights according
to Eq (2.12).
w w+(x
n
;y
n
) (x
n
;^y
n
) (2.12)
This weight update serves to bring the vector closer to the true output and further
from the incorrect output.As in the standard perceptron,this often leads to a learned
model that generalizes poorly.As before,one solution to this problemis weight averaging.
This behaves identically to the averaged binary perceptron and the full training algorithm
is depicted in Figure 2.3.
The behavior of the structured perceptron and the standard perceptron are virtually
identically.The major changes are as follow.First,there is no bias b.For structured
problems,a bias is irrelevant:it will increase the score of all hypothetical outputs by the
same amount.The next major dierence is in step (6):the best scoring output ^y
n
for
the input x
n
is computed using the arg max.After checking for an error,the weights are
updated,according to Eq (2.12),in steps (8) and (9).
19
2.2.4 Incremental Perceptron
The incremental perceptron (Collins and Roark,2004) is a variant on the structured per-
ceptron that deals with the issue that the arg max in step 6 may not be analytically
available.The idea of the incremental perceptron (which I build on signicantly in Chap-
ter 3) is to replace the arg max with a beam search algorithm.Thus,step 6 becomes
\^y
n
BeamSearch(x
n
;w
0
)".The key observation is that it is often possible to detect
in the process of executing search whether it is possible for the resulting output to ever
be correct.For instance,in sequence labeling,as soon as the beam search algorithm has
made an error,we can detect it without completing the search (for standard loss function
and search algorithms).The incremental perceptron aborts the search algorithm as soon
as it has detected that an error has been made.Empirical results in the parsing domain
have shown that this simple modication leads to much faster convergence and superior
results.2.2.5 Maximum Entropy Markov Models
The maximum entropy Markov model (MEMM) framework,pioneered by McCallum,
Freitag,and Pereira (2000) is a straightforward application of maximum entropy models
(aka logistic regression models,see Section 2.1.2) to sequence labeling problems.For
those familiar with the hidden Markov model framework,MEMMs can be seen as HMMs
where the conditional\observation given state"probabilities are replaced with direct
\state given observation"probabilities (this leads to the ability to include large numbers
of overlapping,non-independent features).In particular,a rst-order MEMM places the
conditional distribution shown in Eq (2.13) on the nth label,y
n
,given the full input x,
the previous label,y
n1
,a feature function  and a weight vector w.
p(y
n
j x;y
n1
;w) =
1
Z
x;y
n1
;w
exp

w
>
(x;y
n
;y
n1
)

(2.13)
Z
x;y
n1
;w
=
X
y
0
2Y
n
exp

w
>
(x;y
0
;y
n1
)

The MEMM is trained by tracing along the true output sequences for the training
data and using the true y
n1
to generate training examples.This process simply produces
multiclass classication examples,equal in number to the number of labels in all of the
training data.Based on this data,the weight vector w is learned exactly as in standard
maximum entropy models.
At prediction time,one applies the Viterbi algorithm,as in the case of the structured
perceptron,to solve the\arg max"problem.Importantly,since the true values for y
n1
are not known,one uses the predicted values of y
n1
the nth value (albeit,in the context of Viterbi search).As I will discuss in depth in
Section 3.4.5,this fact can lead to severely suboptimal results.
20
2.2.6 Conditional Random Fields
While successful in many practical examples,maximum entropy Markov models suf-
fer from two severe problems:the\label-bias problem"(both Laerty,McCallum,and
Pereira (2001) and Bottou (1991) discuss the label-bias problem in depth) and a lim-
itation to sequence labeling.Conditional random elds are an alternative extension of
logistic regression (maximumentropy models) to structured outputs (Laerty,McCallum,
and Pereira,2001).Similar to the structured perceptron,a conditional random eld does
not employ a loss function.It optimizes a log-loss approximation to the 0/1 loss over
the entire output.In this sense,it is also a solution only to a decomposable structured
prediction problems.
The actual formulation of conditional random elds is identical to that for multi-
class maximum entropy models.The CRF assumes a feature function (x;y) that maps
input/output pairs to vectors in Euclidean space,and uses a Gibbs distribution parame-
terized by w to model the probability,Eq (2.14).
p(y j x;w) =
1
Z
x;w
exp

w
>
(x;y)

(2.14)
Z
x;w
=
X
y
0
2Y
exp

w
>
(x;y
0
)

(2.15)
Here,Z
x;w
(known as the\partition function") is the sum of responses of all incorrect
outputs.Typically,this set will be too large to sum over explicitly.However,if  is
chosen properly and if Y is a simple linear-chain structure,this sum can be computed
using dynamic programming techniques (Laerty,McCallum,and Pereira,2001;Sha and
Pereira,2002).In particular, must be chosen to obey the Markov property:for a
Markov length of l,no feature can depend on elements of y that are more than l positions
apart.The algorithmassociated with the sumis nearly identical to the forward-backward
algorithm for hidden Markov models (Baum and Petrie,1966) and scales as O(NK
l
),
where N is the length of the sequence,K is the number of labels and l is the\Markov
order"used by .
Just as in maximum entropy models,the weights w are regularized by a Gaussian
prior and the log posterior distribution over weights is as in Eq (2.16).
log p

w j D;
2

= 
1

2
jjwjj
2
+
N
X
n=1
24
w
>
(x
n
;y
n
) log
X
y
0
2Y
exp
h
w
>
(x
n
;y
0
)
i
35
(2.16)
Finding optimal weights can be solved either using iterative scaling methods (Laerty,
McCallum,and Pereira,2001) or more complex optimization strategies such as BFGS
(Sha and Pereira,2002;Daume III,2004b) or stochastic meta-descent (Schraudolph and
Graepel,2003;Vishwanathan et al.,2006).In practice,the latter two are much more
ecient.In practice,in order for full CRF training to be practical,we must be able to
eciently compute both the arg max from Eq (2.11) and the log normalization constant
from Eq (2.17).
21
log Z
x;w
= log
X
y
0
2Y
exp

w
>
(x;y
0
)

(2.17)
So long as we can compute these two quantities,CRFs are a reasonable choice for
solving the decomposable structured prediction problemunder the log-loss approximation
to 0/1 loss over Y.See (Sutton and McCallum,2006) and (Wallach,2004) for in-depth
introductions to conditional random elds.
2.2.7 Maximum Margin Markov Networks
The Maximum Margin Markov Network (M
3
N) formalism considers the structured pre-
Taskar et al.,2005),following the formalism for the support vector machine for binary
classication.Recall from Section 2.1.3 that the SVMformulation sought a weight vector
with small norm (for good generalization) and which achieved a margin of at least one on
all training examples (modulo the slack variables).The M
3
N formalism extends this to
structured outputs under a given loss function l by requiring that the dierence in score
between the true output y and any incorrect output ^y is at least the loss l(x;y;^y) (modulo
slack variables).That is:the M
3
N framework scales the margin to be proportional to
the loss.This is given formally in Eq (2.18).
minimize
w
1
2
jjwjj
2
+C
N
X
n=1
X
^y

n;^y
(2.18)
subject to w
>
(x
n
;y
n
) w
>
(x
n
;^y)  l(x
n
;y
n
;^y) 
n;^y
8n;8^y 2 Y

n;^y
 0 8n;8y
0
2 Y
One immediate observation about the M
3
N formulation is that there are too many
constraints.That is,the rst set of constraints is instantiated for every training instance
n and for every incorrect output ^y.Fortunately,under restrictions on Y and ,it is
possible to replace this exponential number of constraints with a polynomial number.In
particular,for the special case of sequence labeling under Hamming loss (a decomposable
structured prediction problem),one needs only one constraint per element in an example.
In the original development of the M
3
2003),this optimization problem was solved using an active set formulation similar to
the SMO algorithm (Platt,1999).Subsequently,more ecient optimization techniques
have been proposed,including ones based on the exponentiated gradient method (Bartlett
method (Bagnell,Ratli,and Zinkevich,2006).Of these,the last two appear to be the
most ecient.In order to employ these methods in practice,one must be able to compute
both the arg max from Eq (2.11) as well as a so-called\loss-augmented search"problem
given in Eq (2.19).
S(x;y) = arg max
^y2Y
w
>
(x;^y) +l(x;y;^y) (2.19)
22
In order for this to be eciently computable,the loss function is forced to decompose
over the structure.This implies that M
3
Ns are only (eciently) applicable to decompos-
able structured prediction problems.Nevertheless,they are applicable to a strictly wider
set of problems than CRFs for two reasons.First,M
3
Ns do not have a requirement that
the log normalization constant (Eq (2.17)) be eciently computable.This alone allows
optimization in M
3
Ns for problems that would be F#P-complete for CRFs (Taskar et
al.,2005).Second,M
3
Ns can be applied to loss functions other than 0/1 loss over the
entire sequence.However,in practice,they are essentially only applicable to a hinge-loss
approximation to Hamming loss over Y.
2.2.8 SVMs for Interdependent and Structured Outputs
The Support Vector Machines for Interdependent and Structured Outputs (SVM
struct
)
formalism (Tsochantaridis et al.,2005) is strikingly similar to the M
3
N formalism.The
dierence lies in the fact that the M
3
N framework scales the margin by the loss,while the
SVM
struct
formalism scales the slack variables by the loss.The quadratic programming
problem for the SVM
struct
is given as:
minimize
w
1
2
jjwjj
2
+C
X
n
X
^y

n;^y
(2.20)
subject to w
>
(x
n
;y
n
) w
>
(x
n
;y
0
)  1 

n;y
0
l(x
n
;y
n
;y
0
)
8n;8y
0
2 Y

n;y
0  0 8n;8y
0
2 Y
The objective function is the same in both cases;the only dierence is found in the rst
constraint.Dividing the slack variable by the corresponding loss is akin to multiplying the
slack variables in the objective function by the loss (in the division,we assume 0=0 = 0).
Though,to date,the SVM
struct
framework has generated less interest than the M
3
N
framework,the formalism seems more appropriate.It is much more intuitive to scale the
training error (slack variables) by the loss,rather than to scale the margin by the loss.
This advantage is also claimed by the original creators of the SVM
struct
framework,in
which they suggest that their formalism is superior to the M
3
N formalism because the
latter will cause the system to work very hard to separate very lossful hypotheses,even
if they are not at all confusable for the truth.
In addition to the dierence in loss-scaling,the optimization techniques employed
by the two techniques dier signicantly.In particular,the decomposition of the loss
function that enabled us to remove the exponentially many constraints does not work
in the SVM
struct
optimization procedure,in which constraints are added in an\as needed"basis.It can
be shown that this will converge to a solution within  of the optimal in a polynomial
number of steps.
The primary disadvantage to the SVM
struct
framework is that it is often dicult to op-
timize.However,unlike the other three frameworks described thus far,the SVM
struct
does
not assume that the loss function decomposes over the structure.However,in exchange
23
for this generality,the loss-augmented search problem for them SVM
struct
framework be-
comes more dicult.In particular,while the M
3
N loss-augmented search (Eq (2.19)) as-
sumes decomposition in order to remain tractable,the loss-augmented search (Eq (2.21))
for the SVM
struct
framework is often never tractable.
S(x;y) = arg max
^y2Y

w
>
(x;^y)

l(x;y;^y) (2.21)
The dierence between the two requirements is that in the M
3
N case,the loss appears
as an additive term,while in the SVM
struct
case,the loss appears as a multiplicative term.
In practice,for many problems,this renders the search problem intractable.
2.2.9 Reranking
Reranking is an increasingly popular technique for solving complex natural language
processing problems.The motivation behind reranking is the following.We have access
to a method for solving a problem,but it is dicult or impossible to modify this method
to include features we want or to optimize the loss function we want.Assuming that
this method can produce a\n-best"list of outputs (instead of just outputting what it
thinks is the single best output,it produces many best outputs),we can attempt to
build a second model for picking an output from this n-best list.Since we are only ever
considering a constant-sized list,we can incorporate features that would otherwise render
the argmax problem intractable.Moreover,we can often optimize a reranker to a loss
function closer to the one we care about (in fact,we can do so using techniques described
in Section 2.3).Based on these advantages,reranking has been applied in a variety of
NLP problems including parsing (Collins,2000;Charniak and Johnson,2005),machine


text:
# zbMATH — the first resource for mathematics

Diffusions hypercontractives. (French) Zbl 0561.60080
Sémin. de probabilités XIX, Univ. Strasbourg 1983/84, Proc., Lect. Notes Math. 1123, 177-206 (1985).
[For the entire collection see Zbl 0549.00007.]
Let $$(P_ t)$$ be a Markovian semigroup of diffusion with infinitesimal generator L and stationary probability $$\mu$$. The hypercontractivity of $$(P_ t)$$ means that there exists a constant $$\lambda >0$$ such that for all $$p\geq 1$$, $$q\geq 1$$, $$t>0$$, satisfying $$q-1\leq (p-1)e^{\lambda t}$$, $$\| P_ tf\|_{L^ q}\leq \| f\|_{L^ p}$$, $$f\in L^ p(\mu)$$. After proving some equivalent formulations of hypercontractivity, including Sobolev’s logarithmic inequalities, in terms of $$\Gamma$$ and $$\Gamma_ 2$$, called square field respectively iterated square field operators by the authors: $\Gamma (f,g)=[L(fg)- fL(g)-gL(f)],$
$\Gamma_ 2(f,g)=[L\Gamma (f,g)-\Gamma (Lf,g)-\Gamma (f,Lg)],$ sufficient conditions for hypercontractivity are established. Some examples are discussed to illustrate the availability of these conditions. As useful tools, the operators $$\Gamma$$ and $$\Gamma_ 2$$ are investigated and calculated for some cases.
Reviewer: Sh.W.He

##### MSC:
 60J60 Diffusion processes
Full Text:

format: plain


text:
# Young tableux (representation theory)

1. Jan 4, 2013

### Ted123

1. The problem statement, all variables and given/known data

Consider the irreducible representation $V$ in the symmetric group $S_5$ corresponding to the Young diagram (these are meant to be boxes): $$[\;\;][\;\;] \\ [\;\;][\;\;] \\ [\;\;]\;\;\;\;$$

(a) List all standard Young tableaux of the given shape (that is, list all the possible fillings of the boxes with $\{1,2,3,4,5\}$ such that the numbers increase along the rows and down the columns).

(b) Give the dimension of $V$.

(c) For any standard tableau $\Omega$ of the given shape, let $e_{\Omega}$ be the standard basis element of the representation $V$. Evaluate the action of the permutation $g=(23)(45)(23)(34)(23) \in S_5$ on the vector $e_{\Omega}$ where $\Omega =$ $$[\;1\;][\;4\;] \\ [\;2\;][\;5\;] \\ [\;3\;]\;\;\;\;\;\,$$
2. Relevant equations

3. The attempt at a solution

(c) The basis vector $e_{\Omega} = P_{\Omega}Q_{\Omega}$ where $P_\Omega \in \mathbb{C}S_5$ and $Q_{\Omega}\in\mathbb{C}S_5$ are the row symmetrizer and column antisymmetrizer of $\Omega$: $$P_{\Omega} = [e+(14)][e+(25)] = e + (25) + (14) + (14)(25) \\ Q_{\Omega} = [e - (12) - (13) - (23) + (123) + (132)][e-(45)]$$
The given permutation $g=(23)(45)(23)(34)(23)=(2543)$. Is there a quicker way to evaluate the action of this permutation on $e_{\Omega}$ then to work out $(2543)P_{\Omega}Q_{\Omega}$?


text:
# Conclusions from output of a principal component analysis

I am trying to understand output of principal component analysis performed as follows:

> head(iris)
Sepal.Length Sepal.Width Petal.Length Petal.Width Species
1          5.1         3.5          1.4         0.2  setosa
2          4.9         3.0          1.4         0.2  setosa
3          4.7         3.2          1.3         0.2  setosa
4          4.6         3.1          1.5         0.2  setosa
5          5.0         3.6          1.4         0.2  setosa
6          5.4         3.9          1.7         0.4  setosa
> res = prcomp(iris[1:4], scale=T)
> res
Standard deviations:
[1] 1.7083611 0.9560494 0.3830886 0.1439265

Rotation:
PC1         PC2        PC3        PC4
Sepal.Length  0.5210659 -0.37741762  0.7195664  0.2612863
Sepal.Width  -0.2693474 -0.92329566 -0.2443818 -0.1235096
Petal.Length  0.5804131 -0.02449161 -0.1421264 -0.8014492
Petal.Width   0.5648565 -0.06694199 -0.6342727  0.5235971
>
> summary(res)
Importance of components:
PC1    PC2     PC3     PC4
Standard deviation     1.7084 0.9560 0.38309 0.14393
Proportion of Variance 0.7296 0.2285 0.03669 0.00518
Cumulative Proportion  0.7296 0.9581 0.99482 1.00000
>

I tend to conclude following from above output:

1. The proportion of variance indicates how much of total variance is there in variance of a particular principal component. Hence, PC1 variability explains 73% of total variance of the data.

2. Rotation values shown are same as 'loadings' mentioned in some descriptions.

3. Considering rotations of PC1, one can conclude that Sepal.Length, Petal.Length and Petal.Width are directly related, and they all are inversely related to Sepal.Width (which has a negative value in rotation of PC1)

4. There may be a factor in plants (some chemical/physical functional system etc) which may be affecting all these variables (Sepal.Length, Petal.Length and Petal.Width in one direction and Sepal.Width in opposite direction).

5. If I want to show all rotations in one graph, I can show their relative contribution to total variation by multiplying each rotation by proportion of variance of that principal component. For example, for PC1, the rotations of 0.52, -0.26, 0.58 and 0.56 are all multiplied by 0.73 (proportional variance for PC1, shown in summary(res) output.

Am I right about above conclusions?

Edit regarding question 5: I want to show all rotation in a simple barchart as follows:

Since PC2, PC3 and PC4 have progressively lesser contribution to variation, will it make sense to adjust (reduce) the loadings of the variables there?

• @amoeba : What is plotted in biplot of PCA, rotations or loadings? – rnso Apr 4 '15 at 3:23
• Most often loadings are plotted, by see my answer here for further discussion. – amoeba Apr 4 '15 at 12:54

1. Yes. This is the correct interpretation.
2. Yes, rotation values indicate the component loading values. This is confirmed by the prcomp documentation, though I'm not sure why they label this part of the aspect "Rotation", as it implies the loadings have been rotated using some orthogonal (likely) or oblique (less likely) method.
3. While it does appear to be the case that Sepal.Length, Petal.Length, and Petal.Width are all positively associated, I would not put as much stock in the small negative loading of Sepal.Width on PC1; it loads much more strongly (almost exclusively) on PC2. To be clear, Sepal.Width is still likely negatively associated with the other three variables, but it just doesn't seem to be strongly related to the first principle component.
4. Based on this question, I wonder whether you would be better served by using a common factor (CF) analysis, rather than a principle components analysis (PCA). CF is more of an appropriate data-reducing technique when your goal is to uncover meaningful theoretical dimensions--such as the plant-factor that you are hypothesizing may affect Sepal.Length, Petal.Length, and Petal.Width. I appreciate you're from some sort of biological science--botany perhaps--but there's some good writing in Psychology on the PCA v. CF distinction by Fabrigar et al., 1999, Widaman, 2007, and others. The core distinction between the two is that PCA assumes that all variances is true-score variance--no error is assumed--whereas CF partitions true score variance from error variance, before factors are extracted and factor loadings are estimated. Ultimately you might get a similar-looking solution--people sometimes do--but when they do diverge, it tends to be the case that PCA overestimate loading values, and underestimates the correlations between components. An additional perk of the CF approach is that you can use maximum likelihood estimation to perform significance tests of loading values, while also getting some indexes of how well your chosen solution (1 factor, 2 factors, 3 factors, or 4 factors) explains your data.
5. I would plot the factor loading values as you have, without weighting their bars by the proportion of variance for their respective components. I understand what you want to try to show by such an approach, but I think it would likely lead to readers to misunderstanding the component loading values from your analysis. However, if you wanted a visual way of showing the relative magnitude of variance accounted for by each component, you might consider manipulating the opacity of the groups bars (if you're using ggplot2, I believe this is done with the alpha aesthetic), based on the proportion of variance explained by each component (i.e., more solid colors = more variance explained). However, in my experience, your figure is not a typical way of presenting the results of a PCA--I think a table or two (loadings + variance explained in one, component correlations in another) would be much more straightforward.

References

Fabrigar, L. R., Wegener, D. T., MacCallum, R. C., & Strahan, E. J. (1999). Evaluating the use of exploratory factor analysis in psychological research. Psychological Methods, 4, 272-299.

Widaman, K. F. (2007). Common factors versus components: Principals and principles, errors, and misconceptions. In R. Cudeck & R. C. MacCallum (Eds.), Factor analysis at 100: Historic developments and future directions (pp. 177-203). Mahwah, NJ: Lawrence Erlbaum.

• I apologize for the bad formatting on answer 5. I've looked around for how to format formulas appropriately on CV but have not had much luck. – jsakaluk Apr 2 '15 at 18:25
• you can do as in Latex : putting maths between \$ signs, and then using backslashes – Anthony Martin Apr 2 '15 at 18:32
• @jsakaluk This handy reference from Math.SE lays out mathjax formating in great detail. meta.math.stackexchange.com/questions/5020/… – Sycorax Apr 2 '15 at 18:38
• +1, many good points here. Re (2): eigenvectors of the covariance matrix are called "Rotation" here, because PCA is essentially a rotation of coordinate system such that the new coordinate system is aligned with the eigenvectors. This has nothing to do with "orthogonal/oblique rotation of factors" in factor analysis. Re (5): I am not sure I understand what you meant here, and I also don't understand how OP wants to "show" the eigenvectors "in one graph". Perhaps OP has something like a biplot in mind. Then yes, eigenvectors are often scaled by the eigenvalues, but by their square roots. – amoeba Apr 2 '15 at 20:57
• Though nice floral-themed plot for your topic, @rnso :) – jsakaluk Apr 3 '15 at 1:18
1. No, not the total variance of the data. The total variance of the data given you want to express it in 4 principle components. You can always find more total variance by adding more principle components. But this decays rapidly.


text:
View more

View more

View more

### Image of the Day Submit

IOTD | Top Screenshots

### The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.

# C# Exporting text to CSV(or Excel)

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

5 replies to this topic

Posted 05 April 2012 - 04:19 PM

Hey everybody,

I was hoping to get a little help on a data exporter here. I'm reading files from a delimited txt log and need to export it to a CSV file. The problem I'm having is how to get the data I need from the log. The txt files resemble this:

[Date] - [some system info] - [some system state]
[Date] - [Athenticate] - [some system state]
[Date] - [some system info] - [some system state]

I need to only grab the Athenticates in the file and export those to a CSV. Sadly I'm not to fluent in C#. What whould be the best way to go about this? I have no problem reading the file and I shouldnt have any problem exporting but how do I handle only collecting the ata I need from the file? A List maybe? or a 2-D array?

### #2Telastyn  Members

Posted 05 April 2012 - 04:52 PM

How big is the file?

System.IO.File has ReadAllLines and WriteAllLines. Super easy if your file isn't huge.

Posted 05 April 2012 - 05:01 PM

They can vary. Some as small as a few KB, others can get kinda large. I need to find a way to check that 2nd part of the file to see if it will be added or not.

### #4ApochPiQ  Moderators

Posted 05 April 2012 - 05:04 PM

Screw writing your own tool. Just use sed or something similar.

I'm dead serious. It was literally designed to do this kind of thing.
Wielder of the Sacred Wands

Posted 05 April 2012 - 05:06 PM

You need to define a grammar for both your log file input and your csv output. This might be over engineering the problem though. You could also define a regular expression and use matching to pull out the desired data.

Posted 05 April 2012 - 05:38 PM

I think I may of found a way, I checked out those links Adam, and I needed something like Matching. Though again, not very fluent in C# still, I kinda implemented it my own way. Heres what I have to know that it works, I have 2 lists, one that delimits part by part and if the part matches with the Authenticate info the 2nd list stores the line. I applied these to listboxes to test, but now I just need to delimit the line to stick in colums and rows in the CSV and it should work

public  void ReadTextFile(string fileName)
{
List<string> sepList = new List<string>();
string line;

// Read the file and display it line by line.
{
while ((line = file.ReadLine()) != null)
{

char[] delimiters = new char[] { '-',',' };
string[] parts = line.Split(delimiters, StringSplitOptions.RemoveEmptyEntries);

for (int i = 0; i < parts.Length; i++)
{
Console.WriteLine(parts[i]);

if (parts[i].ToString() == " [Authenticate info]")
{

}

}
}
listBox1.DataSource = sepList;
}


text:
Article Contents
Article Contents

# A simple delayed neural network with large capacity for associative memory

• We consider periodic solutions of a system of difference equations with delay arising from a discrete neural network. We show that such a small network possesses a huge amount of stable periodic orbits with large domains of attraction if the delay is large, and thus the network has the potential large capacity for associative memory and for temporally periodic pattern recognition.
Mathematics Subject Classification: 39A11, 92B21.

 Citation:


text:
# Question

Refer to Exercise 22. Of the 193 placebo takers, 43 reported headaches.
a. Compute a 95% confidence interval for the true population proportion that would get headaches after taking a placebo.
b. Notice that a higher proportion of placebo takers than Seldane-D takers reported headaches. Use that information to explain why it is important to have a group taking placebos when studying the potential side effects of medications.

Sales0
Views18