Two Sisters Reunited After 18 Years in Checkout Counter Deer Kill 130,000 Prostitutes Appeal to Pope Man Struck by Lightning Faces Battery Charge Milk.

Slides:



Advertisements
Similar presentations
Statistical NLP Course for Master in Computational Linguistics 2nd Year Diana Trandabat.
Advertisements

Please turn off cell phones, pagers, etc. The lecture will begin shortly.
Copyright © 2010, 2007, 2004 Pearson Education, Inc. Chapter 14 From Randomness to Probability.
INTRODUCTION TO ARTIFICIAL INTELLIGENCE Massimo Poesio LECTURE 11 (Lab): Probability reminder.
PROBABILISTIC MODELS David Kauchak CS451 – Fall 2013.
Lecture 1, Part 2 Albert Gatt Corpora and statistical methods.
1 BASIC NOTIONS OF PROBABILITY THEORY. NLE 2 What probability theory is for Suppose that we have a fair dice, with six faces, and that we keep throwing.
PROBABILISTIC MODELS David Kauchak CS451 – Fall 2013.
Drawing Trees & Ambiguity in Trees. Some Phrase Structure Rules of English S’ -> (Comp) S S’ -> (Comp) S S -> {NP/S’} (T) VP S -> {NP/S’} (T) VP VP 
Lec 18 Nov 12 Probability – definitions and simulation.
Probability theory Much inspired by the presentation of Kren and Samuelsson.
September SOME BASIC NOTIONS OF PROBABILITY THEORY Universita’ di Venezia 29 Settembre 2003.
Random Variables A Random Variable assigns a numerical value to all possible outcomes of a random experiment We do not consider the actual events but we.
Information Theory and Security
Copyright © 2010, 2007, 2004 Pearson Education, Inc. Chapter 14 From Randomness to Probability.
CHAPTER 10: Introducing Probability
PROBABILITY David Kauchak CS451 – Fall Admin Midterm Grading Assignment 6 No office hours tomorrow from 10-11am (though I’ll be around most of the.
More probability CS311 David Kauchak Spring 2013 Some material borrowed from: Sara Owsley Sood and others.
Chapter 9 Introducing Probability - A bridge from Descriptive Statistics to Inferential Statistics.
2. Mathematical Foundations
Stat 1510: Introducing Probability. Agenda 2  The Idea of Probability  Probability Models  Probability Rules  Finite and Discrete Probability Models.
1-1 Copyright © 2015, 2010, 2007 Pearson Education, Inc. Chapter 13, Slide 1 Chapter 13 From Randomness to Probability.
Copyright © Cengage Learning. All rights reserved. Elementary Probability Theory 5.
Presentation by Dianne Smith, MJE. Something went wrong In jet crash, expert says.
1 Chapters 6-8. UNIT 2 VOCABULARY – Chap 6 2 ( 2) THE NOTATION “P” REPRESENTS THE TRUE PROBABILITY OF AN EVENT HAPPENING, ACCORDING TO AN IDEAL DISTRIBUTION.
 Basic Concepts in Probability  Basic Probability Rules  Connecting Probability to Sampling.
PROBABILITY David Kauchak CS159 – Spring Admin  Posted some links in Monday’s lecture for regular expressions  Logging in remotely  ssh to vpn.cs.pomona.edu.
LOGISTIC REGRESSION David Kauchak CS451 – Fall 2013.
BINOMIALDISTRIBUTION AND ITS APPLICATION. Binomial Distribution  The binomial probability density function –f(x) = n C x p x q n-x for x=0,1,2,3…,n for.
November 2004CSA4050: Crash Concepts in Probability1 CSA4050: Advanced Topics in NLP Probability I Experiments/Outcomes/Events Independence/Dependence.
Uncertainty Uncertain Knowledge Probability Review Bayes’ Theorem Summary.
Copyright © 2010 Pearson Education, Inc. Chapter 14 From Randomness to Probability.
PRIORS David Kauchak CS159 Fall Admin Assignment 7 due Friday at 5pm Project proposals due Thursday at 11:59pm Grading update.
CHAPTER 10: Introducing Probability ESSENTIAL STATISTICS Second Edition David S. Moore, William I. Notz, and Michael A. Fligner Lecture Presentation.
NLP. Introduction to NLP Very important for language processing Example in speech recognition: –“recognize speech” vs “wreck a nice beach” Example in.
Class 2 Probability Theory Discrete Random Variables Expectations.
Slide 14-1 Copyright © 2004 Pearson Education, Inc.
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 14 From Randomness to Probability.
From Randomness to Probability Chapter 14. Dealing with Random Phenomena A random phenomenon is a situation in which we know what outcomes could happen,
12/7/20151 Probability Introduction to Probability, Conditional Probability and Random Variables.
Unit 7A Fundamentals of Probability. BASIC TERMINOLOGY IN PROBABILITY Outcomes are the most basic possible results of observations or experiments. An.
Conditional Probability Mass Function. Introduction P[A|B] is the probability of an event A, giving that we know that some other event B has occurred.
Inference: Probabilities and Distributions Feb , 2012.
Fall 2002Biostat Probability Probability - meaning 1) classical 2) frequentist 3) subjective (personal) Sample space, events Mutually exclusive,
Probability and Distributions. Deterministic vs. Random Processes In deterministic processes, the outcome can be predicted exactly in advance Eg. Force.
Drawing Trees & Ambiguity in Trees
Probability. What is probability? Probability discusses the likelihood or chance of something happening. For instance, -- the probability of it raining.
1 Probability: Introduction Definitions,Definitions, Laws of ProbabilityLaws of Probability Random VariablesRandom Variables DistributionsDistributions.
Stat 13, Thu 4/19/ Hand in HW2! 1. Resistance. 2. n-1 in sample sd formula, and parameters and statistics. 3. Probability basic terminology. 4. Probability.
9/14/1999 JHU CS /Jan Hajic 1 Introduction to Natural Language Processing Probability AI-Lab
Chapter 2: Probability. Section 2.1: Basic Ideas Definition: An experiment is a process that results in an outcome that cannot be predicted in advance.
Copyright © 2010 Pearson Education, Inc. Chapter 14 From Randomness to Probability.
Statistics 14 From Randomness to Probability. Probability This unit will define the phrase “statistically significant This chapter will lay the ground.
Statistical NLP Course for Master in Computational Linguistics 2nd Year Diana Trandabat.
Probability. Today we will look at… 1.Quick Recap from last week 2.Terminology relating to events and outcomes 3.Use of sample spaces when dealing with.
AP Statistics From Randomness to Probability Chapter 14.
Conditional Probability 423/what-is-your-favorite-data-analysis-cartoon 1.
From Randomness to Probability
Dealing with Random Phenomena
Probability David Kauchak CS158 – Fall 2013.
From Randomness to Probability
From Randomness to Probability
From Randomness to Probability
Great Theoretical Ideas In Computer Science
Honors Statistics From Randomness to Probability
CHAPTER 10: Introducing Probability
From Randomness to Probability
Probability Probability Principles of EngineeringTM
Tesla slashed Model S and X staff in recent layoffs
From Randomness to Probability
Presentation transcript:

