Skip to content

What Is Natural Language Processing (NLP)? How Computers Understand Language

Natural language processing (NLP) is the branch of AI that lets computers read, understand and generate human language. Core NLP tasks, how it evolved from rules to transformers and LLMs, everyday examples, and how to get started.

4 min read

What Is NLP? — cover image from TensorCore.si

Short answer

Natural language processing (NLP) is the field of artificial intelligence that enables computers to understand, interpret and generate human language, written or spoken. It powers search engines, translation, spam filters, voice assistants and chatbots. NLP has gone through three eras: hand-written rules, statistical machine learning, and today's deep learning with transformers, which produced large language models like GPT, Claude and Gemini that can handle almost any language task.

Why language is hard for computers

Human language is ambiguous and full of context. "I saw her duck" can mean two very different things. Words change meaning ("bank" of a river vs a bank account), sarcasm flips meaning, and the same idea can be expressed in endless ways. NLP is about turning this messy, flexible language into something a computer can work with, and back again.

Common NLP tasks

TaskWhat it doesExample
Text classificationAssigns a categorySpam detection, topic tagging
Sentiment analysisDetects opinion or emotionRating product reviews as positive or negative
Named entity recognitionFinds names, places, dates, amountsExtracting company names from news
Machine translationConverts between languagesGoogle Translate, DeepL
SummarisationShortens text while keeping key pointsMeeting and article summaries
Question answeringAnswers questions from textSearch snippets, document chatbots
Speech recognitionTurns speech into textDictation, call transcription
Text generationWrites new textChatbots, drafting emails
Information retrievalFinds relevant documentsSearch engines, RAG

How NLP evolved

1. Rule-based NLP (1950s to 1980s)

Experts wrote grammar rules and dictionaries by hand. These systems worked in narrow domains but broke easily with real-world language.

2. Statistical NLP (1990s to 2010s)

Systems learned patterns from large text collections: counting which words appear together, then using models like n-grams, naive Bayes and conditional random fields. Statistical machine translation and early spam filters came from this era.

3. Neural NLP and word embeddings (2013 onwards)

Word2vec (2013) represented words as vectors so that similar words sit close together, see What are embeddings?. Recurrent neural networks (RNNs and LSTMs) then processed sentences word by word.

4. Transformers and LLMs (2017 onwards)

The transformer architecture (2017) used attention to look at all words at once, which trained faster and captured long-range meaning. BERT (2018) set new records on understanding tasks, and the GPT series showed that one model trained to predict the next word could do translation, summarisation, question answering and more. Today most NLP tasks are handled by a single large language model with a good prompt, or by a smaller model fine-tuned for one task.

How modern NLP works, step by step

1. Tokenization: text is split into tokens, words or word pieces. 2. Embedding: each token becomes a vector of numbers. 3. Contextual processing: transformer layers update each token's vector based on the surrounding words, so "bank" gets a different representation in different sentences. 4. Task output: the model produces a label, extracts spans of text or generates new text one token at a time.

NLP in everyday life

  • Search engines understanding what you mean, not just matching keywords
  • Autocomplete and grammar correction in keyboards and email
  • Voice assistants and dictation
  • Translation in browsers and apps
  • Customer service chatbots and email routing
  • Social media moderation and spam filtering
  • Medical and legal document analysis
  • Coding assistants that turn instructions into code

NLP vs LLMs vs NLU

  • NLP is the whole field.
  • NLU (natural language understanding) focuses on comprehension: intent, meaning, entities.
  • NLG (natural language generation) focuses on producing text.
  • LLMs are a powerful technology within NLP that now handles both understanding and generation.

Challenges that remain

  • Hallucinations: generative models can state false information confidently. See AI hallucinations.
  • Bias: models can reflect stereotypes in training data.
  • Low-resource languages: many of the world's languages have little digital text, so models perform worse in them, and they often need more tokens per word.
  • Cost: large models need expensive GPUs to train and serve. See AI training vs inference.

How to get started with NLP

  • No code: use an LLM chat app to classify, summarise or extract information with clear prompts.
  • Python: libraries such as Hugging Face Transformers, spaCy and NLTK cover most tasks.
  • Local models: run open models on your own computer for private text processing; see how to run an LLM locally.

Frequently asked questions

Is ChatGPT an example of NLP?

Yes. ChatGPT is built on large language models, the most advanced form of NLP today.

What is the difference between NLP and machine learning?

Machine learning is a general method for learning from data. NLP is an application area focused on language, which today relies mostly on machine learning and deep learning.

Is NLP still a good career?

Yes, though the work has shifted from building task-specific models towards building applications with LLMs, retrieval, evaluation and fine-tuning.

Does NLP include speech?

Speech recognition and text-to-speech are closely related fields often grouped with NLP. Modern multimodal models handle speech and text together.

Sources and further reading

Think you understand it now? Prove it.

Solve real Tensor Core math in the TensorCore.si Challenge and earn a certificate with your name.

Take the challenge

Leave a Reply

Your email address will not be published. Required fields are marked *