Natural Language Processing Essentials

0 of 18 lessons complete (0%)

Module 1: Text as Data

What Makes Language Hard for Machines

This is a preview lesson

Register or sign in to take this lesson.

The core problem

Computers handle numbers well and text poorly. Text is ambiguous, variable in length, full of exceptions, and dependent on context that is often not written down. The same word means different things in different sentences; the same meaning is expressed in hundreds of ways. Natural language processing, or NLP, is the collection of methods that turn text into forms a computer can measure, compare, and act on.

Specific difficulties

  • Ambiguity: ‘I saw her duck’ has at least two readings. ‘Bank’ is a river edge or a financial institution.
  • Variation: ‘cannot’, ‘can’t’, ‘can not’, ‘CANNOT’ are the same word to a reader and four different strings to a program.
  • Structure: word order matters (‘dog bites man’ versus ‘man bites dog’) but not rigidly.
  • Context: ‘It was fine’ can be praise or disappointment depending on what came before.
  • Noise: typos, abbreviations, emojis, HTML fragments, and copy-paste artifacts.
  • Scale: a vocabulary of hundreds of thousands of words, most of them rare.

How the field responds

  1. Normalize text so variations collapse into consistent forms.
  2. Represent text as numbers so distance and similarity can be computed.
  3. Learn patterns from labeled examples rather than hand-writing rules for every case.
  4. Evaluate against held-out examples because intuition about language is unreliable.

Worked example

A property-management company wanted to route tenant messages to maintenance, billing, or leasing. A first attempt used keyword rules: ‘leak’ or ‘broken’ meant maintenance, ‘rent’ or ‘payment’ meant billing. It handled about half of messages correctly. Failures included ‘my rent check was returned because the mailbox is broken’ (both categories), ‘the thing under the sink is making noise’ (no keyword), and ‘Payment? What payment? You never fixed the heater’ (sarcasm and two topics). The team replaced rules with a classifier trained on 800 past messages that staff had already routed. Accuracy on a held-out set rose well above the keyword approach, and the hardest messages were flagged for a person rather than guessed.

Common mistakes

  • Underestimating variation and writing rules for the cases you can think of.
  • Testing on the same examples you used to write the rules.
  • Expecting perfect accuracy. Language tasks have an irreducible error rate because humans disagree too.

Action Step: Collect 50 real text items from a source you work with: emails, reviews, tickets, notes. Read them and write down every form of ambiguity, variation, and noise you notice. This list is your map of what any NLP method must handle.

Editorial & AI Disclosure