Two Sisters Reunited After 18 Years in Checkout Counter Deer Kill 130,000 Prostitutes Appeal to Pope Man Struck by Lightning Faces Battery Charge Milk Drinkers Are Turning to Powder Doctor Who Aided Bin Laden Raid In Jail Enraged Cow Injures Farmer with Axe Eye Drops Off Shelf Drunk Gets Nine Months in Violin Case Stolen Paining Found by Tree Include Your Children When Baking Cookies August Sales Fall for GM as Trucks Lift Chrysler Big Rig Carrying Fruit Crashes on 210 Freeway, Creates Jam Squad Helps Dog Bite Victims Two Foot Ferries May Be Headed to Trinidad Astronaut Takes Blame for Gas in Spacecraft Reagan Wins on Budget, but More Lies Ahead Dealers Will Hear Car Talk at Noon

PROBABILITY David Kauchak CS159 – Fall 2014

Admin Assignment advice  test individual components of your regex first, then put them all together  write test cases Assignment deadlines Class participation

Assignment 0 What do you think the average, median, min and max were for the “programming proficiency” question (1- 10)?

Assignment 0 Mean/median: 6.5

Assignment 0: programing languages Python9 Java8 Haskell1 Ruby1 Matlab1 SML1 C++1

Regex revisited

Corpus statistics 1/25/2011

Why probability? Prostitutes Appeal to Pope Language is ambiguous Probability theory gives us a tool to model this ambiguity in reasonable ways.

