part-of-speech tagging for twitter: annotation, features...

37
lti Part-of-Speech Tagging for Twitter: Annotation, Features, and Experiments Kevin Gimpel, Nathan Schneider, Brendan O'Connor, Dipanjan Das, Daniel Mills, Jacob Eisenstein, Michael Heilman, Dani Yogatama, Jeffrey Flanigan, and Noah A. Smith

Upload: others

Post on 06-Aug-2020

4 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Part-of-Speech Tagging for Twitter: Annotation, Features ...ttic.uchicago.edu/~kgimpel/talks/gimpel+etal.acl11.slides.pdf · Our tagger augmented with Twitter-specific features. lti

lti

Part-of-Speech Tagging for Twitter: Annotation, Features, and Experiments

Kevin Gimpel, Nathan Schneider, Brendan O'Connor, Dipanjan Das, Daniel Mills, Jacob Eisenstein,

Michael Heilman, Dani Yogatama, Jeffrey Flanigan, and Noah A. Smith

Page 2: Part-of-Speech Tagging for Twitter: Annotation, Features ...ttic.uchicago.edu/~kgimpel/talks/gimpel+etal.acl11.slides.pdf · Our tagger augmented with Twitter-specific features. lti

lti

Why does this paper have so many authors?

Page 3: Part-of-Speech Tagging for Twitter: Annotation, Features ...ttic.uchicago.edu/~kgimpel/talks/gimpel+etal.acl11.slides.pdf · Our tagger augmented with Twitter-specific features. lti

lti

Why does this paper have so many authors?

Our goal:

Build a Twitter part-of-speech tagger in one day

Page 4: Part-of-Speech Tagging for Twitter: Annotation, Features ...ttic.uchicago.edu/~kgimpel/talks/gimpel+etal.acl11.slides.pdf · Our tagger augmented with Twitter-specific features. lti

lti

� Plan:

�Large team of annotators

�Simple, carefully-designed annotation scheme

�Features leveraging existing resources (treebanks) and unannotated data

Page 5: Part-of-Speech Tagging for Twitter: Annotation, Features ...ttic.uchicago.edu/~kgimpel/talks/gimpel+etal.acl11.slides.pdf · Our tagger augmented with Twitter-specific features. lti

lti

� Plan:

�Large team of annotators

�Simple, carefully-designed annotation scheme

�Features leveraging existing resources (treebanks) and unannotated data

� Outcome:

�Tag set for Twitter

�1,827 annotated English tweets

�POS tagger with ~90% accuracy

�Didn’t finish in a day, but took < 250 person-hours

Available todownload!

Page 6: Part-of-Speech Tagging for Twitter: Annotation, Features ...ttic.uchicago.edu/~kgimpel/talks/gimpel+etal.acl11.slides.pdf · Our tagger augmented with Twitter-specific features. lti

lti

The Data

Page 7: Part-of-Speech Tagging for Twitter: Annotation, Features ...ttic.uchicago.edu/~kgimpel/talks/gimpel+etal.acl11.slides.pdf · Our tagger augmented with Twitter-specific features. lti

lti

Page 8: Part-of-Speech Tagging for Twitter: Annotation, Features ...ttic.uchicago.edu/~kgimpel/talks/gimpel+etal.acl11.slides.pdf · Our tagger augmented with Twitter-specific features. lti

lti

multi-wordabbreviations

non-standard spellings

hashtags

Also: at-mentions, URLs, emoticons, symbols, typos, etc.

Page 9: Part-of-Speech Tagging for Twitter: Annotation, Features ...ttic.uchicago.edu/~kgimpel/talks/gimpel+etal.acl11.slides.pdf · Our tagger augmented with Twitter-specific features. lti

lti

Tag Set

Page 10: Part-of-Speech Tagging for Twitter: Annotation, Features ...ttic.uchicago.edu/~kgimpel/talks/gimpel+etal.acl11.slides.pdf · Our tagger augmented with Twitter-specific features. lti

lti

� Start with coarse set of Penn Treebank tags

� Add Twitter-specific tags

