Computational Grammar
Introducti on to Natural Language Processing and Context-Free Grammars
Ambiguity
Lexical ambiguity is when a word can have more than one meaning or multiple definitions, such as
“I saw her duck” in which ‘duck’ can have two meanings. Syntactical ambiguity is when the
structure of a sentence has multiple interpretations, such as “I saw the man with the telescope” in
which you either saw a man together with a telescope or you saw a man through a telescope.
Discourse ambiguity is when the meaning of a sentence is unclear leading to multiple
interpretations, such as “John took his car to the garage” in which ‘his’ can be connected to either
‘John’ or refer to a friend or 3rd person.
Levels of Analysis in Natural Language Processing
In phonology, the phonemes /k/ and /b/ are what differentiate the words “cat” and “bat”.
Morphology is about the structure of words, “jumped” is formed from the root word “jump” and
the suffix “ed”. Syntax is the structure of sentences from a set of rules, relationships of words and
the order, “the dog chased the cat” is formed/parsed in the order: subject – verb – object.
Pragmatics is the use of language by the speaker and interpretation of this language by the listener.
Discourse is how sentences are connected to construct meaning in a conversation/discourse.
Grammatical Structure
The grammatical structure of a sentence is called a constituency structure, a sentence composed of
constituents are identified by their function in the sentence and are used by probabilistic parsing
with the goal to identify the best syntax using a language model.
The grammatical structure of a sentence called dependency structure can also be represented by
defining the relationship between words instead of their function with dependencies in which the
grammatical relationship is indicated with directed edges as dependencies between words and each
word as a node, the relationship can be subject-object, modifier-head, or complement-verb.
CYK Parsing and PCFGs
Context-Free Grammar
A formalism to describe the syntax of language is called context-free grammar or CFG and are used
to parse and generate sentences following a set of rules, with each rule specifying a symbol non-
terminal (N) as the syntactic categories, and a terminal (α) as a set of words or sequence of
terminal and non-terminals.
CYK Algorithm
To determine the constituency structure of a sentence given a CFG in Chomsky Normal Form (CNF)
we use the dynamic-programming based bottom-up CYK algorithm as a parser for CFGs which
avoids recursion and solves by building larger constituent of smaller constituents.
Chomsky Normal Form
CNF is a specific from of CFG allowing rules of either N -> N N or N -> α and non-epsilon rules. One
way to convert CFG to CNF is splitting A -> B C D to A -> B X and X -> C D. Another way is by joining A
-> B C and B -> D to make A -> D C.
Voordelen van het kopen van samenvattingen bij Stuvia op een rij:
Verzekerd van kwaliteit door reviews
Stuvia-klanten hebben meer dan 700.000 samenvattingen beoordeeld. Zo weet je zeker dat je de beste documenten koopt!
Snel en makkelijk kopen
Je betaalt supersnel en eenmalig met iDeal, creditcard of Stuvia-tegoed voor de samenvatting. Zonder lidmaatschap.
Focus op de essentie
Samenvattingen worden geschreven voor en door anderen. Daarom zijn de samenvattingen altijd betrouwbaar en actueel. Zo kom je snel tot de kern!
Veelgestelde vragen
Wat krijg ik als ik dit document koop?
Je krijgt een PDF, die direct beschikbaar is na je aankoop. Het gekochte document is altijd, overal en oneindig toegankelijk via je profiel.
Tevredenheidsgarantie: hoe werkt dat?
Onze tevredenheidsgarantie zorgt ervoor dat je altijd een studiedocument vindt dat goed bij je past. Je vult een formulier in en onze klantenservice regelt de rest.
Van wie koop ik deze samenvatting?
Stuvia is een marktplaats, je koop dit document dus niet van ons, maar van verkoper s.2. Stuvia faciliteert de betaling aan de verkoper.
Zit ik meteen vast aan een abonnement?
Nee, je koopt alleen deze samenvatting voor €5,49. Je zit daarna nergens aan vast.