What Is Natural Language Processing?
Natural language processing lets computers read, interpret and generate language. How NLP works, from word vectors to BERT and LLMs, and its limits.
Natural language processing (NLP) is the branch of AI that lets computers work with human language: reading it, classifying it, extracting facts from it, translating it and generating it. Hugging Face's course describes it as "a field of linguistics and machine learning focused on understanding everything related to human language," including the context words appear in, not just the words themselves [1]. Spam filters, search engines, voice assistants, translation apps and chatbots all run on NLP.
The field has changed more in the past decade than in the forty years before it. Hand-written grammar rules gave way to statistics, then to neural networks, and now to large language models that handle many language tasks in a single system.
What NLP actually does
NLP isn't one task. Hugging Face groups the common ones into five families [1]:
Task family | What it does | Everyday example |
|---|---|---|
Classify whole texts | Assigns a label to a sentence or document | Spam detection, review sentiment, support-ticket routing |
Classify each word | Labels individual words | Finding names, places and organizations (named-entity recognition); tagging nouns and verbs |
Generate text | Produces new text from a prompt | Autocomplete, chatbots, drafting emails |
Extract answers | Pulls an answer out of a given passage | Question answering over a manual or contract |
Transform text | Turns one text into another | Translation, summarization |
NLP also reaches beyond typed text. The same course notes it tackles "speech recognition and computer vision" problems such as transcribing audio or describing an image [1]. Speech recognition is often treated as a sister field, and the standard textbook by Stanford's Dan Jurafsky and James H. Martin covers both under "speech and language processing" [2].
How NLP works: the basic pipeline
Whatever the model, most NLP systems follow the same steps.
- Tokenization. Split text into units the model can handle: words, pieces of words or characters. "Unbelievable" might become "un," "believ," "able."
- Representation. Turn each token into numbers. Modern systems use embeddings, lists of numbers positioned so that related words sit close together. See Embedding Models Explained.
- Modeling context. Combine the token vectors so each word's meaning reflects its neighbors. "Bank" next to "river" should end up different from "bank" next to "loan."
- Output. Produce a label, a highlighted span, a score or new text.
Why is this hard? Hugging Face points out that people can easily judge how similar "I am hungry" and "I am sad" are, while that is much harder for a machine learning model [1]. Ambiguity, sarcasm, humor and cultural context remain hard even for today's best models [1].
How NLP evolved
Rules and statistics
Early NLP relied on linguists writing rules: grammars, dictionaries and pattern matchers. Those systems were precise but brittle. Statistical methods, which learned word probabilities from large text collections, gradually took over because they coped better with messy real-world language. For a full technical treatment, the standard reference is Jurafsky and Martin's textbook, whose third-edition draft was last updated in August 2026 [2].
Word vectors (2013)
A turning point came in 2013 with Google's word2vec work by Tomas Mikolov and colleagues. They proposed two simple neural architectures, Continuous Bag-of-Words and Skip-gram, that learn a vector for each word from its neighbors [3]. The paper reported learning high-quality vectors from a 1.6-billion-word dataset in less than a day [3]. Such vectors capture relationships: the paper highlights earlier work showing vector("King") โ vector("Man") + vector("Woman") lands closest to the vector for "Queen" [3].
The limit: each word got one fixed vector, regardless of context.
Transformers (2017)
The Transformer, introduced in "Attention Is All You Need," replaced the step-by-step recurrent networks that dominated translation with attention, which lets every word look at every other word at once. The authors reported it was "more parallelizable" and needed "significantly less time to train" [4]. See How Transformer Models Work.
Pretrained language models (2018 onward)
BERT (Google, 2018) applied the Transformer to learn context-aware representations from unlabeled text, using a "masked language model" objective: hide some words, predict them from both sides [5]. One extra output layer plus fine-tuning let it set new records on 11 NLP tasks [5]. In October 2019, Google said it was applying BERT to Search, where it would help better understand "one in 10 searches in the U.S. in English." Its example: in "2019 brazil traveler to usa need a visa," the word "to" matters, and earlier systems missed that the searcher was a Brazilian traveling to the US [7].
GPT-3 (OpenAI, 2020) showed that a much larger model, with 175 billion parameters, could perform many tasks from a few examples in the prompt, "without any gradient updates or fine-tuning" [6].
Stanford researchers later called models like these "foundation models," trained on broad data and adapted to many tasks [9]. See What Are Foundation Models?
NLP vs large language models
Classic NLP pipeline | Large language model | |
|---|---|---|
Scope | One model per task (a sentiment model, a translation model) | One model handles many tasks via prompts [1] |
Training data | Often a labeled dataset for the task | Massive unlabeled text, then refinement |
Cost to run | Low; can run on a CPU | Higher; often needs GPUs |
Predictability | High for narrow tasks | Flexible, but can produce confident errors |
Best for | High-volume, well-defined tasks like routing or tagging | Open-ended tasks like drafting, summarizing, Q&A |
Hugging Face describes the shift as moving "from building specialized models for specific NLP tasks to using a single, large model that can be prompted or fine-tuned" for many of them [1]. LLMs are part of NLP, not a replacement for the field. For the mechanics, see How Large Language Models Work.
Where NLP is used
- Search. Understanding what a query means, not just which words it contains [7]. See Semantic Search vs Keyword Search.
- Email and messaging. Spam filtering, smart replies, autocomplete.
- Customer service. Routing tickets, chatbots and summarizing calls.
- Speech. OpenAI's Whisper model was trained on 680,000 hours of multilingual audio with transcripts, and its authors report it approaches human accuracy and robustness in transcription [8].
- Enterprise knowledge. Answering questions from internal documents with retrieval. See What Is Retrieval-Augmented Generation (RAG)?
- Translation and accessibility. Machine translation, captioning and text-to-speech.
Adoption of generative AI, the most visible face of modern NLP, has been unusually fast. Stanford's 2026 AI Index reports that generative AI reached 53% population adoption within three years, faster than the personal computer or the internet, and that four in five US high school and college students use AI for schoolwork [10].
Benefits
- Scale. Software can read millions of documents, reviews or support tickets.
- Accessibility. Speech recognition, captioning and translation open content to more people.
- Natural interfaces. People can query data and software in plain English instead of code.
Limitations and risks
Hugging Face's course lists the key limits of large language models plainly [1]:
- Hallucinations: they "can generate incorrect information confidently." See What Are AI Hallucinations?
- Lack of true understanding: they "operate purely on statistical patterns."
- Bias: they may reproduce biases in their training data.
- Context windows: they can only consider a limited amount of text at once.
- Compute: they need significant computing resources.
Two more matter in practice. First, quality can vary by language and dialect, so a model that performs well in English needs separate testing elsewhere. Second, language models can be manipulated through their inputs, as covered in our guide to RAG security and prompt injection.
How to choose an NLP approach
- Is the task narrow and high-volume? Tagging, routing or sentiment on millions of items often works best with a small fine-tuned model: cheaper, faster and more predictable.
- Is it open-ended? Drafting, summarizing or answering varied questions suits an LLM.
- Does it depend on your own documents? Add retrieval so answers are grounded in your sources.
- How costly is an error? For legal, medical or financial text, keep a human reviewer in the loop. See Human-in-the-Loop AI Systems.
- Which languages? Test on your actual languages and dialects, not just English benchmarks.
Outlook
NLP is merging with other AI fields. Language models increasingly take images and audio as input too. See What Is Multimodal AI? The open problems Hugging Face lists, including ambiguity, sarcasm and cultural context, are the ones to watch [1]. Expect continued work on grounding answers in sources and on smaller models that handle routine language tasks at lower cost.
Frequently asked questions
What is NLP in simple terms?
It's the technology that lets computers handle human language. NLP powers spam filters, search engines, voice assistants, translation tools and chatbots by turning words into numbers a model can learn from [1].
Is ChatGPT an example of NLP?
Yes. ChatGPT is built on large language models, which are the most prominent NLP technology today. NLP also includes much smaller, single-purpose systems such as spam filters and named-entity taggers.
What is the difference between NLP and machine learning?
Machine learning is a general method for learning patterns from data. NLP is an application area focused on language. Modern NLP relies heavily on machine learning, especially neural networks, but the two aren't the same thing.
What are examples of NLP in everyday life?
Email spam filters, phone autocomplete, voice assistants, real-time captions, translation apps and search engines that understand full questions. Google, for instance, applied its BERT model to better understand one in 10 English-language US searches when it launched the change in 2019 [7].
Does NLP actually understand language?
Not the way people do. Hugging Face notes that LLMs "lack true understanding of the world and operate purely on statistical patterns" [1]. They can still be very useful, but they can be wrong while sounding confident.
Sources
- Hugging Face. "Natural Language Processing and Large Language Models." LLM Course, Chapter 1. https://huggingface.co/learn/llm-course/chapter1/2
- Jurafsky, D., and Martin, J. H. Speech and Language Processing, 3rd ed. draft, released August 19, 2026. https://web.stanford.edu/~jurafsky/slp3/
- Mikolov, T., et al. "Efficient Estimation of Word Representations in Vector Space." arXiv 1301.3781. https://arxiv.org/abs/1301.3781
- Vaswani, A., et al. "Attention Is All You Need." arXiv 1706.03762. https://arxiv.org/abs/1706.03762
- Devlin, J., et al. "BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding." arXiv 1810.04805. https://arxiv.org/abs/1810.04805
- Brown, T. B., et al. "Language Models are Few-Shot Learners." arXiv 2005.14165. https://arxiv.org/abs/2005.14165
- Nayak, P. "Understanding searches better than ever before." Google, October 25, 2019. https://blog.google/products/search/search-language-understanding-bert/
- Radford, A., et al. "Robust Speech Recognition via Large-Scale Weak Supervision." arXiv 2212.04356. https://arxiv.org/abs/2212.04356
- Bommasani, R., et al. "On the Opportunities and Risks of Foundation Models." arXiv 2108.07258. https://arxiv.org/abs/2108.07258
- Stanford HAI. "Inside the AI Index: 12 Takeaways from the 2026 Report." April 13, 2026. https://hai.stanford.edu/news/inside-the-ai-index-12-takeaways-from-the-2026-report