Foundations of Natural Language Processing
Foundations of Natural Language Processing
Human language represents one of the most remarkable achievements of human cognition, yet it presents extraordinary challenges for computational systems designed to process it. When we communicate with each other, we effortlessly navigate a linguistic landscape filled with ambiguity, context-dependence, and the implicit knowledge that speakers share but rarely articulate. We understand jokes, resolve pronouns to their referents, infer meaning from what remains unsaid, and adapt our language to our audience—all tasks that seem almost trivial to the human mind yet prove remarkably difficult to automate. This chapter establishes the foundational concepts that define the field of Natural Language Processing (NLP), examining both the theoretical frameworks that guide contemporary research and the practical challenges that continue to drive innovation in the field.
The study of natural language processing exists at the intersection of computer science, linguistics, and cognitive science, drawing insights from each discipline while developing its own distinctive methodology and research agenda. Understanding NLP requires appreciating both the computational challenges of processing human language and the linguistic phenomena that make this processing so difficult. As we shall see throughout this book, the solutions developed in NLP often illuminate aspects of language that purely theoretical approaches miss, and conversely, linguistic theory provides essential constraints on what computational systems must accomplish.
The Unique Challenges of Human Language
Human languages possess properties that distinguish them sharply from formal systems such as programming languages or mathematical notations. These properties, while enabling the remarkable expressiveness and flexibility of natural language, create significant obstacles for computational processing. Understanding these challenges provides essential context for everything that follows in this book.
Ambiguity at Multiple Linguistic Levels
Perhaps no single characteristic of natural language creates more difficulty for computational systems than its pervasive ambiguity. Unlike formal languages, where expressions are designed to have precise, unambiguous meanings, natural language expressions frequently admit multiple interpretations at every level of linguistic analysis.
Lexical ambiguity arises when individual words can have multiple meanings. Consider the word "bank"—it might refer to a financial institution, the edge of a river, or the action of tilting an aircraft. Context typically resolves such ambiguity for human listeners, but computational systems must have access to extensive knowledge about word meanings and the contextual factors that favor particular interpretations. The English language contains numerous examples of words with dozens of distinct senses, and even common words frequently have several meanings that must be distinguished in context. Resolving lexical ambiguity requires not merely a dictionary listing of possible meanings but an understanding of how context constrains interpretation in specific situations.
Syntactic ambiguity occurs when a sentence admits multiple possible parse trees. The classic example "I saw the man with the telescope" can mean either that the speaker used a telescope to see a man, or that the speaker saw a man who was holding a telescope. These two interpretations correspond to different attachment structures for the prepositional phrase "with the telescope." More complex sentences can generate exponentially many syntactic analyses, creating a combinatorial explosion that overwhelms naive parsing approaches. Syntactic ambiguity manifests in numerous forms, including prepositional phrase attachment, modifier scope, coordinate structure, and ellipsis resolution.
Semantic ambiguity goes deeper than word meanings or syntactic structure, operating at the level of propositions and logical form. The sentence "Every journalist met a blogger" is semantically ambiguous in its quantifier scope—does it mean that there exists a particular blogger whom every journalist met, or does it mean that for each journalist, there exists (possibly different) blogger whom they met? These readings have different truth conditions and cannot be disambiguated through syntactic analysis alone. Similarly, sentences containing anaphoric expressions, temporal references, or modal operators create semantic ambiguity that requires reasoning about context and world knowledge to resolve.
Pragmatic ambiguity arises from the gap between what sentences literally mean and what speakers intend to convey in specific communicative situations. Speakers use indirect speech acts, irony, metaphor, and implicature to communicate meanings that differ from their literal formulations. When someone says "It's cold in here," they might be requesting that someone close a window, rather than making a meteorological observation. Understanding pragmatic meaning requires reasoning about speaker intentions, social conventions, and the cooperative principles that govern conversation—factors that lie outside the traditional domain of linguistic analysis.
Long-Range Dependencies
Natural language exhibits dependencies that extend across considerable spans of text, creating challenges for processing systems that rely on local information. In the sentence "The book that the students in the seminar who met every week in the library last semester recommended was fascinating," the verb "was" must agree with its distant subject "book," yet dozens of intervening words separate them. Human speakers effortlessly track such dependencies, maintaining representations of grammatical roles and semantic relationships across arbitrary distances.
This capacity for unbounded dependency creates problems for approaches that process language incrementally without maintaining rich representations of previous context. Early computational approaches often struggled with sentences containing center embedding, where a noun phrase is inserted between parts of a larger grammatical structure, creating sentences that are syntactically valid but cognitively difficult to process. While human processing limitations and memory constraints create processing difficulties for center-embedded constructions, the computational problem of maintaining long-range relationships while processing becomes increasingly severe as sentence length grows.
Modern neural approaches have made significant progress on long-range dependencies through attention mechanisms that allow models to directly access any position in the input sequence. However, the theoretical and practical challenges of capturing very long-range dependencies remain active areas of research, particularly for tasks requiring reasoning over extended documents or maintaining coherent representations across extended discourse.
Context-Dependence and World Knowledge
Language interpretation requires extensive knowledge about the world, social contexts, and the beliefs and goals of communicative participants. When we read that "the surgeon operated on the patient," we implicitly understand that surgeons are medical professionals who perform surgical procedures, that patients are individuals receiving medical care, and that the relationship between surgeon and patient involves medical treatment with specific goals and expectations. None of this knowledge is explicitly encoded in the sentence, yet all of it contributes to our understanding.
This implicit knowledge requirement creates what might be called the frame problem for language understanding—the challenge of determining exactly which background knowledge is relevant to interpreting any particular utterance. Speakers draw on encyclopedic knowledge, situational context, and beliefs about what listeners already know, assuming that listeners will fill in gaps approp