BİL711 Natural Language Processing

Slides:



Advertisements
Similar presentations
Language and Grammar Unit
Advertisements

School of something FACULTY OF OTHER School of Computing FACULTY OF ENGINEERING Machine Learning PoS-Taggers COMP3310 Natural Language Processing Eric.
School of something FACULTY OF OTHER School of Computing FACULTY OF ENGINEERING PoS-Tagging theory and terminology COMP3310 Natural Language Processing.
Outline Why part of speech tagging? Word classes
In your notebooks make a list of the following for your MadLib. The number next to the part of speech indicates how many of each word you need. Plural.
Chapter 8. Word Classes and Part-of-Speech Tagging From: Chapter 8 of An Introduction to Natural Language Processing, Computational Linguistics, and Speech.
Part-of-speech tagging. Parts of Speech Perhaps starting with Aristotle in the West (384–322 BCE) the idea of having parts of speech lexical categories,
Part of Speech Tagging Importance Resolving ambiguities by assigning lower probabilities to words that don’t fit Applying to language grammatical rules.
Natural Language Processing Lecture 8—9/24/2013 Jim Martin.
The Eight Parts of Speech
Hidden Markov Model (HMM) Tagging  Using an HMM to do POS tagging  HMM is a special case of Bayesian inference.
1 Words and the Lexicon September 10th 2009 Lecture #3.
Part II. Statistical NLP Advanced Artificial Intelligence Part of Speech Tagging Wolfram Burgard, Luc De Raedt, Bernhard Nebel, Lars Schmidt-Thieme Most.
1 CSC 594 Topics in AI – Applied Natural Language Processing Fall 2009/ Part-Of-Speech (POS) Tagging.
 Christel Kemke 2007/08 COMP 4060 Natural Language Processing Word Classes and English Grammar.
