AI Natural Language Processing

Natural language processing is the field of building systems that can turn human language into a form a model can compute with, and turn a model's output back into language people can read.

What Is Natural Language Processing?

Natural language processing (NLP) is the branch of AI focused on working with human language - text and speech - rather than numbers, images, or structured tables. Its goal is to build systems that can extract meaning from language, respond in language, or transform language from one form into another, whether that's translating a sentence, summarizing an article, or answering a question.

The Core Challenge: Language Is Not Numbers

Every model underneath an NLP system, no matter how sophisticated, ultimately runs on arithmetic over numeric arrays - it cannot directly 'read' a sentence the way a person does. Language, meanwhile, is messy: the same word can mean different things depending on context ('bank' of a river vs. a 'bank' that holds money), meaning depends heavily on word order and grammar, and people constantly bend or break the rules with slang, sarcasm, and typos. The foundational challenge of NLP is converting this messy, symbolic input into a numeric representation that still preserves as much of the original meaning as possible - a conversion process covered in detail in the next lesson on tokenization and embeddings.

A Typical NLP Pipeline

  1. Collect raw text (documents, messages, transcripts, web pages)
  2. Clean and normalize it (handle casing, punctuation, and unusual characters)
  3. Split the text into tokens (the next lesson covers this step in detail)
  4. Convert tokens into numeric vectors the model can process
  5. Feed those vectors into a model trained for the task at hand
  6. Convert the model's numeric output back into a label, a score, or generated text

Common NLP Tasks

TaskWhat It DoesExample
Sentiment analysisJudges whether text expresses a positive, negative, or neutral opinionFlagging negative product reviews automatically
Named entity recognitionFinds and labels names of people, places, organizations, dates, etc.Pulling company names out of a news article
Machine translationConverts text from one language into anotherTranslating a webpage from Spanish to English
Text summarizationProduces a shorter version of a longer document that keeps the key pointsGenerating a one-paragraph summary of a report
Question answeringFinds or generates an answer to a question, often from a given passageAnswering 'what year was this company founded?' from its About page

Early NLP systems relied heavily on hand-written grammar rules and dictionaries built by linguists - useful, but brittle whenever real language didn't follow the expected pattern. Most modern NLP systems instead learn their behavior from large collections of real text, picking up patterns of grammar, meaning, and usage statistically rather than being told the rules explicitly.

Note: NLP is the broad field and the goal; tokenization and embeddings, covered next, are the specific techniques most current systems use to actually turn text into numbers.
Note: Language is genuinely messy: sarcasm, idioms, regional slang, and low-resource languages (those with little available training text) remain some of the hardest open problems in NLP, even for the most advanced systems.

Exercise: AI Natural Language Processing

What is the primary goal of Natural Language Processing (NLP)?