Basic Probability Theory: terminology An experiment has a set of potential outcomes, e.g., throw a dice, “look at” another sentence The sample space of an experiment is the set of all possible outcomes, e.g., {1, 2, 3, 4, 5, 6} In NLP our sample spaces tend to be very large  All words, bigrams, 5-grams  All sentences of length 20 (given a finite vocabulary)  All sentences  All parse trees over a given sentence

Basic Probability Theory: terminology An event is a subset of the sample space Dice rolls  {2}  {3, 6}  even = {2, 4, 6}  odd = {1, 3, 5} NLP  a particular word/part of speech occurring in a sentence  a particular topic discussed (politics, sports)  sentence with a parasitic gap  pick your favorite phenomena…

Events We’re interested in probabilities of events  p({2})  p(even)  p(odd)  p(parasitic gap)  p(first word in a sentence is “banana”)

Random variables A random variable is a mapping from the sample space to a number (think events) It represents all the possible values of something we want to measure in an experiment For example, random variable, X, could be the number of heads for a coin tossed three times Really for notational convenience, since the event space can sometimes be irregular spaceHHHHHTHTHHTTTHHTHTTTHTTT X

Random variables We can then talk about the probability of the different values of a random variable The definition of probabilities over all of the possible values of a random variable defines a probability distribution spaceHHHHHTHTHHTTTHHTHTTTHTTT X XP(X) 3P(X=3) = ? 2P(X=2) = ? 1P(X=1) = ? 0P(X=0) = ?

Random variables We can then talk about the probability of the different values of a random variable The definition of probabilities over all of the possible values of a random variable defines a probability distribution spaceHHHHHTHTHHTTTHHTHTTTHTTT X XP(X) 3P(X=3) = 1/8 2P(X=2) = 3/8 1P(X=1) = 3/8 0P(X=0) = 1/8

Probability distribution To be explicit  A probability distribution assigns probability values to all possible values of a random variable  These values must be >= 0 and <= 1  These values must sum to 1 for all possible values of the random variable XP(X) 3P(X=3) = 1/2 2P(X=2) = 1/2 1P(X=1) = 1/2 0P(X=0) = 1/2 XP(X) 3P(X=3) = -1 2P(X=2) = 2 1P(X=1) = 0 0P(X=0) = 0

Unconditional/prior probability Simplest form of probability distribution is  P(X) Prior probability: without any additional information:  What is the probability of heads on a coin toss?  What is the probability of a sentence containing a pronoun?  What is the probability of a sentence containing the word “banana”?  What is the probability of a document discussing politics?  …

Prior probability What is the probability of getting HHH for three coin tosses, assuming a fair coin? What is the probability of getting THT for three coin tosses, assuming a fair coin? 1/8

Joint distribution We can also talk about probability distributions over multiple variables P(X,Y)  probability of X and Y  a distribution over the cross product of possible values NLPPassP(NLPPass) true0.89 false0.11 EngPassP(EngPass) true0.92 false0.08 NLPPass, EngPassP(NLPPass, EngPass) true, true.88 true, false.01 false, true.04 false, false.07

Joint distribution Still a probability distribution  all values between 0 and 1, inclusive  all values sum to 1 All questions/probabilities of the two variables can be calculated from the joint distribution NLPPass, EngPassP(NLPPass, EngPass) true, true.88 true, false.01 false, true.04 false, false.07 What is P(ENGPass)?

Joint distribution Still a probability distribution  all values between 0 and 1, inclusive  all values sum to 1 All questions/probabilities of the two variables can be calculated from the joint distribution NLPPass, EngPassP(NLPPass, EngPass) true, true.88 true, false.01 false, true.04 false, false.07 How did you figure that out? 0.92

Joint distribution NLPPass, EngPassP(NLPPass, EngPass) true, true.88 true, false.01 false, true.04 false, false.07 Called “marginalization”, aka summing over a variable

Conditional probability As we learn more information, we can update our probability distribution P(X|Y) models this (read “probability of X given Y”)  What is the probability of a heads given that both sides of the coin are heads?  What is the probability the document is about politics, given that it contains the word “Clinton”?  What is the probability of the word “banana” given that the sentence also contains the word “split”? Notice that it is still a distribution over the values of X

Conditional probability x y In terms of pior and joint distributions, what is the conditional probability distribution?

Conditional probability Given that y has happened, in what proportion of those events does x also happen x y

Conditional probability Given that y has happened, what proportion of those events does x also happen What is: p(NLPPass=true | EngPass=false)? NLPPass, EngPassP(NLPPass, EngPass) true, true.88 true, false.01 false, true.04 false, false.07 x y

