Authored by Tony Feng
Created on Nov 29th, 2022
Last Modified on Nov 29th, 2022
Intro
This sereis of posts contains a summary of materials and readings from the course CSCI 1460 Computational Linguistics that I’ve taken @ Brown University. The class aims to explore techniques regarding recent advances in NLP with deep learning. I posted these “Notes” (what I’ve learnt) for study and review only.
“Sementic” Tasks
Semantics & Syntax
- Syntax = the study of form
- Semantics = the study of meaning
The general goal is to describe precisely how we get from form to meaning.
Semantics & Pragmatics
- Semantics = “sentence meaning” = tied to form/grammar
- Pragmatics = “speaker meaning” = tied more generally to context
In NLP, we tend to blur the distinction, and focus on specific tasks. For example, “Siri, I can’t hear the music” should be received as an instruction.
Executable Forms
- Explicit representation of natural language in formal language
- Question Answering over Databases: SELECT * FROM flights WHERE city = “BOS”
- Robotics: move(a) ^ pick_up(obj)
- Digital Personal Assistants: set_alarm(07:00, GMT-5)
Natural Language Inference
- Also called Recognizing Textual Entailment (RTE)
- Given a premise $p$ and a hypothesis $h$, does $p$ entail $h$?
- Now widely used as a general-purpose evaluation task for systems of “understanding”
Formal Sementics
Model Theory
A premise $p$ entails a hypothesis $h$ iff, in every possible world in which $p$ is true, $h$ is also true.
Truth Conditions and Truth Values
- Truth Conditional Semantics: the meaning of a sentence is its truth conditions
- Understanding “I have a pen in my pocket” does not require knowing whether I have a pen in my pocket.
- Contrast with Denotational Semantics: the meaning of a sentence is its truth value
- “3 is half of 6” == “one week has 7 days”
- Formal semantics uses truth conditions
The Fregean Program
The Goal is to give an unambiguous account of the mapping for form to meaning.
- Input: A (syntactically parsed) string of words
- Output: A context-independent logical form (e.g., lambda calculus, first order logic, etc)
Semantic Types
- $e$ is the semantic type of entities
- $t$ is the semantic type of truth values
1-place Predicates (adjectives, common nouns) are type <e, t>.
2-place Predicates (transitive verbs) are type <e, <e,t>>
Quantifiers (e.g. all, every) are type <<e,t>, t>
“Principle of Compositionality”: The meaning of the whole is a function of the meaning of the parts and the way in which they are combined.
Syntax-Semantics Interface and CCG
CFG Phrase Structure Grammar
Principle of Combinatory Transparency
Combinatory Categorial Grammar (CCG)
Semantics and Deep Learning
- DL for better parsers
- e.g. treat English $\leftarrow$ Logical Form as a machine translation problem
- Treating Semantics as “Latent”