Success

mod01lec03

Google+ Pinterest LinkedIn Tumblr

[Music] hello everyone so welcome to the third lecture of the first week so in the last lecture we were discussing what do we do in NLP what are the various applications where NLP has been used okay ennum it's being used currently and what are some other very some of the future potentials of NLP so today in this lecture we will discuss why is NLP hard what are the some of the difficulties that we face while designing algorithms for NLP and and why do we need to worry about various machine learning techniques and all in NL okay so I'll just start with a very simple case of of the kind of problems that we face in NLP so we start with the case of lexical ambiguity okay ambiguities as you understand which implied for the same word meaning various interpretations okay so take this example sentence here so I have the sentence will will will will swell so what do you see here the same word will has been used five times so let us try to to find out what are the various interpretations of meaning the same word will has been used for will will will will so what what do you say about the first film okay so the first will is a modal verb like should would can etcetera the second will here is the name of a person this is sometimes easy to get from the from the English sentence because this was always been in capitals okay then you have the third will so this is a verb in the sentence okay to express his will the fourth one is again a name of a person you can see it by the apostrophe that is after this word but it can be either the same bill or a different will okay so again it's a name of a person but we do not know if it is the same way not a different way but by the way we the way we write language in the way we communicate in language we can say this probably is the second person because if it was the same person I would have used probably H okay and this will is it noun the will itself okay so what you're saying in the same sentence will the person will will express or huge will well we are using the same word will at least four in four different meanings so this is one of the extreme cases that we see in language okay but let us try to go through some other examples so this is another example Rose rose to put Rose rose on her Rose of roses okay so so here can you try to decipher what are the various meanings that I implied for the same word Rose so what do you say about the first Rouge the first Rose is the name of a person okay Roge there should be a verb in the percent Pashtuns to put Roch Roch okay so what is that this will be an adjective and Rouge it's some sort of a seafood okay and then we have that the next sentence on her Rose of and these roses you can find out these are the flowers and this is arrow the queue so again we see here the same word roach if you see the way it is written so in terms of orthography the same word Rose has been used one now as a name as a verb as an adjective and as a flower okay four different senses but but for the time just try to think of some speech recognition system okay we are you are trying to pronounce this sentence and it has two transcript what what are the different words that you have said in your trends so it will have immunity even to find out whether this rose means ro es or ro Fe okay this is another another problem that is also handled by various models that we will see in natural language processing okay and let us take another extreme example okay so the buffalo buffalo Buffalo buffalo Buffalo buffalo Buffalo buffalo okay so now in the sense this sentence is comprised only by a single vote used eight times so can you try to decipher this okay so let me give you a hint here so here the word buffalo has been used in to sense three senses buffalo so one is the city in us another buffalo is an animal and the third buffalo is like a verb that is used in the same sense edge bully okay so now given these three interpretations so can you try to decipher the meaning of the sentence okay so let us try to identify various blocks here Buffalo buffalo Buffalo buffalo Buffalo buffalo Buffalo buffalo okay so let me try to give you what other units together okay so these are three units in this sentence okay so now what will be the interpretation so these are the satish okay so the other cities I see and the animal a a and a and these two are whoops okay so then this will be the interpretation of the sentence Buffalo's from Buffalo New York whom Buffalo's from Buffalo New York bully bully Buffalo's from Buffalo New York okay probably it's not the sentence that you will encounter very often in the in the corpus but this is just to convey the point that that in language you can you can actually use the same word in multiple different meanings and that creates a problem and this problem is college lexical ambiguity the same word in lexicon is used in multiple different senses okay so now let us go to the next problem again related to emigrate each that is structural ambiguity okay what do I mean by structural ambiguity so I can have different integrations of the same sand sentence okay so let us see the first sentence here so this is a very very common example that we give in NLP the men saw the boy with the binoculars okay so can you try to see what is the ambiguity here so that McCready here is whether the by no colors are with the boy or the binoculars are with man whether the men saw the boy with this boy Nicholas or whether the man saw the boy who was shining with it by Nicholas so these are two different interpretations of the same sentence let us see the other sentence here flying planes can be dangerous can you see the two integrations of the sentence so what is dangerous are the place dangerous or flying dangerous you see flying planes can be dangerous okay so whether the flying is dangerous or the flying page together is dangerous so these are our two interpretations of the same sentence similarly you can see the third sentence here hole found in the room wall police are looking into it okay so now can you see the ambiguity in the sentence so ambiguity hey rich what appeal well it's like looking into are they looking into the hole or are they looking into the matter that was a whole line we are looking into the matter okay so this is another problem that we that we face very very often with language that this is ambiguous both in terms of lexical ambiguity the same word can imply multiple meanings or structural ambiguity where the same sentence can be interpreted in multiple ways okay and then we have some other problems like language very imprecise and wait so what are the examples here so so here is simple sentence it is very warm here so can you see what is the weakness or imprecision here so whenever I see a word like it's very warm here I cannot tell for sure what would be the temperature there okay so if I am in India for me what may mean a temperature of every 40 degree Celsius but if I am in UK or Europe for me warm might mean 25 degree Celsius okay and it might also depend on what was the weather in the last month and so on so this depends on a lot of context to find out what is the actual temperature that is being conveyed by this simple sentence similarly if you see the others other example okay so I have a question did you did your mother call your aunt last night and the answer is I am sure she must have so what is the implication and weakness here in the sentence so you see whenever I say I am sure she would have done that that means I do not know okay if I know that I will say yes she she has called but whenever I'm saying I am sure she must have probably I do not know whether she has okay but yeah that's what I say this is the fun part of NLP because that helps in constructing a lot of jokes okay so I have the simple this is a nice joke for the class age so why is the teacher wearing sunglasses and you can give an answer because the class is so bright and you can see the bright might mean either the class is bright in the sense of lot of sunlight and all or because the class is very bright in the sense of the students being really intelligent okay fine so continuing on the same topic of ambiguities so let us see some other examples so that that is something that we see in news headlines so you see the first sentence hospitals are sued by seven-foot doctors so can you see the ambiguity here immediately when you when you look at the sentence what comes to your mind probably the doctors are seven foot okay seven foot doctors okay of course it will lie seven feet doctors but yes this might be one interpretation but what is implied by the sentence there are seven different doctors okay and they are all four doctors so that is what is implied seven different for doctors take the next sentence here stolen painting found by tree so can you see the ambiguity so it looks as if the tree found the paintings okay but I but what it means is that the paintings were found other tree okay take the third example teachers teacher strikes idle kids okay so when you see the sentence as it is what comes to your mind teacher strikes some kids okay but what the headline was meaning teacher is striking okay there is some semicolon and the kids ride okay so let us take let us do one simple exercise on the on the same topic of ambiguity so I give you a simple sentence I made her duck now try to find so people say there are there are 10 or more than 10 meanings for the sentence but trying to find at least 5 meanings of this sentence I made her duck okay so let's do this exercise I made her duck so what are the different meanings this sentence can take okay so we need to see what are the different interpretations each of the word can have in the sentence so for example the word made can mean for example cook or make okay so one interpretation can be I cook the duck for her okay so simple in tradition I cooked a duck for her okay that is one interpretation now in the same sense of cooking I can also try to write a different integration okay what is that so one meaning is I made her duck another could be I made a duck that belong to her okay I cooked a duck belonging to her so that is her duck it may not I might not have cooked for her I might have cooked for myself but I cook the duck that belong to her I made her duck now mate can also mean Meena Singh simple making so you can think of an artificial duck like a toy and I can say I made the artificial duck she owns okay of course you can also have the second intuition here I can I made of artificial duck for her or belonging to her but let us take this interpretation now what is the other two interpolations you can think of okay so now try to think of the other meaning of duck can duck be used as a verb okay so if you are listening to some cricket common tree sometimes the batsman duck whenever there is a bomb bouncer sometimes know this that means lowering one's head so one intermission can be I made her lower her head there can be another in depression now can you think of any different integration from all the four that we have seen till now so the hint is that tried to go in the Harry Potter mode okay so this is something like I waved my magic vent and converted her into duck yes that's the best possible should integration I waved my magic where went that turned her into a duck okay so you see the simple sentence here I made her duck can have at least these five different indications so so yes these are the five intermissions that we saw so now what is in the language that gives rise to all these different integrations okay so let us try to look closely okay so we send the good is pervasive everywhere so how so one thing is about the syntactic category what is the role of a word sentence so you see the word duck here it can mean either a noun or evil so can you label the sentences here where duck has been used as a noun so this is known this is known this is known this is what this is know okay so fine so these are two indications that can be noun or a verb okay then there are there is a basic case with her the word her can either be a possessive of her or dative for her so can you see the the two examples here the two into Bish's which were made because of this so this was dative I did it for her or this is possessive belonging to her so these are again two intubations for this this ambiguity in language then we saw make can mean either to create or cook yes so this was for cooking and this was for making what else then if you go to grammar the same word may can be either transitive that means it will be enough it will be a verb with a single noun as direct object it can be die transitive that means a verb that is having two different non objects or action transitive it has a direct object plus ever so in these five interpolations can you try to mark them where the verb make was usage transitive die transitive and action transitive so here I have the same word make which is having an object and a work okay I made her lower her head or I made her do something okay so this is an action transitive okay what is die transitive so where there are two objects of the same work so I cooked a duck for so this has two different objects and what is a single transitive I cooked a duck belonging to her this is a single object okay so here there are two different objects so this is die transitive and this is transitive so in language the same verb make and muse in any of these three different page and that gives me three different interpretations okay so so now suppose you go to foreign takes okay so I am is speaking the sentence I made her duck what are different interpretations you can think of so I'm so what happens in speak special mission I am spinning something and you have to transcript okay so whenever I say I made her duck you might think of all these possible transcriptions so like I'm eight or duck I am eight higher duck all these are possible okay but the problem that analyzation will face is when there are many different possible in depressions which one to choose in a given context okay so let's see something from the structural integrity now so I have the simple sentence I saw the man with the telescope and we saw earlier it can have two different passage so passage I mean different ways in which the words can be connected in the sentence so we will have a complete topic on passing today we will discuss it in detail but I guess you can see this at least the the idea from the last example so now suppose I try to increase the length of the sentence I saw the man on the hill with the telescope and immediately you can find five different passage of the sentence okay there's not a stop here so let me have it the sentence I saw the man on the hill impacts us with the telescope okay so now it has 14 passage if I say I saw the man on the hill in Texas with the telescope at noon it was a 42 passage and if I say I saw the man on the hill in Texas with the telescope at noon and on Monday it looked 132 passage okay and you can actually relate these numbers to something called a Catalan number okay so as you keep on increasing the number of phrases in the sentence the number of interpolation in which they can be connected in the sentence increase okay so now so wise language ambiguous okay this can be a nice question that why is language ambiguous at all so we need to understand what is the goal of language as such so language is used for communication okay so the goal in introduction of communication languages to to be able to communicate ideas clearly okay but at the same time I should there are certain certain restrictions or that then that that are posed like I should have shorter linguistic expressions okay so think of the previous example that we saw in the last slide the same sentence was having wanted to do different interpretations now what if I if I need to have a different sentence for each of these 132 different interpretations that will make my language expression really large and also the language will become very complex so what happens in language some sort of ambiguities allowed but if ambiguities some the addition is leave is all available okay so you cannot have an advocate that is not resolvable at all so by some sort of knowledge that you have a human being tries to resolve it okay but in in the case of NLP we try to dump we have we have this task or developing algorithm that can resolve this ambiguity okay so yes language lies mostly on the people's ability to use their knowledge and some inference capabilities to resolve this ambiguity okay so now just a brief discussion of words the difference between a natural language and a computer language as such so one primary difference is the is the ambiguity okay in programming languages do not have any ambiguity in so whenever you write a program it will mean only one particular thing there is no ambiguity there but that is not the same there is not true for the case of language in natural language so so all the program languages are formal and they're designed to be unambiguous so that you can have very very efficient parsing for them okay so they can already defined by a grammar that releases a unique pass for each sentence or each programming construct in in the language okay that is not true for the natural languages so so you can have passing in nearly linear time oh now why else is NLP heart okay so this cartoon gives you some idea that I do not understand the a word Gen people say these days okay so so that so I am talking about social media here so see you I text you later okay this is the sentence see you I will text you later now you're writing edge see you I'll text you later okay so now the problem at hand is to understand that that you are actually meaning the sentence and find out it started from see you mean this see from you do you mean this you and so on okay so so this is also called the non-standard use of English and that is very very turbulent in the use of social media all the SMS and other other platforms okay so let's just see this particular tweet okay so great job Justin Bieber we are so proud of what you've accomplished you taught us to never say never and you yourself should never give up either okay so in the sentence so this is a tweet okay so what are the things that you do not see in formal language so for an example here is mention the use of mention ad Justin Bieber so this mention is again very very specific to Twitter and he is using hashtags Never Say Never it's a single hashtag okay what is so we are seeing constructs like this you have steak is written as you have you ve and – is it honest do so this is again honest and release of English that makes and I'll be difficult okay then there are many other problems like segmentation issue so I have the simple sentence the New York New Haven Railroad so where should I sign ment this particular sentence especially New York New Haven should I egman it like that New York New Haven or New York New Haven the second one is the correct segmentation okay so there are two possible segmentation of the same sentence so problem would another would be to find out what is the correct segmentation given the sentence then there are other cases like the case of helium's in in language okay so so what happens in the case of idioms you cannot construct the the meaning of the phrase by looking at the meaning of the individual works and trying to compose them together so if I see a idiom like Dark Horse I cannot take the meaning of a horse which is dark and make the meaning of this idiom Dark Horse is something else so this is some sort of idiom that is conveyed for a person who is not well known but he suddenly becomes a dog a dark horse so the he's suddenly excelling in in certain field okay similarly you see this idiom ball in your coat now it does not mean the ball is in your code that means the matter is at your hand and now it's Yatta similarly this idiom is again very much used burn the midnight oil does not mean that I'm burning the oil at midnight but what it means is that you are doing hard work okay then there are various new words that up that are being floated and new usages are coming up okay so they are neologism so for one a particular example so these examples are taken from social media is unfriending okay I have some Facebook friend and I'm unfriending him okay so this has become its verb itself retweet okay the tweet has been used a lot as a verb similarly Google Skype Photoshop all are very much used as forms I am googling okay you know so that creates another problem for NLP that is new words are coming up in different and a new a new usages so you do not have a closed vocabulary and your vocabulary keeps on increasing then you you you keep on getting new senses of the works okay so this see this word to example that's sick dude okay so I'm pointing here to the word sick so what is the usual meaning of sick that you see sick I will something that is not healthy that is someone who is ill but in this particular sentence that's sick dude sick mean sick means something that is cool and that meaning is coming up with social media okay similarly you see the word Giants what is the particular meaning of Giants so generally we see Giants as some sort of demons that that we have in any storage but recently some some new meaning of Giants is coming up so that you can think of like some sort of giant multinationals and all that okay giant manufacturers and then there's a problem of entity names okay so take the sentence where is a box life plane you cannot understand the meaning of the sentence unless you know that this particular are trains a box life is a single entity and then you try to understand the meaning of the sentence similarly the second sentence let it be was recorded you need to understand that let it be a single entity here Oh so what we do in NLP to handle all that so we need to have some knowledge about the language how the sentences are constructed what kind of words are there and so on we need to knowledge about the world okay and we need to have a way in which we can combine various knowledge so search in an efficient manner okay so how is it generally done so most of the times we do it by using various probabilistic models okay so this is a single simple example here so I have a word like me Jean in French and I'm going to translate in English and there are multiple interpretations so I want to use a model that says the probability that measum goes to house h-hi and I should choose this Pirkle interpretation okay similarly for the next sentence suppose this is for the speech recognition system whenever I'm saying saying I saw a van and there are two in divisions I saw a van or eyes of an I should be able to say that the first intubation is more probable to occur in the language then the second temptation okay and and we will deal with this a lot so many times we have black sheet lot of text features that Dutch most of this job okay so fine so in this lecture we covered some aspects of wild languages heart so in the next lecture we will start talking about some of the very very basic Umbra collage that we see in language and we will start with doing some basic pre-processing

As found on YouTube