Page 11: Part-of-Speech Tagging for Twitter: Annotation, Features ...ttic.uchicago.edu/~kgimpel/talks/gimpel+etal.acl11.slides.pdf · Our tagger augmented with Twitter-specific features. lti

lti

� Coarse treebank tags:

common noun determiner

proper noun preposition

pronoun verb particle

verb coordinating conjunction

adjective numeral

adverb interjection

punctuation predeterminer / existential there

Page 12: Part-of-Speech Tagging for Twitter: Annotation, Features ...ttic.uchicago.edu/~kgimpel/talks/gimpel+etal.acl11.slides.pdf · Our tagger augmented with Twitter-specific features. lti

lti

� Coarse treebank tags:

common noun determiner

proper noun preposition

pronoun verb particle

verb coordinating conjunction

adjective numeral

adverb interjection

punctuation predeterminer / existential there

Page 13: Part-of-Speech Tagging for Twitter: Annotation, Features ...ttic.uchicago.edu/~kgimpel/talks/gimpel+etal.acl11.slides.pdf · Our tagger augmented with Twitter-specific features. lti

lti

@user1 OMG ur from PA ? i am too (: where abouts ?

@user2 ima get me a flip phone for real

Penn Treebank tokenization is unsuitable for Twitter:

I’m going toyou’re

Page 14: Part-of-Speech Tagging for Twitter: Annotation, Features ...ttic.uchicago.edu/~kgimpel/talks/gimpel+etal.acl11.slides.pdf · Our tagger augmented with Twitter-specific features. lti

lti

@user1 OMG ur from PA ? i am too (: where abouts ?

@user2 ima get me a flip phone for real

Penn Treebank tokenization is unsuitable for Twitter:

I’m going to

Solution: Don’t try to tokenize theseInstead, introduce compound tags

you’re

Page 15: Part-of-Speech Tagging for Twitter: Annotation, Features ...ttic.uchicago.edu/~kgimpel/talks/gimpel+etal.acl11.slides.pdf · Our tagger augmented with Twitter-specific features. lti

lti

@user1 OMG ur from PA ? i am too (: where abouts ?

@user2 ima get me a flip phone for real

Penn Treebank tokenization is unsuitable for Twitter:

I’m going to

Solution: Don’t try to tokenize theseInstead, introduce compound tags

you’re

nominal+verbal

nominal+verbal

Page 16: Part-of-Speech Tagging for Twitter: Annotation, Features ...ttic.uchicago.edu/~kgimpel/talks/gimpel+etal.acl11.slides.pdf · Our tagger augmented with Twitter-specific features. lti

lti

� Twitter-specific tags:

hashtag

at-mention

URL / email address

emoticon

Twitter discourse marker

other (multi-word abbreviations, symbols, garbage)

Page 17: Part-of-Speech Tagging for Twitter: Annotation, Features ...ttic.uchicago.edu/~kgimpel/talks/gimpel+etal.acl11.slides.pdf · Our tagger augmented with Twitter-specific features. lti

lti

� Twitter-specific tags:

hashtag

at-mention

URL / email address

emoticon

Twitter discourse marker

other (multi-word abbreviations, symbols, garbage)

Page 18: Part-of-Speech Tagging for Twitter: Annotation, Features ...ttic.uchicago.edu/~kgimpel/talks/gimpel+etal.acl11.slides.pdf · Our tagger augmented with Twitter-specific features. lti

lti

Hashtags

Innovative , but traditional , too ! Another fun one to watch on the #iPad ! http://bit.ly/ @user1 #utcd2 #utpol #tcot

Twitter hashtags are sometimes used as ordinary words (35% of the time) and other times as topic markers

Page 19: Part-of-Speech Tagging for Twitter: Annotation, Features ...ttic.uchicago.edu/~kgimpel/talks/gimpel+etal.acl11.slides.pdf · Our tagger augmented with Twitter-specific features. lti

lti

Hashtags

Innovative , but traditional , too ! Another fun one to watch on the #iPad ! http://bit.ly/ @user1 #utcd2 #utpol #tcot

proper noun

hashtag

We only use “hashtag” for topic markers

Twitter hashtags are sometimes used as ordinary words (35% of the time) and other times as topic markers

Page 20: Part-of-Speech Tagging for Twitter: Annotation, Features ...ttic.uchicago.edu/~kgimpel/talks/gimpel+etal.acl11.slides.pdf · Our tagger augmented with Twitter-specific features. lti

lti

Twitter Discourse Marker

RT @user1 : I never bought candy bars from those kids on my doorstep so I guess they’re all in gangs now .

Retweet construction:

Page 21: Part-of-Speech Tagging for Twitter: Annotation, Features ...ttic.uchicago.edu/~kgimpel/talks/gimpel+etal.acl11.slides.pdf · Our tagger augmented with Twitter-specific features. lti

lti

Twitter Discourse Marker

RT @user1 : I never bought candy bars from those kids on my doorstep so I guess they’re all in gangs now .

Retweet construction:

Twitter discourse marker

Page 22: Part-of-Speech Tagging for Twitter: Annotation, Features ...ttic.uchicago.edu/~kgimpel/talks/gimpel+etal.acl11.slides.pdf · Our tagger augmented with Twitter-specific features. lti

lti

Twitter Discourse Marker

RT @user1 : I never bought candy bars from those kids on my doorstep so I guess they’re all in gangs now .

RT @user2 : LMBO ! This man filed an EMERGENCY Motion for Continuance on account of the Rangers game tonight ! ⟨⟨ Wow lmao

Retweet construction:

Twitter discourse marker

Page 23: Part-of-Speech Tagging for Twitter: Annotation, Features ...ttic.uchicago.edu/~kgimpel/talks/gimpel+etal.acl11.slides.pdf · Our tagger augmented with Twitter-specific features. lti

lti

Twitter Discourse Marker

RT @user1 : I never bought candy bars from those kids on my doorstep so I guess they’re all in gangs now .

RT @user2 : LMBO ! This man filed an EMERGENCY Motion for Continuance on account of the Rangers game tonight ! ⟨⟨ Wow lmao

Retweet construction:

Twitter discourse marker

Page 24: Part-of-Speech Tagging for Twitter: Annotation, Features ...ttic.uchicago.edu/~kgimpel/talks/gimpel+etal.acl11.slides.pdf · Our tagger augmented with Twitter-specific features. lti

lti

� Resulting tag set: 25 tags

Page 25: Part-of-Speech Tagging for Twitter: Annotation, Features ...ttic.uchicago.edu/~kgimpel/talks/gimpel+etal.acl11.slides.pdf · Our tagger augmented with Twitter-specific features. lti

lti

Annotation

Page 26: Part-of-Speech Tagging for Twitter: Annotation, Features ...ttic.uchicago.edu/~kgimpel/talks/gimpel+etal.acl11.slides.pdf · Our tagger augmented with Twitter-specific features. lti

lti

� 17 researchers from Carnegie Mellon

� Each spent 2-20 hours annotating

� Annotators corrected output of Stanford tagger

� Penn Treebank consulted for difficult cases

Page 27: Part-of-Speech Tagging for Twitter: Annotation, Features ...ttic.uchicago.edu/~kgimpel/talks/gimpel+etal.acl11.slides.pdf · Our tagger augmented with Twitter-specific features. lti

lti

� Two annotators corrected and standardized annotations from the original 17 annotators

� A third annotator tagged a sample of the tweets from scratch

� Inter-annotator agreement: 92.2%

�Cohen’s kappa: 0.914

� One annotator made a single final pass through the data, correcting errors and improving consistency

Page 28: Part-of-Speech Tagging for Twitter: Annotation, Features ...ttic.uchicago.edu/~kgimpel/talks/gimpel+etal.acl11.slides.pdf · Our tagger augmented with Twitter-specific features. lti

lti

Experiments

Page 29: Part-of-Speech Tagging for Twitter: Annotation, Features ...ttic.uchicago.edu/~kgimpel/talks/gimpel+etal.acl11.slides.pdf · Our tagger augmented with Twitter-specific features. lti

lti

Experimental Setup

� 1,827 annotated tweets

�1,000 for training

�327 for development

�500 for testing (OOV rate: 30%)

� Systems:

�Stanford tagger (retrained on our data)

�Our own baseline CRF tagger

�Our tagger augmented with Twitter-specific features

Page 30: Part-of-Speech Tagging for Twitter: Annotation, Features ...ttic.uchicago.edu/~kgimpel/talks/gimpel+etal.acl11.slides.pdf · Our tagger augmented with Twitter-specific features. lti

lti

Results

85.85

83.38

89.37

92.2

78

80

82

84

86

88

90

92

94

Stanford Tagger Our tagger,base features

Our tagger,all features

Inter-annotatoragreement

Page 31: Part-of-Speech Tagging for Twitter: Annotation, Features ...ttic.uchicago.edu/~kgimpel/talks/gimpel+etal.acl11.slides.pdf · Our tagger augmented with Twitter-specific features. lti

lti

Results

85.85

83.38

89.37

92.2

78

80

82

84

86

88

90

92

94

Stanford Tagger Our tagger,base features

Our tagger,all features

Inter-annotatoragreement

Page 32: Part-of-Speech Tagging for Twitter: Annotation, Features ...ttic.uchicago.edu/~kgimpel/talks/gimpel+etal.acl11.slides.pdf · Our tagger augmented with Twitter-specific features. lti

lti

Twitter Orthographic Features

� Regular expressions to detect at-mentions, hashtags, and URLs

89.37

-1.0

86

87

88

89

90

91

With Without

Page 33: Part-of-Speech Tagging for Twitter: Annotation, Features ...ttic.uchicago.edu/~kgimpel/talks/gimpel+etal.acl11.slides.pdf · Our tagger augmented with Twitter-specific features. lti

lti

Distributional Similarity Features

� Embeddings in a low-dimensional space based on neighboring words

� Computed using 134k unannotated tweets

89.37

-1.06

86

87

88

89

90

91

With Without

Page 34: Part-of-Speech Tagging for Twitter: Annotation, Features ...ttic.uchicago.edu/~kgimpel/talks/gimpel+etal.acl11.slides.pdf · Our tagger augmented with Twitter-specific features. lti

lti

Phonetic Normalization Features� Metaphone algorithm (Philips, 1990)

maps tokens to equivalence classes based on phonetics

� Examples:

tomarrow tommorow tomorrtomorrow tomorrowwww

hahaaha hahaha hahahah hahahahhaa hehehe hehehee

thangs thanks thanksss thanxthings thinks thnx

knew kno know knw n nah nawnew no noo nooooooo now

89.37

-0.42

86

87

88

89

90

91

With Without

Page 35: Part-of-Speech Tagging for Twitter: Annotation, Features ...ttic.uchicago.edu/~kgimpel/talks/gimpel+etal.acl11.slides.pdf · Our tagger augmented with Twitter-specific features. lti

lti

Tag Dictionary Features

� One feature for each tag a word occurs with in the Penn Treebank, with its frequency rank

� A similar feature for Metaphone classes of Penn Treebank words

89.37

-1.06

86

87

88

89

90

91

With Without

Page 36: Part-of-Speech Tagging for Twitter: Annotation, Features ...ttic.uchicago.edu/~kgimpel/talks/gimpel+etal.acl11.slides.pdf · Our tagger augmented with Twitter-specific features. lti

lti

Conclusions

� We developed a tag set, annotated data, designed features, and trained models

� Case study in rapidly porting a fundamental NLP task to a social media domain

� Data may be useful for domain adaptation or semi-supervised learning

Page 37: Part-of-Speech Tagging for Twitter: Annotation, Features ...ttic.uchicago.edu/~kgimpel/talks/gimpel+etal.acl11.slides.pdf · Our tagger augmented with Twitter-specific features. lti

lti

Thanks!

� Tagger, tokenizer, and annotations are available (50+ downloads already!):

www.ark.cs.cmu.edu/TweetNLP/