Ch 10 Part-of-Speech Tagging Edited from: L. Venkata Subramaniam February 28, 2002.
More about tagging, assignment 2 DAC723 Language Technology Leif Grönqvist 4. March, 2003.
POS based on Jurafsky and Martin Ch. 8 Miriam Butt October 2003.
LING 388: Language and Computers Sandiway Fong Lecture 23: 11/15.
1 I256: Applied Natural Language Processing Marti Hearst Sept 20, 2006.
NLP and Speech 2004 English Grammar
Part of speech (POS) tagging
Word classes and part of speech tagging Chapter 5.
Albert Gatt Corpora and Statistical Methods Lecture 9.
Grammar Skills Workshop
Part-of-Speech Tagging
Chapter 4 Basics of English Grammar Business Communication Copyright 2010 South-Western Cengage Learning.
8. Word Classes and Part-of-Speech Tagging 2007 년 5 월 26 일 인공지능 연구실 이경택 Text: Speech and Language Processing Page.287 ~ 303.
Lemmatization Tagging LELA /20 Lemmatization Basic form of annotation involving identification of underlying lemmas (lexemes) of the words in.
Part II. Statistical NLP Advanced Artificial Intelligence Applications of HMMs and PCFGs in NLP Wolfram Burgard, Luc De Raedt, Bernhard Nebel, Lars Schmidt-Thieme.
Parts of Speech Sudeshna Sarkar 7 Aug 2008.
Some Advances in Transformation-Based Part of Speech Tagging
Distributional Part-of-Speech Tagging Hinrich Schütze CSLI, Ventura Hall Stanford, CA , USA NLP Applications.
Comparative study of various Machine Learning methods For Telugu Part of Speech tagging -By Avinesh.PVS, Sudheer, Karthik IIIT - Hyderabad.
인공지능 연구실 정 성 원 Part-of-Speech Tagging. 2 The beginning The task of labeling (or tagging) each word in a sentence with its appropriate part of speech.
PHRASES & CLAUSES AND WHY COMMAS ARE IMPORTANT!. WORD CLASSES Every word in the English language belongs to a “class”. It will be one of the following:
Fall 2005 Lecture Notes #8 EECS 595 / LING 541 / SI 661 Natural Language Processing.
CSA2050: Introduction to Computational Linguistics Part of Speech (POS) Tagging II Transformation Based Tagging Brill (1995)
CS : Language Technology for the Web/Natural Language Processing Pushpak Bhattacharyya CSE Dept., IIT Bombay Constituent Parsing and Algorithms (with.
Parts of Speech Notes. Part of Speech: Nouns  A naming word  Names a person, place, thing, idea, living creature, quality, or idea Examples: cowboy,
10/30/2015CPSC503 Winter CPSC 503 Computational Linguistics Lecture 7 Giuseppe Carenini.
13-1 Chapter 13 Part-of-Speech Tagging POS Tagging + HMMs Part of Speech Tagging –What and Why? What Information is Available? Visible Markov Models.
Word classes and part of speech tagging Chapter 5.
Speech and Language Processing Ch8. WORD CLASSES AND PART-OF- SPEECH TAGGING.
CSA2050: Introduction to Computational Linguistics Part of Speech (POS) Tagging I Introduction Tagsets Approaches.
Word classes and part of speech tagging 09/28/2004 Reading: Chap 8, Jurafsky & Martin Instructor: Rada Mihalcea Note: Some of the material in this slide.
Natural Language Processing
CSA3202 Human Language Technology HMMs for POS Tagging.
Parts of Speech Major source: Wikipedia. Adjectives An adjective is a word that modifies a noun or a pronoun, usually by describing it or making its meaning.
GoBack definitions Level 1 Parts of Speech GoBack is a memorization game; the teacher asks students definitions, and when someone misses one, you go back.
Part-of-speech tagging
Word classes and part of speech tagging. Slide 1 Outline Why part of speech tagging? Word classes Tag sets and problem definition Automatic approaches.
Basic Syntactic Structures of English CSCI-GA.2590 – Lecture 2B Ralph Grishman NYU.
Modified from Diane Litman's version of Steve Bird's notes 1 Rule-Based Tagger The Linguistic Complaint –Where is the linguistic knowledge of a tagger?
CSA2050: Introduction to Computational Linguistics Part of Speech (POS) Tagging II Transformation Based Tagging Brill (1995)
Word classes and part of speech tagging Chapter 5.
Part-of-Speech Tagging CSCI-GA.2590 – Lecture 4 Ralph Grishman NYU.
1 COMP790: Statistical NLP POS Tagging Chap POS tagging Goal: assign the right part of speech (noun, verb, …) to words in a text “The/AT representative/NN.
PARTS OF A SENTENCE. The subject of an English sentence is the person or thing that performs the action, or that the sentence makes a statement about.
1 Natural Language Processing Vasile Rus
Lecture 9: Part of Speech
Parts of Speech How Words Function.
CSC 594 Topics in AI – Natural Language Processing
CSCI 5832 Natural Language Processing
Part of Speech Tagging September 9, /12/2018.
Core Concepts Lecture 1 Lexical Frequency.
Lecture 6: Part of Speech Tagging (II): October 14, 2004 Neal Snider
Parts of Speech How Words Function.
English parts of speech
Natural Language Processing
Presentation transcript:

BİL711 Natural Language Processing April 15, 2017 Part of Speech Each word belongs to a word class. The word class of a word is known as part-of-speech (POS) of that word. Most POS tags implicitly encode fine-grained specializations of eight basic parts of speech: noun, verb, pronoun, preposition, adjective, adverb, conjunction, article These categories are based on morphological and distributional similarities (not semantic similarities). Part of speech is also known as: word classes morphological classes lexical tags BİL711 Natural Language Processing

BİL711 Natural Language Processing Part of Speech (cont.) A POS tag of a word describes the major and minor word classes of that word. A POS tag of a word gives a significant amount of information about that word and its neighbours. For example, a possessive pronoun (my, your, her, its) most likely will be followed by a noun, and a personal pronoun (I, you, he, she) most likely will be followed by a verb. Most of words have a single POS tag, but some of them have more than one (2,3,4,…) For example, book/noun or book/verb I bought a book. Please book that flight. BİL711 Natural Language Processing

BİL711 Natural Language Processing Tag Sets There are various tag sets to choose. The choice of the tag set depends on the nature of the application. We may use small tag set (more general tags) or large tag set (finer tags). Some of widely used part-of-speech tag sets: Penn Treebank has 45 tags Brown Corpus has 87 tags C7 tag set has 146 tags In a tagged corpus, each word is associated with a tag from the used tag set. BİL711 Natural Language Processing

BİL711 Natural Language Processing English Word Classes Part-of-speech can be divided into two broad categories: closed class types -- such as prepositions open class types -- such as noun, verb Closed class words are generally also function words. Function words play important role in grammar Some function words are: of, it, and, you Functions words are most of time very short and frequently occur. There are four major open classes. noun, verb, adjective, adverb a new word may easily enter into an open class. Word classes may change depending on the natural language, but all natural languages have at least two word classes: noun and verb. BİL711 Natural Language Processing

BİL711 Natural Language Processing Nouns Nouns can be divided as: proper nouns -- names for specific entities such as Ankara, John, Ali common nouns Proper nouns do not take an article but common nouns may take. Common nouns can be divided as: count nouns -- they can be singular or plural -- chair/chairs mass nouns -- they are used when something is conceptualized as a homogenous group -- snow, salt Mass nouns cannot take articles a and an, and they can not be plural. BİL711 Natural Language Processing

BİL711 Natural Language Processing Verbs Verb class includes the words referring actions and processes. Verbs can be divided as: main verbs -- open class -- draw, bake auxiliary verbs -- closed class -- can, should Auxiliary verbs can be divided as: copula -- be, have modal verbs -- may, can, must, should Verbs have different morphological forms: non-3rd-person-sg eat 3rd-person-sg - eats progressive -- eating past -- ate past participle -- eaten BİL711 Natural Language Processing

BİL711 Natural Language Processing Adjectives Adjectives describe properties or qualities for color -- black, white for age -- young, old In Turkish, all adjectives can also be used as noun. kırmızı kitap red book kırmızıyı the red one (ACC) BİL711 Natural Language Processing

BİL711 Natural Language Processing Adverbs Adverbs normally modify verbs. Adverb categories: locative adverbs -- home, here, downhill degree adverbs -- very, extremely manner adverbs -- slowly, delicately temporal adverbs -- yesterday, Friday Because of the heterogeneous nature of adverbs, some adverbs such as Friday may be tagged as nouns. BİL711 Natural Language Processing

BİL711 Natural Language Processing Major Closed Classes Prepositions -- on, under, over, near, at, from, to, with Determiners -- a, an, the Pronouns -- I, you, he, she, who, others Conjunctions -- and, but, if, when Participles -- up, down, on, off, in, out Numerals -- one, two, first, second BİL711 Natural Language Processing

BİL711 Natural Language Processing Prepositions Occur before noun phrases indicate spatial or temporal relations Example: on the table under chair They occur so often. For example, some of the frequency counts in a 16 million word corpora (COBUILD). of 540,085 in 331,235 for 142,421 to 125,691 with 124,965 on 109,129 at 100,169 BİL711 Natural Language Processing

BİL711 Natural Language Processing Particles A particle combines with a verb to form a larger unit called phrasal verb. go on turn on turn off shut down BİL711 Natural Language Processing

BİL711 Natural Language Processing Articles A small closed class Only three words in the class: a an the Marks definite or indefinite They occur so often. For example, some of the frequency counts in a 16 million word corpora (COBUILD). the 1,071,676 a 413,887 an 59,359 Almost 10% of words are articles in this corpus. BİL711 Natural Language Processing

BİL711 Natural Language Processing Conjunctions Conjunctions are used to combine or join two phrases, clauses or sentences. Coordinating conjunctions -- and or but join two elements of equal status Example: you and me Subordinating conjunctions -- that who combines main clause with subordinate clause Example: I thought that you might like milk BİL711 Natural Language Processing

BİL711 Natural Language Processing Pronouns Shorthand for referring to some entity or event. Pronouns can be divided: personal you she I possessive my your his wh-pronouns who what -- who is the president? BİL711 Natural Language Processing

BİL711 Natural Language Processing TagSets for English There are popular actual tagsets for part-of-speech PENN TREEBANK tagset has 45 tags IN preposition/subordinating conj. DT determiner JJ adjective NN noun, singular or mass NNS noun, plural VB verb, base form VBD verb, past tense A sentence from Brown corpus which is tagged using Penn Treebank tagset. The/DT grand/JJ jury/NN commented/VBD on/IN a/DT number/NN of/IN other/JJ topics/NNS ./. BİL711 Natural Language Processing

BİL711 Natural Language Processing Part of Speech Tagging Part of speech tagging is simply assigning the correct part of speech for each in an input sentence We assume that we have the following: A set of tags (our tag set) A dictionary that tells us the possible tags for each word (including all morphological variants). A text to be tagged. There are different algorithms for tagging. Rule Based Tagging Statistical Tagging (Stochastic Tagging) Transformation Based Tagging BİL711 Natural Language Processing

BİL711 Natural Language Processing How hard is tagging? Most words in English are unambiguous. They have only a single tag. But many of most common words are ambiguous: can/verb can/auxiliary can/noun The number of word types in Brown Corpus unambiguous (one tag) 35,340 ambiguous (2-7 tags) 4,100 2 tags 3760 3 tags 264 4 tags 61 5 tags 12 6 tags 2 7 tags 1 While only 11.5% of word types are ambiguous, over 40% of Brown corpus tokens are ambiguous. BİL711 Natural Language Processing

Rule-Based Part-of-Speech Tagging The rule-based approach uses handcrafted sets of rules to tag input sentence. There are two stages in rule-based taggers: First Stage: Uses a dictionary to assign each word a list of potential parts-of-speech. Second Stage: Uses a large list of handcrafted rules to window down this list to a single part-of-speech for each word. The ENGTWOL is a rule-based tagger In the first stage, uses a two-level lexicon transducer In the second stage, uses hand-crafted rules (about 1100 rules) BİL711 Natural Language Processing

BİL711 Natural Language Processing After The First Stage Example: He had a book. After the fırst stage: he he/pronoun had have/verbpast have/auxliarypast a a/article book book/noun book/verb BİL711 Natural Language Processing

BİL711 Natural Language Processing Tagging Rule Rule-1: if (the previous tag is an article) then eliminate all verb tags Rule-2: if (the next tag is verb) BİL711 Natural Language Processing

Transformation-Based Tagging Transformation-based tagging is also known as Brill Tagging. Similar to rule-based taggers but rules are learned from a tagged corpus. Then these learned rules are used in tagging. BİL711 Natural Language Processing

How TBL Rules are Applied Before the rules are applied the tagger labels every word with its most likely tag. We get these most likely tags from a tagged corpus. Example: He is expected to race tomorrow he/PRN is/VBZ expected/VBN to/TO race/NN tomorrow/NN After selecting most-likely tags, we apply transformation rules. Change NN to VB when the previous tag is TO This rule converts race/NN into race/VB This may not work for every case ….. According to race BİL711 Natural Language Processing

How TBL Rules are Learned We will assume that we have a tagged corpus. Brill’s TBL algorithm has three major steps. Tag the corpus with the most likely tag for each (unigram model) Choose a transformation that deterministically replaces an existing tag with a new tag such that the resulting tagged training corpus has the lowest error rate out of all transformations. Apply the transformation to the training corpus. These steps are repeated until a stopping criterion is reached. The result (which will be our tagger) will be: First tags using most-likely tags Then apply the learned transformations BİL711 Natural Language Processing

BİL711 Natural Language Processing Transformations A transformation is selected from a small set of templates. Change tag a to tag b when - The preceding (following) word is tagged z. - The word two before (after) is tagged z. - One of two preceding (following) words is tagged z. - One of three preceding (following) words is tagged z. - The preceding word is tagged z and the following word is tagged w. - The preceding (following) word is tagged z and the word two before (after) is tagged w. BİL711 Natural Language Processing

BİL711 Natural Language Processing Basic Results We get 91% accuracy just picking the most likely tag. We should improve the accuracy further. Some taggers can perform 99% percent. BİL711 Natural Language Processing

Statistical Part-of-Speech Tagging Choosing the best tag sequence T=t1,t2,…,tn for a given word sequence W = w1,w2,…,wn (sentence): By Bayes Rule: Since P(W) will be same for each tag sequence: BİL711 Natural Language Processing

Statistical POS Tagging (cont.) If we assume a tagged corpus and a trigram language model, then P(T) can be approximated as: To evaluate this formula is simple, we get from simple word counting (and smoothing). BİL711 Natural Language Processing

Statistical POS Tagging (cont.) To evaluate P(W|T), we will make the simplifying assumption that the word depends only on its tag. So, we want the tag sequence that maximizes the following quantity. The best tag sequence can be found by Viterbi algorithm. BİL711 Natural Language Processing