AI and Computing

Understanding the Basics of Natural Language Processing (NLP)

How software handles written and spoken language, from spellcheckers and search to translation and chatbots, and the kinds of mistakes these tools still make.

On this page
  1. What the field is about
  2. Early approaches: rules and word lists
  3. The shift to learning from text
  4. Common tasks
  5. How translation and chatbots fit in
  6. Why language is hard for software
  7. Where mistakes show up
  8. Privacy points
  9. A realistic view

What the field is about

Natural language processing, usually shortened to NLP, is the area of computing concerned with human language: text that people write and speech that people say. The challenge is that language, unlike a spreadsheet or a database, is loose, ambiguous and constantly changing. People use slang, make typos, rely on context and say one thing while meaning another.

Computers work with numbers, so the central task is to turn words into something a program can work with, and then to do something useful with it: correct, search, sort, translate, answer or summarise.

Early approaches: rules and word lists

The first language tools were built from hand-written rules and dictionaries. A basic spelling checker compares each word against a list and suggests close matches, often by counting how many letters would need to change to turn one word into another. Grammar checkers added rules about sentence structure.

Rule-based methods are transparent and can work well for narrow jobs. They struggle with the endless variety of real language, because nobody can write enough rules to cover every case. The word “bank” can mean a riverside or a financial institution, and the rules needed to tell them apart quickly multiply.

The shift to learning from text

Later approaches rely on machine learning. Rather than being told the rules, a program looks at a very large collection of text and learns statistical patterns, such as which words tend to appear together. Early statistical methods counted word sequences. More recent ones use neural networks that represent words as lists of numbers, so that words used in similar ways end up with similar numbers.

This is the idea behind many modern tools. Words are first split into pieces, often called tokens, which may be whole words or fragments of words. The software then works with the numeric form of those pieces and learns how they relate in context.

Common tasks

NLP covers many distinct jobs. Some of the most familiar:

  • Spelling and autocorrect. Suggesting the likely intended word from the letters typed and the words around it.
  • Search. Matching a question to relevant pages, including pages that use different wording from the query.
  • Speech recognition. Converting sound into text for dictation and voice commands, then interpreting what the text asks for.
  • Machine translation. Converting text from one language to another.
  • Classification. Sorting messages into groups, such as junk mail or customer complaints versus questions.
  • Summarising and extracting. Pulling out key points, names, dates and amounts from longer text.
  • Conversation. Chat tools that produce replies to what a person writes, built on generative AI.

How translation and chatbots fit in

Translation tools once translated phrase by phrase using large collections of paired texts. Current systems generally use neural networks that consider the whole sentence, which often produces more natural wording. Quality varies by language pair, and languages with less available text usually fare worse.

Chatbots take a different job: given the conversation so far, they predict a suitable continuation. They are trained on enormous amounts of text, and the nature of that training data shapes both their strengths and their blind spots. The way a request is phrased can affect results, which is why prompt writing has become a practical skill.

Why language is hard for software

Several features of language cause trouble.

  • Ambiguity. “I saw her duck” has more than one meaning. People resolve this using context, and software must try to do the same.
  • Context and reference. In “The trophy did not fit in the suitcase because it was too big”, a reader knows “it” refers to the trophy. Working out such links is harder than it looks.
  • Tone. Sarcasm, humour and politeness are difficult to detect from words alone.
  • Idioms and culture. Phrases rarely mean what their words literally say.
  • Variety. Dialects, accents, regional spelling and mixed-language sentences can confuse tools trained mostly on one standard form.

Where mistakes show up

Language tools make characteristic errors, and knowing them helps you use the tools sensibly.

  • Translation may sound fluent while quietly changing the meaning, so important documents are better checked by a qualified person.
  • Speech recognition tends to be less accurate with strong accents, background noise or specialist vocabulary.
  • Autocorrect can replace a correct but unusual word, such as a name, with a common one.
  • Chat tools can state false information in a confident tone, a problem described as AI hallucinations.
  • Models can echo stereotypes found in their source text, a form of algorithmic bias.
  • Sentiment tools that label text as positive or negative can misjudge sarcasm or mixed feelings.

Privacy points

Because language tools often send your words to a remote service, what you type or say may be stored or reviewed under the provider’s policies. Voice features raise the same question for recordings. Checking the settings, and avoiding sensitive details in services you do not trust, is a reasonable precaution, and the broader issue is discussed under AI chatbot privacy.

A realistic view

NLP has progressed from word lists to systems that can draft, translate and answer questions in ways that seemed out of reach not long ago. Yet fluent output is not the same as comprehension, and these tools are statistical in nature. They are most useful as assistants whose work you read critically, and least reliable when accuracy matters and nobody checks.

The complete guide to ai and computing

Understanding the Basics of Machine Learning and AI
Read the guide

Keep exploring

Guides from other topics

All topics →