Conditional probability What is: p(NLPPass=true | EngPass=false)? NLPPass, EngPassP(NLPPass, EngPass) true, true.88 true, false.01 false, true.04 false, false.07 = Notice this is very different than p(NLPPass=true) = 0.89

A note about notation When talking about a particular assignment, you should technically write p(X=x), etc. However, when it’s clear, we’ll often shorten it Also, we may also say P(X) or p(x) to generically mean any particular value, i.e. P(X=x) = 0.125

Properties of probabilities P(A or B) = ?

Properties of probabilities P(A or B) = P(A) + P(B) - P(A,B)

Properties of probabilities P(  E) = 1– P(E) More generally:  Given events E = e 1, e 2, …, e n P(E1, E2) ≤ P(E1)

Chain rule (aka product rule) We can view calculating the probability of X AND Y occurring as two steps: 1.Y occurs with some probability P(Y) 2.Then, X occurs, given that Y has occured or you can just trust the math…

Chain rule

Applications of the chain rule We saw that we could calculate the individual prior probabilities using the joint distribution What if we don’t have the joint distribution, but do have conditional probability information:  P(Y)  P(X|Y)

Bayes’ rule (theorem)

Bayes rule Allows us to talk about P(Y|X) rather than P(X|Y) Sometimes this can be more intuitive Why?

Bayes rule p(disease | symptoms) How would you estimate this? Find a bunch of people with those symptoms and see how many have the disease Is this feasible?

Bayes rule p(disease | symptoms) p( symptoms | disease ) How would you estimate this? Find a bunch of people with the disease and see how many have this set of symptoms. Much easier!

Bayes rule p( linguistic phenomena | features )  For all examples that had those features, how many had that phenomena?  p(features | linguistic phenomena) For all the examples with that phenomena, how many had this feature p(cause | effect) vs. p(effect | cause)

Gaps I just won’t put these away. These, I just won’t put away. V direct object I just won’t put away. gap filler

Gaps What did you put away? gap The socks that I put away. gap

Gaps Whose socks did you fold and put away? gap Whose socks did you fold ? gap Whose socks did you put away? gap

Parasitic gaps These I’ll put away without folding. gap These without folding. These I’ll put away. gap

Parasitic gaps These I’ll put away without folding. gap 1. Cannot exist by themselves (parasitic) These I’ll put my pants away without folding. gap 2. They’re optional These I’ll put away without folding them. gap

Parasitic gaps ugs-parasitic-gap/

Frequency of parasitic gaps Parasitic gaps occur on average in 1/100,000 sentences Problem: Laura Linguist has developed a complicated set of regular expressions to try and identify parasitic gaps. If a sentence has a parasitic gap, it correctly identifies it 95% of the time. If it doesn’t, it will incorrectly say it does with probability Suppose we run it on a sentence and the algorithm says it is a parasitic gap, what is the probability it actually is?

Prob of parasitic gaps Laura Linguist has developed a complicated set of regular expressions to try and identify parasitic gaps. If a sentence has a parasitic gap, it correctly identifies it 95% of the time. If it doesn’t, it will incorrectly say it does with probability Suppose we run it on a sentence and the algorithm says it is a parasitic gap, what is the probability it actually is? G = gap T = test positive What question do we want to ask?

Prob of parasitic gaps Laura Linguist has developed a complicated set of regular expressions to try and identify parasitic gaps. If a sentence has a parasitic gap, it correctly identifies it 95% of the time. If it doesn’t, it will incorrectly say it does with probability Suppose we run it on a sentence and the algorithm says it is a parasitic gap, what is the probability it actually is? G = gap T = test positive

Prob of parasitic gaps Laura Linguist has developed a complicated set of regular expressions to try and identify parasitic gaps. If a sentence has a parasitic gap, it correctly identifies it 95% of the time. If it doesn’t, it will incorrectly say it does with probability Suppose we run it on a sentence and the algorithm says it is a parasitic gap, what is the probability it actually is? G = gap T = test positive

Prob of parasitic gaps Laura Linguist has developed a complicated set of regular expressions to try and identify parasitic gaps. If a sentence has a parasitic gap, it correctly identifies it 95% of the time. If it doesn’t, it will incorrectly say it does with probability Suppose we run it on a sentence and the algorithm says it is a parasitic gap, what is the probability it actually is? G = gap T = test positive