English subtitles

← Unit 22 12 LPCFGmp4

Get Embed Code
2 Languages

Showing Revision 2 created 05/25/2016 by Udacity Robot.

  1. Let's review. We started off with a context-free grammar. That's a rule of the form,
  2. "VP goes to V NP NP." That's the kind of technology that's used in your grammars for programming languages.
  3. And then we moved to a probabilistic, context-free grammar by adding on a probability,
  4. and we put it in parentheses to the right, but let's be more clear about exactly what we're doing.
  5. We're saying, "What's the probability of this rule, given that the left-hand side of the rule is VP?"
  6. And we said that was equal to .2.
  7. Now, the next step is to go and add lexicalization, so we have a lexicalized, probabilistic, context-free grammar.
  8. So in a lexicalized, probabilistic, context-free grammar, we deal not with the categories of the left-hand side,
  9. but rather with specific words. And there's multiple ways you can do that.
  10. And one way we can do it is say, "What's the probability that a verb phrase is a verb followed by two noun phrases?"
  11. And we're going to condition that on what the actual verb is.
  12. If the verb is "gave," then there should be a relatively high probability.
  13. You said, "He gave me the money," a direct and indirect object. That's fairly common for "gave."
  14. So maybe that's .25 or something. And compare that to the same rule where the verb is said.
  15. Normally, the verb "said" either has a single object, "He said something," but it doesn't normally have two objects.
  16. It would be rare to say, "He said me something." In colloquial, it may occur.
  17. "I said me my piece." But we're going to put down a very low probability for that.
  18. If we had a tree bank we could figure out how low it is. But I'm just going to estimate it's something like .0001.
  19. In a dictionary, they'll give you these probabilities, but they'll give them in absolute terms,
  20. in that they'll tell you whether verbs are transitive or intransitive.
  21. So for example, what's the probability that a verb phrase consists of just a verb?
  22. Versus that the verb phrase consists of a verb followed by a noun phrase, given that the verb is "quake"?
  23. Well, I can put down some numbers here, but if I look in my dictionary, I get a clue.
  24. So my dictionary says that "quake" is an intransitive verb.
  25. And so that means the dictionary is claiming that this probability should be zero.
  26. And this probability should be something higher. Now, unfortunately, if we go out and look at the actual world,
  27. it turns out that "quake" is not always intransitive.
  28. If you do a web search for "quaked the earth," I get back 20,000 results. Now, not all of those are valid sentences;
  29. Some of them are those words just happen to be together in a non-sentence context, a list of words or something.
  30. But you can see thousands of sentences where "quake" is used transitively.
  31. And so this shouldn't be a zero. Maybe it should be a .0001 or something.
  32. But the dictionaries are too Boolean, too logical, too willing to give you a precise answer,
  33. when language is really much more complex than that.
  34. And so these lexicalized grammars come closer to giving you what you need.
  35. Now, we still haven't gone all the way to solving our telescope problem.
  36. For that, we want to be able to say, "What's the probability of noun phrase going to noun phrase followed by prepositional phrase?"
  37. Or, "What's the probability of a verb phrase going to a verb followed by a noun phrase, followed by a prepositional phrase?"
  38. And we want to do that in the case of the verb, if the verb equals "saw," and then if we're also dealing with a case where
  39. the noun phrase has a head, meaning the main verb is equal to "man" and the preposition phrase has "with" and "telescope."
  40. And then compare that to the probability for when the head of the noun phrase is "man" and the preposition has "with" and "telescope."
  41. Now, these probabilities may be hard to get, because they're conditioning on quite a lot, on three very specific words on the right-hand side.
  42. And so it may be hard to estimate these, and we may need some model that backs off,
  43. that says maybe we don't look exactly for the word "man," but rather we look for something which represents an animate person.
  44. And so just as we had in previous models when we talked about how to do smoothing and how to back off
  45. to a more general case, we can do that in these lexicalized models as well.
  46. But the point is that we want to make these choices based on probabilities, and we get these probabilities
  47. by looking at our model, doing an analysis, and informing that analysis from data that we get from the tree banks.
  48. We can put that all together, then we can make these choices and we can come up with the right interpretation of sentences,
  49. and do the disambiguation, and figure out which one is more probable.